﻿/* 许愿算法 V0.4 — Cloudflare 远端版（与本地版共用同一设计语言与免责文案） */

/* --- tokens --------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* 灞傜骇琛ㄩ潰锛氳秺闈犲墠瓒娿€岄珮銆?*/
  --void: #05070a;
  --base: #090c11;
  --surf-1: #0e131a;
  --surf-2: #131a23;
  --surf-3: #1a222d;
  --surf-hi: #222c39;

  --line: rgba(255, 255, 255, 0.065);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.20);

  --fg: #e9eff7;
  --fg-2: #9db0c6;
  --fg-3: #6b7d94;
  --fg-4: #4d5c6e;

  --accent: #4ee0c8;
  --accent-s: rgba(78, 224, 200, 0.14);
  --accent-b: rgba(78, 224, 200, 0.32);
  --accent-d: #2ba192;

  --blue: #7aa2ff;
  --blue-s: rgba(122, 162, 255, 0.13);
  --warn: #f0b429;
  --warn-s: rgba(240, 180, 41, 0.12);
  --warn-b: rgba(240, 180, 41, 0.28);
  --danger: #ff6b5e;
  --danger-s: rgba(255, 107, 94, 0.12);
  --ok: #4ade80;
  --ok-s: rgba(74, 222, 128, 0.12);

  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-2: 0 4px 16px -6px rgba(0, 0, 0, 0.7);
  --sh-3: 0 18px 48px -20px rgba(0, 0, 0, 0.9);
  --bevel: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  --rail-w: 264px;
  --content-max: 1040px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.65;
  font-feature-settings: "tnum" 1, "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 鐜鍏夛細涓ゅ洟鏋佷綆楗卞拰鐨勫厜鏅曪紝鍒堕€犵旱娣变絾涓嶅枾鍝?*/
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(78, 224, 200, 0.075), transparent 62%),
    radial-gradient(760px 480px at 92% 4%, rgba(122, 162, 255, 0.06), transparent 60%),
    linear-gradient(180deg, #0a0e14 0%, var(--void) 46%);
}

/* 鏋佺粏缃戞牸锛氭彁渚涢噺鍖栫粓绔殑銆屾祴閲忔劅銆嶏紝閫忔槑搴﹀帇鍒板嚑涔庡彧鏄汗鐞?*/
.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(1200px 700px at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(1200px 700px at 50% 0%, #000 20%, transparent 78%);
}

.icon-sprite { display: none; }

svg.i, svg.strip-i, svg.card-i, svg.btn-i, svg.empty-i, svg.mode-check-i,
svg.brand-glyph, svg.compliance-i, svg.split-i, svg.health-dot {
  fill: currentColor;
  flex: none;
  display: block;
}
svg.i { width: 17px; height: 17px; }
svg.brand-glyph { width: 20px; height: 20px; }
svg.strip-i { width: 16px; height: 16px; }
svg.card-i { width: 15px; height: 15px; }
svg.btn-i { width: 16px; height: 16px; }
svg.empty-i { width: 30px; height: 30px; }
svg.mode-check-i { width: 12px; height: 12px; }
svg.compliance-i { width: 20px; height: 20px; }
svg.split-i { width: 16px; height: 16px; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: #7ff0dd; }

.mono, code, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
code {
  background: var(--surf-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12.5px;
  color: var(--fg-2);
}
.faint { color: var(--fg-3); }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.danger-text { color: var(--danger); }
.accent-text { color: var(--accent); }
.hide { display: none !important; }
.muted { color: var(--fg-2); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1e2733; border-radius: 6px; border: 2px solid var(--void); }
::-webkit-scrollbar-thumb:hover { background: #2b3746; }

:focus-visible {
  outline: 2px solid var(--accent-b);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- top bar ------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 9, 13, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 60px;
  padding: 0 24px;
  max-width: 1680px;
  margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 11px; color: var(--fg); }
.brand:hover { color: var(--fg); }
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: #06201c;
  background: linear-gradient(150deg, #5beed6, #2ba192);
  box-shadow: 0 4px 14px -4px rgba(78, 224, 200, 0.55), var(--bevel);
  flex: none;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 15px; letter-spacing: 0.06em; font-weight: 650; }
.brand-copy small { font-size: 11.5px; color: var(--fg-3); letter-spacing: 0.02em; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.tag-version {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-2);
  border: 1px solid var(--line-2);
  background: var(--surf-1);
  border-radius: 999px;
  padding: 3px 10px;
}

.health {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-family: var(--mono);
  color: var(--fg-3);
  border: 1px solid var(--line);
  background: var(--surf-1);
  border-radius: 999px;
  padding: 3px 11px 3px 9px;
}
.health-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--fg-4);
  flex: none;
}
.health[data-state="ok"] .health-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-s); }
.health[data-state="ok"] .health-text { color: var(--ok); }
.health[data-state="bad"] .health-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-s); }
.health[data-state="bad"] .health-text { color: var(--danger); }

