/* =====================================================
   作战室 · War Room（2026-11-08）
   -----------------------------------------------------
   定位：**态势页**，不是第二个首页。
     · 概览页回答「今天要做什么」——操作导向，每天必看
     · 作战室回答「我现在打到哪了」——态势导向，开工/收工/专注前看一眼
   所以它只读、不录入、不做高频操作；信息密度刻意压到 4 块（参考图的密度）。

   全部使用既有令牌（--bw / --r-* / --sh-* / --fs-* / --sp-*），
   因此主题皮肤与沉浸氛围会自动跟随，不需要在 themes.css 里再写一遍。
   回滚：删掉本文件 + index.html 里两行引用即可。
   ===================================================== */

.war {
  --war-gap: 16px;
  position: relative;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 18px 26px;
  align-items: start;
  padding-bottom: 28px;
}
/* 右列：时钟 / 三格 / 两栏 / 数据带，依次往下 */
.war-main { display: flex; flex-direction: column; gap: var(--war-gap); min-width: 0; }

/* ---------- 1. 左列：竖排巨幅标题 ---------- */
/* 跨满整列高度：标题的高度就是版面的高度，这是参考图1 最核心的构图手法 */
.war-vert {
  grid-row: 1 / -1; align-self: stretch; position: relative;
  display: flex; align-items: flex-start; gap: 13px;
  padding-bottom: 22px;
}
.war-vert-col {
  writing-mode: vertical-rl;              /* 参考图1 的竖排大标题，靠这一行 */
  font-family: "Archivo Black", "Space Grotesk", sans-serif;
  font-weight: 900; letter-spacing: -.01em; line-height: .92;
  color: var(--ink); text-transform: uppercase;
  animation: war-rise .5s cubic-bezier(.2, .9, .3, 1) both;
}
/* 字符数决定字号：主列 8 字符用 64px，副列 3 字符可以更大 */
.war-vert-main { font-size: clamp(56px, 7.4vw, 104px); }
.war-vert-sub {
  /* 下移错位：和主字顶端齐平会显得像"两个并排标签"，错开才有版面节奏 */
  margin-top: clamp(48px, 7vw, 104px);
  font-size: clamp(34px, 4.4vw, 62px);
  /* 竖排下默认字距会把 3 个字母拉散成 3 个独立符号，收紧才有"一列字"的整体感 */
  letter-spacing: -.06em;
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);     /* 空心字：和实心主列形成主次 */
  animation-delay: .1s;
}
/* 最左一列竖排小字：参考图1 的版面边缘就用这列小字压住，
   order:-1 让它排在「作战」左边，和右侧大字形成大小对照 */
.war-vert-note {
  writing-mode: vertical-rl; order: -1;
  font-family: inherit; font-size: 11px; font-weight: 700;
  letter-spacing: .3em; line-height: 1.5; color: var(--text2);
  max-height: 100%; overflow: hidden;
}

.war-clock {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  flex: 0 0 auto;
}
/* 时钟数字：图5 那种「方框数字」用 tabular-nums + 描边框近似，
   不引等宽字体（中文字体包里没有，引一个 3MB 不值得） */
.war-clock b {
  font-family: "Archivo Black", "Space Grotesk", sans-serif;
  font-size: clamp(34px, 4vw, 52px); font-weight: 900; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
  padding: 4px 10px; border: var(--bw) solid var(--ink); border-radius: var(--r-sm);
  background: var(--card);
}
.war-clock span { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--text2); }

