/* ===== Pages — Apple-Inspired Design System ===== */
/* System font stack — no external CDN dependency */

:root {
    /* 字体 */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Menlo', 'Consolas', monospace;

    /* 圆角 (Modern Rounded Corners) */
    --radius: 16px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --radius-xl: 24px;

    /* 过渡 */
    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    --duration: 0.3s;

    /* 投影 (Premium Smooth Layered Shadows) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03), 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.06), 0 24px 64px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.08), 0 40px 100px rgba(0, 0, 0, 0.04);

    /* 发光边框/投影 (Glows for Interactive States) */
    --glow-primary: 0 0 0 2px rgba(0, 112, 243, 0.15), 0 4px 12px rgba(0, 112, 243, 0.15);
}

/* ===== 浅色主题（默认） ===== */
[data-theme="light"],
[data-theme="auto"] {
    /* Backgrounds: pure clean white */
    --bg: #FFFFFF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F3F4F6;
    --bg-tertiary: #E5E7EB;
    --bg-card: #FFFFFF;
    --bg-input: #F9FAFB;
    --bg-hover: rgba(0, 0, 0, 0.04);

    --text: #111827;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;

    --border: rgba(0, 0, 0, 0.06);
    --border-focus: rgba(0, 0, 0, 0.15);
    --divider: rgba(0, 0, 0, 0.04);

    /* Accent Color — matches landing page */
    --accent: #0070f3;
    --accent-hover: #0060df;
    --accent-light: rgba(0, 112, 243, 0.10);

    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    --code-bg: #F3F4F6;
    /* Glassmorphism: Lighter, more blur */
    --glass: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* ===== 深色主题 ===== */
[data-theme="dark"] {
    /* Backgrounds: pure black */
    --bg: #000000;
    --bg-primary: #121214;
    --bg-secondary: #1F1F22;
    --bg-tertiary: #27272A;
    --bg-card: #121214;
    --bg-input: #18181B;
    --bg-hover: rgba(255, 255, 255, 0.06);

    --text: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-tertiary: #6B7280;

    --border: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(255, 255, 255, 0.2);
    --divider: rgba(255, 255, 255, 0.04);

    --accent: #3291ff;
    --accent-hover: #0070f3;
    --accent-light: rgba(50, 145, 255, 0.15);

    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    --code-bg: #1F1F22;
    --glass: rgba(9, 9, 11, 0.65);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.7);
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --bg: #000000;
        --bg-primary: #121214;
        --bg-secondary: #1F1F22;
        --bg-tertiary: #27272A;
        --bg-card: #121214;
        --bg-input: #18181B;
        --bg-hover: rgba(255, 255, 255, 0.06);
        --text: #F9FAFB;
        --text-secondary: #9CA3AF;
        --text-tertiary: #6B7280;
        --border: rgba(255, 255, 255, 0.08);
        --border-focus: rgba(255, 255, 255, 0.2);
        --divider: rgba(255, 255, 255, 0.04);
        --accent: #3291ff;
        --accent-hover: #0070f3;
        --accent-light: rgba(50, 145, 255, 0.15);
        --danger: #EF4444;
        --code-bg: #1F1F22;
        --glass: rgba(9, 9, 11, 0.65);
        --glass-border: rgba(255, 255, 255, 0.05);
        --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
        --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
        --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.7);
    }
}

/* ===== 基础组件 fallback ===== */
.page-nav {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
}

/* ===== 基础 ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'kern' 1;
}

/* ===== View Transitions & Reusable Animations ===== */
::view-transition-old(root) {
    animation: fade-out 0.2s var(--ease) both;
}

::view-transition-new(root) {
    animation: slide-up 0.4s var(--ease) both;
}

@keyframes fade-out {
    to {
        opacity: 0;
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fade-in 0.4s var(--ease) forwards;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s var(--ease);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.skeleton {
    background-image: linear-gradient(90deg, var(--bg-tertiary) 0px, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--radius-sm);
    color: transparent !important;
}

.skeleton * {
    visibility: hidden;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity var(--duration) var(--ease);
}

a:hover {
    opacity: 0.8;
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* ===== 卡片 ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--text-tertiary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.85;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 17px;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font);
    font-size: 15px;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--duration) var(--ease);
}

