/* =========================================================
   你填我划 · ONE LINE —— 白底 + 红点，极简
   结构：tokens → base → topbar → board → docks → sheet → toast → responsive
   ========================================================= */

/* ---------- tokens ---------- */
:root{
  color-scheme:light;

  --bg:#ffffff;
  --surface:#ffffff;
  --surface-2:#fafafa;

  --ink:#161616;
  --ink-2:#3d3d3d;
  --muted:#8c8c8c;
  --muted-2:#b3b3b3;

  --line:#e6e6e6;
  --line-2:#d4d4d4;

  --red:#d7263d;
  --red-dark:#b31c31;
  --red-tint:#fbebed;

  --radius:14px;
  --radius-sm:10px;
  --radius-xs:8px;

  --sans:"MiSans VF",-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans SC","Microsoft YaHei","PingFang SC",sans-serif;
  --num:"MiSans VF",-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans SC","Microsoft YaHei","PingFang SC",sans-serif;

  --cell-gap:10px;
}

/* ---------- base ---------- */
*,*::before,*::after{ box-sizing:border-box; }
[hidden]{ display:none !important; }

html{ min-width:320px; }

body{
  margin:0;
  min-height:100vh;
  min-height:100dvh;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--sans);
  font-size:15px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

button{
  font:inherit;
  color:inherit;
  background:none;
  border:0;
  padding:0;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
}
button:disabled{ cursor:not-allowed; }
button:focus-visible{ outline:2px solid var(--red); outline-offset:2px; }
button.cell.is-active:focus-visible{ outline:none; }
input{ font:inherit; color:inherit; }

::selection{ background:var(--red-tint); color:var(--ink); }

.sr-only{
  position:absolute !important;
  width:1px; height:1px;
  margin:-1px; padding:0; border:0;
  clip:rect(0 0 0 0);
  clip-path:inset(50%);
  overflow:hidden;
  white-space:nowrap;
}

/* ---------- page ---------- */
.app{ min-height:100vh; min-height:100dvh; display:flex; }

.page{
  width:100%;
  max-width:560px;
  margin:0 auto;
  padding:0 20px 40px;
  display:flex;
  flex-direction:column;
}

.topbar{
  min-height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  border-bottom:1px solid var(--line);
}

.brand{ display:flex; align-items:center; gap:10px; }
.brand__seal{
  width:34px; height:34px;
  display:grid; place-items:center;
  border:1px solid var(--red);
  border-radius:50%;
  color:var(--red);
  font-size:15px;
  line-height:1;
}
.brand__text{ display:flex; flex-direction:column; line-height:1.2; }
.brand__text b{ font-size:15px; font-weight:600; letter-spacing:.04em; }
.brand__text small{ font-size:9px; letter-spacing:.18em; color:var(--muted); }

.role-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:34px;
  padding:0 14px;
  border:1px solid var(--line-2);
  border-radius:999px;
  font-size:12px;
  color:var(--ink-2);
}
.role-pill__dot{
  width:6px; height:6px;
  border-radius:50%;
  background:var(--red);
}
.role-pill__en{ font-size:9px; letter-spacing:.16em; color:var(--muted); }

/* ---------- stage / board ---------- */
.stage{ padding:24px 0 0; }
.screen{ width:100%; }

.board-shell{
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--surface);
  padding:16px;
}

.board-topline{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding-bottom:12px;
  font-size:11px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--muted);
}
.board-title{ display:inline-flex; align-items:center; gap:8px; }
.meta-dot{
  width:5px; height:5px;
  border-radius:50%;
  background:var(--red);
  display:inline-block;
}
.board-state{ font-size:12px; letter-spacing:.04em; text-transform:none; color:var(--ink-2); }
.board-state.is-ready{ color:var(--red); }
.board-state.is-locked{ color:var(--muted); }

.board{ position:relative; }

.grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:var(--cell-gap);
}

button.cell{
  position:relative;
  aspect-ratio:1;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  background:var(--surface);
  transition:border-color .15s ease,background .15s ease;
}
button.cell:hover{ border-color:var(--line-2); background:var(--surface-2); }
button.cell.is-active{ border-color:var(--red); background:var(--red-tint); }
button.cell.is-duplicate{ border-color:var(--red); }
button.cell:disabled{ cursor:default; }

.cell__number{
  font-family:var(--num);
  font-size:clamp(38px,10vw,54px);
  line-height:1;
  font-variant-numeric:tabular-nums;
  color:var(--ink);
  opacity:0;
  transition:opacity .18s ease;
}
.cell.is-filled .cell__number{ opacity:1; }

.cell__empty{
  position:absolute;
  left:50%; top:50%;
  width:14px; height:1px;
  transform:translate(-50%,-50%);
  background:var(--line-2);
  pointer-events:none;
}
.cell.is-filled .cell__empty{ opacity:0; }
button.cell.is-active .cell__empty{ background:var(--red); width:18px; }

