/* ==========================================================================
   claudechat.club · 配色系统
   6 套主题，全部由 CSS 变量驱动，切换只改变量，不重排布局
   ========================================================================== */

/* ---------- 基础令牌（不随主题变化） ---------- */
:root {
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --fs-2xs: .75rem;
  --fs-xs: .8125rem;
  --fs-sm: .875rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: clamp(2.25rem, 1.15rem + 3.6vw, 4rem);
  --fs-hero: clamp(2.5rem, 1.1rem + 4.9vw, 4.5rem);

  --radius-card: 14px;
  --radius-panel: 20px;
  --radius-pill: 999px;
  --radius-input: 10px;

  --content-width: 1180px;
  --gutter: 24px;
  --section-gap: clamp(72px, 9vw, 112px);
  --header-h: 64px;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.2, .8, .2, 1);
  --dur-fast: .16s;
  --dur-base: .32s;
  --dur-slow: .64s;
}

/* ==========================================================================
   主题 1 · Claude 原味（默认）
   暖米白 + 陶土橙，与原站一致
   ========================================================================== */
:root,
[data-theme="claude"] {
  --page: #faf9f5;
  --surface: #f0eee6;
  --surface-2: #e8e5da;
  --ink: #141413;
  --ink-hover: #30302f;
  --text: var(--ink);
  --text-muted: #5e5d59;
  --text-subtle: #87867f;
  --line: #1414131a;
  --line-strong: #14141329;

  --accent: #d97757;
  --accent-text: #a9502c;
  --accent-tint: #d977571a;
  --accent-soft: #f4dfd5;

  --sky: #6a9bcc;
  --sky-text: #3d6d99;
  --olive: #788c5d;
  --olive-text: #5a6b43;
  --kraft: #d4a27f;
  --kraft-text: #96603c;

  --dark: #141413;
  --on-dark: #faf9f5;
  --on-dark-muted: #b0aea5;
  --on-dark-line: #faf9f51a;

  --danger: #b42318;
  --danger-tint: #fdecea;
  --success: #3f7d4e;
  --success-tint: #e8f2ea;

  --glass: #1414138c;
  --shadow-soft: 0 0 0 .5px #0000000f, 0 8px 24px #00000008;
  --shadow-panel: inset 0 1px 0 #ffffff17, 0 18px 44px #00000047;
}

/* ==========================================================================
   主题 2 · Bangkok 暮色
   赤陶 + 暖白，更沉，呼应曼谷
   ========================================================================== */
[data-theme="bangkok"] {
  --page: #faf7f2;
  --surface: #f2ece3;
  --surface-2: #eae1d4;
  --ink: #1a1614;
  --ink-hover: #38302b;
  --text-muted: #6b605a;
  --text-subtle: #948982;
  --line: #1a16141a;
  --line-strong: #1a161429;

  --accent: #c96342;
  --accent-text: #9c4526;
  --accent-tint: #c963421a;
  --accent-soft: #f3ddd3;

  --sky: #5f8fb5;
  --sky-text: #38658a;
  --olive: #7a8455;
  --olive-text: #57603a;
  --kraft: #c99468;
  --kraft-text: #8e5c33;

  --dark: #1a1614;
  --on-dark: #faf7f2;
  --on-dark-muted: #b5aaa2;
  --on-dark-line: #faf7f21a;

  --danger: #b42318;
  --danger-tint: #fdecea;
  --success: #4a7a52;
  --success-tint: #e9f1e9;

  --glass: #1a16148c;
  --shadow-soft: 0 0 0 .5px #0000000f, 0 8px 24px #00000008;
  --shadow-panel: inset 0 1px 0 #ffffff17, 0 18px 44px #00000047;
}

/* ==========================================================================
   主题 3 · 深海
   雾蓝 + 冷白，技术/开发者向
   ========================================================================== */
[data-theme="deepsea"] {
  --page: #f8fafc;
  --surface: #eef2f7;
  --surface-2: #e2e9f2;
  --ink: #101720;
  --ink-hover: #2a3644;
  --text-muted: #566373;
  --text-subtle: #8492a3;
  --line: #1017201a;
  --line-strong: #10172029;

  --accent: #3d6d99;
  --accent-text: #2b5279;
  --accent-tint: #3d6d991a;
  --accent-soft: #d9e6f2;

  --sky: #5b8fc4;
  --sky-text: #35638f;
  --olive: #6b8a72;
  --olive-text: #4a6751;
  --kraft: #b8a180;
  --kraft-text: #856b4a;

  --dark: #101720;
  --on-dark: #f8fafc;
  --on-dark-muted: #a9b5c4;
  --on-dark-line: #f8fafc1a;

  --danger: #b42318;
  --danger-tint: #fdecea;
  --success: #307a5c;
  --success-tint: #e5f2ec;

  --glass: #1017208c;
  --shadow-soft: 0 0 0 .5px #0000000d, 0 8px 24px #0d1a2b0a;
  --shadow-panel: inset 0 1px 0 #ffffff20, 0 18px 44px #0d1a2b47;
}

