#toast{position:absolute;left:50%;top:10px;transform:translateX(-50%);max-width:min(560px,90%);padding:9px 16px;background:#10191dee;border:1px solid var(--line);border-radius:6px;font-size:14px;line-height:1.6;opacity:0;pointer-events:none;transition:opacity .25s;z-index:5;text-align:center}#toast.on{opacity:1}
#hud{display:flex;flex-wrap:wrap;gap:4px 18px;align-items:center}#hud b{color:#fff0c0;font-weight:600}.chip{display:inline-block;padding:1px 8px;border:1px solid #a68b5566;border-radius:10px;font-size:11px;margin-right:4px}
.overlay{position:fixed;inset:0;z-index:20;background:#04090cc4;display:flex;align-items:center;justify-content:center;padding:16px}.overlay[hidden]{display:none}
.panel{background:#10191df4;border:1px solid var(--line);border-radius:8px;color:var(--ink);padding:22px 26px;max-height:92vh;overflow:auto;box-shadow:0 20px 60px #000a}
.menu{width:min(980px,100%)}.menuHead{display:flex;justify-content:space-between;align-items:center}.menuHead h2{margin:0;font-weight:500;letter-spacing:4px}.menuHead>div{display:flex;gap:12px;align-items:center}.chk{font-size:13px;cursor:pointer}.menuNote{font-size:12.5px;opacity:.75;line-height:1.7;margin:8px 0 14px}
.tier{margin:0 0 18px}.tier h3{margin:0 0 2px;font-weight:500;font-size:17px;display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}.tier h3 small{font:12px system-ui;opacity:.65}.tier p{margin:0 0 8px;font-size:12.5px;opacity:.7}.tier.locked{opacity:.45}
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:8px}.card{padding:8px 8px 7px;text-align:left;display:flex;flex-direction:column;gap:2px;min-height:78px;border-radius:5px}.card b{font-size:16px}.card small{font:11px system-ui;opacity:.75}.card .st{font-size:13px;color:#f0c96a;letter-spacing:1px}.card.cur{outline:2px solid #fff3b8}.card.lock{opacity:.35;cursor:not-allowed}.card.done{background:#27382f}
.rule{margin-top:6px;font-size:12.5px;line-height:1.8}.rule summary{cursor:pointer;opacity:.8}.rule code{background:#0006;padding:1px 6px;border-radius:3px}.rule ul{margin:6px 0 0 18px;padding:0}
.win{text-align:center;width:min(440px,100%)}.win h2{margin:0 0 6px;font-weight:500;letter-spacing:8px;font-size:28px}.stars{font-size:38px;color:#f0c96a;letter-spacing:6px}.stars .off{color:#fff3;}.win p{line-height:1.8;font-size:14px}.winBtns{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}button.primary{background:var(--ink);color:#1c2a2b}
#hintBtn[disabled]{opacity:.5}.sunDir{display:inline-block;transition:transform .3s}
@media(max-width:700px){nav a{display:none}#toast{font-size:12.5px}.panel{padding:16px 14px}.cards{grid-template-columns:repeat(auto-fill,minmax(92px,1fr))}}

.legend{max-width:620px;width:100%}
.lrow{display:flex;gap:14px;align-items:center;padding:10px 0;border-top:1px solid var(--line)}
.lmarks{display:flex;gap:6px;flex:none;min-width:136px}
.lmarks canvas{width:64px!important;height:64px!important;min-height:0!important;max-width:none!important;flex:none;background:#1b2a2f;border-radius:6px}
.ltext{display:flex;flex-direction:column;gap:4px;font-size:13.5px;line-height:1.55}
.ltext b{font-size:14.5px;color:#f1d99a}
@media(max-width:700px){.lrow{flex-direction:column;align-items:flex-start}.lmarks{min-width:0}}

.card.paid{border-color:#c9a24b;background:linear-gradient(180deg,rgba(201,162,75,.12),transparent)}.card.paid b{color:#8a6a1c}
/* Compact legend with the same marker renderer used by the board. */
.legend.panel {
  width: min(560px, 100%);
  max-height: min(88dvh, 780px);
  padding: 12px 16px;
}
.legend .menuHead {
  position: sticky;
  top: -12px;
  z-index: 1;
  background: #10191d;
  padding: 6px 0;
  gap: 12px;
}
.legend .menuHead h2 { font-size: 18px; letter-spacing: 1px; }
.legend .menuHead button { width: 44px; height: 44px; flex: none; padding: 0; }
.legend .lrow {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px 0;
}
.legend .lrow.legend-groups { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.legend .lmarks { min-width: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.legend .lmarks canvas {
  width: 28px !important;
  height: 28px !important;
  border-radius: 4px;
}
.legend .ltext { gap: 2px; font-size: 12px; line-height: 1.5; }
.legend .ltext b { font-size: 13px; }
.legend .menuNote { font-size: 11px; margin-bottom: 0; }
@media (max-width: 480px) {
  #legend { padding: 10px; }
  .legend.panel { padding: 10px 12px; max-height: 90dvh; }
  .legend .menuHead { top: -10px; }
  .legend .menuHead h2 { font-size: 16px; }
  .legend .lrow { grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
}
/* Version access and password dialog. */
.title h1 { display: inline-block; margin-right: 10px; }
.shell button.version-tag, .panel button.version-tag, #homeCover .cover-actions .version-tag {
  min-height: 32px;
  width: auto;
  padding: 4px 7px;
  background: transparent;
  border: 1px solid transparent;
  color: #c1ae83;
  font: 11px/1.4 system-ui, sans-serif;
  letter-spacing: 0;
  box-shadow: none;
}
#homeCover .cover-actions .version-tag { justify-self: center; }
.shell button.version-tag:hover, .panel button.version-tag:hover, #homeCover .cover-actions .version-tag:hover {
  border-color: #786b4e;
  background: #202b2f;
  color: #f1dfad;
}
.debug-password {
  width: min(340px, calc(100vw - 32px));
  padding: 20px;
  color: #e7e0ce;
  background: #172125;
  border: 1px solid #8b7b58;
  border-radius: 8px;
}
.debug-password::backdrop { background: #03090cc9; }
.debug-password form { display: grid; gap: 10px; }
.debug-password h2 { margin: 0 0 6px; font-size: 20px; }
.debug-password label { font-size: 13px; }
.debug-password input {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #8b7b58;
  border-radius: 4px;
  background: #0e181b;
  color: #f0dfb7;
  font: 16px system-ui, sans-serif;
}
#debugError { min-height: 18px; margin: 0; color: #e9aa93; font-size: 12px; }
.debug-actions { display: flex; justify-content: flex-end; gap: 8px; }
.debug-actions button { min-height: 44px; }

/* 选关：等级下拉 + 手机上卡片更紧凑（窄屏3列，更窄2列，平板/宽屏4~6列） */
.tier-filter{width:100%;margin:0 0 12px;min-height:40px;background:#172125;color:#f2e1b6;border:1px solid #a28a55;border-radius:4px;padding:6px 8px;font:14px system-ui}
.card small,.card b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:700px){
 .cards{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 .card{padding:6px 6px 5px;min-height:0}.card b{font-size:14px}.card small{font-size:10px}.card .st{font-size:12px}
}
@media(max-width:330px){.cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:701px) and (max-width:1000px){.cards{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(min-width:1001px){.cards{grid-template-columns:repeat(6,minmax(0,1fr))}}

.cards.measure .card>*{align-self:flex-start;max-width:none!important;overflow:visible!important;text-overflow:clip!important}

.card .dot{font-style:normal}
@media(max-width:700px){.card small bdi{display:block}.card .dot{display:none}}

@media(max-width:700px){.panel.menu{padding-left:10px;padding-right:10px}.card small{font-size:9.5px}}

/* 选关里的教学部分可折叠 */
.tutorial-menu>summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:8px}.tutorial-menu>summary::-webkit-details-marker{display:none}.tutorial-menu>summary::before{content:'▸';color:#e0bf7b;transition:transform .15s}.tutorial-menu[open]>summary::before{transform:rotate(90deg)}.tutorial-menu>summary h3{margin:0}
