:root {
  color-scheme: light;
  --forest: #142821;
  --ink: #151e19;
  --muted: #526158;
  --page: #f1f4f0;
  --paper: #fff;
  --line: #d8e0d8;
  --lime: #d8fa85;
  --lime-dark: #14331a;
  --green: #176137;
  --soft-green: #edf8ed;
  --error: #a02921;
  --radius: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #278452; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.45rem); letter-spacing: -.045em; line-height: 1.12; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.6rem); line-height: 1.25; }
h3 { font-size: 1.13rem; line-height: 1.35; }
.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.site-header { color: #f4fff0; background: var(--forest); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .045em; white-space: nowrap; text-decoration: none; }
.brand-mark {
  width: 18px;
  height: 18px;
  border-inline: 5px solid var(--lime);
  border-block: 2px solid var(--lime);
  transform: skew(-14deg);
}
nav { display: flex; gap: 5px; }
nav a { display: grid; min-height: 44px; place-items: center; padding: 0 13px; color: #d5e4d9; border-radius: 10px; text-decoration: none; white-space: nowrap; font-size: .94rem; }
nav a:hover, nav a[aria-current] { color: var(--lime); background: #294033; }
main { padding-block: 36px 56px; }
.hero {
  background: var(--forest);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(25px, 4.5vw, 52px);
  display: grid;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.hero p { max-width: 660px; color: #d3e2d6; font-size: clamp(1rem, 2vw, 1.13rem); }
.hero a:not(.button) { color: var(--lime); }
.hero-split { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.hero-copy { display: grid; gap: 12px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.section { margin-top: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.stack { display: grid; gap: 13px; }
.muted { color: var(--muted); }
.loading { padding: 40px 0; }
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 3.5vw, 32px);
}
.narrow { max-width: 490px; margin-inline: auto; }
.identity-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.identity-bar strong { overflow-wrap: anywhere; }
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 7px; font-weight: 650; }
input, select {
  min-width: 0;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #aebdb0;
  border-radius: 11px;
  background: #fafcf9;
  color: var(--ink);
}
select {
  appearance: none;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, #243f2d 50%), linear-gradient(135deg, #243f2d 50%, transparent 50%);
  background-size: 6px 6px;
  background-position: calc(100% - 18px) 51%, calc(100% - 12px) 51%;
  background-repeat: no-repeat;
}
.error { color: var(--error); font-weight: 650; min-height: 1.5em; }
.error:empty { display: none; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 750;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}
.button.primary { background: var(--lime); color: var(--lime-dark); border-color: #a5cd55; }
.button.primary:hover { background: #c8ee69; }
.button.secondary { background: #f8faf7; border-color: var(--line); color: var(--forest); }
.button.secondary:hover { background: #eaf1e9; }
.button:disabled { cursor: default; background: #e7ebe6; border-color: #d2dad1; color: #5e6b61; }
.button.plain { color: var(--green); background: transparent; }
.full { width: 100%; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 19px;
  display: grid;
  align-content: start;
  gap: 11px;
  overflow-wrap: anywhere;
}
.card.open { border-color: #7eb491; }
.card-top, .card-bottom { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.card-bottom { margin-top: auto; min-height: 44px; }
.state { display: inline-block; font-size: .89rem; line-height: 1.3; font-weight: 750; padding: 6px 9px; border-radius: 8px; color: #45524a; background: #e9eee9; }
.state.open { color: #155d31; background: #dff3e2; }
.clock, .quote, .number, .price { font-variant-numeric: tabular-nums; }
.quote { color: var(--green); font-weight: 700; }
.clock { font-weight: 800; }
.number { font-size: 1.63rem; font-weight: 800; }
.card-footnote { font-size: .95rem; }
.card-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.admin-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-actions p { max-width: 530px; }
dialog { width: min(490px, calc(100% - 28px)); max-height: calc(100% - 26px); color: var(--ink); padding: 25px; border: 0; border-radius: var(--radius); box-shadow: 0 22px 80px #050e09a0; overflow: auto; }
dialog::backdrop { background: #0a1911aa; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.dialog-count { white-space: nowrap; background: var(--soft-green); color: var(--green); padding: 5px 10px; border-radius: 8px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toast { position: fixed; inset: auto 14px max(18px, env(safe-area-inset-bottom)); margin-inline: auto; width: fit-content; max-width: calc(100% - 28px); padding: 11px 16px; border-radius: 12px; color: #fff; background: var(--forest); z-index: 5; }
.toast.bad { background: #8b241d; }
.qr-box { text-align: center; display: grid; justify-items: center; gap: 13px; }
.qr-box canvas { width: min(380px, 100%); height: auto; image-rendering: pixelated; }
.qr-box a { overflow-wrap: anywhere; }
.results { display: grid; gap: 9px; }
.rank-head, .result-row {
  display: grid;
  grid-template-columns: minmax(72px, .7fr) minmax(55px, .55fr) minmax(0, 2.4fr) minmax(110px, 1.2fr) 24px;
  align-items: center;
  gap: 12px;
}
.rank-head { padding: 0 19px; color: var(--muted); font-weight: 700; font-size: .93rem; }
.result { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.result.winner { border-color: #81a754; background: #f6ffe7; }
.result-row { list-style: none; padding: 15px 18px; }
.result-row::-webkit-details-marker { display: none; }
.result-row > span { min-width: 0; overflow-wrap: anywhere; }
.result-row .chevron { width: 9px; height: 9px; justify-self: center; border-right: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(45deg); }
.result[open] .chevron { transform: rotate(225deg); }
.result-row .price { font-size: clamp(1rem, 2.6vw, 1.6rem); font-weight: 850; color: #174827; line-height: 1.24; }
.detail { border-top: 1px solid var(--line); padding: 17px 18px; display: grid; gap: 12px; }
.detail-line { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.values { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 0; margin: 0; list-style: none; }
.values li { font-variant-numeric: tabular-nums; background: #edf2eb; padding: 4px 8px; border-radius: 6px; max-width: 100%; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .shell { width: calc(100% - 28px); }
  main { padding-block: 17px 42px; }
  .header-inner { min-height: 58px; gap: 4px; }
  nav a { padding: 0 10px; }
  .hero-split, .cards { grid-template-columns: 1fr; }
  .section { margin-top: 16px; }
  .rank-head, .result-row {
    grid-template-columns: minmax(46px, .75fr) minmax(33px, .52fr) minmax(0, 1.45fr) minmax(60px, 1fr) 10px;
    gap: 6px;
    padding-inline: 10px;
  }
  .result-row { font-size: .9rem; }
  .rank-head { font-size: .81rem; }
  .detail { padding-inline: 12px; }
}
