/* ===== CSS VARIABLES & RESET ===== */
:root {
    --bg: #ffffff;
    --text-main: #111111;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-light: #eaeaea;
    --surface-gray: #f8f9fa;
    --surface-dark: #0a0a0a;
    --accent-blue: #4285F4;
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --container-width: 1320px;
    --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== HEADER (injected by header.js) ===== */
header {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 80px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    z-index: 1000;
    display: flex; align-items: center;
}

.header-inner {
    width: 100%; max-width: var(--container-width);
    margin: 0 auto; padding: 0 40px;
    display: flex; justify-content: space-between; align-items: center;
}

.logo {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; color: var(--text-main);
    font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.5px;
}
.logo svg { width: 24px; height: 24px; color: var(--accent-blue); }

.nav-group { display: flex; gap: 36px; align-items: center; }
.nav-group a {
    text-decoration: none; color: var(--text-secondary);
    font-size: 15px; font-weight: 500; transition: color 0.2s;
    position: relative;
}
.nav-group a:hover { color: var(--text-main); }
.nav-group a.active { color: var(--text-main); font-weight: 600; }
.nav-group a.active::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0; right: 0;
    height: 2px;
    background: var(--accent-blue);
    border-radius: 1px;
}

/* Header right group (lang switcher + CTA) */
.header-right { display: flex; align-items: center; gap: 12px; }

/* Language switcher */
.lang-switcher { position: relative; }
.lang-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 7px 11px; border-radius: 100px;
    border: 1px solid rgba(0,0,0,0.12);
    background: transparent; cursor: pointer;
    color: var(--text-secondary); font-size: 13px; font-weight: 500;
    transition: border-color 0.2s, color 0.2s;
    font-family: var(--font-sans);
}
.lang-btn:hover { border-color: rgba(0,0,0,0.22); color: var(--text-main); }
.lang-chevron { transition: transform 0.2s; flex-shrink: 0; }
.lang-switcher.is-open .lang-btn { border-color: rgba(0,0,0,0.18); color: var(--text-main); }
.lang-switcher.is-open .lang-chevron { transform: rotate(180deg); }
.lang-dropdown {
    display: none;
    position: absolute; top: calc(100% + 8px); right: 0;
    min-width: 136px;
    background: #fff; border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.09);
    padding: 5px; z-index: 1100;
}
.lang-switcher.is-open .lang-dropdown { display: block; }
.lang-option {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 11px; border-radius: 8px;
    text-decoration: none; color: var(--text-secondary);
    font-size: 14px; font-weight: 500; white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.lang-option:hover { background: #f5f5f5; color: var(--text-main); }
.lang-option--current { color: var(--text-main); font-weight: 600; }
.lang-option--current::after { content: '✓'; font-size: 12px; color: var(--accent-blue); }

.btn-black {
    background: #111; color: #fff;
    padding: 10px 24px; border-radius: 100px;
    font-size: 14px; font-weight: 500; text-decoration: none;
    display: flex; align-items: center; gap: 8px;
    transition: transform 0.2s var(--ease-smooth), background 0.2s;
}
.btn-black:hover { transform: scale(1.03); background: #000; }

/* ===== FOOTER (injected by footer.js) ===== */
footer {
    border-top: 1px solid var(--border-light);
    padding: 80px 40px 40px;
}
.footer-inner {
    max-width: var(--container-width); margin: 0 auto;
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 60px;
}
.footer-col h5 { font-family: var(--font-display); font-size: 14px; font-weight: 600; margin-bottom: 16px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-tertiary); }
.footer-col a { display: block; color: var(--text-secondary); text-decoration: none; font-size: 14px; margin-bottom: 10px; transition: color 0.2s; }
.footer-col a:hover { color: var(--text-main); }
.footer-col p { color: var(--text-secondary); font-size: 14px; max-width: 280px; margin-top: 16px; }
.footer-bottom {
    max-width: var(--container-width); margin: 60px auto 0;
    padding-top: 28px; border-top: 1px solid var(--border-light);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; color: var(--text-tertiary);
}

/* ===== TERMS HERO ===== */
.terms-hero {
    padding: 160px 40px 80px;
    background: var(--surface-dark);
    position: relative;
    overflow: hidden;
}

.terms-hero::before {
    content: '';
    position: absolute;
    top: -300px; left: 50%;
    transform: translateX(-50%);
    width: 800px; height: 800px;
    background: radial-gradient(circle, rgba(66,133,244,0.12) 0%, transparent 65%);
    pointer-events: none;
}

.terms-hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 1px;
    background: rgba(255,255,255,0.07);
}

.th-inner {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.th-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-blue);
    background: rgba(66,133,244,0.12);
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid rgba(66,133,244,0.2);
    width: fit-content;
}

.th-inner h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 54px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #ffffff;
}

.th-desc {
    font-size: 17px;
    color: rgba(255,255,255,0.55);
    line-height: 1.7;
    max-width: 620px;
}

.th-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
    width: 100%;
    flex-wrap: wrap;
}

