/* ---------- 紫金 · 宋 ----------
   颜色从两张彩妆照里取：Lunasol 四色盘的薰衣草紫 #dacbe0、蓝紫 #aea4e0 / #808bc2，
   Canmake 指甲油的丁香紫 #bdaade，Clio 盘里的粉紫 #d196c2，Lunasol 的灰紫棕 #756778。
   主紫和深紫是把蓝紫往下压出来的，用于文字和行动；金只做点缀，任何一屏最多两处（标题下一笔粗金线、白文小印），不铺大面。
   全站只改这里就能调色。 */
:root {
  --paper: #f8f5ef;          /* 棉纸，略暖 */
  --slip: #efe8f2;           /* 题签纸：淡淡的薰衣草 */
  --wash: #ebe4f1;           /* 大块淡洗 */
  --ink: #2c2340;            /* 紫墨，正文 */
  --muted: #675d77;
  --zi: #5a4790;             /* 主紫：行动、强调 */
  --zi-deep: #3a2b5f;
  --lav: #dacbe0;            /* 取自 Lunasol 薰衣草 */
  --peri: #aea4e0;           /* 取自 Lunasol 蓝紫 */
  --lilac: #bdaade;          /* 取自 Canmake 丁香紫 */
  --mauve: #d196c2;          /* 取自 Clio 粉紫，只用在极小处 */
  --dusk: #756778;           /* 取自 Lunasol 灰紫棕 */
  --jin: #b08a4e;            /* 泥金：装饰线、印 */
  --jin-ink: #80602a;        /* 写字用的金，够对比 */
  --jin-leaf: #dcc48e;       /* 金箔，洒金 */
  --pencil: rgba(44, 35, 64, .5);
  --tape: rgba(174, 164, 224, .32);
  --seal-bg: #80602a; --seal-ink: #f8f5ef;   /* 白文印 */
  --mount: #fffdf9;                          /* 装裱底纸：深色下也保持浅，画不和深底糊在一起 */
  --qiang: #8e6397; --qiang-deep: #5c3f66;   /* 墙紫（第七轮）：主人拍的教室墙，往紫里拉了一点，明度不变。小字仍用 --zi，墙紫在纸上只有 4.4:1 */
  --band: #5c3f66; --band-ink: #f3eef9; --band-accent: #c8bcf0;   /* 深紫横带：全站唯一一块实心紫，第七轮换成墙紫 */
  --band-bg: repeating-linear-gradient(90deg, #5c3f66 0 11px, #523860 11px 14px);   /* 连墙上的竖条一起 */
  --scrap-q: var(--qiang);
  --ticker-ink: #43306b;
  --f-hand: "LXGW WenKai Lite", "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", "BiauKai", serif;
  --f-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --spring: cubic-bezier(.2, .9, .3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1c1928; --band: #2f2b4d; --band-ink: #f3eef9; --band-accent: #c8bcf0; --ticker-ink: #e6defa; --slip: #2a2540; --wash: #272238; --ink: #efeaf5; --muted: #b5acc4;
    --zi: #c8bcf0; --zi-deep: #e6defa; --lav: #4a4068; --peri: #5d5490; --lilac: #6a5a92; --mauve: #8a5a7e; --dusk: #9a8aa0;
    --jin: #c9ab70; --jin-ink: #d9bf86; --jin-leaf: #b89a5c; --pencil: rgba(239, 234, 245, .45); --tape: rgba(200, 188, 240, .2);
    --seal-bg: #d9bf86; --seal-ink: #1c1928; --mount: #e9e3d7; --qiang: #b892c2; --qiang-deep: #8a6694; --band-bg: var(--band); --scrap-q: var(--lav);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1c1928; --band: #2f2b4d; --band-ink: #f3eef9; --band-accent: #c8bcf0; --ticker-ink: #e6defa; --slip: #2a2540; --wash: #272238; --ink: #efeaf5; --muted: #b5acc4;
  --zi: #c8bcf0; --zi-deep: #e6defa; --lav: #4a4068; --peri: #5d5490; --lilac: #6a5a92; --mauve: #8a5a7e; --dusk: #9a8aa0;
  --jin: #c9ab70; --jin-ink: #d9bf86; --jin-leaf: #b89a5c; --pencil: rgba(239, 234, 245, .45); --tape: rgba(200, 188, 240, .2);
  --seal-bg: #d9bf86; --seal-ink: #1c1928; --mount: #e9e3d7; --qiang: #b892c2; --qiang-deep: #8a6694; --band-bg: var(--band); --scrap-q: var(--lav);
  color-scheme: dark;
}

@font-face { font-family: "LXGW WenKai Lite"; src: url(../fonts/wenkai.woff2) format("woff2"); font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* .act 等写了 display 的元素也要能藏住 */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper) var(--fibre, none); color: var(--ink); font: 17px/1.8 var(--f-body); overflow-x: clip; }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.hand { font-family: var(--f-hand); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 动作：手写字，没有底色块 */
.act { font: 400 19px/1.4 var(--f-hand); color: var(--zi); text-decoration: none; background: none; border: 0; padding: 10px 0; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center; gap: .3em; }
.act[aria-pressed="true"], .act.on { text-decoration: underline; text-decoration-color: var(--jin); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.pill { display: inline-flex; align-items: center; min-height: 48px; padding: 10px 28px; border-radius: 999px; background: var(--zi); color: var(--paper); font: 400 19px/1.3 var(--f-hand); text-decoration: none; border: 0; cursor: pointer; }
.pill, .act { transition: transform .18s var(--spring), opacity .18s ease; }
.pill:active, .act:active { transform: scale(.97); opacity: .85; }
.pill:disabled, .ghost:disabled, .act:disabled { opacity: .5; cursor: default; }
/* 描边胶囊：让画停下 / 接着动 */
.ghost { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--zi); background: transparent; color: var(--zi); font: 400 18px/1.2 var(--f-hand); cursor: pointer; transition: transform .18s var(--spring), opacity .18s ease; }
.ghost:active { transform: scale(.97); opacity: .85; }
a:focus-visible, button:focus-visible, textarea:focus-visible, input:focus-visible, label:focus-within { outline: 2px solid var(--zi); outline-offset: 3px; }

/* 纸：形状加毛边滤镜，字不加 */
.paper { position: relative; isolation: isolate; }
.paper::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--pbg, var(--slip)); filter: url(#deckle); }
.tape::after { content: ""; position: absolute; top: -11px; left: 50%; width: 74px; height: 22px; margin-left: -37px; background: var(--tape); transform: rotate(var(--tr, -3deg)); }

/* 题签：竖排短题名，纸色 */
.slip { writing-mode: vertical-rl; font: 400 22px/1 var(--f-hand); letter-spacing: .12em; padding: 16px 10px; position: relative; isolation: isolate; color: var(--ink); margin: 0; }
.slip::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--slip); filter: url(#deckle); }
.slip.long { writing-mode: horizontal-tb; letter-spacing: 0; padding: 8px 14px; }

/* 小印：白文印，泥金底、纸色字 */
.seal { display: inline-grid; place-items: center; width: 28px; height: 28px; font: 400 17px/1 var(--f-hand); color: var(--seal-ink); background: var(--seal-bg); border-radius: 3px; transform: rotate(-2deg); flex: none; }

.draft { display: inline-block; font: 400 15px/1.4 var(--f-hand); color: var(--zi); border: 1.5px dashed currentColor; border-radius: 6px; padding: 2px 10px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition-duration: .01s !important; }
}