/* 绐勫睆鏃剁殑妯悜瀵艰埅锛堝灞忕敱宸︿晶鏍忔壙鎷咃級 */
.rail-scroll { display: none; }

/* --- shell --------------------------------------------------------------- */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  max-width: 1680px;
  margin: 0 auto;
  align-items: start;
}

.rail {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.rail-caption {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-4);
  padding: 0 10px 10px;
}

.rail-list { display: flex; flex-direction: column; gap: 3px; }

.rail-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--r);
  color: var(--fg-2);
  border: 1px solid transparent;
  position: relative;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.rail-item > svg { color: var(--fg-4); transition: color 0.14s ease; }
.rail-item:hover {
  background: var(--surf-1);
  color: var(--fg);
  border-color: var(--line);
}
.rail-item:hover > svg { color: var(--fg-2); }

.rail-label { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.rail-title { font-size: 13.5px; font-weight: 550; }
.rail-hint { font-size: 11px; color: var(--fg-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rail-item.active {
  background: linear-gradient(100deg, var(--accent-s), rgba(78, 224, 200, 0.02) 70%);
  border-color: rgba(78, 224, 200, 0.22);
  color: var(--fg);
}
.rail-item.active > svg { color: var(--accent); }
.rail-item.active .rail-hint { color: var(--accent-d); }
.rail-item.active::before {
  content: "";
  position: absolute;
  left: -16px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.rail-foot {
  margin-top: auto;
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surf-1);
  box-shadow: var(--bevel);
}
.rail-foot-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-size: 11.5px; color: var(--fg-4);
  padding: 3px 0;
}
.rail-foot-row b { font-size: 11px; font-weight: 500; }
.rail-foot-row b.mono { color: var(--fg-2); }

.main {
  min-width: 0;
  padding: 34px 40px 0;
  max-width: var(--content-max);
}

/* --- page head ----------------------------------------------------------- */
.page-head { padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.page-kicker {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent-d);
  text-transform: uppercase;
  margin-bottom: 9px;
}
.page-head h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: -0.015em;
  font-weight: 640;
}
.page-lead {
  margin: 10px 0 0;
  color: var(--fg-2);
  font-size: 14.5px;
  max-width: 720px;
}
.page-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }

/* --- tags / badges ------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  padding: 2.5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surf-2);
  color: var(--fg-3);
  white-space: nowrap;
  font-weight: 500;
}
.tag-accent { color: var(--accent); border-color: var(--accent-b); background: var(--accent-s); }
.tag-ok { color: var(--ok); border-color: rgba(74, 222, 128, 0.3); background: var(--ok-s); }
.tag-warn { color: var(--warn); border-color: var(--warn-b); background: var(--warn-s); }
.tag-danger { color: var(--danger); border-color: rgba(255, 107, 94, 0.3); background: var(--danger-s); }
.tag-info { color: var(--blue); border-color: rgba(122, 162, 255, 0.3); background: var(--blue-s); }
.tag-plain {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 10.5px;
  padding: 2.5px 8px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surf-2); color: var(--fg-3);
  white-space: nowrap; font-weight: 500;
}

/* --- section headings ---------------------------------------------------- */
.sec {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 40px 0 14px;
  font-size: 16px;
  font-weight: 600;
}
.sec::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
  transform: translateY(-4px);
}
.sec-no {
  font-size: 11px;
  color: var(--accent-d);
  letter-spacing: 0.14em;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 1px 6px;
  background: var(--surf-1);
  flex: none;
}
.sec-title { letter-spacing: -0.005em; }
.sec-note { font-size: 12px; color: var(--fg-4); font-weight: 400; white-space: nowrap; }

/* 浜岀骇鏍囬锛氬悓涓€鍖哄潡鍐呯殑鍒嗙粍锛屼笉鍐嶅崰鐢ㄧ紪鍙蜂綅銆?*/
.subsec {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 30px 0 12px;
  font-size: 14px;
  font-weight: 600;
}
.subsec::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
  transform: translateY(-3px);
}
.subsec .sec-note { font-size: 11.5px; color: var(--fg-4); font-weight: 400; white-space: nowrap; }

h3 { font-size: 14.5px; margin: 0 0 8px; font-weight: 600; letter-spacing: -0.005em; }
p { margin: 9px 0; }

/* --- strips锛堟寚浠?/ 鍚堣鎻愮ず锛?-------------------------------------------- */
.strip {
  display: flex;
  gap: 11px;
  padding: 13px 15px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  border-left: 3px solid var(--fg-4);
  background: var(--surf-1);
  font-size: 13px;
  color: var(--fg-2);
  margin: 11px 0;
  box-shadow: var(--bevel);
}
.strip-i { margin-top: 2px; color: var(--fg-3); }
.strip-body { min-width: 0; }
.strip-body b { color: var(--fg); font-weight: 600; }

