:root {
  color-scheme: dark;
  --background: #0e1720;
  --panel: #141f2b;
  --surface: #192735;
  --line: #2e3e4e;
  --ink: #f6eee1;
  --muted: #b1bec9;
  --gold: #efd293;
  --gold-ink: #252012;
  --teal: #a0d6c4;
  --danger: #ffb2a6;
  font-family: system-ui, "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--ink); }
body, button, input { font-size: 1rem; }
button, input { font-family: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
.shell { width: min(1200px, calc(100% - 3rem)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { height: 68px; display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.brand { display: inline-flex; gap: .7rem; align-items: center; font-weight: 700; letter-spacing: .08em; }
.brand-mark { color: var(--gold); font-size: 1.45rem; line-height: 1; }
.hero { isolation: isolate; position: relative; overflow: hidden; margin: 1.6rem 0; min-height: 326px; display: grid; align-items: center; padding: 2.6rem 3rem; border: 1px solid #3e4a54; border-radius: 1rem; background: radial-gradient(ellipse at 78% 55%, #334052 0%, #1d2b39 43%, #17222e 72%); }
.hero-copy { z-index: 1; }
.overline { margin: 0 0 .65rem; color: var(--gold); font-size: .875rem; letter-spacing: .13em; font-weight: 650; }
h1, h2 { margin: 0; font-family: "Songti SC", SimSun, Georgia, serif; font-weight: 700; }
h1 { font-size: clamp(2.45rem, 6vw, 4.1rem); letter-spacing: .055em; line-height: 1.14; }
h2 { font-size: 1.7rem; letter-spacing: .04em; }
.hero-copy > p:not(.overline) { margin: 1rem 0 1.4rem; color: #d8e0e5; line-height: 1.75; }
.hero-art { position: absolute; right: 8%; top: 50%; width: 320px; height: 280px; transform: translateY(-50%); color: var(--gold); }
.orbit { position: absolute; inset: -14px 4px; border-radius: 50%; border: 1px solid #d6bc7938; outline: 1px solid #d6bc7923; outline-offset: 15px; }
.orbit::before,.orbit::after { content: "✧"; position: absolute; font-size: 1.45rem; }
.orbit::before { left: 22px; top: 13px; }
.orbit::after { right: 19px; bottom: 16px; }
.talon { position: absolute; display: grid; place-items: center; top: 38px; width: 116px; height: 197px; border: 1px solid #b39c66; border-radius: .65rem; background: #253345; box-shadow: 0 13px 35px #0a111b66, inset 0 0 0 5px #253345, inset 0 0 0 6px #9e87564d; }
.talon-left { left: 50px; transform: rotate(-19deg); font-size: 2rem; }
.talon-right { right: 46px; transform: rotate(18deg); font-size: 2rem; }
.talon-center { top: 26px; left: 97px; width: 126px; height: 220px; grid-template-rows: 1fr 1.9fr 1fr; background: radial-gradient(ellipse at 50% 45%, #485464, #253345 70%); }
.talon-center span { font-size: .82rem; letter-spacing: .17em; }
.talon-center i { display: block; width: 65px; height: 65px; border-radius: 50%; box-shadow: -11px 8px 0 1px var(--gold); transform: translate(7px,-4px) rotate(-13deg); }
.primary, .secondary, .quiet, .danger { display: inline-flex; justify-content: center; align-items: center; gap: .6rem; min-height: 42px; padding: .55rem .88rem; border: 1px solid transparent; border-radius: .45rem; font-weight: 650; }
.primary { background: var(--gold); color: var(--gold-ink); }
.primary:not(:disabled):hover { background: #ffe5af; }
.secondary { background: #223142; color: var(--ink); border-color: #435568; }
.secondary:not(:disabled):hover, .quiet:not(:disabled):hover { background: #283949; }
.quiet { background: transparent; color: var(--muted); font-size: .9rem; }
.danger { background: transparent; color: var(--danger); border-color: var(--danger); margin-top: .5rem; }
.workbench { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.3rem; align-items: start; }
.panel { padding: 1.4rem; background: var(--panel); border: 1px solid var(--line); border-radius: .9rem; scroll-margin-top: 1rem; min-width: 0; }
.panel-head { margin-bottom: 1.2rem; }
.board-head, .board-tools, .picker-head, .entry-head, .entry-actions, .pager { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.board-tools { flex-wrap: wrap; }
.realm-field { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.field, legend { display: block; padding: 0; margin: 0 0 .5rem; font-size: .95rem; font-weight: 650; }
.field small { color: var(--muted); font-size: .83rem; margin-left: .4rem; font-weight: 400; }
input[type=text] { width: 100%; padding: .66rem .75rem; color: var(--ink); background: #101a24; border: 1px solid #48586a; border-radius: .45rem; }
input[type=text]::placeholder { color: #a4b0bc; }
input[type=checkbox] { accent-color: var(--gold); }
.segments { display: inline-flex; align-items: center; gap: 3px; padding: 3px; background: #0f1923; border: 1px solid var(--line); border-radius: .5rem; }
.segments label { display: grid; }
.segments input { position: absolute; opacity: 0; width: 1px; }
.segments label span, .segments button { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .65rem; min-height: 34px; border: 0; border-radius: .33rem; color: var(--muted); background: transparent; cursor: pointer; font-size: .875rem; font-weight: 650; }
.segments input:checked + span, .segments button[aria-pressed=true] { color: var(--gold); background: #343126; }
.segments input:focus-visible + span { outline: 2px solid var(--teal); }
.picker-head { margin-top: 1rem; margin-bottom: .6rem; }
.picker button span { font-size: .82rem; opacity: .85; }
.deck { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .38rem; }
.card { display: flex; align-items: center; gap: .35rem; min-height: 43px; border-radius: .38rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: .42rem; font-size: .82rem; text-align: left; }
.card:hover { border-color: var(--gold); }
.card-number { color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.card[data-group=wanted] { background: #393127; border-color: #a28b54; color: var(--gold); }
.card[data-group=offered] { background: #223930; border-color: #689784; color: var(--teal); }
.editor-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin-top: 1rem; }
.fine-print, .feedback, .hide-label, .entry-time, .pager { color: var(--muted); font-size: .875rem; line-height: 1.55; }
.fine-print { margin: .75rem 0 0; }
.feedback:empty { display: none; }
.feedback[data-error=true] { color: var(--danger); }
.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: .5rem; margin-top: .95rem; line-height: 1.65; }
.empty strong { display: block; color: var(--ink); margin-bottom: .35rem; }
.entry { border-bottom: 1px solid var(--line); padding-block: 1rem; }
.entry-uid { font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: .05em; }
.entry-time { text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: .32rem; align-items: center; margin: .48rem 0; }
.chips b { font-size: .875rem; color: var(--muted); min-width: 4.4rem; }
.chip { font-size: .85rem; padding: .18rem .42rem; border-radius: .25rem; background: #253443; }
.chip.wanted { color: var(--gold); background: #393127; }
.chip.offered { color: var(--teal); background: #223930; }
.entry-actions { justify-content: flex-start; margin-top: .65rem; flex-wrap: wrap; }
.entry-actions button { font-size: .875rem; }
.entry-actions [aria-pressed=true] { color: var(--teal); }
.pager { margin-top: .7rem; }
footer { padding: 1.6rem 0; color: var(--muted); font-size: .875rem; text-align: center; }
dialog { width: min(480px, calc(100% - 2rem)); padding: 1.35rem; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: .85rem; }
dialog::backdrop { background: #070c13bd; }
dialog p { line-height: 1.55; }
.dialog-actions { margin-top: 1rem; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .4rem; }
@media (max-width: 900px) {
  .workbench { grid-template-columns: minmax(0,1fr); }
  .hero-art { right: 3%; transform: translateY(-50%) scale(.85); }
}
@media (max-width: 650px) {
  .shell { width: calc(100% - 1.5rem); }
  .hero { padding: 1.4rem 1rem; min-height: 265px; margin: .85rem 0; background: linear-gradient(90deg,#17222e 30%,#2b384a); }
  .hero-art { right: -108px; transform: translateY(-50%) scale(.65); opacity: .25; }
  .hero-copy > p:not(.overline) { font-size: .9rem; }
  .workbench { gap: .85rem; }
  .panel { padding: .9rem; }
  .deck { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