/* 遮罩：未揭开前盖住棋盘 */
.veil{
  position:absolute;
  inset:0;
  z-index:3;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  background:rgba(255,255,255,.94);
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter:blur(6px);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease;
}
.veil__grid{
  position:absolute;
  inset:0;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:var(--cell-gap);
}
.veil__grid i{
  display:block;
  border:1px dashed var(--line-2);
  border-radius:var(--radius-sm);
}
.veil__shine{ display:none; }
.veil__label{
  position:absolute;
  left:50%; bottom:12px;
  transform:translateX(-50%);
  padding:3px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:var(--muted);
  font-size:10px;
  letter-spacing:.12em;
  white-space:nowrap;
}
.board.is-covered .veil{ opacity:1; }
.board.has-ink .veil__label{ opacity:0; }
.board.is-covered .cell{ pointer-events:none; }

/* 直链进入时立刻遮住，避免数字闪一下 */
.boot-hitman .board .veil{ opacity:1; }
.boot-hitman .boss-dock{ display:none !important; }

.draw-canvas{
  position:absolute;
  inset:0;
  z-index:5;
  width:100%;
  height:100%;
  pointer-events:none;
  touch-action:none;
  filter:drop-shadow(0 1px 2px rgba(215,38,61,.22));
}
.app[data-mode="hitman"] .draw-canvas{ pointer-events:auto; }
.board.is-locked .draw-canvas{ pointer-events:none; }

.sparks{ display:none; }
.spark{ display:none; }

.board-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--line);
  font-size:12px;
  color:var(--muted);
  min-height:24px;
}
.board-code{ font-size:10px; letter-spacing:.14em; color:var(--muted-2); }

/* ---------- docks ---------- */
.lower{ margin-top:18px; }

.boss-dock{ display:flex; flex-direction:column; gap:14px; }

.boss-id{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  background:var(--surface);
  transition:border-color .15s ease;
}
.boss-id.is-missing{ border-color:var(--red); }
.boss-id__label{
  flex:0 0 auto;
  font-size:12px;
  color:var(--muted);
  letter-spacing:.04em;
}
.boss-id__input{
  flex:1 1 auto;
  min-width:0;
  border:0;
  outline:none;
  background:transparent;
  font-size:16px;
  color:var(--ink);
}
.boss-id__input::placeholder{ color:var(--muted-2); }
.boss-id__hint{ flex:0 0 auto; font-size:11px; color:var(--muted-2); }

.fill-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:13px;
  color:var(--muted);
}
.fill-count b{ color:var(--ink); font-weight:600; }
.fill-count i{ font-style:normal; color:var(--muted-2); }

.fill-meter{ display:grid; grid-template-columns:repeat(9,1fr); gap:5px; }
.fill-meter span{ height:3px; border-radius:2px; background:var(--line); }
.fill-meter span.is-filled{ background:var(--red); }

.palette{ display:grid; grid-template-columns:repeat(9,1fr); gap:6px; }
.key{
  height:44px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:var(--radius-xs);
  background:var(--surface);
  font-family:var(--num);
  font-size:18px;
  color:var(--ink);
  transition:border-color .15s ease,color .15s ease;
}
.key:hover:not(:disabled){ border-color:var(--red); color:var(--red); }
.key.is-used{ color:var(--muted-2); border-color:var(--line); background:var(--surface-2); }

.dock-actions{ display:flex; align-items:center; gap:10px; }
.minor-actions{ display:flex; gap:8px; }

.mini-btn{
  min-height:44px;
  padding:0 16px;
  border:1px solid var(--line);
  border-radius:var(--radius-xs);
  background:var(--surface);
  font-size:13px;
  color:var(--ink-2);
  transition:border-color .15s ease,color .15s ease;
}
.mini-btn:hover:not(:disabled){ border-color:var(--line-2); color:var(--ink); }
.mini-btn:disabled{ color:var(--muted-2); }

.primary-btn{
  flex:1 1 auto;
  min-height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 20px;
  border-radius:var(--radius-xs);
  background:var(--red);
  color:#fff;
  font-size:14px;
  font-weight:500;
  transition:background .15s ease;
}
.primary-btn:hover:not(:disabled){ background:var(--red-dark); }
.primary-btn:disabled{ background:var(--line); color:var(--muted-2); }
.primary-btn svg{ width:15px; height:15px; }

.boss-note{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  margin:0;
  font-size:11px;
  color:var(--muted-2);
}
.boss-note kbd{
  display:inline-grid;
  place-items:center;
  min-width:16px; height:16px;
  padding:0 3px;
  border:1px solid var(--line);
  border-radius:4px;
  font-family:inherit;
  font-size:10px;
  color:var(--muted);
}
.boss-note .sep{ color:var(--line-2); }

/* ---------- hitman dock ---------- */
.hitman-dock{ display:flex; flex-direction:column; gap:16px; }
.hitman-state{ display:flex; align-items:flex-start; gap:12px; }
.hitman-mark{
  flex:0 0 auto;
  width:18px; height:18px;
  margin-top:3px;
  border-radius:50%;
  border:1px solid var(--red);
}
.hitman-copy{ flex:1 1 auto; min-width:0; }
.hitman-title{ margin:0; font-size:15px; font-weight:500; color:var(--ink); }
.hitman-sub{ margin:4px 0 0; font-size:12px; color:var(--muted); }