.strip-info { border-left-color: var(--blue); }
.strip-info .strip-i { color: var(--blue); }
.strip-warn { border-left-color: var(--warn); background: linear-gradient(90deg, var(--warn-s), var(--surf-1) 42%); }
.strip-warn .strip-i { color: var(--warn); }
.strip-critical { border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-s), var(--surf-1) 42%); color: var(--fg); }
.strip-critical .strip-i { color: var(--accent); }
.strip-danger { border-left-color: var(--danger); background: linear-gradient(90deg, var(--danger-s), var(--surf-1) 42%); }
.strip-danger .strip-i { color: var(--danger); }
.strip-ok { border-left-color: var(--ok); }
.strip-ok .strip-i { color: var(--ok); }

/* --- metric grid --------------------------------------------------------- */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat {
  position: relative;
  background: linear-gradient(178deg, var(--surf-2), var(--surf-1));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 15px 14px;
  box-shadow: var(--bevel), var(--sh-1);
  overflow: hidden;
  min-width: 0;
}
.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}
.stat-k {
  font-size: 11px;
  letter-spacing: 0.07em;
  color: var(--fg-4);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-v {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-top: 6px;
  color: var(--fg);
  word-break: break-word;
  line-height: 1.35;
}
.stat-note { font-size: 11px; color: var(--fg-4); margin-top: 5px; line-height: 1.45; }

/* 闀垮搱甯?闀挎爣璇嗭細闄愬埗鍦ㄤ袱琛屽唴锛屽畬鏁村€间粛鍙€氳繃鎮仠鎻愮ず涓庡師濮嬪瓧娈靛尯鏌ョ湅銆?*/
.hash {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  color: var(--fg-2);
}

/* 闀挎爣璇嗙锛堢畻娉曠増鏈€侀椄闂ㄧ姸鎬併€佽矾寰勭瓑锛夛細闄嶄竴妗ｅ瓧鍙凤紝閬垮厤鎶婂崱鐗囨拺鎴愬琛屻€?*/
.long {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  letter-spacing: 0;
}

.tone-accent .stat-v { color: var(--accent); }
.tone-warn .stat-v { color: var(--warn); }
.tone-danger .stat-v { color: var(--danger); }
.tone-ok .stat-v { color: var(--ok); }
.tone-info .stat-v { color: var(--blue); }
.tone-accent::after, .tone-warn::after, .tone-danger::after, .tone-ok::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
}
.tone-accent::after { background: var(--accent); }
.tone-warn::after { background: var(--warn); }
.tone-danger::after { background: var(--danger); }
.tone-ok::after { background: var(--ok); }

/* --- card ---------------------------------------------------------------- */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surf-1), rgba(14, 19, 26, 0.72));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin: 14px 0;
  box-shadow: var(--bevel), var(--sh-2);
}
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head .card-i { color: var(--accent-d); }
.card-head h3 { margin: 0; }
.card > h3:not(:first-child) { margin-top: 20px; }
.lead-p { font-size: 15.5px; color: var(--fg); margin: 0; }

/* --- forms --------------------------------------------------------------- */
.control-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.control-cta { margin-left: auto; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label {
  font-size: 11.5px;
  color: var(--fg-3);
  letter-spacing: 0.03em;
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.field-hint { font-size: 10.5px; color: var(--fg-4); }

input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  min-width: 130px;
  background: var(--void);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--fg);
  padding: 9px 11px;
  font-size: 13.5px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
  appearance: none;
}
input::placeholder { color: var(--fg-4); font-family: var(--sans); }
input:hover, select:hover { border-color: var(--line-3); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-b);
  box-shadow: 0 0 0 3px var(--accent-s), inset 0 1px 2px rgba(0, 0, 0, 0.5);
}
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%236b7d94'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 28px;
  cursor: pointer;
}
select option { background: var(--surf-2); color: var(--fg); }

/* 鍒嗘鎺т欢锛堟敞鏁帮級 */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--void);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}
.seg-btn {
  min-width: 38px;
  padding: 6px 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--fg-3);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.seg-btn:hover { color: var(--fg); background: var(--surf-2); }
.seg-btn.selected {
  background: linear-gradient(180deg, var(--accent-s), rgba(78, 224, 200, 0.06));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-b);
}

/* --- buttons ------------------------------------------------------------- */
.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--r-sm);
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}
.btn-primary {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, #62eed8, #2fa596);
  color: #04231f;
  box-shadow: 0 6px 18px -8px rgba(78, 224, 200, 0.75), var(--bevel);
}
.btn-primary:hover { background: linear-gradient(180deg, #74f4e0, #35b3a3); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  border: 1px solid var(--line-2);
  background: var(--surf-2);
  color: var(--fg);
  box-shadow: var(--bevel);
}
.btn-ghost:hover { background: var(--surf-3); border-color: var(--line-3); color: var(--fg); }
.btn-primary:disabled, .btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-link { text-decoration: none; }

.fine { font-size: 12px; color: var(--fg-4); margin: 12px 0 0; }
.fine a { color: var(--fg-2); text-decoration: underline; text-decoration-color: var(--line-3); }
.fine a:hover { color: var(--accent); }

/* --- mode cards ---------------------------------------------------------- */
.mode-grid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-align: left;
  padding: 17px 18px 15px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: linear-gradient(178deg, var(--surf-2), var(--surf-1));
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--bevel), var(--sh-1);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.mode-card:hover { border-color: var(--line-3); transform: translateY(-1px); }
.mode-card.selected {
  border-color: var(--accent-b);
  background: linear-gradient(178deg, rgba(78, 224, 200, 0.08), var(--surf-1) 62%);
  box-shadow: 0 0 0 1px var(--accent-b), 0 12px 34px -18px rgba(78, 224, 200, 0.6), var(--bevel);
}

