/* ═══════════════════════════════════════════════════
   主题一 · 国风武侠江湖（黑白水墨 + 朱砂）
   ═══════════════════════════════════════════════════ */

[data-theme="wuxia"] {
  --font-display: "Ma Shan Zheng", "ZCOOL XiaoWei", "Noto Serif SC", serif;
  --font-body: "Noto Serif SC", "Songti SC", serif;
  --font-mono: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  --radius: 4px;
}

[data-theme="wuxia"][data-mode="light"] {
  --bg: #f2ecdf;          /* 宣纸 */
  --bg-soft: #eae2d0;
  --surface: #f8f4e9;
  --ink: #2b2926;         /* 墨色 */
  --ink-soft: #6f675c;
  --line: #d8cfba;
  --accent: #a83226;      /* 朱砂 */
  --accent-fg: #f8f4e9;
  --accent-2: #40514f;    /* 黛青 */
  --shadow: 0 1px 0 rgba(43,41,38,.05), 0 10px 26px -18px rgba(43,41,38,.35);
  --topbar-bg: rgba(242,236,223,.88);
  --code-bg: #241f1a; --code-fg: #e8ddc8;
  --ink-wash-strong: #2b2926;
  --ink-wash-mid: #55503f;
  --ink-wash-far: #8d8574;
}

[data-theme="wuxia"][data-mode="dark"] {
  --bg: #14110d;          /* 夜墨 */
  --bg-soft: #1d1915;
  --surface: #1c1813;
  --ink: #e4dccb;
  --ink-soft: #9a8f7c;
  --line: #352e25;
  --accent: #c9463a;
  --accent-fg: #f8f4e9;
  --accent-2: #7d928e;
  --shadow: 0 1px 0 rgba(0,0,0,.3), 0 12px 30px -18px rgba(0,0,0,.8);
  --topbar-bg: rgba(20,17,13,.88);
  --code-bg: #0d0b08; --code-fg: #d9cfb8;
  --ink-wash-strong: #d8d0bc;
  --ink-wash-mid: #6e6656;
  --ink-wash-far: #453e31;
}

/* ── 品牌印 ───────────────────────────────────── */
[data-theme="wuxia"] .brand-mark {
  background: var(--accent); color: var(--accent-fg);
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px rgba(248,244,233,.35);
  transform: rotate(-3deg);
  font-size: 24px;
}
[data-theme="wuxia"] .nav-link.is-active { background: var(--bg-soft); }

/* ── 氛围：雾气与落叶 ─────────────────────────── */
[data-theme="wuxia"] .amb-wuxia { display: block; }
.mist {
  position: absolute; width: 46vw; height: 22vh;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--bg-soft) 0%, transparent 70%);
  opacity: .7; filter: blur(18px);
}
.mist-1 { top: 26%; left: -8%; animation: mist-drift 46s ease-in-out infinite alternate; }
.mist-2 { top: 48%; right: -10%; animation: mist-drift 58s ease-in-out infinite alternate-reverse; }
.mist-3 { top: 64%; left: 22%; animation: mist-drift 52s ease-in-out infinite alternate; animation-delay: -20s; }
@keyframes mist-drift {
  from { transform: translateX(-4vw) scale(1); }
  to   { transform: translateX(6vw) scale(1.12); }
}

.leaf {
  position: absolute; top: -30px;
  width: 14px; height: 9px;
  background: var(--ink-wash-mid);
  border-radius: 80% 0 80% 0;
  opacity: .5;
  animation: leaf-fall linear infinite;
}
.leaf-1 { left: 12%; animation-duration: 15s; animation-delay: 0s; }
.leaf-2 { left: 34%; animation-duration: 19s; animation-delay: -6s; transform: scale(.7); }
.leaf-3 { left: 58%; animation-duration: 13s; animation-delay: -3s; }
.leaf-4 { left: 74%; animation-duration: 21s; animation-delay: -11s; transform: scale(.8); }
.leaf-5 { left: 88%; animation-duration: 16s; animation-delay: -8s; }
@keyframes leaf-fall {
  0%   { transform: translate(0, -4vh) rotate(0deg); opacity: 0; }
  8%   { opacity: .55; }
  50%  { transform: translate(5vw, 50vh) rotate(200deg); }
  100% { transform: translate(-2vw, 104vh) rotate(420deg); opacity: 0; }
}

