/* Legal pages: slim header shell + document styles (avoids 130KB home/css/style.css) */
:root {
    --primary-color: #0056d2;
    --primary-hover: #0044a8;
    --text-main: #1d1d1f;
    --text-secondary: #52525b;
    --bg-section: #f8f9fb;
    --border-color: #e2e8f0;
    --transition-base: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --header-height: 50px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: var(--font-ui, 'Inter', 'Inter Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif);
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* —— Header shell —— */
header,
.sk-header,
.mobile-menu {
    font-family: var(--font-ui, 'Inter', 'Inter Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif);
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-base);
    border-bottom: 1px solid transparent;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.nav-inner .logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 0;
    text-decoration: none;
    color: inherit;
}

.nav-inner .logo-mark-wrap,
.nav-inner .logo-wordmark {
    display: block;
}

.nav-inner .logo-mark-wrap {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    line-height: 0;
}

.nav-inner .logo-mark-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.nav-inner .logo-mark-svg .logo-part {
    transform-origin: 992.5px 909.5px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-inner .logo:hover .logo-mark-svg .logo-part--1,
.nav-inner .logo:focus-visible .logo-mark-svg .logo-part--1 {
    transform: translate3d(48px, -32px, 0);
}

.nav-inner .logo:hover .logo-mark-svg .logo-part--2,
.nav-inner .logo:focus-visible .logo-mark-svg .logo-part--2 {
    transform: translate3d(-54px, 13px, 0);
}

.nav-inner .logo:hover .logo-mark-svg .logo-part--3,
.nav-inner .logo:focus-visible .logo-mark-svg .logo-part--3 {
    transform: translate3d(34px, 44px, 0);
}

.nav-inner .logo-wordmark {
    height: 22px;
    width: auto;
    max-width: min(158px, 40vw);
    object-fit: contain;
    object-position: left center;
    flex-shrink: 1;
    transform: translateY(-0.5px);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-inner .logo:hover .logo-wordmark,
.nav-inner .logo:focus-visible .logo-wordmark {
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-base);
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* 登录控制台：墨色玻璃胶囊（与 /home/css/style.css 同款；悬停不位移） */
.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px 0 14px;
    border-radius: 999px;
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    background-color: rgba(14, 19, 24, 0.9);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        0 1px 2px rgba(14, 19, 24, 0.12),
        0 6px 16px -8px rgba(14, 19, 24, 0.45);
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s ease, transform 0.16s ease;
}

.nav-btn:hover {
    background-color: rgba(34, 43, 53, 0.92);
}

.nav-btn:active {
    transform: scale(0.97);
}

.nav-btn:focus-visible {
    outline: 2px solid rgba(0, 86, 210, 0.45);
    outline-offset: 2px;
}

.nav-btn-arrow {
    flex: none;
    width: 10px;
    height: 10px;
    opacity: 0.72;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.nav-btn:hover .nav-btn-arrow {
    opacity: 1;
    transform: translateX(2px);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    border-radius: 8px;
    transition: background-color 0.2s;
    gap: 5px;
}

.mobile-menu-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: calc(var(--header-height) + 10px);
    left: 50%;
    width: min(360px, calc(100vw - 32px));
    max-height: calc(100vh - var(--header-height) - 28px);
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
    transition: opacity 0.18s ease, transform 0.2s ease, visibility 0.18s ease;
    z-index: 999;
    padding: 14px 0;
    border-radius: 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(-50%, -8px, 0);
    border: 1px solid var(--border-color);
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(-50%, 0, 0);
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 18px;
}

.mobile-menu-links a {
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.mobile-menu-links a:hover {
    color: var(--primary-color);
    background: rgba(0, 86, 210, 0.08);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: rgba(15, 23, 42, 0.24);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu {
        display: block;
    }

    .nav-links {
        display: none;
    }

    /* 登录按钮常驻顶栏，贴在汉堡左侧 */
    .nav-btn {
        height: 30px;
        margin: 0 8px 0 auto;
        padding: 0 11px 0 13px;
        font-size: 13px;
    }

    .nav-inner .logo {
        gap: 0;
    }

    .nav-inner .logo .logo-wordmark {
        display: none;
    }

    .nav-inner .logo-mark-wrap {
        width: clamp(28px, 8vw, 36px);
        height: clamp(28px, 8vw, 36px);
    }

    .container {
        padding: 0 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-inner .logo-mark-svg .logo-part,
    .nav-inner .logo .logo-wordmark,
    .nav-btn,
    .nav-btn-arrow,
    .mobile-menu,
    .mobile-menu-overlay {
        transition: none;
    }

    .nav-inner .logo:hover .logo-mark-svg .logo-part--1,
    .nav-inner .logo:focus-visible .logo-mark-svg .logo-part--1,
    .nav-inner .logo:hover .logo-mark-svg .logo-part--2,
    .nav-inner .logo:focus-visible .logo-mark-svg .logo-part--2,
    .nav-inner .logo:hover .logo-mark-svg .logo-part--3,
    .nav-inner .logo:focus-visible .logo-mark-svg .logo-part--3 {
        transform: none;
    }
}

/* —— Header skeleton (CLS=0 while header.js fetches) —— */
.sk {
    position: relative;
    overflow: hidden;
    background: #eef2f7;
    border-radius: 8px;
}

.sk::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0, rgba(255, 255, 255, 0.7) 50%, transparent 100%);
    transform: translateX(-100%);
    animation: legal-sk-shimmer 1.4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes legal-sk-shimmer {
    to {
        transform: translateX(100%);
    }
}

.sk-fade {
    transition: opacity 0.32s ease;
}

.sk-fade.sk-hide {
    opacity: 0;
    pointer-events: none;
}

.sk-reveal {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.sk-reveal.sk-shown {
    opacity: 1;
}

.sk-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    display: flex;
    align-items: center;
}

.sk-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    gap: 12px;
}

.sk-header__logo {
    width: 132px;
    height: 28px;
}

.sk-header__nav {
    display: flex;
    gap: 22px;
}

.sk-header__nav-item {
    width: 56px;
    height: 12px;
    border-radius: 999px;
}

.sk-header__btn {
    width: 110px;
    height: 32px;
    border-radius: 999px;
}

@media (max-width: 768px) {
    .sk-header__nav {
        display: none;
    }

    .sk-header__btn {
        width: 100px;
        height: 30px;
        margin-right: 48px;
    }

    .sk-header__inner {
        padding: 0 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sk::after {
        animation: none;
    }

    .sk-fade,
    .sk-reveal {
        transition: none;
    }
}

/* —— Legal document —— */
.legal-page {
    padding: 32px 16px 64px;
    margin-top: var(--header-height);
}

@media (max-width: 768px) {
    .legal-page {
        padding: 24px 14px 48px;
    }
}

.legal-doc {
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    padding: 40px 44px 48px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    line-height: 1.75;
    font-size: 15px;
}

@media (max-width: 600px) {
    .legal-doc {
        padding: 28px 20px 36px;
        font-size: 14px;
    }
}

.legal-doc h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.legal-meta {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.legal-lead {
    margin-bottom: 28px;
    color: #334155;
}

.legal-doc h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 32px 0 14px;
    color: #0f172a;
}

.legal-doc h2:first-of-type {
    margin-top: 0;
}

.legal-doc h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 22px 0 10px;
    color: #334155;
}

.legal-doc p {
    margin: 0 0 12px;
}

.legal-doc ul,
.legal-doc ol {
    margin: 0 0 14px;
    padding-left: 1.35em;
}

.legal-doc li {
    margin-bottom: 8px;
}

.legal-doc strong {
    color: #0f172a;
    font-weight: 600;
}

.legal-doc a {
    color: #2563eb;
    text-decoration: none;
}

.legal-doc a:hover {
    text-decoration: underline;
}

.legal-doc .toc {
    margin: 20px 0 28px;
    padding-left: 1.2em;
    list-style: none;
}

.legal-doc .toc li {
    margin-bottom: 6px;
}

.legal-doc table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    font-size: 14px;
}

.legal-doc th,
.legal-doc td {
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.legal-doc th {
    background: #f8fafc;
    font-weight: 600;
    color: #0f172a;
}

.legal-doc tr:nth-child(even) {
    background: #fafbfc;
}

.legal-doc .table-wrap {
    overflow-x: auto;
    margin: 16px 0 24px;
}

.legal-doc .table-wrap table {
    min-width: 560px;
}