.mode-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mode-name { font-size: 15px; font-weight: 620; letter-spacing: -0.005em; }
.mode-check {
  width: 19px; height: 19px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  color: transparent;
  background: var(--void);
  flex: none;
  transition: all 0.15s ease;
}
.mode-card.selected .mode-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #04231f;
  box-shadow: 0 0 0 3px var(--accent-s);
}
.mode-tag {
  align-self: flex-start;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  color: var(--fg-3);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 1.5px 7px;
  background: var(--void);
}
.mode-card.selected .mode-tag { color: var(--accent); border-color: var(--accent-b); }
.mode-desc { color: var(--fg-2); font-size: 12.5px; line-height: 1.6; }
.mode-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--fg-4);
}
.mode-foot b { font-weight: 600; font-family: var(--mono); font-size: 11px; }

/* --- tickets ------------------------------------------------------------- */
.tickets { display: grid; gap: 11px; }

/* 绁ㄩ潰锛氬簭鍙?| 鍓嶅尯 | 鎾曠嚎 | 鍚庡尯锛堝彸瀵归綈锛夛紝妯℃嫙绾歌川绁ㄦ嵁鐨勫垎鍖恒€?*/
.ticket {
  position: relative;
  display: grid;
  grid-template-columns: 84px auto minmax(24px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 15px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surf-2), var(--surf-1));
  box-shadow: var(--bevel), var(--sh-2);
  overflow: hidden;
}
.ticket::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-d));
}
.ticket-head { display: flex; flex-direction: column; gap: 1px; }
.ticket-idx {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.ticket-live { font-size: 10.5px; color: var(--fg-4); letter-spacing: 0.1em; text-transform: uppercase; }

.ticket-perf {
  align-self: stretch;
  width: 1px;
  margin: 2px auto;
  background: repeating-linear-gradient(180deg, var(--line-3) 0 3px, transparent 3px 9px);
}

.ticket-zone { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ticket-zone.back { justify-self: end; }
.zone-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--fg-4);
  text-transform: uppercase;
  white-space: nowrap;
}

.balls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* 鐞冨彿锛氱幓鐠冭川鎰熺悆浣撱€傚埢鎰忛伩寮€绾㈤噾褰╃エ閰嶈壊锛屽墠鍖虹敤闈掋€佸悗鍖虹敤鐞ョ弨銆?*/
.ball {
  position: relative;
  width: 42px; height: 42px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 15.5px;
  font-weight: 600;
  color: #d6fbf3;
  border: 1px solid rgba(78, 224, 200, 0.24);
  background:
    radial-gradient(circle at 33% 25%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 72% 82%, rgba(78, 224, 200, 0.26), rgba(0, 0, 0, 0) 58%),
    linear-gradient(158deg, #123230, #0a1918);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -9px 15px rgba(0, 0, 0, 0.55),
    0 5px 14px -6px rgba(0, 0, 0, 0.85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.ball.back {
  color: #ffeecb;
  border-color: rgba(240, 180, 41, 0.26);
  background:
    radial-gradient(circle at 33% 25%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 46%),
    radial-gradient(circle at 72% 82%, rgba(240, 180, 41, 0.28), rgba(0, 0, 0, 0) 58%),
    linear-gradient(158deg, #33280f, #191405);
}
.sep { color: var(--fg-4); font-family: var(--mono); font-size: 15px; padding: 0 2px; }

/* --- compliance block ---------------------------------------------------- */
.compliance {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surf-1), rgba(14, 19, 26, 0.6));
  padding: 18px 20px;
  box-shadow: var(--bevel), var(--sh-1);
  margin-top: 14px;
}
.compliance-head { display: flex; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.compliance-i { color: var(--accent-d); margin-top: 1px; }
.compliance-head h3 { margin: 0 0 4px; font-size: 14.5px; }
.compliance-head p { margin: 0; font-size: 12.5px; color: var(--fg-3); }
.compliance-list { margin: 0; padding: 0; list-style: none; counter-reset: c; }
.compliance-list li {
  counter-increment: c;
  position: relative;
  padding: 12px 0 12px 34px;
  font-size: 13px;
  color: var(--fg-2);
  border-bottom: 1px solid var(--line);
  line-height: 1.65;
}
.compliance-list li:last-child { border-bottom: 0; padding-bottom: 2px; }
.compliance-list li::before {
  content: counter(c, decimal-leading-zero);
  position: absolute;
  left: 0; top: 13px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent-d);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 1px 5px;
  background: var(--void);
}

/* --- tables -------------------------------------------------------------- */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surf-1);
  box-shadow: var(--bevel);
  margin: 12px 0;
}
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th {
  position: sticky;
  top: 0;
  background: var(--surf-2);
  color: var(--fg-4);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--fg-2);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.017); }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.k { color: var(--fg-4); font-family: var(--mono); font-size: 11.5px; }
