/* ============================================================
   AI 副业岛 · 设计系统 v3 —— A+C 合成
   ------------------------------------------------------------
   方向：A 编辑部（暖纸白底 · 衬线大标题 · 发丝线 · 几乎不用颜色）
        + C 瑞士（粗黑无衬线 · 直角 · 大留白 · 等宽数字 · 一个大红）
   规则来源：Taste（破绽黑名单 · 三把锁）/ Impeccable（typeset · layout · craft-floor）
             / Emil（缓动与时长）
   加载：每个模板 </head> 之前（最后生效，压过内联 <style> 与 theme.css）
   回滚：删掉模板里的 design-system.css 一行 + 删掉本文件
   ============================================================ */

/* ── 1. 令牌覆盖：把全站配色换成 A+C 纸感 ──────────────────── */
/* 默认（无 data-theme）就是浅色纸感 */
:root,
html[data-theme="light"] {
    /* 主站命名空间（index / tools / news / search / page / brand_detail …） */
    --bg:       #FAF9F6;
    --surface:  #FFFFFF;
    --surface2: #F2F0EA;
    --border:   #E3DFD5;
    --border2:  #D8D3C6;
    --text:     #14120E;
    --text2:    #5C564C;
    --text3:    #8A8377;
    --primary:  #B02A1E;   /* 编辑部暗红（唯一强调色） */
    --primary2: #8E2016;
    --primary-l:#B02A1E;
    --cyan:     #2F5D50;   /* 不再用青色：换成墨绿 */
    --amber:    #A9752A;   /* 琥珀压暗，别刺眼 */
    --green:    #2F6B45;
    --red:      #B02A1E;
    --pink:     #9A3A4E;
    --radius:   2px;
    --radius-sm:2px;
    --radius-lg:3px;

    /* library.css 命名空间（名人堂 / 百科 / 技能库 / 漫剧 / 资讯） */
    --l-bg:      #FAF9F6;
    --l-surface: #FFFFFF;
    --l-surface2:#F2F0EA;
    --l-border:  #E3DFD5;
    --l-border2: #D8D3C6;
    --l-text:    #14120E;
    --l-text2:   #5C564C;
    --l-text3:   #8A8377;
    --l-primary: #B02A1E;
    --l-primary-l:#B02A1E;

    /* style.css 命名空间（commercial 等） */
    --ink-950:  #14120E;
    --ink-900:  #1E1A15;
    --ink-800:  #2A251E;
    --ink-700:  #3A342A;
    --brand:      #B02A1E;
    --brand-deep: #8E2016;
    --brand-soft: #F7EAE7;
    --accent:      #A9752A;
    --accent-deep: #8A5F1F;
    --accent-soft: #F7F0E2;
    --free:      #2F6B45;
    --free-deep: #245636;
    --free-soft: #E9F2EC;
    --text-2: #5C564C;
    --text-3: #8A8377;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: 0 10px 26px rgba(20,18,14,.08);
    color-scheme: light;
}

/* 深色开关：暖墨黑（不用深蓝、不用青紫） */
html[data-theme="dark"] {
    --bg:       #14120E;
    --surface:  #1C1915;
    --surface2: #221E19;
    --border:   #2E2921;
    --border2:  #3A342A;
    --text:     #F2EDE4;
    --text2:    #A2988A;
    --text3:    #7C7365;
    --primary:  #E0A458;
    --primary2: #C98A3E;
    --primary-l:#E0A458;
    --cyan:     #7FA98F;
    --amber:    #E0A458;
    --green:    #7FA98F;
    --l-bg:      #14120E;
    --l-surface: #1C1915;
    --l-surface2:#221E19;
    --l-border:  #2E2921;
    --l-border2: #3A342A;
    --l-text:    #F2EDE4;
    --l-text2:   #A2988A;
    --l-text3:   #7C7365;
    --l-primary: #E0A458;
    --l-primary-l:#E0A458;
    --ink-950: #F2EDE4; --ink-900: #E8E1D5;
    --brand: #E0A458; --brand-deep: #C98A3E; --brand-soft: #2A2318;
    --text-2: #A2988A; --text-3: #7C7365;
    color-scheme: dark;
}