.hitman-actions{ display:flex; gap:10px; margin-top:14px; }
.hitman-redraw{
  min-height:44px;
  padding:0 18px;
  border:1px solid var(--line);
  border-radius:var(--radius-xs);
  background:var(--surface);
  font-size:13px;
  color:var(--ink-2);
}
.hitman-redraw:disabled{ color:var(--muted-2); }
.hitman-actions .primary-btn{ flex:1 1 auto; }

/* ---------- handoff sheet ---------- */
body.is-sheet-open{ overflow:hidden; }

.sheet{ position:fixed; inset:0; z-index:40; display:grid; place-items:center; padding:16px; }
.sheet__backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.32); }
.sheet__panel{
  position:relative;
  width:100%;
  max-width:460px;
  max-height:calc(100dvh - 32px);
  overflow:auto;
  padding:26px 24px 22px;
  border-radius:var(--radius);
  background:var(--surface);
  border:1px solid var(--line);
}
.sheet__close{
  position:absolute;
  top:14px; right:14px;
  width:34px; height:34px;
  display:grid; place-items:center;
  border:1px solid var(--line);
  border-radius:50%;
  color:var(--muted);
}
.sheet__close:hover{ color:var(--ink); border-color:var(--line-2); }
.sheet__close svg{ width:14px; height:14px; }

.sheet__eyebrow{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0 0 14px;
  font-size:10px;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--muted);
}
.sheet__title{
  margin:0 0 8px;
  font-size:24px;
  font-weight:600;
  letter-spacing:-.01em;
  color:var(--ink);
}
.sheet__lead{ margin:0 0 20px; font-size:13px; color:var(--muted); }

.sheet__codebox{
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  padding:12px;
  background:var(--surface-2);
}
.sheet__codehead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
  font-size:11px;
  color:var(--muted);
}
.sheet__crypto{ font-size:10px; letter-spacing:.06em; color:var(--muted-2); }
.sheet__linkrow{ display:flex; gap:8px; }
.sheet__linkinput{
  flex:1 1 auto;
  min-width:0;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:var(--radius-xs);
  background:#fff;
  font-size:12px;
  color:var(--ink-2);
  text-overflow:ellipsis;
}
.sheet__copy{
  flex:0 0 auto;
  padding:0 14px;
  min-height:38px;
  border:1px solid var(--line-2);
  border-radius:var(--radius-xs);
  background:#fff;
  font-size:12px;
  color:var(--ink-2);
}
.sheet__copy:hover:not(:disabled){ border-color:var(--red); color:var(--red); }
.sheet__copy:disabled{ color:var(--muted-2); }
.sheet__linknote{ margin:8px 0 0; font-size:11px; color:var(--muted); }

.sheet__warn{
  margin:16px 0 0;
  font-size:11px;
  line-height:1.6;
  color:var(--muted);
}
.sheet__actions{ margin-top:16px; display:flex; gap:10px; }
.sheet__actions--single .primary-btn{ width:100%; }
.sheet__status{ margin:12px 0 0; min-height:16px; font-size:11px; color:var(--muted); }
.sheet__status.is-error{ color:var(--red); }

/* ---------- toast ---------- */
.toast-region{
  position:fixed;
  left:50%;
  bottom:calc(20px + env(safe-area-inset-bottom));
  transform:translateX(-50%);
  z-index:50;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  pointer-events:none;
}
.toast{
  padding:9px 16px;
  border-radius:999px;
  background:var(--ink);
  color:#fff;
  font-size:12px;
  white-space:nowrap;
}

/* ---------- responsive ---------- */
@media (max-width:600px){
  :root{ --cell-gap:8px; }
  .page{
    padding-left:max(14px, env(safe-area-inset-left));
    padding-right:max(14px, env(safe-area-inset-right));
    padding-bottom:calc(24px + env(safe-area-inset-bottom));
  }
  .topbar{ min-height:56px; }
  .brand__seal{ width:30px; height:30px; font-size:13px; }
  .brand__text b{ font-size:14px; }
  .brand__text small{ display:none; }
  .role-pill{ min-height:30px; padding:0 11px; font-size:11px; }
  .role-pill__en{ display:none; }
  .stage{ padding:16px 0 0; }
  .board-shell{ padding:12px; border-radius:12px; }
  .board-topline{ padding-bottom:10px; font-size:10px; }
  .board-state{ font-size:11px; }
  .board-footer{ margin-top:10px; padding-top:10px; font-size:11px; }
  .cell__number{ font-size:clamp(36px,11vw,50px); }
  .veil__label{ bottom:10px; font-size:9px; }
  .lower{ margin-top:14px; }
  .boss-dock{ gap:12px; }
  .fill-row{ font-size:12px; }
  .palette{ gap:5px; }
  .key{ height:42px; font-size:16px; }
  .mini-btn{ padding:0 12px; font-size:12px; min-height:42px; }
  .primary-btn{ min-height:42px; font-size:13px; padding:0 16px; }
  .boss-note{ display:none; }
  .boss-id{ padding:10px 12px; }
  .boss-id__hint{ display:none; }
  .hitman-title{ font-size:14px; }
  .hitman-sub{ font-size:11px; }
  .hitman-redraw{ min-height:42px; padding:0 14px; font-size:12px; }
  .sheet__panel{ padding:22px 18px 18px; }
  .sheet__title{ font-size:20px; }
  .toast{ font-size:11px; }
}