td.v { color: var(--fg); font-family: var(--mono); word-break: break-all; }

/* --- evidence ------------------------------------------------------------ */
.ev-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.ev-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--surf-1), rgba(14, 19, 26, 0.7));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 17px 0;
  box-shadow: var(--bevel), var(--sh-2);
  transition: border-color 0.15s ease;
}
.ev-card:hover { border-color: var(--line-2); }
.ev-head { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 9px; }
.ev-head h3 { margin: 0; font-size: 14px; line-height: 1.45; letter-spacing: -0.005em; }
.ev-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ev-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.ev-table th {
  text-align: left;
  color: var(--fg-4);
  font-weight: 400;
  font-size: 11px;
  padding: 5px 0;
  vertical-align: top;
  width: 88px;
  white-space: nowrap;
}
.ev-table td {
  padding: 5px 0;
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
  border: 0;
}
.ev-table td.wrap { font-family: var(--sans); font-size: 12px; line-height: 1.55; color: var(--fg-2); }
.ev-qualifier {
  margin: 13px 0 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  border-left: 2px solid var(--warn);
  background: var(--warn-s);
  font-size: 12px;
  color: var(--fg-2);
  font-family: var(--sans);
}
.ev-perm {
  margin-top: 14px;
  padding: 11px 0 13px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--fg-3);
  font-family: var(--sans);
}
.ev-perm b { font-family: var(--mono); font-size: 11.5px; }
.ev-perm .no { color: var(--danger); }
.ev-perm .yes { color: var(--ok); }
.ev-reason {
  font-size: 11.5px;
  color: var(--fg-4);
  font-family: var(--mono);
  padding-bottom: 13px;
  line-height: 1.5;
  word-break: break-word;
}

/* --- terms list ---------------------------------------------------------- */
.terms { margin: 0; display: grid; gap: 0; }
.terms > div {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.terms > div:last-child { border-bottom: 0; padding-bottom: 0; }
.terms dt { margin: 0; }
.terms dd { margin: 0; font-size: 13px; color: var(--fg-2); }

/* --- about split --------------------------------------------------------- */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; margin-top: 20px; }
.split-col { min-width: 0; }
.split-h {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; margin-bottom: 11px;
  padding-bottom: 9px; border-bottom: 1px solid var(--line);
}
.ticks, .crosses { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ticks li, .crosses li {
  position: relative;
  padding-left: 24px;
  font-size: 13px;
  color: var(--fg-2);
}
.ticks li::before, .crosses li::before {
  position: absolute; left: 0; top: 0;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
}
.ticks li::before { content: "鉁?; color: var(--ok); }
.crosses li::before { content: "鉁?; color: var(--danger); }

/* --- ledger queue -------------------------------------------------------- */
.queue { display: grid; gap: 0; }
.queue-block { padding: 4px 0 18px; }
.queue-block + .queue-block { border-top: 1px dashed var(--line-2); padding-top: 20px; }
.queue-no {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--accent-d);
  text-transform: uppercase;
}
.queue-title { font-size: 14px; font-weight: 600; margin: 5px 0 14px; }

/* --- progress ------------------------------------------------------------ */
.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--void);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
  margin: 10px 0;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-d), var(--accent));
  box-shadow: 0 0 12px -2px var(--accent);
}

/* --- charts -------------------------------------------------------------- */
.chart {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--void), rgba(5, 7, 10, 0.6));
  padding: 16px 16px 12px;
  margin: 12px 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.chart-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.chart-cap { font-size: 11.5px; color: var(--fg-3); font-family: var(--mono); }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--fg-3);
}
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-swatch.line { width: 16px; height: 2px; border-radius: 2px; }
.legend-swatch.dash { width: 16px; height: 0; border-top: 1px dashed currentColor; }
.chart rect.bar, .chart rect.zone { transition: opacity 0.14s ease; }
.chart-note { font-size: 11.5px; color: var(--fg-4); margin: 10px 0 0; line-height: 1.55; }

/* --- json payload disclosure --------------------------------------------- */
details.payload { margin-top: 14px; }
details.payload > summary {
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surf-1);
  transition: color 0.14s ease, border-color 0.14s ease;
}
details.payload > summary::-webkit-details-marker { display: none; }
details.payload > summary::before { content: "鈻?; font-family: var(--mono); font-size: 10px; }
details.payload[open] > summary::before { content: "鈻?; }
details.payload > summary:hover { color: var(--fg); border-color: var(--line-2); }
details.payload .payload-body {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--void);
  padding: 13px 15px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg-2);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 340px;
  overflow: auto;
  line-height: 1.6;
}