/* ── 2. 排版（Impeccable typeset + A/C 字型分工）────────────── */
body {
    font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI",
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 1rem;              /* 正文 16px 起 */
    line-height: 1.75;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
/* 主标题（Hero / 页面大标题）用宋体 —— A 的编辑部气质 */
h1, .hero h1, .l-hero h1, .page-title, .detail-title {
    font-family: "Noto Serif SC", "Songti SC", Georgia, "Times New Roman", serif;
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: -.012em;
    text-wrap: balance;
}
/* 区块标题用粗黑无衬线 —— C 的瑞士清晰度 */
h2, h3, h4, h5, h6 {
    font-family: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: -.028em;
    text-wrap: balance;
}
/* 数字等宽，价格/统计不跳（瑞士） */
time, .price, .num, .stat, .stat b, [class*="count"], .stars {
    font-variant-numeric: tabular-nums;
}
code, pre, kbd, samp, .mono { font-family: "SFMono-Regular", "JetBrains Mono", Consolas, monospace; }
/* 正文行长：中文每行约 30–40 字 */
.article, .prose, .p-desc, .detail-desc, .sd-body, .news-body { max-width: 40em; }

/* ── 2b. 页面背景：细网格 + 暖光晕 + 极慢漂移（不再纯白/纯黑）──
   网格画在 html 上（静态、零开销）；两团暖光晕放在 body::before，
   用 transform 动画（GPU 合成，不吃性能）。 */
html {
    background-color: var(--bg, #FAF9F6);
    background-image:
        linear-gradient(to right,  color-mix(in srgb, var(--text, #14120E) 3.5%, transparent) 1px, transparent 1px),
        linear-gradient(to bottom, color-mix(in srgb, var(--text, #14120E) 3.5%, transparent) 1px, transparent 1px);
    background-size: 32px 32px, 32px 32px;
}
body { background: transparent !important; }
body::before {
    content: "";
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(closest-side, color-mix(in srgb, var(--primary, #B02A1E) 7%, transparent), transparent 72%) 14% 6% / 72% 72% no-repeat,
        radial-gradient(closest-side, color-mix(in srgb, var(--amber, #A9752A) 9%, transparent), transparent 72%) 90% 92% / 66% 66% no-repeat;
    animation: ds-drift 80s ease-in-out infinite alternate;
    will-change: transform;
}
/* 深色模式下光晕更暗一点，别发亮 */
html[data-theme="dark"] body::before { opacity: .8; }
@keyframes ds-drift {
    from { transform: translate3d(-1.5%, -1%, 0) scale(1.02); }
    to   { transform: translate3d(1.5%, 1.5%, 0) scale(1.08); }
}

/* ── 3. 去机器感（Taste §9 破绽黑名单）────────────────────── */
/* 3.1 渐变文字硬禁 → 实色 + 一段下划强调 */
.hero h1 span, .l-hero h1 span, .pdd-hero h1 .grad, [class*="grad"] {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    color: inherit !important;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--primary, #B02A1E) 50%, transparent);
    text-decoration-thickness: .055em;
    text-underline-offset: .13em;
}
/* 3.2 Logo / 徽标：紫青渐变 → 墨色方块（编辑部） */
.nav-logo, .l-logo {
    background: var(--text, #14120E) !important;
    color: var(--bg, #FAF9F6) !important;
    border-radius: 2px !important;
    box-shadow: none !important;
}
/* 3.3 装饰性发光/光斑：全关（纸感不需要） */
[class*="hero"]::before, [class*="hero"]::after,
.bg-deco, .glow, .l-hero::before, .l-hero::after { display: none !important; }
/* 3.4 缩略图/封面上的深色渐变 → 细纹纸底（等真图覆盖） */
.th, .card .th, .nw-img, .cvr, .cover, .pz-img, .mj-cover {
    background: repeating-linear-gradient(45deg, #F1EEE7, #F1EEE7 7px, #E8E4DA 7px, #E8E4DA 14px) !important;
}
/* 3.5 深色横幅 → 纸面（亮底上别出现刺眼的深块） */
.gift-banner, .promo-block, .banner {
    background: var(--surface, #fff) !important;
    border: 1px solid var(--border, #E3DFD5) !important;
    color: var(--text, #14120E) !important;
    border-radius: 2px !important;
}

/* ── 4. 版式：直角 + 发丝线 + 无阴影（A/C 都是"平"的）────── */
.pcard, .tcard, .l-card, .rail-card, .ccard, .card, .tile, .box {
    border-radius: 2px !important;
    box-shadow: none !important;
    border: 1px solid var(--border, #E3DFD5);
}
.pcard:hover, .tcard:hover, .l-card:hover, .ccard:hover, .card:hover, .tile:hover {
    transform: none !important;                    /* 不用"抬升"那套 AI 悬停 */
    box-shadow: none !important;
    border-color: var(--text, #14120E) !important;
}
/* 分区标题下加一条墨线（瑞士） */
.section-title, .sec-t, .sec-title {
    border-bottom: 2px solid var(--text, #14120E);
    padding-bottom: 8px;
}

/* ── 5. 控件（Emil：crisp 缓动，只动 transform/颜色）────────── */
.btn, .cta-btn, .cbtn, .go, [class*="btn"], .search-bar button, .search-box button {
    border-radius: 2px !important;
    font-family: inherit;
    font-weight: 650;
    letter-spacing: .01em;
    transition: transform .12s cubic-bezier(0.77, 0, 0.175, 1),
                background-color .16s cubic-bezier(0.23, 1, 0.32, 1),
                border-color .16s cubic-bezier(0.23, 1, 0.32, 1),
                color .16s cubic-bezier(0.23, 1, 0.32, 1);
}
.btn:active, .cta-btn:active, .cbtn:active, .go:active, [class*="btn"]:active {
    transform: scale(.975);
    transition-duration: .12s;
}
.pill, .tag, .badge, .l-tab, .sk-tab, .ch-tab, [class*="pill"] { border-radius: 2px !important; }
a { transition: color .12s cubic-bezier(0.23, 1, 0.32, 1); }

/* ── 6. 浏览器表面（Impeccable craft-floor）────────────────── */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--primary, #B02A1E);
    outline-offset: 2px;
}
::selection { background: color-mix(in srgb, var(--primary, #B02A1E) 20%, transparent); }
* { scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text, #14120E) 22%, transparent);
    border-radius: 0;
}
::-webkit-scrollbar-track { background: transparent; }

/* ── 7. 减少动效（Emil 门控）───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