.input:focus,
select:focus,
textarea:focus {
    background: var(--bg-card);
    border-color: var(--accent);
    box-shadow: var(--glow-primary);
}

.input::placeholder {
    color: var(--text-tertiary);
}

textarea {
    resize: vertical;
    line-height: 1.6;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 6L0 0h10z' fill='%2386868b'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ===== 徽章 ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(48, 209, 88, 0.12);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 159, 10, 0.12);
    color: var(--warning);
}

.badge-danger {
    background: rgba(255, 59, 48, 0.12);
    color: var(--danger);
}

.badge-info {
    background: rgba(26, 115, 232, 0.12);
    color: var(--accent);
}

/* ===== 主题切换器 ===== */
.theme-switcher {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 980px;
    padding: 3px;
    gap: 2px;
}

.theme-switcher button {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration) var(--ease);
    opacity: 0.5;
}

.theme-switcher button:hover {
    opacity: 0.8;
}

.theme-switcher button.active {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    opacity: 1;
}

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

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    background: var(--glass);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    box-shadow: var(--glass-shadow), var(--shadow-lg);
    animation: toastIn 0.4s var(--ease);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.success {
    border-left: 3px solid var(--success);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== Nav ===== */
        .nav {
            position: sticky;
            top: 0;
            z-index: 100;
            max-width: 1240px;
            margin: 18px auto 0;
            padding: 0 24px;
        }

        .nav-inner {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 18px;
            min-height: 72px;
            padding: 12px 28px;
            border-radius: 16px;
            background: rgba(255, 255, 255, 0.56);
            border: 1px solid var(--lp-line);
            box-shadow: var(--lp-shadow-sm);
            backdrop-filter: blur(18px) saturate(180%);
            -webkit-backdrop-filter: blur(18px) saturate(180%);
        }

        .brand {
            display: inline-flex;
            align-items: center;
            gap: 12px;
            text-decoration: none;
            white-space: nowrap;
        }

        .brand-mark { width: 30px; height: 30px; object-fit: contain; }

        .brand-text { display: flex; flex-direction: column; gap: 1px; }

        .brand-name {
            font-family: var(--display-font);
            font-size: 18px;
            font-weight: 700;
            letter-spacing: -0.03em;
        }

        .brand-sub {
            font-size: 11px;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--lp-soft);
        }

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

        .nav-link {
            font-size: 13px;
            color: var(--lp-muted);
            text-decoration: none;
        }

        .nav-link:hover { color: var(--lp-ink); opacity: 1; }

        .nav-actions { display: flex; align-items: center; gap: 12px; }

        .theme-switcher {
            display: inline-flex;
            align-items: center;
            padding: 4px;
            border-radius: 999px;
            border: 1px solid var(--lp-line);
            background: var(--lp-frost);
        }

        .theme-switcher button {
            width: 34px;
            height: 34px;
            padding: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: none;
            border-radius: 999px;
            background: transparent;
            color: var(--lp-soft);
            cursor: pointer;
            transition: color 0.2s ease, background 0.2s ease;
        }

        .theme-switcher button:hover { color: var(--lp-ink); background: var(--lp-accent-soft); }
        .theme-switcher button.active { background: var(--lp-accent); color: #fff; }


@media (max-width: 980px) {
    .nav { margin-top: 10px; }
    .nav-inner {
        border-radius: 16px;
        padding: 14px;
        min-height: auto;
        flex-wrap: wrap;
    }
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: space-between;
    }
}
@media (max-width: 760px) {
    .nav { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 560px) {
    .nav-inner { flex-wrap: nowrap; }
    .nav-links { display: none; }
    .nav-actions { margin-left: auto; flex-shrink: 0; }
    #auth-nav { display: flex; align-items: center; gap: 10px; }
    #lp-auth-nav { display: flex; align-items: center; gap: 10px; }
    .theme-switcher { display: none; }
}


/* ===== Global Nav (Injected) ===== */
.nav {
            position: sticky;
            top: 0;
            z-index: 100;
            width: 100%;
            max-width: 1240px;
            margin: 18px auto 0;
            padding: 0 24px;
        }

        .nav-inner {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 18px;
            min-height: 72px;
            padding: 12px 28px;
            border-radius: 16px;
            background: rgba(255, 255, 255, 0.56);
            border: 1px solid var(--lp-line);
            box-shadow: var(--lp-shadow-sm);
            backdrop-filter: blur(18px) saturate(180%);
            -webkit-backdrop-filter: blur(18px) saturate(180%);
        }

        .brand {
            display: inline-flex;
            align-items: center;
            gap: 12px;
            text-decoration: none;
            white-space: nowrap;
        }

        .brand-mark { width: 30px; height: 30px; object-fit: contain; }

        .brand-text { display: flex; flex-direction: column; gap: 1px; }

        .brand-name {
            font-family: var(--display-font);
            font-size: 18px;
            font-weight: 700;
            letter-spacing: -0.03em;
        }

        .brand-sub {
            font-size: 11px;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--lp-soft);
        }

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

        .nav-link {
            font-size: 13px;
            color: var(--lp-muted);
            text-decoration: none;
        }

        .nav-link:hover { color: var(--lp-ink); opacity: 1; }

        .nav-actions { display: flex; align-items: center; gap: 12px; }

        .theme-switcher {
            display: inline-flex;
            align-items: center;
            padding: 4px;
            border-radius: 999px;
            border: 1px solid var(--lp-line);
            background: var(--lp-frost);
        }

        .theme-switcher button {
            width: 34px;
            height: 34px;
            padding: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: none;
            border-radius: 999px;
            background: transparent;
            color: var(--lp-soft);
            cursor: pointer;
            transition: color 0.2s ease, background 0.2s ease;
        }

        .theme-switcher button:hover { color: var(--lp-ink); background: var(--lp-accent-soft); }
        .theme-switcher button.active { background: var(--lp-accent); color: #fff; }

/* ===== Global Responsive Nav (Injected) ===== */
@media (max-width: 1180px) {
            .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        }

        @media (max-width: 980px) {
            .nav { margin-top: 10px; }

            .nav-inner {
                border-radius: 16px;
                padding: 14px;
                min-height: auto;
                flex-wrap: wrap;
            }

            .nav-links {
                order: 3;
                width: 100%;
                justify-content: space-between;
            }

            .format-rail { grid-template-columns: 1fr; }
            .format-grid { grid-template-columns: 1fr; }
            .faq-grid { grid-template-columns: 1fr; }
        }

        @media (max-width: 760px) {
            .nav { padding-left: 14px; padding-right: 14px; }
            .section { padding: 0 14px 64px; }
            .hero { padding-top: 48px; }
            .hero-title { font-size: clamp(38px, 12vw, 60px); }
            .pricing-grid { grid-template-columns: 1fr; }
            .features-grid { grid-template-columns: 1fr; }
            .footer { padding-left: 14px; padding-right: 14px; }

            .try-panel { padding: 32px 20px 28px; }
            .try-panel::before { left: 20px; right: 20px; }
            .try-form-row { flex-direction: column; }
            .try-select { width: 100%; }
            .try-btn { width: 100%; }
            .try-examples { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
            .try-example-tag { flex-shrink: 0; }
            .try-output-body { padding: 16px; font-size: 13px; }
        }

        @media (max-width: 560px) {
            .nav-inner { flex-wrap: nowrap; }
            .nav-links { display: none; }
            .nav-actions { margin-left: auto; flex-shrink: 0; }

            #auth-nav {
                display: flex;
                align-items: center;
                gap: 10px;
            }

            .hero-actions, .hero-trust { flex-direction: column; align-items: stretch; }
            .footer-nav-row { grid-template-columns: 1fr; gap: 20px; }
            .theme-switcher { display: none; }
            .btn, .btn-sm { width: 100%; }

            #auth-nav .btn, #auth-nav .btn-sm, #auth-nav .nav-link { width: auto; }

            .cta-panel, .footer-inner { padding-left: 20px; padding-right: 20px; }
        }