/* ---------- 2. 态势三格 ---------- */
.war-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
/* 复用 .card 的类名 → 自动继承 amb 模式的玻璃效果与主题配色 */
.war-stat { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 1px; padding: 14px 16px; }
.war-stat b {
  font-family: "Archivo Black", "Space Grotesk", sans-serif;
  font-size: clamp(26px, 3vw, 38px); font-weight: 900; line-height: 1.1;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.war-stat span { font-size: 12px; font-weight: 700; color: var(--text2); }
.war-stat em {
  font-style: normal; font-size: 11px; font-weight: 800;
  letter-spacing: .12em; color: var(--text2); margin-top: 4px;
}
/* 聚光（reactbits Spotlight Card）：跟随指针的柔和光斑，只在 hover 时存在 */
.war-stat::before,
.war-focus::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 0%),
              color-mix(in srgb, var(--yellow) 34%, transparent), transparent 72%);
  opacity: 0; transition: opacity .22s; pointer-events: none;
}
.war-stat:hover::before,
.war-focus:hover::before { opacity: 1; }
/* 三格的强调色不做成三种颜色（会花），用左侧一道色带区分 */
.war-stat::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--bar, var(--yellow));
}
.war-stat.done  { --bar: var(--green); }
.war-stat.drag  { --bar: var(--accent); }
.war-stat.money { --bar: var(--primary); }

/* ---------- 3. 主体两列：主推项目 / 今日战线 ---------- */
.war-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.war-body > div { display: flex; flex-direction: column; min-width: 0; }
.war-sec-title {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .2em;
  color: var(--text2); margin-bottom: 7px;
}
.war-sec-title i { font-size: 11px; }
.war-sec-title em { font-style: normal; margin-left: auto; letter-spacing: 0; font-weight: 600; }

/* 3.1 主推项目：旋转描边（reactbits Star Border 的思路）
   用 conic-gradient + mask 只留 2px 边，成本比 4 个伪元素 + 4 段动画低得多。
   @property 不支持的浏览器会退化成静态渐变边（仍然好看，只是不转）。 */
