/* Daily Nonogram — Palette 2 COOL（cool off-white + indigo），E1 纪律全量落地 */
:root {
  --bg: oklch(98% 0.002 250);
  --bg-elevated: oklch(100% 0 0);
  --text: oklch(22% 0.01 250);
  --text-muted: oklch(48% 0.015 250);
  --border: oklch(91% 0.005 250);
  --accent: oklch(58% 0.18 260);
  --accent-fg: oklch(98% 0.002 250);
  --accent-soft: oklch(58% 0.18 260 / 0.12);
  --warn: oklch(60% 0.15 50);
  --ok: oklch(58% 0.13 150);
  --shadow-card-stacked: 0 1px 2px 0 rgb(0 0 0 / 0.06), 0 20px 40px -12px rgb(0 0 0 / 0.10);
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  --font-sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, 'Songti SC', 'SimSun', serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 16px; line-height: 1.7; }
body.grain::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' /></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/></svg>");
  mix-blend-mode: overlay;
}
.wrap { max-width: 1080px; margin-inline: auto; padding-inline: 20px; }
.wrap.narrow { max-width: 760px; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; letter-spacing: 0; }
:lang(en) h1, :lang(en) h2 { letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw + 0.5rem, 3.2rem); font-weight: 800; margin: 0.2em 0; }
h1 em { font-family: var(--font-serif); font-style: italic; font-weight: 500; color: var(--accent); }
h2 { font-size: 1.6rem; font-weight: 700; margin: 1.4em 0 0.6em; }
h3 { font-size: 1.05rem; margin: 0 0 0.3em; }
p { margin: 0.5em 0; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.mono-line { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-variant-numeric: tabular-nums; }

.site-header { position: sticky; top: 0; z-index: 50; background: oklch(98% 0.002 250 / 0.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.header-in { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; padding-block: 6px; }
.brand { font-weight: 800; text-decoration: none; }
.site-nav { display: flex; gap: 14px; }
.site-nav a { text-decoration: none; color: var(--text-muted); font-size: 0.92rem; padding: 6px 4px; }
.site-nav a:hover { color: var(--text); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.visits { font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lang-switch { text-decoration: none; font-size: 0.88rem; font-weight: 600; color: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-full); padding: 4px 12px; }
.lang-switch:hover { background: var(--accent-soft); }

.hero { padding: 56px 0 20px; }
.kicker { font-family: ui-monospace, Consolas, monospace; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); }
.lede { font-size: 1.1rem; color: var(--text-muted); max-width: 62ch; }

.btn { display: inline-block; background: var(--accent); color: var(--accent-fg); text-decoration: none; font-weight: 700; border: 0; border-radius: var(--radius-full); padding: 11px 20px; font-size: 0.92rem; cursor: pointer; box-shadow: var(--shadow-card-stacked); transition: transform 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); box-shadow: none; }

/* 棋盘区 */
#board-section { padding-bottom: 24px; }
.board-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 12px 0; }
.lvl-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.lvl-btn { border: 1.5px solid var(--border); background: var(--bg-elevated); color: var(--text-muted); border-radius: var(--radius-full); padding: 8px 16px; font: inherit; font-weight: 600; font-size: 0.88rem; cursor: pointer; transition: transform 0.15s ease; }
.lvl-btn:hover { transform: translateY(-1px); }
.lvl-btn.active { border-color: var(--accent); background: var(--accent); color: var(--accent-fg); }
.board-meta { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.date-badge { font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; border: 1px solid var(--border); border-radius: var(--radius-full); padding: 4px 12px; background: var(--bg-elevated); }
.timer, .progress { font-size: 0.9rem; color: var(--text); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }

.board-frame { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-card-stacked); padding: 18px; max-width: 1080px; }
.board-scroll { overflow-x: auto; }
.nono-board { border-collapse: collapse; margin-inline: auto; }
.nono-board .corner { border-right: 2px solid var(--text); border-bottom: 2px solid var(--text); background: var(--bg); }
.nono-board th { position: sticky; background: var(--bg); z-index: 1; }
.nono-board .row-clue { text-align: right; font-size: 0.82rem; font-weight: 500; color: var(--text); white-space: pre; padding: 2px 8px 2px 4px; border-right: 2px solid var(--text); border-bottom: 1px solid var(--border); }
.nono-board .col-clue { text-align: center; font-size: 0.82rem; font-weight: 500; color: var(--text); white-space: pre; padding: 4px 2px; border-bottom: 2px solid var(--text); border-right: 1px solid var(--border); vertical-align: bottom; }
.nono-board td.cell { width: 34px; height: 34px; border: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; background: var(--bg-elevated); transition: background-color 0.1s ease; }
.nono-board td.cell:nth-child(5n+2) { border-right: 1px solid oklch(80% 0.01 250); }
.nono-board tr:nth-child(5n) td.cell { border-bottom: 1px solid oklch(80% 0.01 250); }
.nono-board td.cell:hover { background: var(--accent-soft); }
.nono-board td.cell.filled { background: var(--text); }
.nono-board td.cell.filled:hover { background: oklch(30% 0.01 250); }
.nono-board td.cell.marked { background: var(--bg-elevated); color: var(--text-muted); }
.nono-board td.cell.marked::after { content: "×"; font-weight: 700; color: var(--warn); display: block; line-height: 34px; text-align: center; }
.nono-board td.cell.bad { outline: 2px solid var(--warn); outline-offset: -2px; }

.board-msg { margin: 14px 4px 0; padding: 10px 16px; border-radius: var(--radius-md); font-weight: 700; }
.board-msg.ok { background: oklch(58% 0.13 150 / 0.12); color: var(--ok); }
.board-msg.warn { background: oklch(60% 0.15 50 / 0.12); color: var(--warn); }
.board-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 8px; }

.faq { border-bottom: 1px solid var(--border); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 800; font-size: 1.2rem; }
.faq[open] summary::after { content: "−"; }
.faq p { color: var(--text-muted); margin: 0 0 12px; }

.steps { padding-left: 1.4em; }
.steps li { margin: 14px 0; }
.steps li::marker { color: var(--accent); font-weight: 800; }

.crumbs { font-size: 0.85rem; color: var(--text-muted); margin-top: 24px; }
.page-head { padding: 44px 0 8px; }
.prose h2 { margin-top: 2em; }

.site-footer { border-top: 1px solid var(--border); margin-top: 64px; padding: 32px 0; }
.footer-in { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.footer-note { font-size: 0.82rem; color: var(--text-muted); max-width: 62ch; margin: 0; }
.footer-nav a { text-decoration: none; color: var(--text-muted); font-size: 0.85rem; }
.footer-nav a:hover { color: var(--accent); }

html.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease; }
html.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 640px) {
  .nono-board td.cell { width: 30px; height: 30px; }
  .nono-board td.cell.marked::after { line-height: 30px; }
  .board-meta { margin-left: 0; }
  .hero { padding-top: 36px; }
}
@media (max-width: 520px) {
  .header-in { flex-direction: column; align-items: flex-start; gap: 4px; }
  .header-right { margin-left: 0; }
}
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
