/* ============================================================
   tokens.css — 全站唯一的设计常量。颜色 / 字阶 / 间距 / 阴影 / 动效曲线。
   组件样式（style.css）与场景绘制（js/scene.js 读取 --sky-* 等）都只引用这里。
   像素网格单位 --p：窄屏 3px、≥820 为 4px；所有边框、阴影、间距都是 --p 的整数倍。
   ============================================================ */

@font-face {
  font-family: "Yang Pixel";
  src: url("fonts/yang-pixel-sub.woff") format("woff");
  font-display: swap;
}

:root {
  --p: 3px;
  --font: "Yang Pixel", "Fusion Pixel 12px", "PingFang SC", "Microsoft YaHei", monospace;

  /* 字阶：Fusion Pixel 的原生栅格是 12px，只用 12 的倍数或 1.5 倍 */
  --t1: 12px;   /* 标注 / 域名 / 标签 */
  --t2: 18px;   /* 正文 */
  --t3: 24px;   /* 木牌标题 */
  --t4: 36px;   /* 页面大标题 */

  /* 间距阶（p 的倍数） */
  --s1: calc(var(--p) * 1);
  --s2: calc(var(--p) * 2);
  --s3: calc(var(--p) * 3);
  --s4: calc(var(--p) * 4);
  --s6: calc(var(--p) * 6);
  --s8: calc(var(--p) * 8);
  --s12: calc(var(--p) * 12);

  /* 动效：全部是「阶梯」曲线，像素动画不插值 */
  --step-3: steps(3, end);
  --step-4: steps(4, end);
  --step-6: steps(6, end);
  --dur-1: 240ms;
  --dur-2: 480ms;
  --stagger: 90ms;

  /* 结构色（昼 / 夜在下面覆盖） */
  --ink: #2b1d17;
  --ink-2: #3f2d22;
  --outline: #2a1a12;
  --wood: #8a5a30;
  --wood-l: #b5793f;
  --wood-d: #5c3a20;
  --board: #6e4526;
  --board-d: #5c3a20;
  --cream: #fff1cf;
  --tan: #f0d49a;
  --paper: #f3e2b3;
  --paper-d: #d8bf86;
  --paper-ink: #3a2a1c;
  --gold: #e8b64a;
  --red: #c8553d;
  --lamp: #ffcf6b;
  --shade: rgba(42, 26, 18, .28);
  --focus: #e8b64a;

  /* 季节 · 昼（默认春） */
  --grass: #78b650;  --grass-d: #5f9a43;  --grass-l: #94cc66;
  --hill-far: #8fc0a0;  --hill-near: #6aa657;
  --tree: #5a9a4a;  --tree-d: #3f7a3a;  --trunk: #6a4426;
  --accent: #f2a0b4;  /* 花瓣 / 点缀 */
  --snow: #f4f8fb;
  --dirt: #c9a36a;  --dirt-d: #b08a52;
  --roof: #c8553d;  --roof-d: #9a3e2e;  --wall: #ecd9a6;  --wall-d: #cdb57c;
  --cloud: #ffffff;  --cloud-d: #e3eef2;  --star: #fff6c8;
  --sun: #ffe27a;
  --sky-0: #8fd0ea; --sky-1: #a3d8ee; --sky-2: #b8e0ef; --sky-3: #cde8ee; --sky-4: #dfeee6; --sky-5: #eaf1de; --sky-6: #f1f1d6;
}

/* ---------- 季节 · 昼 ---------- */
[data-season="spring"] { /* 默认值即春 */ }
[data-season="summer"] {
  --grass: #5aa040; --grass-d: #458531; --grass-l: #74b956;
  --hill-far: #6fae9c; --hill-near: #4f9444;
  --tree: #3f8a3a; --tree-d: #2c6a30; --accent: #f2d24e;
  --sun: #fff0a0;
  --sky-0: #4fb1e6; --sky-1: #69bfe9; --sky-2: #86cdee; --sky-3: #a6dcf0; --sky-4: #c5e8f1; --sky-5: #dcf0ee; --sky-6: #eaf3e4;
}
[data-season="autumn"] {
  --grass: #a8a045; --grass-d: #8c8636; --grass-l: #c2b95a;
  --hill-far: #b8b28a; --hill-near: #96903c;
  --tree: #e08a2e; --tree-d: #b8561f; --accent: #d9553a;
  --sun: #ffd48a;
  --sky-0: #8db8d6; --sky-1: #a8c8dc; --sky-2: #c4d6df; --sky-3: #e0e0d6; --sky-4: #f2dfc0; --sky-5: #f6d6a6; --sky-6: #f6c991;
}
[data-season="winter"] {
  --grass: #e1ebf1; --grass-d: #c4d4df; --grass-l: #f6fafc;
  --hill-far: #c3d3e0; --hill-near: #d3e0ea;
  --tree: #3f6a58; --tree-d: #2c4f44; --accent: #ffffff;
  --sun: #fff3c4;
  --sky-0: #a5bed3; --sky-1: #b6cbdc; --sky-2: #c7d8e4; --sky-3: #d6e2eb; --sky-4: #e3ebf1; --sky-5: #edf2f5; --sky-6: #f4f6f7;
}

/* ---------- 夜晚（深色 = 夜晚农场）---------- */
[data-time="night"] {
  --ink: #f3e6c0;
  --ink-2: #d4c697;
  --outline: #120b10;
  --wood: #62422b;
  --wood-l: #8a5c3a;
  --wood-d: #3f2819;
  --board: #3f2a1d;
  --board-d: #2f1f15;
  --cream: #ffe9a8;
  --tan: #d9b878;
  --paper: #c9b684;
  --paper-d: #a8946a;
  --paper-ink: #2a2016;
  --gold: #f2c14e;
  --shade: rgba(0, 0, 0, .42);
  --snow: #aebbd8;
  --dirt: #6e5a46; --dirt-d: #584736;
  --roof: #7a3a38; --roof-d: #5a2a2e; --wall: #b4a07a; --wall-d: #8f7f60;
  --cloud: #4a4f86; --cloud-d: #383d70; --star: #fff6c8;
  --sun: #e8e6c8;
  --sky-0: #0e1230; --sky-1: #161b44; --sky-2: #1f2558; --sky-3: #2a2f6b; --sky-4: #3a3a78; --sky-5: #52477f; --sky-6: #6e5683;
}
[data-time="night"][data-season="spring"] {
  --grass: #2a4d35; --grass-d: #1f3d2a; --grass-l: #386444; --hill-far: #2c3d62; --hill-near: #24432f;
  --tree: #1f4a34; --tree-d: #163826; --accent: #d98ca4;
}
[data-time="night"][data-season="summer"] {
  --grass: #204a33; --grass-d: #173a28; --grass-l: #2d5f42; --hill-far: #28385e; --hill-near: #1d4230;
  --tree: #17432d; --tree-d: #102f20; --accent: #f2d24e;
}
[data-time="night"][data-season="autumn"] {
  --grass: #4a4426; --grass-d: #3a351d; --grass-l: #5f5832; --hill-far: #3a3558; --hill-near: #433e22;
  --tree: #8a4a1e; --tree-d: #66361a; --accent: #c4503a;
}
[data-time="night"][data-season="winter"] {
  --grass: #4a5a84; --grass-d: #3a4770; --grass-l: #62729c; --hill-far: #35436e; --hill-near: #404f7c;
  --tree: #1f3d3a; --tree-d: #162e2c; --accent: #dfe8ff;
}

@media (min-width: 820px) { :root { --p: 4px; } }
@media (min-width: 1280px) { :root { --p: 4px; } }
