/**
 * @//file/: theme.css
 * @//description/: 全局主题变量与基础样式（Linear/Vercel 风格：深色优先 + 克制动效）
 * @//author/: Junwen
 * @//email/: 565897782@qq.com
 * @//contact/: WeChat:Awoowo
 * @//version/: 1.0.0
 * @//date/: 2026-11-06
 * @//copyright/: Copyright (c) 2026 Junwen All rights reserved.
 */

/* ===== 深色主题（默认，Linear/Vercel 风格） ===== */
:root {
    /* 主色（品牌蓝，深色下收敛克制） */
    --primary: #3B82F6;
    --primary-hover: #60A5FA;
    --primary-active: #2563EB;
    --primary-rgb: 59, 130, 246;
    --primary-hover-rgb: 96, 165, 250;
    --primary-active-rgb: 37, 99, 235;

    --success: #34D399;
    --warning: #FBBF24;
    --error: #F87171;
    --disabled: #3F3F46;

    /* 文字（深色底浅字） */
    --text-primary: #F4F4F5;
    --text-secondary: #B4B4BD;
    --text-tertiary: #7C7C86;

    /* 边框与背景（半透明边框 + 深色卡片） */
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);
    --bg-page: #08090A;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-solid: #111113;
    --bg-hover: rgba(255, 255, 255, 0.06);
    --section-alt: #0C0D0F;

    /* 布局（克制圆角，不过大） */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45), 0 16px 40px rgba(0, 0, 0, 0.5);

    /* 动效 */
    --ease: cubic-bezier(0.21, 0.65, 0.36, 1);
    --duration: 0.3s;
}

/* ===== 浅色主题（用户手动切换） ===== */
[data-theme="light"] {
    --primary: #2563EB;
    --primary-hover: #3B82F6;
    --primary-active: #1D4ED8;
    --primary-rgb: 37, 99, 235;
    --primary-hover-rgb: 59, 130, 246;
    --primary-active-rgb: 29, 78, 216;

    --success: #059669;
    --warning: #D97706;
    --error: #DC2626;
    --disabled: #D4D4D8;

    --text-primary: #18181B;
    --text-secondary: #52525B;
    --text-tertiary: #A1A1AA;

    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.14);
    --bg-page: #FAFAFA;
    --bg-card: #FFFFFF;
    --bg-card-solid: #FFFFFF;
    --bg-hover: rgba(0, 0, 0, 0.04);
    --section-alt: #F4F4F5;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 16px 40px rgba(0, 0, 0, 0.1);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/**
 * html 也要铺底色：
 * 只给 body 设背景时，body 尚未渲染完的那一帧会露出浏览器默认白底，
 * 深色主题下同样会造成「闪白/闪黑」。这里把画布本身也统一成页面底色，
 * color-scheme 则让滚动条、原生输入控件跟随主题。
 */
html {
    background: var(--bg-page);
    color-scheme: dark;
}

html[data-theme="light"] {
    color-scheme: light;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-page);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    letter-spacing: -0.01em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

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

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    vertical-align: middle;
}

/* 标题：Inter 几何无衬线，紧凑字距（Linear/Vercel 招牌） */
h1, h2, h3, h4, .hero h1, .section-title, .detail-title,
.hero .subtitle, .cta-banner h2, .stat-band-num {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: -0.02em;
}

/* 通用工具类 */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.flexcenter {
    display: flex;
    align-items: center;
    justify-content: center;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

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

/* 尊重用户「减少动态」偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
