/* ── 公共基础样式，index.html 和 tools.html 共用 ── */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #f4efe6;
    --bg-secondary: rgba(255, 251, 245, 0.92);
    --bg-tertiary: #efe4d2;
    --text-primary: #172033;
    --text-secondary: #5f6879;
    --text-tertiary: #8a93a3;
    --border-color: rgba(23, 32, 51, 0.12);
    --border-light: rgba(23, 32, 51, 0.08);
    --accent-primary: #0f766e;
    --accent-secondary: #c66b1a;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-error: #ef4444;
    --shadow-sm: 0 6px 18px rgba(23, 32, 51, 0.06);
    --shadow-md: 0 14px 36px rgba(23, 32, 51, 0.08);
    --shadow-lg: 0 20px 48px rgba(23, 32, 51, 0.12);
    --shadow-xl: 0 28px 64px rgba(23, 32, 51, 0.16);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    min-height: 100vh;
    font-family: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 26%),
        radial-gradient(circle at top right, rgba(198, 107, 26, 0.14), transparent 24%),
        linear-gradient(180deg, #f8f3eb 0%, #f4efe6 42%, #f7f2ea 100%);
    color: var(--text-primary);
    line-height: 1.4;
    padding: 28px 34px 64px;
    font-size: 14px;
}

.container {
    position: relative;
    max-width: 1520px;
    margin: 0 auto;
}

.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, rgba(23, 32, 51, 0), rgba(23, 32, 51, 0.18), rgba(23, 32, 51, 0));
    margin: 34px 0;
}

/* ── 页面导航 Tab（外层不裁切，设置面板挂在 cluster 上） ── */
.page-nav-cluster {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    background: rgba(255, 249, 241, 0.76);
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 28px rgba(23, 32, 51, 0.08);
    position: sticky;
    top: 14px;
    z-index: 40;
    overflow: visible;
}

.page-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.page-nav::-webkit-scrollbar {
    display: none;
}

.page-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.page-tab:hover {
    color: var(--text-primary);
    background: rgba(15, 118, 110, 0.08);
}

.page-tab.active {
    color: #f8fffd;
    background: linear-gradient(135deg, #1c3552 0%, #0f766e 100%);
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(28, 53, 82, 0.18);
}

/* ── Header ── */
.header {
    margin-bottom: 28px;
    text-align: left;
    position: relative;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(255, 252, 246, 0.96) 0%, rgba(255, 248, 238, 0.84) 56%, rgba(239, 246, 244, 0.92) 100%);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.header::before,
.header::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.header::before {
    width: 420px;
    height: 420px;
    top: -220px;
    right: -180px;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.18), rgba(15, 118, 110, 0));
}

.header::after {
    width: 320px;
    height: 320px;
    left: -160px;
    bottom: -180px;
    background: radial-gradient(circle, rgba(198, 107, 26, 0.16), rgba(198, 107, 26, 0));
}

.header > * {
    position: relative;
    z-index: 1;
}

.github-link {
    position: absolute;
    top: 24px;
    right: 24px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s;
    padding: 11px 18px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 22px rgba(23, 32, 51, 0.06);
}

.github-link:hover {
    color: var(--text-primary);
    border-color: rgba(23, 32, 51, 0.18);
    transform: translateY(-1px);
}

.header h1 {
    max-width: calc(100% - 140px);
    font-size: clamp(40px, 6vw, 68px);
    color: var(--text-primary);
    margin-bottom: 16px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.02;
}

.update-date {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    color: #18344f;
    margin-bottom: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: rgba(24, 52, 79, 0.08);
}

.header .subtitle {
    width: 100%;
    max-width: 100%;
    color: #39465a;
    font-size: clamp(17px, 2vw, 21px);
    margin-bottom: 18px;
    font-weight: 500;
    line-height: 1.72;
}

.header .models,
.header-info {
    width: 100%;
    max-width: 100%;
    margin-top: 22px;
    padding: 14px 16px;
    border: 1px solid rgba(23, 32, 51, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.66);
    color: var(--text-secondary);
    line-height: 1.75;
    box-shadow: 0 10px 20px rgba(23, 32, 51, 0.05);
}

/* ── 超宽屏模式 ── */
.ultra-wide .container {
    max-width: none !important;
}