@media (max-width:360px){
  .palette{ gap:4px; }
  .key{ height:40px; font-size:15px; }
  .mini-btn{ padding:0 10px; }
}

@media (prefers-reduced-motion:reduce){
  *{ transition-duration:.001ms !important; animation-duration:.001ms !important; }
}

/* =========================================================
   ENDFIELD THEME（浅色纸 + 琥珀强调 + 墨线；切角=可点击）
   仅覆盖外观，类名与结构不变
   ========================================================= */
@font-face{
  font-family:"Saira";
  src:url("../fonts/Saira.ttf") format("truetype");
  font-weight:100 900;
  font-stretch:50% 125%;
  font-display:swap;
}

:root{
  --bg:#F4F4F2;
  --surface:#FFFFFF;
  --surface-2:#FAFAF8;
  --ink:#161616;
  --ink-2:#5C5C5C;
  --muted:#5C5C5C;
  --muted-2:#8A8A86;
  --line:#D9D9D6;
  --line-2:#B9B9B3;
  --red:#161616;
  --red-dark:#000000;
  --red-tint:#EFEFEA;
  --accent:#FFB31F;
  --radius:0px;
  --radius-sm:0px;
  --radius-xs:0px;
  --sans:"Saira","MiSans VF",-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans SC","Microsoft YaHei","PingFang SC",sans-serif;
  --num:"Saira","MiSans VF",-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans SC",sans-serif;
  --ease-mech:cubic-bezier(.7,0,.2,1);
}

body{ background:var(--bg); }
::selection{ background:var(--accent); color:var(--ink); }
button:focus-visible{ outline:2px solid var(--ink); outline-offset:2px; }

.topbar{ min-height:62px; border-bottom:1px solid var(--ink); }
.brand__seal{
  width:34px; height:34px;
  border:0; border-radius:0;
  background:var(--ink); color:var(--bg);
  font-family:"Saira","MiSans VF",sans-serif;
  font-weight:700; font-size:16px;
  clip-path:polygon(0 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%);
}
.brand__text b{ font-size:16px; font-weight:800; letter-spacing:.01em; }
.brand__text small{ font-size:9px; letter-spacing:.2em; color:var(--ink-2); font-stretch:125%; }
.role-pill{
  min-height:30px; padding:0 12px;
  border:1px solid var(--ink); border-radius:0;
  font-size:11px; letter-spacing:.08em; text-transform:uppercase;
  font-stretch:112%; color:var(--ink);
  clip-path:polygon(0 0,100% 0,100% calc(100% - 7px),calc(100% - 7px) 100%,0 100%);
}
.role-pill__dot{ width:7px; height:7px; border-radius:0; background:var(--accent); }
.role-pill__en{ font-size:9px; letter-spacing:.16em; color:var(--ink-2); }

.board-shell{
  position:relative;
  border:1px solid var(--line); border-radius:0;
  background:var(--surface);
}
.board-shell::before{
  content:""; position:absolute; left:-1px; top:-1px;
  width:72px; height:5px; background:var(--ink);
}
.board-topline{
  padding-bottom:10px; border-bottom:1px solid var(--line);
  color:var(--ink-2); font-size:10px; letter-spacing:.18em; font-stretch:112%;
}
.meta-dot{ width:6px; height:6px; border-radius:0; background:var(--accent); }
.board-state{ font-size:11px; letter-spacing:.06em; color:var(--ink); }
.board-state.is-ready{ color:var(--ink); font-weight:700; }
.board-state.is-locked{ color:var(--muted); }

button.cell{
  border:1px solid var(--line); border-radius:0; background:var(--surface);
  transition:background .2s var(--ease-mech),border-color .2s var(--ease-mech);
}
button.cell:hover{ border-color:var(--ink); background:var(--surface-2); }
button.cell.is-active{ border-color:var(--ink); background:var(--accent); }
button.cell.is-duplicate{ border-color:var(--ink); border-style:dashed; }
.cell__number{ font-family:var(--num); font-weight:700; font-stretch:112%; font-variant-numeric:tabular-nums; }
.cell__empty{ height:1px; border-radius:0; background:var(--line-2); }
button.cell.is-active .cell__empty{ background:var(--ink); }

.veil{
  border:1px solid var(--line); border-radius:0;
  background:rgba(244,244,242,.97);
  backdrop-filter:none; -webkit-backdrop-filter:none;
}
.veil__grid i{ border:1px dashed var(--line-2); border-radius:0; }
.veil__label{
  border:1px solid var(--ink); border-radius:0; background:var(--surface);
  color:var(--ink); letter-spacing:.16em; text-transform:uppercase; font-stretch:112%;
}

.draw-canvas{ filter:none; }

.board-footer{ border-top:1px solid var(--line); color:var(--ink-2); font-stretch:112%; }
.board-code{ font-stretch:125%; letter-spacing:.18em; color:var(--muted-2); }

