/* ========================================================================
   YYShop 主题变量系统
   8 套皮肤，通过 [data-theme="xxx"] 切换
   ======================================================================== */

/* --- 默认 / 现代简约（国际风）--- */
:root,
[data-theme="modern"] {
  --bg:           #faf8f5;
  --bg-alt:       #ffffff;
  --bg-card:      #ffffff;
  --surface:      #f2ede5;
  --fg:           #0f0f0f;
  --fg-muted:     #6b6158;
  --fg-subtle:    #9a918a;
  --border:       #e8e2d8;
  --border-strong:#0f0f0f;
  --accent:       #0f0f0f;
  --accent-fg:    #ffffff;
  --accent-2:     #b8976a;
  --danger:       #c8502b;
  --success:      #4a7c59;

  --font-display: "Fraunces", "Noto Serif SC", Georgia, serif;
  --font-body:    "Inter", "Noto Sans SC", -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;
  --font-accent:  "Fraunces", serif;

  --radius:       4px;
  --radius-lg:    8px;
  --radius-pill:  999px;

  --shadow-sm:    0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg:    0 24px 60px rgba(0,0,0,0.10);

  --pattern:      none;
  --grain:        none;
}

/* --- 水墨风 / 文人雅韵 --- */
[data-theme="ink"] {
  --bg:           #f5f1e8;
  --bg-alt:       #faf7ef;
  --bg-card:      #fdfbf5;
  --surface:      #ece5d3;
  --fg:           #1a1a1a;
  --fg-muted:     #5a544a;
  --fg-subtle:    #8b7f6e;
  --border:       #d9d0bc;
  --border-strong:#1a1a1a;
  --accent:       #1a1a1a;
  --accent-fg:    #f5f1e8;
  --accent-2:     #8b5a3c;
  --danger:       #a8391c;
  --success:      #4a5d3a;

  --font-display: "Noto Serif SC", "Ma Shan Zheng", "Songti SC", "SimSun", serif;
  --font-body:    "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-accent:  "Ma Shan Zheng", "Noto Serif SC", "KaiTi", serif;

  --radius:       2px;
  --radius-lg:    4px;

  --shadow-sm:    0 1px 3px rgba(60,40,20,0.08);
  --shadow-md:    0 6px 18px rgba(60,40,20,0.10);
  --shadow-lg:    0 30px 60px rgba(60,40,20,0.14);

  --pattern: radial-gradient(ellipse at 15% 20%, rgba(26,26,26,0.04), transparent 50%),
             radial-gradient(ellipse at 85% 80%, rgba(139,90,60,0.05), transparent 55%);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/></svg>");
}

/* --- 青花瓷 / 典雅蓝白 --- */
[data-theme="porcelain"] {
  --bg:           #fafaf5;
  --bg-alt:       #ffffff;
  --bg-card:      #ffffff;
  --surface:      #eaf0f8;
  --fg:           #0d1b3c;
  --fg-muted:     #425373;
  --fg-subtle:    #7a89a8;
  --border:       #c8d4e6;
  --border-strong:#1e3a8a;
  --accent:       #1e3a8a;
  --accent-fg:    #ffffff;
  --accent-2:     #5b7fb5;
  --danger:       #a8391c;
  --success:      #365a52;

  --font-display: "Noto Serif SC", "Cormorant Garamond", "Songti SC", serif;
  --font-body:    "Noto Sans SC", "Inter", sans-serif;
  --font-accent:  "Cormorant Garamond", "Noto Serif SC", serif;

  --radius:       3px;
  --radius-lg:    8px;

  --shadow-sm:    0 1px 3px rgba(30,58,138,0.06);
  --shadow-md:    0 6px 20px rgba(30,58,138,0.08);
  --shadow-lg:    0 30px 60px rgba(30,58,138,0.12);

  --pattern: radial-gradient(circle at 20% 30%, rgba(30,58,138,0.03), transparent 40%);
}

/* --- 宫廷红金 / 节庆 --- */
[data-theme="palace"] {
  --bg:           #1a0a08;
  --bg-alt:       #2a0f0c;
  --bg-card:      #311310;
  --surface:      #3d1a15;
  --fg:           #f7e8c4;
  --fg-muted:     #c9a961;
  --fg-subtle:    #8a7544;
  --border:       #4d2420;
  --border-strong:#c9a961;
  --accent:       #c9a961;
  --accent-fg:    #1a0a08;
  --accent-2:     #8b0000;
  --danger:       #ff6b4a;
  --success:      #d4af37;

  --font-display: "Noto Serif SC", "Cinzel", "Songti SC", serif;
  --font-body:    "Noto Serif SC", "Cormorant Garamond", serif;
  --font-accent:  "Cinzel", "Noto Serif SC", serif;

  --radius:       2px;
  --radius-lg:    6px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.5);
  --shadow-md:    0 6px 24px rgba(0,0,0,0.45);
  --shadow-lg:    0 30px 80px rgba(0,0,0,0.55);

  --pattern: radial-gradient(ellipse at 50% 0%, rgba(201,169,97,0.08), transparent 60%);
}

