/* ============================================================
   潇洒科技 - 5 套主题模板
   主题通过 html[data-theme="..."] 切换，全部基于 CSS 变量
   ============================================================ */

/* ---------- 1. 深色科技风 tech ---------- */
html[data-theme="tech"] {
  --bg: #0a0e17;
  --bg-soft: #0d1322;
  --hero-bg: radial-gradient(1200px 500px at 20% -10%, rgba(34,211,238,.16), transparent 60%),
             radial-gradient(1000px 500px at 80% 0%, rgba(167,139,250,.18), transparent 55%);
  --card: #0f172a;
  --card-solid: #0f172a;
  --card-alpha: rgba(15,23,42,.72);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --accent-grad: linear-gradient(120deg, #22d3ee, #a78bfa);
  --border: #1f2b3f;
  --border-strong: #2c3d59;
  --shadow-card: 0 0 0 1px rgba(34,211,238,.06), 0 10px 30px rgba(0,0,0,.5);
  --shadow-hover: 0 0 20px rgba(34,211,238,.18), 0 14px 34px rgba(0,0,0,.55);
  --glow: 0 0 14px rgba(34,211,238,.45);
  --btn-text: #06121a;
  --chip-bg: rgba(34,211,238,.1);
  --header-bg: rgba(10,14,23,.82);
  --code-bg: #0b1120;
  --blur: none;
  --hero-title-grad: linear-gradient(100deg,#7dd3fc,#a78bfa 55%,#f0abfc);
}

/* ---------- 2. 玻璃拟态风 glass ---------- */
html[data-theme="glass"] {
  --bg: #dfe6f7;
  --bg-soft: #e7edfb;
  --hero-bg: radial-gradient(900px 480px at 15% 0%, rgba(124,58,237,.22), transparent 60%),
             radial-gradient(900px 480px at 85% 10%, rgba(14,165,233,.25), transparent 55%),
             radial-gradient(700px 400px at 50% 100%, rgba(236,72,153,.16), transparent 60%);
  --card: rgba(255,255,255,.55);
  --card-solid: #ffffff;
  --card-alpha: rgba(255,255,255,.55);
  --text: #1e2333;
  --muted: #5c6478;
  --accent: #7c3aed;
  --accent-2: #0ea5e9;
  --accent-grad: linear-gradient(120deg,#7c3aed,#0ea5e9);
  --border: rgba(255,255,255,.65);
  --border-strong: rgba(124,58,237,.35);
  --shadow-card: 0 8px 32px rgba(31,41,80,.14), inset 0 1px 0 rgba(255,255,255,.6);
  --shadow-hover: 0 14px 44px rgba(31,41,80,.2), inset 0 1px 0 rgba(255,255,255,.7);
  --glow: 0 0 14px rgba(124,58,237,.3);
  --btn-text: #ffffff;
  --chip-bg: rgba(124,58,237,.1);
  --header-bg: rgba(230,236,250,.72);
  --code-bg: rgba(255,255,255,.75);
  --blur: blur(18px) saturate(1.4);
  --hero-title-grad: linear-gradient(100deg,#4c1d95,#0e7490 55%,#be185d);
}

/* ---------- 3. CorePress 简洁杂志风 corepress ---------- */
html[data-theme="corepress"] {
  --bg: #f7f8fa;
  --bg-soft: #ffffff;
  --hero-bg: linear-gradient(180deg,#eef2f7 0%,#f7f8fa 100%);
  --card: #ffffff;
  --card-solid: #ffffff;
  --card-alpha: rgba(255,255,255,.92);
  --text: #24292f;
  --muted: #6e7781;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-grad: linear-gradient(120deg,#2563eb,#1d4ed8);
  --border: #e4e8ee;
  --border-strong: #c9d2dd;
  --shadow-card: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-hover: 0 10px 28px rgba(16,24,40,.12);
  --glow: 0 0 12px rgba(37,99,235,.25);
  --btn-text: #ffffff;
  --chip-bg: rgba(37,99,235,.08);
  --header-bg: rgba(255,255,255,.9);
  --code-bg: #f6f8fa;
  --blur: blur(10px);
  --hero-title-grad: linear-gradient(100deg,#111827,#1d4ed8);
}

/* ---------- 4. Kratos 卡片动漫风 kratos ---------- */
html[data-theme="kratos"] {
  --bg: #f5f6f8;
  --bg-soft: #ffffff;
  --hero-bg: linear-gradient(135deg,#ff6b9d 0%,#ff8e53 50%,#ffb347 100%);
  --hero-banner: linear-gradient(135deg,#ff6b9d 0%,#ff8e53 50%,#ffb347 100%);
  --card: #ffffff;
  --card-solid: #ffffff;
  --card-alpha: rgba(255,255,255,.94);
  --text: #333333;
  --muted: #888888;
  --accent: #ff6b9d;
  --accent-2: #ff8e53;
  --accent-grad: linear-gradient(120deg,#ff6b9d,#ff8e53);
  --border: #f0e3ea;
  --border-strong: #f2c1d4;
  --shadow-card: 0 4px 16px rgba(255,107,157,.10);
  --shadow-hover: 0 10px 30px rgba(255,107,157,.22);
  --glow: 0 0 12px rgba(255,107,157,.35);
  --btn-text: #ffffff;
  --chip-bg: rgba(255,107,157,.1);
  --header-bg: rgba(255,255,255,.88);
  --code-bg: #fdf2f6;
  --blur: blur(10px);
  --hero-title-grad: linear-gradient(100deg,#e11d48,#c2410c);
  --hero-solid: 1;
}

/* ---------- 5. Puock 清新风 puock ---------- */
html[data-theme="puock"] {
  --bg: #f4f9f7;
  --bg-soft: #ffffff;
  --hero-bg: linear-gradient(160deg,#e0f2ef 0%,#f4f9f7 60%,#eef4ff 100%);
  --card: #ffffff;
  --card-solid: #ffffff;
  --card-alpha: rgba(255,255,255,.95);
  --text: #2d3436;
  --muted: #7b8688;
  --accent: #10b981;
  --accent-2: #0ea5e9;
  --accent-grad: linear-gradient(120deg,#10b981,#0ea5e9);
  --border: #e2ece8;
  --border-strong: #bfe3d6;
  --shadow-card: 0 2px 12px rgba(16,185,129,.08);
  --shadow-hover: 0 10px 28px rgba(16,185,129,.18);
  --glow: 0 0 12px rgba(16,185,129,.3);
  --btn-text: #ffffff;
  --chip-bg: rgba(16,185,129,.1);
  --header-bg: rgba(255,255,255,.9);
  --code-bg: #f0faf6;
  --blur: blur(10px);
  --hero-title-grad: linear-gradient(100deg,#065f46,#0e7490);
}

/* ---------- 主题特化微调 ---------- */
/* 玻璃拟态：卡片毛玻璃 */
html[data-theme="glass"] .card,
html[data-theme="glass"] .site-header,
html[data-theme="glass"] .editor-panel {
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

/* 深色科技：卡片发光描边 */
html[data-theme="tech"] .card {
  border: 1px solid var(--border);
  position: relative;
}
html[data-theme="tech"] .card:hover {
  border-color: rgba(34,211,238,.4);
  box-shadow: var(--shadow-hover);
}
html[data-theme="tech"] .btn-primary {
  box-shadow: var(--glow);
}

/* Kratos：Hero 使用实色渐变横幅 */
html[data-theme="kratos"] .hero {
  border-radius: 0 0 28px 28px;
  color: #fff;
}
html[data-theme="kratos"] .hero .hero-title {
  background: none;
  -webkit-text-fill-color: #fff;
  color: #fff;
}
html[data-theme="kratos"] .hero .hero-slogan { color: rgba(255,255,255,.92); }
html[data-theme="kratos"] .hero-badge { background: rgba(255,255,255,.22); color:#fff; border-color: rgba(255,255,255,.35); }

/* ============================================================
   全局深色 / 浅色模式切换（独立于主题模板）
   模式只覆盖中性色（背景/文字/边框/阴影），保留各主题强调色
   注意：必须放在主题块之后，同特异性下后者生效
   ============================================================ */

html[data-mode="dark"] {
  --bg: #0a0e17;
  --bg-soft: #0d1424;
  --card: #0f172a;
  --card-solid: #0f172a;
  --card-alpha: rgba(15,23,42,.72);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #1f2b3f;
  --border-strong: #2c3d59;
  --header-bg: rgba(10,14,23,.85);
  --code-bg: #0b1120;
  --shadow-card: 0 0 0 1px rgba(255,255,255,.03), 0 10px 30px rgba(0,0,0,.5);
  --shadow-hover: 0 14px 34px rgba(0,0,0,.62);
  --hero-bg: radial-gradient(1100px 460px at 20% -10%, rgba(34,211,238,.13), transparent 60%),
             radial-gradient(1000px 460px at 80% 0%, rgba(167,139,250,.15), transparent 55%);
  --hero-title-grad: linear-gradient(100deg,#7dd3fc,#c4b5fd 55%,#f9a8d4);
}
html[data-mode="light"] {
  --bg: #f7f8fa;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-solid: #ffffff;
  --card-alpha: rgba(255,255,255,.92);
  --text: #24292f;
  --muted: #6e7781;
  --border: #e4e8ee;
  --border-strong: #c9d2dd;
  --header-bg: rgba(255,255,255,.9);
  --code-bg: #f6f8fa;
  --shadow-card: 0 1px 3px rgba(16,24,40,.08), 0 2px 8px rgba(16,24,40,.05);
  --shadow-hover: 0 10px 28px rgba(16,24,40,.14);
  --hero-bg: linear-gradient(180deg,#eef2f7 0%,#f7f8fa 100%);
  --hero-title-grad: linear-gradient(100deg,#1e293b,#4338ca 60%,#7c3aed);
}

/* 深色模式下的主题微调 */
html[data-mode="dark"] .card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
html[data-mode="dark"] .comment-box,
html[data-mode="dark"] .editor-panel,
html[data-mode="dark"] .draft-item,
html[data-mode="dark"] .widget {
  background: var(--card);
}

/* CorePress：标题更杂志化 */
html[data-theme="corepress"] .section-title { letter-spacing: .04em; }
html[data-theme="corepress"] .card { border: 1px solid var(--border); }