/* ==========================================================================
   主题 4 · 墨竹
   橄榄绿 + 微绿白，稳重低攻击性
   ========================================================================== */
[data-theme="bamboo"] {
  --page: #f9faf5;
  --surface: #eff2e8;
  --surface-2: #e4e9d9;
  --ink: #151810;
  --ink-hover: #303629;
  --text-muted: #5c6355;
  --text-subtle: #8b927f;
  --line: #1518101a;
  --line-strong: #15181029;

  --accent: #5a6b43;
  --accent-text: #45532f;
  --accent-tint: #5a6b431a;
  --accent-soft: #e0e7d1;

  --sky: #628493;
  --sky-text: #40606e;
  --olive: #788c5d;
  --olive-text: #5a6b43;
  --kraft: #c0a173;
  --kraft-text: #8d6f42;

  --dark: #151810;
  --on-dark: #f9faf5;
  --on-dark-muted: #aeb3a3;
  --on-dark-line: #f9faf51a;

  --danger: #b42318;
  --danger-tint: #fdecea;
  --success: #4b7a3c;
  --success-tint: #e8f2e3;

  --glass: #1518108c;
  --shadow-soft: 0 0 0 .5px #0000000d, 0 8px 24px #0f140a08;
  --shadow-panel: inset 0 1px 0 #ffffff17, 0 18px 44px #0f140a47;
}

/* ==========================================================================
   主题 5 · 夜航（深色）
   墨黑底 + 陶土橙，全局反转
   ========================================================================== */
[data-theme="night"] {
  --page: #141413;
  --surface: #1d1d1b;
  --surface-2: #262624;
  --ink: #faf9f5;
  --ink-hover: #e6e4dc;
  --text: #faf9f5;
  --text-muted: #b0aea5;
  --text-subtle: #87867f;
  --line: #faf9f51a;
  --line-strong: #faf9f52e;

  --accent: #e08a6b;
  --accent-text: #e89b80;
  --accent-tint: #d977570f;
  --accent-soft: #3a2a22;

  --sky: #7ba8d4;
  --sky-text: #94b9de;
  --olive: #93a873;
  --olive-text: #a8bb8c;
  --kraft: #dcb28f;
  --kraft-text: #e5c2a4;

  --dark: #0d0d0c;
  --on-dark: #faf9f5;
  --on-dark-muted: #b0aea5;
  --on-dark-line: #faf9f51a;

  --danger: #e8736a;
  --danger-tint: #3a1f1d;
  --success: #6fae7f;
  --success-tint: #1e2f23;

  --glass: #faf9f514;
  --shadow-soft: 0 0 0 .5px #ffffff0f, 0 8px 24px #00000030;
  --shadow-panel: inset 0 1px 0 #ffffff14, 0 18px 44px #00000066;
}

/* ==========================================================================
   主题 6 · 宣纸
   深赭 + 纸黄，中文书卷气
   ========================================================================== */
[data-theme="paper"] {
  --page: #f5f1e8;
  --surface: #ebe4d6;
  --surface-2: #e0d7c5;
  --ink: #1c1a15;
  --ink-hover: #3a352b;
  --text-muted: #655e50;
  --text-subtle: #93897a;
  --line: #1c1a151a;
  --line-strong: #1c1a1529;

  --accent: #a9502c;
  --accent-text: #8a3d1f;
  --accent-tint: #a9502c1a;
  --accent-soft: #efdbd0;

  --sky: #5e7f95;
  --sky-text: #3d5b6e;
  --olive: #77804f;
  --olive-text: #565d36;
  --kraft: #b98d5e;
  --kraft-text: #866034;

  --dark: #1c1a15;
  --on-dark: #f5f1e8;
  --on-dark-muted: #b3a995;
  --on-dark-line: #f5f1e81a;

  --danger: #a32118;
  --danger-tint: #fbe8e5;
  --success: #4a7050;
  --success-tint: #e6efe4;

  --glass: #1c1a158c;
  --shadow-soft: 0 0 0 .5px #0000000f, 0 8px 24px #2b1e0a0a;
  --shadow-panel: inset 0 1px 0 #ffffff17, 0 18px 44px #2b1e0a47;
}

/* ==========================================================================
   局部色调（沿用原站 data-tone 机制，补全使用）
   ========================================================================== */
[data-tone="accent"] { --tone: var(--accent); --tone-text: var(--accent-text); }
[data-tone="sky"]    { --tone: var(--sky);    --tone-text: var(--sky-text); }
[data-tone="olive"]  { --tone: var(--olive);  --tone-text: var(--olive-text); }
[data-tone="kraft"]  { --tone: var(--kraft);  --tone-text: var(--kraft-text); }

.panel-dark [data-tone],
.panel-dark[data-tone] { --tone-text: var(--tone); }

/* 主题切换过渡：只过渡颜色，不碰布局 */
html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: background-color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out) !important;
}