/* --- 东南亚热带 / 鲜艳 --- */
[data-theme="tropical"] {
  --bg:           #fff4e6;
  --bg-alt:       #fffaf0;
  --bg-card:      #ffffff;
  --surface:      #ffe0b8;
  --fg:           #1a2e1a;
  --fg-muted:     #4a6340;
  --fg-subtle:    #7a8c6a;
  --border:       #ffcc88;
  --border-strong:#ff6b35;
  --accent:       #ff6b35;
  --accent-fg:    #ffffff;
  --accent-2:     #06a77d;
  --danger:       #e63946;
  --success:      #06a77d;

  --font-display: "DM Serif Display", "Noto Serif", serif;
  --font-body:    "Poppins", "Noto Sans", sans-serif;
  --font-accent:  "Caveat", "DM Serif Display", cursive;

  --radius:       14px;
  --radius-lg:    24px;

  --shadow-sm:    0 2px 6px rgba(255,107,53,0.12);
  --shadow-md:    0 8px 24px rgba(255,107,53,0.15);
  --shadow-lg:    0 24px 60px rgba(255,107,53,0.20);

  --pattern: radial-gradient(circle at 10% 20%, rgba(255,209,102,0.25), transparent 35%),
             radial-gradient(circle at 90% 80%, rgba(6,167,125,0.15), transparent 40%);
}

/* --- 欧美高端 / 极简黑白 --- */
[data-theme="noir"] {
  --bg:           #ffffff;
  --bg-alt:       #f7f7f7;
  --bg-card:      #ffffff;
  --surface:      #efefef;
  --fg:           #000000;
  --fg-muted:     #555555;
  --fg-subtle:    #999999;
  --border:       #e0e0e0;
  --border-strong:#000000;
  --accent:       #000000;
  --accent-fg:    #ffffff;
  --accent-2:     #999999;
  --danger:       #000000;
  --success:      #000000;

  --font-display: "Playfair Display", "Noto Serif", serif;
  --font-body:    "Inter", "Helvetica Neue", -apple-system, sans-serif;
  --font-accent:  "Playfair Display", serif;

  --radius:       0px;
  --radius-lg:    0px;

  --shadow-sm:    none;
  --shadow-md:    none;
  --shadow-lg:    0 0 0 1px #000;
}

/* --- 年轻潮流 / 撞色 --- */
[data-theme="youth"] {
  --bg:           #ffee00;
  --bg-alt:       #fff38a;
  --bg-card:      #ffffff;
  --surface:      #ffffff;
  --fg:           #0d0d0d;
  --fg-muted:     #444444;
  --fg-subtle:    #777777;
  --border:       #0d0d0d;
  --border-strong:#ff3366;
  --accent:       #ff3366;
  --accent-fg:    #ffffff;
  --accent-2:     #00d9ff;
  --danger:       #ff3366;
  --success:      #00d9ff;

  --font-display: "Archivo Black", "Space Grotesk", sans-serif;
  --font-body:    "Space Grotesk", "Inter", sans-serif;
  --font-accent:  "Archivo Black", sans-serif;

  --radius:       0px;
  --radius-lg:    0px;

  --shadow-sm:    3px 3px 0 #0d0d0d;
  --shadow-md:    5px 5px 0 #0d0d0d;
  --shadow-lg:    8px 8px 0 #0d0d0d;
}

/* --- 节日限定 / 春节金红 --- */
[data-theme="festival"] {
  --bg:           #0d1b2a;
  --bg-alt:       #152639;
  --bg-card:      #1a2d44;
  --surface:      #253a54;
  --fg:           #f5e4b8;
  --fg-muted:     #d4af37;
  --fg-subtle:    #8a7544;
  --border:       #3d5270;
  --border-strong:#d4af37;
  --accent:       #d4af37;
  --accent-fg:    #0d1b2a;
  --accent-2:     #9b1d20;
  --danger:       #e63946;
  --success:      #d4af37;

  --font-display: "Noto Serif SC", "Cinzel", serif;
  --font-body:    "Noto Sans SC", "Inter", sans-serif;
  --font-accent:  "Cinzel", "Noto Serif SC", serif;

  --radius:       3px;
  --radius-lg:    8px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:    0 8px 28px rgba(212,175,55,0.15);
  --shadow-lg:    0 24px 60px rgba(0,0,0,0.5);

  --pattern: radial-gradient(circle at 50% 0%, rgba(212,175,55,0.1), transparent 60%),
             radial-gradient(circle at 20% 100%, rgba(155,29,32,0.15), transparent 50%);
}

/* ========================================================================
   基础样式 - 全部由变量驱动
   ======================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-feature-settings: "ss01", "cv01", "tnum";
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  transition: background 400ms ease, color 400ms ease;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background: var(--pattern);
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  transition: opacity 400ms ease;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* Serif 微调 */
[data-theme="ink"] h1, [data-theme="ink"] h2, [data-theme="ink"] h3,
[data-theme="palace"] h1, [data-theme="palace"] h2,
[data-theme="festival"] h1, [data-theme="festival"] h2 {
  letter-spacing: 0.02em;
  font-weight: 500;
}

[data-theme="youth"] h1, [data-theme="youth"] h2 {
  letter-spacing: -0.03em;
  text-transform: uppercase;
  font-weight: 900;
}

[data-theme="noir"] h1, [data-theme="noir"] h2 {
  font-weight: 400;
  letter-spacing: -0.02em;
}

/* 通用组件 */
.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 28px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 120ms ease, opacity 160ms;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 13px 26px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* RTL */
[dir="rtl"] { direction: rtl; }
