[hidden] { display: none !important; }
:root {
  --bg: #0b0b12;
  --panel: #13131d;
  --panel2: #1a1a27;
  --line: #262638;
  --fg: #ecebf5;
  --muted: #8f8da8;
  --accent: #836ef9;
  --accent2: #6e54ff;
  --gold: #ffd166;
  --ok: #2ecc8f;
  --bad: #ff5d6c;
  --miss: #3d3d55;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.6 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
code { font-family: var(--mono); font-size: .92em; }
h1, h2 { letter-spacing: -.01em; }

/* header */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 12px 28px; background: #0b0b12e6; backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); }
.brand .name { font-weight: 700; font-size: 17px; }
.brand em { font-style: normal; color: var(--accent); margin-left: 4px; font-weight: 600; }
.logo { width: 32px; height: 32px; border-radius: 8px; background: var(--accent2); display: grid; padding: 7px 6px; gap: 2px; grid-template-rows: 1fr 5px 1fr; }
.logo i { display: block; background: #fff; border-radius: 2px; }
.logo b { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); justify-self: center; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: 14px; }
.nav a.active { color: var(--fg); background: var(--panel2); }
.chain { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; }
.chain code { color: var(--gold); min-width: 84px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--miss); display: inline-block; }
.dot.live { background: var(--ok); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 #2ecc8f88; } 70% { box-shadow: 0 0 0 7px #2ecc8f00; } }

main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px 28px 48px; }
.view { display: none; }
.view.active { display: block; animation: fade .25s; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--fg); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: #4a4a68; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #7b63ff; }
.btn.ghost { background: transparent; }
.btn.lg { padding: 13px 26px; font-size: 16px; border-radius: 12px; }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; border-bottom: 1px solid #ffffff08; }
.kv:last-child { border: 0; }
.kv span { color: var(--muted); }
.kv code { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eyebrow { font-size: 12px; letter-spacing: .08em; color: var(--accent); text-transform: uppercase; font-weight: 600; }

/* home */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; padding: 28px 0 36px; }
.hero h1 { font-size: 52px; line-height: 1.12; margin: 14px 0 18px; }
.lead { color: #c9c7db; font-size: 17px; max-width: 560px; margin: 0 0 28px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-card { background: linear-gradient(160deg, #1b1830, #11111a); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: 0 30px 80px -30px #6e54ff55; }
.hc-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.hc-blocks { display: flex; flex-direction: column; gap: 6px; height: 252px; overflow: hidden; }
.hc-blk { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: #ffffff06; border: 1px solid #ffffff0a; border-radius: 10px; padding: 8px 12px; font: 13px var(--mono); animation: slide .35s; }
.hc-blk b { color: var(--gold); font-weight: 600; }
.hc-blk span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-blk small { color: var(--ok); }
@keyframes slide { from { opacity: 0; transform: translateY(-10px); } }
.hc-foot { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 12px; }
.hc-foot code { color: var(--fg); }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 44px; }
.stat { background: var(--panel); padding: 18px; text-align: center; }
.stat b { display: block; font: 600 24px var(--mono); }
.stat span { color: var(--muted); font-size: 13px; }
.sec { font-size: 22px; margin: 0 0 16px; }
.scenes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 44px; }
.scene { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; color: var(--fg); display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .15s; }
.scene:hover { border-color: var(--accent); transform: translateY(-2px); }
.scene .ic { font-size: 28px; }
.scene small { color: var(--muted); font-size: 13px; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pillar { border-top: 2px solid var(--accent); padding: 16px 4px 0; }
.pillar .num { font: 600 13px var(--mono); color: var(--accent); }
.pillar b { display: block; font-size: 18px; margin: 4px 0; }
.pillar p { color: var(--muted); margin: 0; font-size: 14px; }
.more { margin-top: 28px; font-size: 14px; }

/* capture */
.cap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; margin-bottom: 20px; }
.stage { position: relative; background: #000; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16/9; }
.stage canvas, .stage video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.cam-msg { max-width: 420px; margin: 14px auto 0; color: #ffb3bb; font-size: 14px; text-align: center; line-height: 1.6; }
.stage-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; padding: 16px; background: radial-gradient(circle at 50% 40%, #1d1a33, #050508); }
.rec-badge { position: absolute; top: 14px; left: 14px; display: flex; align-items: center; gap: 8px; background: #000a; color: #fff; padding: 5px 12px; border-radius: 8px; font: 600 14px var(--mono); }
.rec-badge i { width: 10px; height: 10px; border-radius: 50%; background: #ff3b4e; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.live-meter { position: absolute; top: 14px; right: 14px; background: #000a; color: #fff; padding: 5px 12px; border-radius: 8px; font-size: 13px; }
.live-meter span { color: var(--gold); font-family: var(--mono); }
.shutter-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 18px 4px 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.chip.on { color: var(--fg); border-color: var(--accent); background: #836ef922; }
.shutter { width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 5px; cursor: pointer; }
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #ff3b4e; transition: all .2s; }
.shutter.rec span { border-radius: 8px; transform: scale(.55); }
.shutter:disabled { opacity: .35; cursor: not-allowed; }
.cap-opts { justify-self: end; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; padding: 5px 14px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--accent2); color: #fff; }
.seg button:disabled { cursor: not-allowed; }
.shutter.photo span { background: #fff; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash .35s; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }
.stage img { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; }
.switch input { display: none; }
.switch .sl { width: 40px; height: 22px; border-radius: 11px; background: var(--miss); position: relative; transition: .2s; }
.switch .sl::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + .sl { background: var(--accent2); }
.switch input:checked + .sl::after { left: 21px; }
.switch input:checked ~ * { color: var(--fg); }
.cap-side { display: flex; flex-direction: column; gap: 16px; }
.done { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.done-ic { width: 48px; height: 48px; border-radius: 50%; background: #1f6b4c; color: #fff; display: grid; place-items: center; font-size: 24px; margin: 4px auto 0; }
.done b { font-size: 17px; }
.done p { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.ledger summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.ledger[open] summary { margin-bottom: 12px; }
.feed { max-height: 300px; overflow: auto; font: 12.5px/1.5 var(--mono); }
.feed .ln { display: grid; grid-template-columns: 50px 80px 1fr 170px 90px; gap: 10px; padding: 5px 4px; border-bottom: 1px solid #ffffff08; }
.feed .ln.hd { color: var(--muted); position: sticky; top: 0; background: var(--panel); }
.feed .st { text-align: right; }
.feed .pend { color: var(--muted); } .feed .ok { color: var(--ok); } .feed .bad { color: var(--bad); }

/* records */
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 28px; }
.records { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.rec-item { display: grid; grid-template-columns: 48px 1fr auto auto; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; color: var(--fg); }
.rec-item:hover { border-color: #4a4a68; }
.rec-item .ic { width: 48px; height: 48px; border-radius: 12px; background: var(--panel2); display: grid; place-items: center; font-size: 22px; }
.rec-item b { display: block; }
.rec-item small { color: var(--muted); }
.rec-item code { color: var(--muted); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: var(--panel2); color: var(--muted); }
.pill.ok { background: #143d2d; color: #7fe3b8; }
.pill.bad { background: #3d1820; color: #ffa3ad; }
.empty { text-align: center; color: var(--muted); padding: 40px; border: 1px dashed var(--line); border-radius: 14px; }
.find b { display: block; margin-bottom: 10px; }
.find .row { display: flex; gap: 10px; }
.find input, .row input { flex: 1; max-width: 280px; background: var(--bg); border: 1px solid var(--line); color: var(--fg); border-radius: 10px; padding: 9px 12px; font: inherit; }

/* certificate */
.cert { position: relative; background: linear-gradient(150deg, #1d1935 0%, #13131d 55%); border: 1px solid #3a3360; border-radius: 20px; padding: 26px 28px; margin-bottom: 18px; overflow: hidden; }
.cert::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 30px solid #836ef912; }
.cert-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.cert-head h1 { margin: 6px 0 20px; font: 600 30px var(--mono); }
.cert-side { display: flex; align-items: flex-start; gap: 14px; position: absolute; top: 24px; right: 28px; z-index: 1; }
.cert-grid { padding-right: 260px; }
@media (max-width: 900px) { .cert-side { position: static; flex-direction: row-reverse; justify-content: flex-end; margin-bottom: 16px; } .cert-grid { padding-right: 0; } .cert-head { flex-direction: column; } }
.cert-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; background: #fff; padding: 8px 8px 6px; border-radius: 12px; }
.cert-qr canvas { width: 104px; height: 104px; image-rendering: pixelated; display: block; }
.cert-qr span { color: #1a1a27; font-size: 12px; font-weight: 600; }
.cert-status .pill { font-size: 14px; padding: 6px 14px; }
.cert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 24px; position: relative; z-index: 1; }
.cert-grid span { display: block; font-size: 12px; color: var(--muted); }
.cert-grid b { font-weight: 600; font-size: 15px; font-family: var(--mono); word-break: break-all; }
.cert-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid #ffffff12; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.verify-box { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.vb-text { flex: 1; display: flex; flex-direction: column; min-width: 200px; }
.vb-text span { color: var(--muted); font-size: 13px; }
.verdict { border-radius: 16px; padding: 18px 22px; margin-bottom: 18px; border: 1px solid var(--line); background: var(--panel); }
.verdict.ok { background: #0e271d; border-color: #1f6b4c; }
.verdict.bad { background: #2a1117; border-color: #6b1f2c; }
.verdict b { font-size: 19px; display: block; margin-bottom: 4px; }
.verdict p { margin: 0; color: #c9c7db; }
.vgrid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; margin-bottom: 18px; }
.seginfo .big { font: 600 26px var(--mono); color: var(--gold); margin: 6px 0; }
.seginfo .big small { font-size: 12px; color: var(--muted); font-family: system-ui; }
.seginfo .challenge { margin-top: 10px; padding: 10px 12px; background: var(--panel2); border-radius: 10px; font-size: 14px; }
.tl-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.tl-head b { flex: 1; }
.legend { display: flex; gap: 6px 14px; align-items: center; font-size: 12px; color: var(--muted); }
.legend span { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: -8px; }
.legend .ok { background: var(--ok); } .legend .bad { background: var(--bad); } .legend .miss { background: var(--miss); }
.timeline { display: flex; flex-wrap: wrap; gap: 3px; }
.timeline .c { width: 16px; height: 26px; border-radius: 3px; background: var(--miss); cursor: pointer; }
.timeline .c.ok { background: var(--ok); }
.timeline .c.bad { background: var(--bad); }
.timeline .c.cur { outline: 2px solid var(--gold); outline-offset: 1px; }

/* about */
.doc { max-width: 780px; }
.doc h1 { font-size: 30px; margin-top: 0; }
.doc h2 { font-size: 20px; margin-top: 36px; }
.doc p { color: #c9c7db; }
.diagram { width: 100%; display: block; margin: 12px 0; }
.diagram .axis, .diagram .lnk { stroke: var(--muted); stroke-width: 2; fill: none; }
.diagram .fillfg { fill: var(--muted); }
.diagram .blk { fill: #1f1c36; stroke: var(--accent); stroke-width: 2; }
.diagram .vid { fill: #2a2312; stroke: var(--gold); stroke-width: 2; }
.diagram .t1 { fill: var(--fg); font-size: 16px; font-weight: 600; }
.diagram .t2 { fill: var(--muted); font-size: 13px; }
.diagram .lbl { fill: var(--muted); font-size: 13px; }
.bars { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.bar { display: grid; grid-template-columns: 130px 1fr 60px; gap: 12px; align-items: center; font-size: 13px; }
.track { height: 12px; background: var(--panel2); border-radius: 6px; overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 6px; }
.track .eth { background: #627eea; } .track .l2 { background: #8f8da8; } .track .mon { background: var(--accent); }
.tm { width: 100%; border-collapse: collapse; font-size: 14px; }
.tm th, .tm td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tm th { color: var(--muted); font-weight: 500; }
.tm .y, .tm .m { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 6px; margin-right: 8px; }
.tm .y { background: #143d2d; color: #7fe3b8; }
.tm .m { background: #3a3012; color: #ffd98a; }

.foot { display: flex; justify-content: center; gap: 22px; color: var(--muted); font-size: 13px; padding: 22px 16px 30px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--fg); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 10px 18px; border-radius: 10px; z-index: 9; max-width: calc(100% - 32px); font-size: 14px; box-shadow: 0 10px 40px #0008; }

@media (max-width: 900px) {
  .top { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
  .nav { order: 3; flex-basis: 100%; }
  main { padding: 20px 16px 40px; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 8px; }
  .hero h1 { font-size: 38px; }
  .stats-row, .scenes { grid-template-columns: repeat(2, 1fr); }
  .pillars { grid-template-columns: 1fr; }
  .cap, .vgrid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
  .shutter-bar { grid-template-columns: 1fr auto; }
  .shutter-bar .chips { grid-column: 1 / -1; }
  .feed .ln { grid-template-columns: 40px 1fr 90px; }
  .feed .ln .h, .feed .ln .sz { display: none; }
  .rec-item { grid-template-columns: 40px 1fr auto; }
  .rec-item code { display: none; }
}