/* ── HERO：水墨山水 ───────────────────────────── */
.hero-wuxia { background: var(--bg); min-height: 520px; }
.scene-ink { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 430px; }
.scene-ink .sky-stop-1 { stop-color: var(--bg); }
.scene-ink .sky-stop-2 { stop-color: var(--bg-soft); }
.scene-ink .ink-sun {
  fill: var(--accent); opacity: .8;
  animation: sun-breathe 9s ease-in-out infinite;
}
@keyframes sun-breathe { 0%,100% { opacity: .55; } 50% { opacity: .85; } }
.scene-ink .mtn-far path  { fill: var(--ink-wash-far); }
.scene-ink .mtn-mid path  { fill: var(--ink-wash-mid); opacity: .75; }
.scene-ink .mtn-near path { fill: var(--ink-wash-mid); }
.scene-ink .cliff path    { fill: var(--ink-wash-strong); }
.scene-ink .cliff-pine    { stroke: var(--bg); stroke-width: 3; stroke-linecap: round; opacity: .8; }

.swordsman { fill: var(--ink-wash-strong); }
.swordsman .sw-sword { stroke: var(--ink-wash-strong); stroke-width: 3.4; stroke-linecap: round; }
.swordsman .sw-cloak {
  transform-origin: -7px -40px;
  animation: cloak-sway 5.5s ease-in-out infinite;
}
@keyframes cloak-sway {
  0%, 100% { transform: rotate(0deg) skewX(0deg); }
  50%      { transform: rotate(-4deg) skewX(-5deg); }
}

.hero-wuxia .hero-eyebrow { letter-spacing: .5em; }
.hero-wuxia .hero-title { font-size: clamp(48px, 7vw, 84px); }
/* 笔刷揭示 */
.hero-wuxia .brush {
  position: relative;
  background: linear-gradient(to right, var(--ink) 50%, transparent 50%);
  background-size: 220% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: brush-reveal 1.4s .2s ease forwards;
}
@keyframes brush-reveal { to { background-position: 0 0; } }
.hero-wuxia .brush::after {
  content: ""; position: absolute; left: 2%; right: -4%; bottom: .02em; height: .1em;
  background: var(--accent); opacity: .8;
  transform: scaleX(0); transform-origin: left;
  animation: brush-line 1s 1s ease forwards;
}
@keyframes brush-line { to { transform: scaleX(1); } }

.hero-wuxia .v-seal {
  writing-mode: vertical-rl;
  font-size: 12px; letter-spacing: .3em;
  border: 1.5px solid var(--accent); color: var(--accent);
  padding: 8px 4px; border-radius: 3px;
}

/* ── 卡片：宣纸帖 ─────────────────────────────── */
[data-theme="wuxia"] .card { border-left: 3px solid transparent; }
[data-theme="wuxia"] .card:hover { border-left-color: var(--accent); box-shadow: var(--shadow); }
[data-theme="wuxia"] .card::after {
  content: attr(data-seal);
  position: absolute; top: 18px; right: 20px;
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-size: 13px; letter-spacing: .18em;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 7px 3px; border-radius: 3px;
  opacity: .75; transform: rotate(3deg);
}
[data-theme="wuxia"] .card-title { padding-right: 56px; }
[data-theme="wuxia"] .card-summary { padding-right: 40px; }

/* ── 江湖告示：竖排卷轴 ───────────────────────── */
[data-theme="wuxia"] .widget-wuxia { display: block; background: var(--bg-soft); }
.notice-scroll {
  writing-mode: vertical-rl;
  height: 210px; margin: 0 auto;
  font-size: 14.5px; letter-spacing: .14em;
  color: var(--ink-soft);
  display: flex; gap: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.notice-scroll p { margin: 0; }

/* ── 分页与杂项 ───────────────────────────────── */
[data-theme="wuxia"] .page-btn.is-on { box-shadow: inset 0 0 0 1px rgba(248,244,233,.4); }
[data-theme="wuxia"] .footer { background: var(--bg-soft); }
[data-theme="wuxia"] .reader-panel { background: var(--bg); }
[data-theme="wuxia"] .reader-head h1::first-letter { color: var(--accent); }