/* --- states -------------------------------------------------------------- */
.empty {
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  padding: 46px 24px;
  text-align: center;
  color: var(--fg-3);
  background: linear-gradient(180deg, rgba(14, 19, 26, 0.5), transparent);
  margin: 14px 0;
}
.empty-i { margin: 0 auto 14px; color: var(--fg-4); }
.empty-title { font-size: 14.5px; color: var(--fg-2); margin: 0 0 5px; font-weight: 550; }
.empty-sub { font-size: 12.5px; color: var(--fg-4); margin: 0; }
.empty p:last-child { margin-bottom: 0; }

.loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 2px;
  color: var(--fg-3);
  font-size: 13px;
}
.loading-bar {
  width: 96px;
  height: 3px;
  border-radius: 999px;
  flex: none;
  background: linear-gradient(90deg, var(--surf-3) 0%, var(--accent) 45%, var(--surf-3) 100%);
  background-size: 200% 100%;
  animation: sweep 1.15s ease-in-out infinite;
}
@keyframes sweep {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-bar { animation: none; }
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}

.error-box {
  display: flex;
  gap: 11px;
  border: 1px solid rgba(255, 107, 94, 0.3);
  border-left: 3px solid var(--danger);
  background: linear-gradient(90deg, var(--danger-s), var(--surf-1) 45%);
  color: #ffc8c1;
  border-radius: var(--r);
  padding: 13px 15px;
  font-size: 13px;
  margin: 12px 0;
}

/* --- footer -------------------------------------------------------------- */
.site-foot {
  margin-top: 56px;
  padding: 22px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--fg-4);
  font-size: 12px;
}
.site-foot p { margin: 5px 0; }
.site-foot .mono { font-size: 11px; }

/* --- responsive ---------------------------------------------------------- */
@media (max-width: 1080px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .rail-scroll {
    display: flex;
    gap: 4px;
    padding: 8px 18px 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .rail-scroll::-webkit-scrollbar { display: none; }
  .rail-scroll .rail-item {
    padding: 8px 13px;
    border-radius: var(--r-sm) var(--r-sm) 0 0;
    border: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }
  .rail-scroll .rail-item > svg { display: none; }
  .rail-scroll .rail-hint { display: none; }
  .rail-scroll .rail-item.active {
    background: none;
    border-bottom-color: var(--accent);
  }
  .rail-scroll .rail-item.active::before { display: none; }
  .main { padding: 26px 22px 0; max-width: none; }
  .topbar-inner { padding: 0 18px; }
}

/* 鍒楁暟鍦ㄧ獎灞忛檷绾э紝閬垮厤 4 鍒楄鍘嬫墎 */
@media (max-width: 940px) {
  .stat-grid.cols-3, .stat-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  .page-head h1 { font-size: 24px; }
  .main { padding: 22px 15px 0; }
  .card { padding: 15px 15px; border-radius: var(--r); }
  .brand-copy small { display: none; }
  .health-text { display: none; }
  .control-cta { margin-left: 0; width: 100%; }
  .control-cta > button { width: 100%; }
  .stat-grid, .stat-grid.cols-2, .stat-grid.cols-3, .stat-grid.cols-4 {
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  }
  .ball { width: 36px; height: 36px; font-size: 13.5px; }
  .terms > div { grid-template-columns: 1fr; gap: 7px; }
  .ticket {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "head front" "back back";
    gap: 12px 14px;
    padding: 13px 15px;
  }
  .ticket-head { grid-area: head; }
  .ticket-zone { grid-area: front; }
  .ticket-zone.back { grid-area: back; justify-self: start; }
  .ticket-perf { display: none; }
  .sec-note { display: none; }
  .stat-v { font-size: 15.5px; }
}

/* V0.4.2 daily-use surfaces */
.daily-foot p { margin: 9px 0 0; color: var(--fg-3); font-size: 12px; line-height: 1.5; }
.draw-summary { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding: 17px 0; border-bottom: 1px solid var(--line); }
.network-access { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 6px 14px; padding: 14px 16px; margin: 14px 0 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--fg-2); }
.network-access code { color: var(--accent); overflow-wrap: anywhere; }
.network-access small { grid-column: 1 / -1; color: var(--fg-3); }
.draw-label { color: var(--fg-3); font-size: 13px; }
.draw-summary strong { font: 700 22px var(--mono); color: var(--fg); }
.draw-date { color: var(--fg-3); font-size: 13px; }
.candidate-panel, .confirmed-panel, .history-card { background: var(--surf-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--sh-1); }
.candidate-head, .history-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.candidate-head h3, .history-head h3 { margin: 0 0 3px; font-size: 21px; }
.candidate-status { color: var(--accent); font-size: 13px; }
.candidate-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.confirmed-panel { border-left: 4px solid var(--ok); }
.confirmed-panel h3 { margin: 12px 0 6px; font-size: 24px; }
.record-detail { margin-top: 12px; color: var(--fg-3); }
.record-detail summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.history-card { margin-bottom: 16px; }
.history-tickets { display: grid; gap: 8px; margin: 18px 0; }
.history-ticket { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 12px; background: var(--surf-2); border-radius: 8px; }
.history-zone { margin-left: 7px; color: var(--fg-3); font-size: 12px; }
.ticket-result { margin-left: auto; color: var(--fg-2); font-size: 13px; }
.official-result { display: grid; gap: 8px; margin: 18px 0; padding: 14px; background: var(--accent-s); border-radius: 8px; }
.stats-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat-row, .prize-grid > div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 10px 0; color: var(--fg-2); }
.stat-row:last-child { border-bottom: 0; }
.stat-row b, .prize-grid b { color: var(--fg); font-family: var(--mono); }
.prize-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 26px; }
.reference-note, .sample-note { margin-top: 16px; padding: 16px; background: var(--accent-s); border-radius: 8px; color: var(--fg-2); }
.reference-note p { margin: 5px 0 0; }
.admin-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.admin-links .card { display: block; color: var(--fg); text-decoration: none; }
.admin-links .card:hover { border-color: var(--accent-b); }
.admin-links p { margin: 5px 0 0; color: var(--fg-2); }
@media (max-width: 720px) {
  .draw-summary strong { font-size: 18px; }
  .candidate-panel, .confirmed-panel, .history-card { padding: 18px; }
  .candidate-actions { flex-direction: column-reverse; }
  .candidate-actions button { width: 100%; }
  .ticket-result { width: 100%; margin-left: 0; }
  .stats-columns, .admin-links { grid-template-columns: 1fr; }
  .prize-grid { grid-template-columns: 1fr; }
}