.boss-id{ border:1px solid var(--line); border-radius:0; background:var(--surface); }
.boss-id:focus-within{ border-color:var(--ink); }
.boss-id.is-missing{ border-color:var(--ink); border-left:3px solid var(--accent); }
.boss-id__label{ font-size:11px; letter-spacing:.14em; text-transform:uppercase; font-stretch:112%; color:var(--ink-2); }
.boss-id__hint{ font-size:10px; letter-spacing:.08em; text-transform:uppercase; font-stretch:112%; }
.fill-row{ font-size:12px; letter-spacing:.04em; color:var(--ink-2); font-stretch:112%; }
.fill-count b{ font-weight:700; font-variant-numeric:tabular-nums; }
.fill-meter span{ height:3px; border-radius:0; background:var(--line); }
.fill-meter span.is-filled{ background:var(--ink); }

.key{
  border:1px solid var(--line); border-radius:0; background:var(--surface);
  font-family:var(--num); font-weight:600; font-stretch:112%;
  transition:background .2s var(--ease-mech),color .2s var(--ease-mech),border-color .2s var(--ease-mech);
}
.key:hover:not(:disabled){ border-color:var(--ink); background:var(--ink); color:var(--bg); }
.key.is-used{ border-color:var(--line); background:var(--surface-2); color:var(--muted-2); }

.mini-btn,.hitman-redraw,.sheet__copy{
  border:1px solid var(--ink); border-radius:0; background:transparent;
  color:var(--ink); font-size:11px; font-weight:600; letter-spacing:.1em;
  text-transform:uppercase; font-stretch:112%;
  clip-path:polygon(0 0,100% 0,100% calc(100% - 7px),calc(100% - 7px) 100%,0 100%);
}
.mini-btn:hover:not(:disabled),.hitman-redraw:hover:not(:disabled),.sheet__copy:hover:not(:disabled){
  background:var(--ink); border-color:var(--ink); color:var(--bg);
}
.mini-btn:disabled,.hitman-redraw:disabled,.sheet__copy:disabled{
  border-color:var(--line); color:var(--muted-2); background:transparent;
}

.primary-btn{
  border-radius:0; background:var(--ink); color:var(--bg);
  font-size:12px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; font-stretch:112%;
  clip-path:polygon(0 0,100% 0,100% calc(100% - 9px),calc(100% - 9px) 100%,0 100%);
  transition:background .2s var(--ease-mech),color .2s var(--ease-mech);
}
.primary-btn:focus-visible{ outline:2px solid var(--ink); outline-offset:3px; }
@media (hover:hover){ .primary-btn:hover:not(:disabled){ background:var(--accent); color:var(--ink); } }
@media (hover:none){ .primary-btn{ background:var(--accent); color:var(--ink); } }
.primary-btn:disabled{ background:var(--line); color:var(--muted-2); }
.primary-btn svg{ width:14px; height:14px; }

.boss-note{ font-size:10px; letter-spacing:.06em; color:var(--muted-2); }
.boss-note kbd{ border-radius:0; border:1px solid var(--line-2); background:var(--surface); color:var(--ink-2); font-stretch:112%; }

.hitman-mark{ width:14px; height:14px; border-radius:0; border:1px solid var(--ink); background:var(--accent); }
.hitman-title{ font-size:15px; font-weight:700; }
.hitman-sub{ font-size:11px; letter-spacing:.04em; }

.sheet__backdrop{ background:rgba(22,22,22,.5); }
.sheet__panel{
  position:relative; border:1px solid var(--ink); border-radius:0; background:var(--surface);
}
.sheet__panel::before{ content:""; position:absolute; left:-1px; top:-1px; width:56px; height:5px; background:var(--ink); }
.sheet__close{ border-radius:0; border:1px solid var(--line-2); color:var(--ink-2); }
.sheet__close:hover{ border-color:var(--ink); color:var(--ink); }
.sheet__eyebrow{ margin-top:6px; font-size:10px; letter-spacing:.18em; font-stretch:112%; color:var(--ink-2); }
.sheet__title{ font-size:22px; font-weight:800; letter-spacing:0; }
.sheet__lead{ color:var(--ink-2); font-size:13px; }
.sheet__codebox{ border:1px solid var(--line); border-radius:0; background:var(--bg); }
.sheet__codehead{ font-size:10px; letter-spacing:.12em; text-transform:uppercase; font-stretch:112%; color:var(--ink-2); }
.sheet__crypto{ letter-spacing:.08em; color:var(--muted-2); }
.sheet__linkinput{ border:1px solid var(--line); border-radius:0; background:var(--surface); }
.sheet__copy{ min-height:36px; padding:0 12px; }
.sheet__linknote{ font-size:10px; letter-spacing:.04em; }
.sheet__warn{ font-size:11px; color:var(--ink-2); }
.sheet__status{ font-size:11px; }
.sheet__status.is-error{ color:var(--ink); font-weight:700; border-left:3px solid var(--accent); padding-left:8px; }

.toast{
  border-radius:0; background:var(--ink); color:var(--bg);
  font-stretch:112%; letter-spacing:.06em;
  clip-path:polygon(0 0,100% 0,100% calc(100% - 7px),calc(100% - 7px) 100%,0 100%);
}