@property --war-ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.war-focus { position: relative; overflow: hidden; padding: 16px 18px; }
.war-focus::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px;
  background: conic-gradient(from var(--war-ang),
    var(--accent), var(--yellow), var(--cyan), var(--accent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: war-spin 7s linear infinite; pointer-events: none;
}
.wf-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.wf-title {
  font-size: 16px; font-weight: 800; line-height: 1.45; flex: 1; min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wf-stage {
  flex: 0 0 auto; font-size: 11px; font-weight: 800; padding: 1px 8px;
  border: var(--bw) solid var(--ink); border-radius: var(--r-pill);
  background: var(--yellow); color: var(--ink);
}
.wf-flex { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.wf-num {
  font-family: "Archivo Black", "Space Grotesk", sans-serif;
  font-size: 40px; font-weight: 900; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--ink); flex: 0 0 auto;
}
.wf-num small { font-size: 16px; margin-left: 1px; color: var(--text2); }
.wf-meta { display: flex; gap: 4px 12px; flex-wrap: wrap; font-size: 12px; color: var(--text2); }
.wf-pipe { display: flex; gap: 14px; margin-top: 8px; font-size: 11px; font-weight: 700; color: var(--text2); }
.wf-pipe b { color: var(--ink); font-variant-numeric: tabular-nums; }
.wf-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.wf-bar { height: 10px; border: var(--bw) solid var(--ink); border-radius: var(--r-pill); background: var(--card); overflow: hidden; }
.wf-bar > i { display: block; height: 100%; background: var(--green); transition: width .5s cubic-bezier(.2, .9, .3, 1); }
.wf-sub { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; font-weight: 700; color: var(--text2); }

/* 3.1b 今日习惯点阵：把左列的高度撑到与右列战线齐平 */
.war-habits { margin-top: 10px; padding: 12px 16px; }
.wh-dots { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.wh-dot {
  width: 28px; height: 28px; display: grid; place-items: center;
  border: var(--bw) solid var(--ink); border-radius: var(--r-xs);
  background: var(--card); color: var(--ink); font-size: 11px;
}
.wh-dot.on { background: var(--green); }
.wh-foot { margin-top: 8px; font-size: 11px; font-weight: 700; color: var(--text2); }
.wh-foot b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* 3.2 今日战线：竖线 + 圆点的步进器（reactbits Stepper 的思路） */
.war-line { padding: 16px 18px; }
.wl-item { display: flex; gap: 10px; padding-bottom: 12px; position: relative; }
.wl-item:last-child { padding-bottom: 0; }
/* 竖线用伪元素，比给每个 li 加 border-left 更好控制末端 */
.wl-item::before {
  content: ""; position: absolute; left: 5px; top: 14px; bottom: 0;
  width: 2px; background: var(--line-soft, #ddd);
}
.wl-item:last-child::before { display: none; }
.wl-dot {
  flex: 0 0 auto; width: 12px; height: 12px; margin-top: 4px;
  border: var(--bw) solid var(--ink); border-radius: 50%; background: var(--card);
  position: relative; z-index: 1;
}
.wl-item.pri-high .wl-dot { background: var(--accent); }
.wl-item.pri-low  .wl-dot { background: var(--hover); }
.wl-body { flex: 1; min-width: 0; }
.wl-text { font-size: 13px; font-weight: 700; line-height: 1.5; word-break: break-word; }
.wl-tag { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; font-size: 11px; color: var(--text2); }
.wl-tag b { font-weight: 800; }
.wl-late { color: var(--accent); font-weight: 800; }
.wl-empty { padding: 18px 4px; text-align: center; font-size: 13px; color: var(--text2); }

/* ---------- 4. 底部：目标进度滚动条（reactbits text-loop / marquee） ---------- */
.war-tape {
  display: flex; gap: 28px; overflow: hidden; position: relative;
  padding: 9px 0; border-top: var(--bw) solid var(--ink); border-bottom: var(--bw) solid var(--ink);
  background: var(--card);
}
.war-tape-track { display: flex; gap: 28px; flex: 0 0 auto; animation: war-marquee 34s linear infinite; }
.war-tape:hover .war-tape-track { animation-play-state: paused; }
.war-tape-i { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12px; font-weight: 700; }
.war-tape-i b { font-variant-numeric: tabular-nums; }
.war-tape-i i { width: 42px; height: 8px; border: 2px solid var(--ink); border-radius: var(--r-pill); overflow: hidden; display: block; }
.war-tape-i i > u { display: block; height: 100%; background: var(--primary); }

/* ---------- 5. 破框立绘（本轮最关键的层次手法） ----------
   挂在 body 上而不是 #page 里：#page 每次渲染会重置 animation，
   里面有 transform 就会让 fixed 退化成相对 #page 定位，人物会跟着滚走。 */
.war-figure {
  /* 相对 .war 定位，站在它右侧的空白带里（不是 fixed 贴视口右下角 ——
     那样在 1920 屏上一定会压到战线列表的右半截）。 */
  position: absolute; left: calc(100% + 24px); bottom: 0; z-index: 3;
  width: min(24vw, 300px); pointer-events: none; user-select: none;
  color: var(--ink); opacity: .94;
  transform: translateY(6px);
  animation: war-figure-in .7s cubic-bezier(.2, .9, .3, 1) both;
}
.war-figure svg { width: 100%; height: auto; display: block; }
/* 真实立绘（本地 WebP）：按宽度铺满、底对齐，人物"站"在版面下沿 */
.war-figure-img { width: 100%; height: auto; display: block; object-fit: contain; object-position: bottom center; }
/* 立绘站位的宽度账（实测）：
     #page 宽 ≈ min(1360, vw − 280)
     立绘占 300 + 24 间隙 = 324
   → 只有 vw ≥ 1400（#page ≥ 1120）时，收窄内容后还够用；
     窄屏硬要摆，内容会被压到 700px 以下，反而比"没有人物"更糟。 */
@media (min-width: 1400px) {
  .war { max-width: min(1020px, calc(100% - 324px)); }
  /* 没有立绘（经典模式 / 无素材主题）时不必为它留位，内容用满 */
  .war.no-fig { max-width: 1020px; }
}
@media (max-width: 1399px) {
  .war-figure { display: none; }
}

/* 只读页不要悬浮球：qc-off 原本只管「记一句」，AI 球也要一起收掉，
   否则它在手机上正好压住战线列表的最后两条。 */
body.qc-off .ai-fab { display: none; }

/* ---------- 6. 入场与动效 ---------- */
@keyframes war-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes war-figure-in {
  from { opacity: 0; transform: translateY(34px) scale(.97); }
  to   { opacity: .94; transform: translateY(6px); }
}
@keyframes war-spin { to { --war-ang: 360deg; } }
@keyframes war-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* 战线条目逐个入场（reactbits Animated List）：靠行内 --i 控制延迟 */
.wl-item { animation: war-rise .34s ease-out both; animation-delay: calc(var(--i, 0) * 45ms); }

/* ---------- 7. 响应式 ---------- */
@media (max-width: 980px) {
  /* 关键：左列 210px 是桌面版的海报骨架，窄屏必须先塌成单列，
     否则右列会被压到 ~55px，三格卡片和文字会全部竖排换行（已踩）。 */
  .war { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .war-vert { grid-row: auto; flex-direction: row; align-items: baseline; gap: 10px; padding-bottom: 0; }
  .war-vert-col { writing-mode: horizontal-tb; line-height: 1.05; }
  .war-vert-note { writing-mode: horizontal-tb; order: 0; letter-spacing: .1em; }
  .war-vert-main { font-size: clamp(30px, 7vw, 44px); }
  .war-vert-sub { font-size: clamp(22px, 5vw, 32px); margin-top: 0; }
  .war-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .war-vert-main { font-size: 28px; }
  .war-vert-sub { display: none; }
  .war-clock { align-items: flex-start; }
  .war-clock b { font-size: 30px; }
  .war-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .war-stat { padding: 10px; }
  .war-stat b { font-size: 20px; }
  .war-stat span, .war-stat em { font-size: 10.5px; letter-spacing: .02em; }
}

/* 关掉动效偏好：本轮所有动画都不再播放，但样式（渐变边、聚光底色）保留 */
@media (prefers-reduced-motion: reduce) {
  .war-vert-col, .wl-item, .war-figure { animation: none; }
  .war-focus::after, .war-tape-track { animation: none; }
  .war-stat::before, .war-focus::before { display: none; }
}

/* ==========================================================================
   今日战线 · 就地打勾（2026-11-11）
   --------------------------------------------------------------------------
   需求：「显示今天要做的、完成了就不显示」。
   · 把原来的装饰圆点换成一个真的可点的方框（正方形 = 待办勾选框，比圆点更明确）
   · 完成后整行淡出 + 划掉，220ms 后由 JS 摘掉节点
   · 优先级改用方框左侧的竖条表达，不再靠圆点填色（填色在暗色主题下看不出）
   ========================================================================== */
.wl-list { display: block; }
.wl-item { gap: 11px; align-items: flex-start; }
/* 竖线改挂在勾选框中心（14px 框 → 中心 7px） */
.wl-item::before { left: 6px; top: 20px; }

.wl-check {
  flex: 0 0 auto;
  width: 15px; height: 15px; margin-top: 3px;
  border: 2px solid var(--ink); border-radius: 4px;
  background: var(--card); cursor: pointer; padding: 0;
  position: relative; z-index: 1;
  transition: background .12s ease, transform .12s ease, box-shadow .12s ease;
}
.wl-item.pri-high .wl-check { box-shadow: inset 3px 0 0 var(--accent); }
.wl-item.pri-low  .wl-check { border-color: var(--text3); }
.wl-check:hover { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--ink); }
.wl-check:active { transform: translate(1px, 1px); box-shadow: none; }
.wl-check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 完成态：整行退场（保留 220ms 让人看到「我点中了」） */
.wl-item.is-done { animation: wl-done-out .22s var(--ease, ease) forwards; pointer-events: none; }
.wl-item.is-done .wl-text { text-decoration: line-through; color: var(--text3); }
.wl-item.is-done .wl-check { background: var(--green); border-color: var(--ink); }
@keyframes wl-done-out {
  to { opacity: 0; transform: translateX(6px); }
}

/* 清零态：今天没有剩的了 */
.wl-clear { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 12px; }
.wl-clear i { font-size: 20px; color: var(--green); }
.wl-clear b { font-size: 14px; font-weight: 900; color: var(--ink); }
.wl-clear span { font-size: 12px; color: var(--text2); line-height: 1.6; }

@media (prefers-reduced-motion: reduce) {
  .wl-item.is-done { animation: none; opacity: 0; }
}