/* ── 设置按钮与面板 ── */
.settings-wrapper {
    margin-left: auto;
    position: relative;
    display: flex;
    align-items: center;
}

.settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.settings-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.78);
    border-color: var(--border-color);
}

.settings-btn.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.78);
    border-color: var(--border-color);
}

.settings-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(255, 251, 245, 0.92);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 16px;
    width: 230px;
    box-shadow: var(--shadow-xl);
    z-index: 2000;
}

.settings-panel-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: var(--text-primary);
}

.settings-toggle-row label:first-child {
    cursor: pointer;
    flex: 1;
}

.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 20px;
    transition: background 0.2s;
    cursor: pointer;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

/* ── 底部说明 ── */
.notes-section {
    margin-top: 30px;
    padding: 24px 28px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 251, 245, 0.84);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
}

.notes-section h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.notes-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notes-section li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0;
    padding-left: 18px;
    position: relative;
    line-height: 1.75;
}

.notes-section li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

/* ── 更新日志 ── */
.updates-section {
    margin-top: 28px;
    padding: 24px 28px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 251, 245, 0.84);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
}

.updates-section h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.updates-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.update-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.update-item:last-child {
    border-bottom: none;
}

.log-date {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.update-items {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-left: 16px;
}

.update-items li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 4px 0;
    position: relative;
    line-height: 1.7;
}

.update-items li::before {
    content: "-";
    position: absolute;
    left: -12px;
    color: var(--accent-secondary);
}

.hero-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.hero-summary-card {
    padding: 22px;
    border-radius: 24px;
    border: 1px solid rgba(23, 32, 51, 0.08);
    background: rgba(255, 251, 245, 0.84);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
}

.hero-summary-card--accent {
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.09), rgba(255, 255, 255, 0.88));
}

.hero-summary-card--warm {
    background: linear-gradient(180deg, rgba(198, 107, 26, 0.09), rgba(255, 255, 255, 0.88));
}

.hero-summary-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-primary);
    background: rgba(15, 118, 110, 0.1);
    margin-bottom: 12px;
}

.hero-summary-title {
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.hero-summary-body {
    color: var(--text-secondary);
    line-height: 1.76;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(23, 32, 51, 0.16), rgba(23, 32, 51, 0));
}

.surface-panel {
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 251, 245, 0.84);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
}

.surface-panel--padded {
    padding: 24px 28px;
}

.surface-panel--compact {
    padding: 22px 24px;
}

.surface-control {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(23, 32, 51, 0.08);
    border-radius: 18px;
    box-shadow: 0 10px 20px rgba(23, 32, 51, 0.05);
}

.surface-popover {
    background: rgba(255, 251, 245, 0.96);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 1200px) {
    body {
        padding: 24px 22px 56px;
    }
}

@media (max-width: 860px) {
    .page-nav-cluster {
        gap: 8px;
        padding: 10px;
        border-radius: 24px;
    }

    .page-nav {
        gap: 8px;
    }

    .page-tab {
        padding: 10px 14px;
        font-size: 13px;
    }

    .header,
    .notes-section,
    .updates-section {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    body {
        padding: 18px 14px 40px;
    }

    .page-nav-cluster {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
        padding: 12px;
    }

    .page-nav {
        grid-column: 1 / -1;
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .page-tab {
        min-width: 0;
        min-height: 44px;
        justify-content: center;
        text-align: center;
        white-space: normal;
        line-height: 1.3;
        padding: 10px 12px;
    }

    .settings-wrapper {
        grid-column: 1 / -1;
        margin-left: 0;
        justify-content: flex-end;
        padding-top: 2px;
    }

    .settings-panel {
        width: min(230px, calc(100vw - 28px));
    }

    .header > .github-link {
        position: absolute;
        top: 18px;
        right: 18px;
        margin-bottom: 0;
        padding: 10px 14px;
    }

    .header > h1 {
        max-width: calc(100% - 132px);
        font-size: clamp(34px, 12vw, 52px);
    }
}

@media (max-width: 420px) {
    .page-nav-cluster {
        grid-template-columns: 1fr;
    }

    .settings-wrapper {
        padding-top: 0;
    }
}