/* V0.4.1 structural redesign: a quiet research workspace, not a telemetry wall. */
:root {
  color-scheme: light;
  --void: #f4f6f5;
  --base: #f4f6f5;
  --surf-1: #ffffff;
  --surf-2: #f7faf9;
  --surf-3: #eef3f1;
  --surf-hi: #e6eeeb;
  --line: rgba(21, 48, 43, .11);
  --line-2: rgba(21, 48, 43, .18);
  --line-3: rgba(21, 48, 43, .28);
  --fg: #17322e;
  --fg-2: #526b66;
  --fg-3: #718680;
  --fg-4: #8da09a;
  --accent: #177f70;
  --accent-s: #e4f3ef;
  --accent-b: #9fd4ca;
  --accent-d: #236e63;
  --blue: #4369a5;
  --blue-s: #edf3fc;
  --warn: #9a6a05;
  --warn-s: #fff7df;
  --warn-b: #e7ca79;
  --danger: #b04d46;
  --danger-s: #fff0ee;
  --ok: #237d56;
  --ok-s: #e9f7ef;
  --sh-1: 0 1px 2px rgba(22, 51, 45, .05);
  --sh-2: 0 8px 24px rgba(22, 51, 45, .08);
  --sh-3: 0 18px 48px rgba(22, 51, 45, .10);
}

