:root {
  --bg: #07120e;
  --panel: #0e241d;
  --panel-2: #123028;
  --line: rgba(216, 178, 106, .22);
  --line-soft: rgba(233, 245, 238, .10);
  --text: #eaf5ef;
  --muted: #90a89e;
  --gold: #d8b26a;
  --green: #1fa06f;
  --red: #c0503f;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #12402f 0%, var(--bg) 60%) no-repeat, var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }

.wrap { max-width: 860px; margin: 0 auto; padding: 18px 16px 60px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 0 18px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2b6b55, #0b2b21 70%);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-weight: 700; color: var(--gold); font-size: 15px;
}
.brand h1 { font-size: 17px; margin: 0; font-weight: 600; letter-spacing: .5px; }
.brand p { margin: 0; font-size: 12px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }

.card {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.table-card { position: relative; overflow: hidden; transition: transform .15s ease, border-color .15s; }
.table-card:active { transform: scale(.985); }
.table-card .no {
  font-size: 40px; font-weight: 700; color: var(--gold); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.table-card .no small { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.table-card .state { font-size: 13px; margin-top: 8px; color: var(--muted); }
.table-card .price { font-size: 13px; color: var(--muted); margin-top: 2px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line-soft); color: var(--muted);
}
.pill.on { color: #bff2d9; border-color: rgba(31, 160, 111, .5); background: rgba(31, 160, 111, .12); }
.pill.off { color: #f0d9a6; border-color: rgba(216, 178, 106, .35); background: rgba(216, 178, 106, .08); }
.pill.warn { color: #f6c9a8; border-color: rgba(192, 80, 63, .45); background: rgba(192, 80, 63, .12); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 26px 0 12px; font-size: 14px; color: var(--muted); letter-spacing: .5px;
}
.section-title strong { color: var(--text); font-size: 15px; font-weight: 600; }
.section-title .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  appearance: none; border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .04); color: var(--text);
  border-radius: 12px; padding: 10px 16px; font-size: 15px;
  cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
  font-family: inherit;
}
.btn:active { transform: scale(.98); }
.btn.primary {
  background: linear-gradient(180deg, #27b47f, #15875c);
  border-color: rgba(255, 255, 255, .16); color: #fff; font-weight: 600;
  box-shadow: 0 8px 22px rgba(21, 135, 92, .35);
}
.btn.gold { background: linear-gradient(180deg, #e3c07d, #c39a4c); color: #22180a; font-weight: 600; border-color: #e9cd94; }
.btn.ghost { color: var(--muted); }
.btn.tiny { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.btn.danger { border-color: rgba(192, 80, 63, .5); color: #f4c3b9; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { display: block; width: 100%; padding: 15px; font-size: 17px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 18px; }
.chip {
  flex: 1 1 0; min-width: 88px;
  border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 12px 10px; text-align: center; cursor: pointer;
  background: rgba(255, 255, 255, .03);
  transition: .15s;
}
.chip.selected { border-color: var(--gold); background: rgba(216, 178, 106, .12); }
.chip .h { font-size: 15px; font-weight: 600; }
.chip .p { font-size: 12px; color: var(--muted); margin-top: 2px; }

.hero { text-align: center; padding: 8px 0 4px; }
.hero .label { font-size: 13px; color: var(--muted); letter-spacing: 2px; }
.hero .big { font-size: 46px; font-weight: 700; color: var(--gold); line-height: 1.15; font-variant-numeric: tabular-nums; }
.hero .sub { font-size: 13px; color: var(--muted); }

.amount { font-size: 40px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.amount small { font-size: 16px; margin-right: 2px; }

.qrbox {
  margin: 16px auto; width: 200px; padding: 12px; border-radius: 14px;
  background: #fff; display: grid; place-items: center;
}
.qrbox img { width: 100%; display: block; border-radius: 6px; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line-soft); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv b { font-weight: 600; }

.tip { font-size: 13px; color: var(--muted); line-height: 1.7; }
.tip strong { color: var(--gold); font-weight: 600; }
.note { font-size: 13px; color: var(--muted); background: rgba(255, 255, 255, .03); border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 14px; line-height: 1.7; }
.note.gold { border-color: var(--line); background: rgba(216, 178, 106, .07); }
.note.red { border-color: rgba(192, 80, 63, .35); background: rgba(192, 80, 63, .08); color: #f2c6bd; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border-radius: 11px;
  border: 1px solid var(--line-soft); background: rgba(0, 0, 0, .25); color: var(--text);
  font-size: 15px; font-family: inherit; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--gold); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.row-list { display: grid; gap: 8px; }
.row-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 13px; border-radius: 12px; background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line-soft); font-size: 14px;
}
.row-item .meta { color: var(--muted); font-size: 12px; }
.row-item .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.row-item select, .row-item input { padding: 6px 8px; border-radius: 8px; font-size: 13px; background: rgba(0,0,0,.3); color: var(--text); border: 1px solid var(--line-soft); }

.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.04); margin: 14px 0; }
.tabs button {
  flex: 1; border: 0; background: transparent; color: var(--muted); font-size: 14px;
  padding: 9px; border-radius: 9px; cursor: pointer; font-family: inherit;
}
.tabs button.active { background: rgba(216, 178, 106, .16); color: var(--text); }

.mask { position: fixed; inset: 0; background: rgba(3, 9, 7, .78); backdrop-filter: blur(6px); display: none; place-items: center; padding: 18px; z-index: 50; }
.mask.show { display: grid; }
.mask .card { width: 100%; max-width: 360px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: rgba(10, 30, 24, .96); border: 1px solid var(--line);
  color: var(--text); padding: 11px 18px; border-radius: 12px; font-size: 14px;
  opacity: 0; transition: .25s; pointer-events: none; z-index: 80; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(192, 80, 63, .6); color: #f4c3b9; }

.footer { margin-top: 28px; text-align: center; font-size: 12px; color: #5f7a6f; }
.footer a { color: #6c8a7d; }

.countdown { font-variant-numeric: tabular-nums; }
.hintline { font-size: 12px; color: var(--muted); margin-top: 10px; }

table.plain { width: 100%; border-collapse: collapse; font-size: 13px; }
table.plain th, table.plain td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.plain th { color: var(--muted); font-weight: 500; }
table.plain td.num { font-variant-numeric: tabular-nums; text-align: right; }

@media (max-width: 420px) {
  .table-card .no { font-size: 34px; }
  .hero .big { font-size: 40px; }
  .amount { font-size: 34px; }
}

@media print {
  body { background: #fff !important; color: #111 !important; }
  .no-print { display: none !important; }
}