.th-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.35);
}

.th-meta-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ===== TERMS LAYOUT ===== */
.terms-layout {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 80px 40px 120px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 80px;
    align-items: start;
}

/* ===== TOC SIDEBAR ===== */
.terms-toc {
    position: sticky;
    top: 100px;
}

.toc-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-list a {
    display: block;
    text-decoration: none;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 2px solid transparent;
    transition: all 0.2s;
    line-height: 1.4;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--text-main);
    background: var(--surface-gray);
    border-left-color: var(--accent-blue);
}

.toc-related {
    margin-top: 32px;
    padding: 20px;
    background: var(--surface-gray);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.toc-related-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.toc-related a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.toc-related a:hover {
    color: var(--text-main);
    background: var(--bg);
}

.toc-related a svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--text-tertiary);
}

/* ===== TERMS CONTENT ===== */
.terms-content {
    min-width: 0;
}

.terms-section {
    margin-bottom: 64px;
    scroll-margin-top: 100px;
}

.terms-section:last-child {
    margin-bottom: 0;
}

.ts-number {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.terms-section h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.terms-section p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.terms-section p:last-child {
    margin-bottom: 0;
}

.terms-section ul,
.terms-section ol {
    margin: 16px 0 16px 20px;
}

.terms-section li {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 8px;
}

.terms-section li:last-child {
    margin-bottom: 0;
}

.terms-section h3 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-main);
    margin: 28px 0 12px;
}

.terms-section a {
    color: var(--accent-blue);
    text-decoration: none;
}

.terms-section a:hover {
    text-decoration: underline;
}

/* Warning / Notice cards */
.ts-notice {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 12px;
    margin: 24px 0;
}

.ts-notice--blue {
    background: rgba(66,133,244,0.05);
    border: 1px solid rgba(66,133,244,0.14);
}

.ts-notice--amber {
    background: rgba(251,191,36,0.06);
    border: 1px solid rgba(251,191,36,0.2);
}

.ts-notice--amber .ts-notice-icon { color: #D97706; }

.ts-notice-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--accent-blue);
    margin-top: 2px;
}

.ts-notice p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.7;
}

.ts-notice p strong {
    color: var(--text-main);
}

/* Billing summary table */
.ts-billing-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.ts-billing-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    background: var(--surface-gray);
    border-bottom: 1px solid var(--border-light);
}

.ts-billing-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: top;
}

.ts-billing-table tr:last-child td {
    border-bottom: none;
}

.ts-billing-table td strong {
    color: var(--text-main);
    display: block;
    margin-bottom: 2px;
}

/* Contact box */
.ts-contact-box {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 32px;
    background: var(--surface-gray);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    margin-top: 24px;
}

.ts-contact-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: rgba(66,133,244,0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ts-contact-icon svg {
    width: 22px;
    height: 22px;
    color: var(--accent-blue);
}

.ts-contact-text h3 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 8px;
}

.ts-contact-text p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

.ts-contact-text a {
    color: var(--accent-blue);
}

.ts-contact-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ts-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: #111;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 100px;
    transition: transform 0.2s var(--ease-smooth), background 0.2s;
}

.ts-btn-primary:hover {
    transform: scale(1.03);
    background: #000;
    text-decoration: none;
}

/* ===== BOTTOM CTA ===== */
.terms-cta {
    background: var(--surface-gray);
    border-top: 1px solid var(--border-light);
    padding: 100px 40px;
    text-align: center;
}

.terms-cta-inner {
    max-width: 640px;
    margin: 0 auto;
}

.terms-cta h2 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 16px;
}

.terms-cta p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 36px;
}

.terms-cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.tcta-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: #111;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 100px;
    transition: transform 0.2s var(--ease-smooth), background 0.2s;
}

.tcta-btn-primary:hover {
    transform: scale(1.03);
    background: #000;
}

.tcta-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border-light);
    border-radius: 100px;
    transition: all 0.2s;
}

.tcta-btn-secondary:hover {
    color: var(--text-main);
    border-color: #bbb;
    background: var(--bg);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .terms-layout {
        grid-template-columns: 220px 1fr;
        gap: 56px;
    }
}

@media (max-width: 768px) {
    .terms-hero {
        padding: 120px 24px 60px;
    }

    .terms-layout {
        grid-template-columns: 1fr;
        padding: 48px 24px 80px;
        gap: 40px;
    }

    .terms-toc {
        position: static;
    }

    .toc-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .toc-list a {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 6px 10px;
    }

    .toc-list a:hover,
    .toc-list a.active {
        border-left-color: transparent;
        border-bottom-color: var(--accent-blue);
    }

    .ts-billing-table {
        display: block;
        overflow-x: auto;
    }

    .terms-cta {
        padding: 80px 24px;
    }

    .ts-contact-box {
        flex-direction: column;
    }

    footer {
        padding: 60px 24px 32px;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .header-inner {
        padding: 0 24px;
    }

    .nav-group {
        display: none;
    }
}

@media (max-width: 480px) {
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .th-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