body { background: var(--void); color: var(--fg); }
.ambient { opacity: 0; }
.topbar { background: rgba(255,255,255,.92); border-bottom-color: var(--line); }
.brand-mark { box-shadow: none; }
.rail { background: rgba(255,255,255,.72); border-right-color: var(--line); }
.rail-caption, .rail-hint, .faint { color: var(--fg-3); }
.rail-item { color: var(--fg-2); }
.rail-item:hover { background: var(--surf-3); color: var(--fg); }
.rail-item.active { background: var(--accent-s); border-color: var(--accent-b); }
.rail-item.active::before { box-shadow: none; }
.rail-foot, .card, .stat, .compliance, .chart, .empty, .home-intro { background: var(--surf-1); border-color: var(--line); box-shadow: var(--sh-1); }
.main { max-width: 1120px; padding-top: 42px; }
.page-head { border-bottom-color: var(--line); margin-bottom: 20px; }
.page-head h1 { font-size: 34px; color: var(--fg); }
.page-lead { color: var(--fg-2); max-width: 680px; }
.sec { margin-top: 30px; }
.sec::after, .subsec::after { background: linear-gradient(90deg, var(--line-2), transparent); }
.sec-no { color: var(--accent); background: transparent; border-color: var(--accent-b); }
.strip { background: var(--surf-1); border-color: var(--line); color: var(--fg-2); }
.strip-critical { border-left-color: var(--accent); }
.strip-warn { border-left-color: var(--warn); }
.mode-grid { gap: 14px; }
.mode-card { background: var(--surf-1); border-color: var(--line); box-shadow: var(--sh-1); }
.mode-card.selected { background: var(--accent-s); border-color: var(--accent-b); box-shadow: none; }
.mode-desc { color: var(--fg-2); }
.mode-foot { border-top-color: var(--line); }
.btn-primary { background: var(--accent); box-shadow: none; }
.btn-primary:hover { background: #126c5f; box-shadow: var(--sh-2); }
input, select { background: var(--surf-1); border-color: var(--line-2); color: var(--fg); }
.ticket { background: var(--surf-1); border-color: var(--line); box-shadow: var(--sh-2); }
.ball { background: var(--accent-s); color: var(--accent-d); border-color: var(--accent-b); }
.ball.back { background: var(--blue-s); color: var(--blue); border-color: #b9c9e7; }
.home-intro { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 30px 34px; margin: 4px 0 26px; border-radius: var(--r-lg); }
.home-intro-copy { max-width: 660px; }
.eyebrow { display: block; color: var(--accent); font: 600 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; }
.home-intro h2 { margin: 0; font-size: clamp(28px, 4vw, 44px); line-height: 1.15; letter-spacing: -.04em; }
.home-intro h2 em { color: var(--accent); font-style: normal; }
.home-intro p { max-width: 580px; color: var(--fg-2); font-size: 16px; margin: 16px 0 12px; }
.text-link { color: var(--accent); font-weight: 600; }
.home-state-note { display: flex; align-items: center; gap: 11px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; white-space: nowrap; }
.home-state-note b, .home-state-note span { display: block; }
.home-state-note b { font: 700 12px var(--mono); color: var(--accent); }
.home-state-note div span { color: var(--fg-3); font-size: 12px; }
.state-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.home-footnote { display: flex; align-items: center; gap: 12px; color: var(--fg-2); border-top: 1px solid var(--line); padding: 16px 2px; font-size: 13px; }
.home-footnote a { margin-left: auto; color: var(--accent); }
.sample-controls { padding-bottom: 18px; }
.site-foot { border-top-color: var(--line); color: var(--fg-3); }
.payload { background: var(--surf-2); border-color: var(--line); }
.ev-card { background: var(--surf-1); border-color: var(--line); box-shadow: var(--sh-1); }
.ev-card:nth-child(n+5) { background: var(--surf-2); }
.ev-summary { margin: 14px 0; color: var(--fg); font-size: 15px; line-height: 1.55; }
.ev-detail { border-top: 1px solid var(--line); padding-top: 10px; }
.ev-detail > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
.ev-detail > summary:hover { color: var(--accent-d); }
.lab-method { margin-top: 18px; }
.lab-method > summary { cursor: pointer; color: var(--accent); font-weight: 650; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ev-table th, .ev-table td { border-bottom-color: var(--line); }
.ev-qualifier { background: var(--warn-s); border-color: var(--warn-b); color: var(--warn); }
.ev-perm { border-top-color: var(--line); border-bottom-color: var(--line); }
.chart svg text, table { color: var(--fg-2); }

@media (max-width: 720px) {
  .main { padding: 22px 16px 0; }
  .page-head h1 { font-size: 28px; }
  .home-intro { display: block; padding: 24px 20px; }
  .home-state-note { margin-top: 22px; width: fit-content; }
  .home-footnote { align-items: flex-start; flex-wrap: wrap; }
  .home-footnote a { width: 100%; margin-left: 0; }
  .mode-grid, .ev-grid, .stat-grid { grid-template-columns: 1fr !important; }
  .control-bar { grid-template-columns: 1fr; }
  .control-cta .btn-primary { width: 100%; }
  .ticket { padding: 18px 14px; }
  .ball { width: 38px; height: 38px; }
  .ev-table { font-size: 13px; }
  .ev-table td.wrap { font-size: 13px; }
}
.record-delete-dialog { width: min(440px, calc(100vw - 32px)); box-sizing: border-box; padding: 28px; border: 1px solid #e2e6ec; border-radius: 16px; color: #253249; background: #fff; box-shadow: 0 24px 80px #14233d33; }
.record-delete-dialog::backdrop { background: #14233d66; }
.record-delete-dialog h3 { margin: 0 0 12px; font-size: 19px; }
.record-delete-dialog p { line-height: 1.6; }
.record-delete-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* ==========================================================================
   云端版补充（Cloudflare 远端工作台）
   共用上面同一套设计语言；此处只补齐远端独有的几个容器，不改变任何既有样式。
   ========================================================================== */

.ev-detail-body { padding: 12px 0 4px; }
.ball-back { opacity: 0.92; }
.ticket-zone.back .ball { box-shadow: none; }
.payload-body {
  margin: 0;
  padding: 12px 14px;
  background: var(--surf-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 12px;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 340px;
  overflow-y: auto;
}
.sync-note { font-size: 12.5px; color: var(--fg-3); }
#page-login { max-width: 560px; }
.rail-foot b.danger-text { color: var(--danger); }
.rail-foot b.ok-text { color: var(--ok); }
@media (max-width: 720px) {
  .ticket { grid-template-columns: 46px auto minmax(12px, 1fr) auto; gap: 8px; padding: 12px 10px; }
  .zone-label { display: none; }
  .ball { width: 32px; height: 32px; font-size: 13px; }
}