/* 强调色统一为终末地黄：划线、箭头与悬停都用同一支黄 */
:root{ --accent:#FFFA00; }
.key:hover:not(:disabled){ border-color:var(--ink); background:var(--accent); color:var(--ink); }
.mini-btn:hover:not(:disabled),.hitman-redraw:hover:not(:disabled),.sheet__copy:hover:not(:disabled){
  background:var(--accent); border-color:var(--ink); color:var(--ink);
}
.primary-btn:hover:not(:disabled){ background:var(--accent); color:var(--ink); }
@media (hover:none){ .primary-btn{ background:var(--accent); color:var(--ink); } }

/* =========================================================
   动效：入场 / 回应 / 进出 / 状态变化
   短、硬、机械；系统要求减少动效时全部关闭
   ========================================================= */
:root{ --ease-snap:cubic-bezier(.16,1,.3,1); --ease-mech:cubic-bezier(.7,0,.2,1); }

@keyframes ef-rise{
  from{ opacity:0; transform:translateY(10px); }
  to{ opacity:1; transform:none; }
}
@keyframes ef-cell-mark{
  from{ box-shadow:inset 0 0 0 2px var(--accent); }
  to{ box-shadow:inset 0 0 0 2px transparent; }
}
@keyframes ef-toast-in{
  from{ opacity:0; transform:translateY(8px); }
  to{ opacity:1; transform:none; }
}

@media (prefers-reduced-motion:no-preference){
  .topbar{ animation:ef-rise .38s var(--ease-snap) both; }
  .board-shell{ animation:ef-rise .46s var(--ease-snap) .05s both; }
  .lower{ animation:ef-rise .46s var(--ease-snap) .12s both; }
}

/* 回应操作：按下沉一格 */
.primary-btn,.mini-btn,.key,.sheet__copy,.hitman-redraw,button.cell{
  transition-property:background,color,border-color,transform,box-shadow;
  transition-duration:.2s,.2s,.2s,.1s,.2s;
  transition-timing-function:var(--ease-mech);
}
.primary-btn:active:not(:disabled),.mini-btn:active:not(:disabled),.key:active:not(:disabled),
.sheet__copy:active:not(:disabled),.hitman-redraw:active:not(:disabled),button.cell:active{
  transform:translateY(1px);
}

/* 状态变化：填格闪一圈黄，进度条滑动 */
.cell.is-filled{ animation:ef-cell-mark .34s var(--ease-snap); }
.fill-meter span{ transition:background-color .22s var(--ease-snap); }

/* 交接面板：退场比入场短 */
.sheet__backdrop{ transition:opacity .2s var(--ease-mech); }
.sheet__panel{ transition:opacity .26s var(--ease-mech),transform .36s var(--ease-mech); }
.sheet.is-opening .sheet__backdrop{ opacity:0; }
.sheet.is-opening .sheet__panel{ opacity:0; transform:translateY(14px); }
.sheet.is-open .sheet__backdrop{ opacity:1; }
.sheet.is-open .sheet__panel{ opacity:1; transform:none; }
.sheet.is-closing .sheet__backdrop{ opacity:0; transition-duration:.16s; }
.sheet.is-closing .sheet__panel{ opacity:0; transform:translateY(8px); transition-duration:.24s; }

/* 提示条 */
.toast{ animation:ef-toast-in .28s var(--ease-snap) both; transition:opacity .16s var(--ease-mech),transform .16s var(--ease-mech); }
.toast.is-out{ opacity:0; transform:translateY(6px); }

@media (prefers-reduced-motion:reduce){
  .topbar,.board-shell,.lower,.cell.is-filled,.toast{ animation:none !important; }
  .sheet__panel,.sheet__backdrop,.toast{ transition-duration:.001ms !important; }
}

/* ---------- 入场时间轴（逐帧，总长约 1s） ---------- */
@media (prefers-reduced-motion:no-preference){
  .topbar{ animation:ef-rise .34s var(--ease-snap) 0ms backwards; }
  .board-shell{ animation:ef-rise .42s var(--ease-snap) 60ms backwards; }
  .lower{ animation:none; }
  .board-topline{ animation:ef-rise .3s var(--ease-snap) 100ms backwards; }
  .board-footer{ animation:ef-rise .3s var(--ease-snap) 460ms backwards; }

  .grid .cell{ animation:ef-rise .3s var(--ease-snap) backwards; }
  .grid .cell:nth-child(1){ animation-delay:120ms; }
  .grid .cell:nth-child(2){ animation-delay:150ms; }
  .grid .cell:nth-child(3){ animation-delay:180ms; }
  .grid .cell:nth-child(4){ animation-delay:210ms; }
  .grid .cell:nth-child(5){ animation-delay:240ms; }
  .grid .cell:nth-child(6){ animation-delay:270ms; }
  .grid .cell:nth-child(7){ animation-delay:300ms; }
  .grid .cell:nth-child(8){ animation-delay:330ms; }
  .grid .cell:nth-child(9){ animation-delay:360ms; }

  .boss-id{ animation:ef-rise .3s var(--ease-snap) 500ms backwards; }
  .fill-row{ animation:ef-rise .3s var(--ease-snap) 540ms backwards; }
  .fill-meter{ animation:ef-rise .3s var(--ease-snap) 560ms backwards; }

  .palette .key{ animation:ef-rise .28s var(--ease-snap) backwards; }
  .palette .key:nth-child(1){ animation-delay:560ms; }
  .palette .key:nth-child(2){ animation-delay:582ms; }
  .palette .key:nth-child(3){ animation-delay:604ms; }
  .palette .key:nth-child(4){ animation-delay:626ms; }
  .palette .key:nth-child(5){ animation-delay:648ms; }
  .palette .key:nth-child(6){ animation-delay:670ms; }
  .palette .key:nth-child(7){ animation-delay:692ms; }
  .palette .key:nth-child(8){ animation-delay:714ms; }
  .palette .key:nth-child(9){ animation-delay:736ms; }

  .dock-actions{ animation:ef-rise .3s var(--ease-snap) 760ms backwards; }
  .boss-note{ animation:ef-rise .3s var(--ease-snap) 780ms backwards; }

  .hitman-dock.is-entering .hitman-state{ animation:ef-rise .34s var(--ease-snap) backwards; }
  .hitman-dock.is-entering .hitman-actions{ animation:ef-rise .34s var(--ease-snap) 45ms backwards; }
}

/* =========================================================
   MOTION：按 motion.md 清单补齐（三色条 / 字标 / 马克笔 /
   乱码落定 / 通电 / 擦入 / 亮边 / 按下 / 页签 / 提示条 / 快门）
   ========================================================= */
@keyframes ef-tri{ from{ transform:scaleX(0); } to{ transform:scaleX(1); } }
@keyframes ef-drive{ from{ clip-path:inset(0 100% 0 0); } to{ clip-path:inset(0 0 0 0); } }
@keyframes ef-mark{ from{ background-size:0% 42%; } to{ background-size:100% 42%; } }
@keyframes ef-power{ from{ clip-path:inset(0 0 100% 0); opacity:0; } to{ clip-path:inset(0 0 0 0); opacity:1; } }
@keyframes ef-wipe-in{ from{ clip-path:inset(0 100% 0 0); } to{ clip-path:inset(0 0 0 0); } }
@keyframes ef-wipe-out{ from{ clip-path:inset(0 0 0 0); } to{ clip-path:inset(0 0 0 100%); } }
@keyframes ef-sheen{ from{ transform:translateX(-100%); } to{ transform:translateX(100%); } }

.tri-strip{ display:flex; height:3px; width:100%; }
.tri-strip i{ flex:1 1 33.333%; }
.tri-strip i:nth-child(1){ background:#FF00F0; }
.tri-strip i:nth-child(2){ background:#FFFA00; }
.tri-strip i:nth-child(3){ background:#00FFA2; }

.board-title{
  position:relative;
  background-image:linear-gradient(90deg,rgba(255,250,0,.92) 0 100%);
  background-repeat:no-repeat;
  background-position:0 66%;
  background-size:100% 42%;
}

@media (prefers-reduced-motion:no-preference){
  .tri-strip{ transform-origin:left; animation:ef-tri .6s cubic-bezier(.2,.7,.1,1) both; }
  .brand__text b{ animation:ef-drive .62s var(--ease-mech) both; }
  .brand__text small{ animation:ef-drive .5s var(--ease-mech) .14s both; }
  .board-title{ animation:ef-mark .42s var(--ease-mech) .42s both; }
  .hitman-dock.is-entering .hitman-state{ animation:ef-power .52s var(--ease-mech) both; }
  .hitman-dock.is-entering .hitman-actions{ animation:ef-power .52s var(--ease-mech) .1s both; }
  .sheet__status.is-error{ animation:ef-wipe-in .28s var(--ease-mech) both; }
  .toast{ animation:ef-wipe-in .28s var(--ease-mech) both; }
  .primary-btn.is-done::before{ animation:ef-sheen .6s var(--ease-mech) both; }
}

/* 黄色擦入：悬停 / 聚焦时从左铺满 */
.primary-btn,.mini-btn,.hitman-redraw,.sheet__copy,.key{
  background-image:linear-gradient(90deg,var(--accent) 0 100%);
  background-repeat:no-repeat;
  background-position:0 0;
  background-size:0% 100%;
  transition:background-size .28s var(--ease-mech),color .2s var(--ease-mech),border-color .2s var(--ease-mech),transform .1s var(--ease-mech);
}
@media (hover:hover){
  .primary-btn:hover:not(:disabled),.mini-btn:hover:not(:disabled),.hitman-redraw:hover:not(:disabled),
  .sheet__copy:hover:not(:disabled),.key:hover:not(:disabled){
    background-image:linear-gradient(90deg,var(--accent) 0 100%);
    background-size:100% 100%;
    color:var(--ink);
    border-color:var(--ink);
  }
  .mini-btn:hover::after,.primary-btn:hover::after{ transform:scaleX(1); }
  .board-shell:hover::before{ transform:scaleX(1.6); }
}
@media (hover:none){
  .primary-btn{ background-size:100% 100%; color:var(--ink); }
}
.primary-btn:disabled,.mini-btn:disabled,.hitman-redraw:disabled,.sheet__copy:disabled,.key:disabled{
  background-size:0% 100%;
}

/* 亮边扫过 */
.mini-btn,.primary-btn{ position:relative; }
.mini-btn::after,.primary-btn::after{
  content:""; position:absolute; left:0; right:0; bottom:0; height:1px;
  background:currentColor;
  transform:scaleX(0); transform-origin:left;
  transition:transform .3s var(--ease-mech);
  pointer-events:none;
}

/* 按下：下沉 1px + 缩 1.5% */
.primary-btn:active:not(:disabled),.mini-btn:active:not(:disabled),.key:active:not(:disabled),
.sheet__copy:active:not(:disabled),.hitman-redraw:active:not(:disabled),button.cell:active{
  transform:translateY(1px) scale(.985);
}

/* 处理中：铺斜线纹；完成：黄光扫过一次 */
.primary-btn[aria-busy="true"]{
  background-image:repeating-linear-gradient(-45deg,transparent 0 5px,rgba(255,255,255,.22) 5px 6.5px);
  background-size:auto;
  color:var(--muted-2);
}
.primary-btn.is-done::before{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(90deg,transparent 0,var(--accent) 50%,transparent 100%);
  opacity:.55;
}

/* 页签伸开 */
.board-shell::before{ transition:transform .4s var(--ease-mech); transform-origin:left center; }

/* 提示条：从左擦入，向右擦掉 */
.toast.is-out{ animation:ef-wipe-out .16s var(--ease-mech) both; opacity:1; transform:none; }

/* 换页快门 */
@view-transition{ navigation:auto; }
::view-transition-old(root){ animation:ef-wipe-out .36s var(--ease-mech) both; }
::view-transition-new(root){ animation:ef-wipe-in .36s var(--ease-mech) both; }

@media (prefers-reduced-motion:reduce){
  .tri-strip,.brand__text b,.brand__text small,.board-title,.toast,.primary-btn.is-done::before{ animation:none !important; }
}

/* 数字栏：3×3 九宫格 */
.palette{ grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.palette .key{ height:56px; font-size:20px; }
@media (max-width:600px){
  .palette{ gap:6px; }
  .palette .key{ height:48px; font-size:17px; }
}

/* 线经过数字时半透明：正片叠底，黑字透出来 */
.board{ isolation:isolate; }
.draw-canvas{ mix-blend-mode:multiply; filter:none; opacity:1; }

/* 当前保底 */
.board-yield{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin-top:10px;
  padding:14px 12px;
  border:1px solid var(--line);
  border-left:3px solid var(--accent);
  background:var(--surface);
  text-align:center;
}
.board-yield__label{ font-size:11px; letter-spacing:.16em; text-transform:uppercase; color:var(--ink-2); }
.board-yield__num{ font-family:var(--num); font-size:34px; line-height:1; font-weight:800; letter-spacing:.04em; font-variant-numeric:tabular-nums; }
.board-yield__unit{ font-size:12px; letter-spacing:.08em; color:var(--ink-2); }
@media (max-width:600px){
  .board-yield{ padding:12px 10px; gap:10px; }
  .board-yield__num{ font-size:30px; }
}

/* 背景等高线：左下、右上各一片，墨色 9% */
html{ background:var(--bg); }
body{ background:transparent; }
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background-image:url("../img/contour-a.svg"),url("../img/contour-b.svg");
  background-repeat:no-repeat;
  background-position:left -6% bottom -8%,right -6% top -8%;
  background-size:clamp(240px,42vw,620px) auto,clamp(240px,42vw,620px) auto;
  opacity:.09;
}

/* 方格：间距统一为 10px（手机 8px），方形改小圆角矩形 */
:root{ --cell-gap:10px; }
.board-shell{ padding:10px; }
button.cell{ border-radius:8px; }
.veil{ border-radius:8px; }
.veil__grid i{ border-radius:8px; }
@media (max-width:600px){
  :root{ --cell-gap:8px; }
  .board-shell{ padding:8px; }
  button.cell,.veil,.veil__grid i{ border-radius:7px; }
}

/* 老板 ID 弹窗 */
.gate{ position:fixed; inset:0; z-index:60; display:grid; place-items:center; padding:16px; }
.gate[hidden]{ display:none; }
.gate__backdrop{ position:absolute; inset:0; background:rgba(22,22,22,.5); }
.gate__panel{ position:relative; width:100%; max-width:360px; padding:22px 20px 18px; background:var(--surface); border:1px solid var(--ink); }
.gate__eyebrow{ margin:0 0 10px; font-size:10px; letter-spacing:.18em; color:var(--ink-2); }
.gate__title{ margin:0 0 14px; font-size:18px; font-weight:800; }
.gate__field{ display:flex; flex-direction:column; gap:6px; }
.gate__field span{ font-size:10px; letter-spacing:.12em; text-transform:uppercase; color:var(--ink-2); }
.gate__field input{ height:40px; padding:0 10px; border:1px solid var(--line); border-radius:0; background:#fff; font:inherit; font-size:15px; color:var(--ink); }
.gate__field input:focus-visible{ outline:2px solid var(--ink); outline-offset:1px; }
.gate__note{ min-height:16px; margin:8px 0 12px; font-size:11px; color:#B3261E; }
.gate .primary-btn{ width:100%; }
