:root {
  --navy: #17355f;
  --navy-2: #0b1c34;
  --blue: #68b7d9;
  --pink: #ff9fc6;
  --cream: #fff4d6;
  --paper: #fff9ea;
  --red: #d93d4a;
  --mint: #8ff0c7;
  --green: #76ff8e;
  --ink: #10243f;
  --muted: #65738a;
  --line: #10243f;
  --shadow: 0 7px 0 #10243f;
  --sprite: url("https://router-files.neta.art/files/2af252f2-3aec-4459-8efa-0b002c5acaa2/95b1622c-3552-40c7-a764-59ed2a2bd2e0.png");
  --scene: url("https://router-files.neta.art/files/585c713f-a87b-4c3a-a784-76c02ead06ee/a6961e31-abd6-416b-a95d-417fda463b66.jpg");
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  overflow: hidden;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 70% 18%, rgba(143,240,199,.32), transparent 22%),
    radial-gradient(circle at 18% 92%, rgba(255,159,198,.38), transparent 30%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.14) 0 1px, transparent 1px 36px),
    linear-gradient(180deg, #f7d7e7 0%, #9bd6ed 46%, #26436f 100%);
}
.bg-noise { position: fixed; inset: 0; pointer-events: none; opacity: .18; background-image: linear-gradient(45deg, rgba(255,255,255,.6) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.35) 25%, transparent 25%); background-size: 7px 7px; mix-blend-mode: soft-light; }
button { font: inherit; color: inherit; border: 2px solid var(--line); background: var(--cream); box-shadow: 0 4px 0 var(--line); padding: 10px 12px; cursor: pointer; font-weight: 800; }
button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.shell { position: relative; z-index: 1; height: 100dvh; padding: 12px; display: grid; grid-template-rows: 150px minmax(0, 1fr); gap: 12px; }
.hero { display: grid; grid-template-columns: 260px minmax(0, 1fr) 320px; gap: 12px; align-items: stretch; }
.hero-art { border: 3px solid var(--line); box-shadow: var(--shadow); background: linear-gradient(rgba(255,244,214,.08), rgba(23,53,95,.2)), var(--scene) center/cover; }
.hero-copy, .hero-stats, .panel { border: 3px solid var(--line); box-shadow: var(--shadow); background: rgba(255,249,234,.92); }
.hero-copy { padding: 16px 18px; overflow: hidden; }
.eyebrow, .kicker { margin: 0 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--red); font-weight: 900; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(28px, 4vw, 54px); line-height: .9; color: var(--navy); text-shadow: 2px 2px 0 var(--pink); }
.tagline { margin: 0; max-width: 900px; line-height: 1.45; font-weight: 700; }
.hero-stats { display: grid; grid-template-columns: repeat(3,1fr); align-items: center; text-align: center; background: linear-gradient(135deg, #fff9ea, #d9f4ff); }
.hero-stats div { display: grid; gap: 4px; border-left: 2px dashed rgba(16,36,63,.28); }
.hero-stats div:first-child { border-left: 0; }
.hero-stats span { color: var(--muted); font-weight: 800; font-size: 13px; }
.hero-stats strong { font-size: 30px; color: var(--navy); }
.workbench { min-height: 0; height: 100%; display: grid; grid-template-columns: 315px minmax(420px, 1fr) 300px; gap: 12px; }
.panel { min-height: 0; padding: 12px; }
.left-panel, .right-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 20px;
}
.left-panel::-webkit-scrollbar,
.right-panel::-webkit-scrollbar { width: 8px; }
.left-panel::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb { background: rgba(16,36,63,.38); border: 2px solid rgba(255,249,234,.92); }
.clerk-card, .order-card, .supply-card { border: 2px solid var(--line); background: #fff; padding: 12px; }
.clerk-card { display: grid; grid-template-columns: 84px 1fr; gap: 12px; background: linear-gradient(135deg, #fff, #d8f5ff); }
.clerk-card h2, .manual-head h2 { margin: 0 0 4px; }
.clerk-card p:last-child { margin-bottom: 0; font-weight: 700; line-height: 1.38; }
.sprite { background-image: var(--sprite); background-size: 600% 600%; background-repeat: no-repeat; image-rendering: pixelated; }
.portrait { width: 78px; height: 78px; border: 2px solid var(--line); background-color: var(--pink); box-shadow: 0 4px 0 var(--line); }
.portrait-smile { background-position: 0% 100%; }
.portrait-serious { background-position: 20% 100%; }
.portrait-angry { background-position: 40% 100%; }
.portrait-confused { background-position: 60% 100%; }
.order-head { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: center; }
.item-icon { width: 64px; height: 64px; border: 2px solid var(--line); background-color: #eaf8ff; }
.order-card button, .supply-card button { width: 100%; margin-top: 10px; }
.supply-card { display: grid; gap: 8px; }
.supply-card button { margin: 0; text-align: left; background: linear-gradient(180deg, #fff4d6, #ffd3e3); }
.board-panel { display: grid; grid-template-rows: 38px minmax(0, 1fr) 48px; gap: 10px; background: linear-gradient(180deg, rgba(255,249,234,.96), rgba(188,235,255,.94)); }
.ticker { border: 2px solid var(--line); background: var(--navy-2); color: var(--cream); overflow: hidden; display: flex; align-items: center; white-space: nowrap; }
.ticker span { padding-left: 100%; animation: marquee 18s linear infinite; font-weight: 900; }
@keyframes marquee { to { transform: translateX(-100%); } }
.board { min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(0, 1fr)); gap: 8px; touch-action: none; }
.slot { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; border: 2px solid rgba(16,36,63,.55); background: repeating-linear-gradient(45deg, rgba(255,255,255,.58) 0 8px, rgba(104,183,217,.16) 8px 16px); }
.slot.drag-over { outline: 4px solid var(--green); }
.tile { width: min(82%, 92px); aspect-ratio: 1; border: 3px solid var(--line); background-color: #fff; box-shadow: 0 5px 0 var(--line); cursor: grab; position: relative; }
.tile::after { content: attr(data-level); position: absolute; right: -8px; bottom: -8px; min-width: 24px; height: 24px; display: grid; place-items: center; border: 2px solid var(--line); background: var(--red); color: #fff; font-size: 12px; font-weight: 900; }
.tile:active { cursor: grabbing; }
.tile.new { animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.72); } to { transform: scale(1); } }
.footer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.manual-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.manual-head span { font-size: 12px; color: var(--muted); font-weight: 800; }
.codex { min-height: 0; overflow: hidden; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.codex-item { aspect-ratio: 1; border: 2px solid rgba(16,36,63,.45); background-color: rgba(255,255,255,.65); filter: grayscale(1); opacity: .45; }
.codex-item.found { filter: none; opacity: 1; border-color: var(--line); background-color: #fff; }
.detail { position: fixed; inset: 0; z-index: 9999; display: none; place-items: center; padding: 20px; pointer-events: auto; }
.detail.is-open { display: grid; }
.detail-backdrop { position: absolute; inset: 0; z-index: 0; background: rgba(11,28,52,.72); cursor: pointer; }
.detail-card { position: relative; z-index: 1; width: min(520px, 92vw); border: 3px solid var(--line); box-shadow: 0 9px 0 var(--line); background: var(--paper); padding: 18px; }
.detail-card button { position: absolute; z-index: 2; right: 12px; top: 12px; min-width: 62px; }
.detail-icon { width: 138px; height: 138px; border: 3px solid var(--line); background-color: #fff; margin-bottom: 12px; }
.detail-card h2 { font-size: 34px; margin-bottom: 6px; color: var(--navy); }
.detail-card p:last-child { line-height: 1.55; font-weight: 700; }
@media (max-width: 980px) {
  body { overflow: auto; }
  .shell { height: auto; min-height: 100dvh; grid-template-rows: auto auto; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 180px; }
  .workbench { grid-template-columns: 1fr; }
  .left-panel, .right-panel { max-height: none; overflow: visible; }
  .board { height: min(92vw, 620px); }
}
