:root {
  color-scheme: light;
  --page: #f3f6f1; --surface: #fff; --surface-2: #f6f8f5; --tint: #edf5ee;
  --ink: #182d29; --muted: #526861; --subtle: #61746c; --line: #dee6df;
  --field: #fff; --field-line: #c8d6cd; --accent: #116858; --accent-hover: #0c554a;
  --accent-ink: #fff; --tile: #deefe2; --tile-ink: #19624d; --focus: #32977b;
  --shadow: 0 5px 18px -12px #204c3926; --warning: #79550e; --warn-bg: #fff6df;
  --danger: #a13731; --danger-bg: #fff1ed; --ok: #116751;
  --heading: "Instrument Sans","PingFang SC","Microsoft YaHei UI","Microsoft YaHei",system-ui,sans-serif;
  --mono: "IBM Plex Mono","Cascadia Code",Consolas,ui-monospace,monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #10201d; --surface: #192b26; --surface-2: #20352e; --tint: #213a30;
  --ink: #e6f3e9; --muted: #aec6b8; --subtle: #a3bcaf; --line: #384d43;
  --field: #152820; --field-line: #496252; --accent: #a2dfbd; --accent-hover: #b4efcb;
  --accent-ink: #10382c; --tile: #2e4c38; --tile-ink: #b1ebc2; --focus: #7dd5a7;
  --shadow: none; --warning: #edca81; --warn-bg: #3a3222; --danger: #ffafa5;
  --danger-bg: #472e29; --ok: #99dfb6;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.55 var(--heading); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.symbols { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.ic { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
.shell { width: min(1192px, calc(100% - 72px)); margin-inline: auto; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner, .brand, nav, .top-tools, .session, .nav-link, .card-head, .tile, .icon-btn, .btn, .mini-btn, .token-head, .token-foot, .token-foot > span, .dialog-head { display: flex; align-items: center; }
.top-inner { min-height: 70px; gap: 44px; }
.brand { text-decoration: none; gap: 11px; color: var(--ink); font-size: 20px; letter-spacing: .04em; font-weight: 800; white-space: nowrap; }
.brand img { width: 36px; height: 36px; }
nav { gap: 29px; align-self: stretch; }
nav a, .nav-link { display: flex; align-items: center; position: relative; background: none; border: 0; padding: 0; color: var(--muted); text-decoration: none; font-size: 14px; gap: 7px; font-weight: 600; }
nav .current { color: var(--accent); }
nav .current::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; border-radius: 2px 2px 0 0; background: var(--accent); }
.nav-link:hover { color: var(--accent); }
.nav-link .ic { width: 16px; }
.top-tools { gap: 16px; margin-left: auto; }
.session { gap: 9px; font-size: 13px; white-space: nowrap; color: var(--muted); }
.session i { width: 8px; height: 8px; background: #93a39a; border-radius: 50%; box-shadow: 0 0 0 4px var(--surface-2); }
.session.active i { background: #27a076; box-shadow: 0 0 0 4px var(--tile); }
.icon-btn { justify-content: center; padding: 0; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.icon-btn:hover { color: var(--accent); border-color: var(--field-line); }
main.shell { padding-block: 26px 58px; }
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 174px; display: flex; align-items: center; padding: 30px 38px; border-radius: 21px; background: radial-gradient(ellipse at 82% 82%,#286754 0,transparent 55%),linear-gradient(110deg,#123c37,#0b5147 65%,#123d36); color: #f3fff7; }
.hero::after { content: ""; pointer-events: none; position: absolute; inset: 0; border: 1px solid #22584a; border-radius: inherit; }
.hero-copy { position: relative; z-index: 1; }
.hero h1 { margin: 0 0 10px; font-size: clamp(30px,3.25vw,47px); line-height: 1.22; letter-spacing: .015em; font-weight: 750; }
.hero p { color: #d2e7dc; font-size: 15px; line-height: 1.7; margin: 0; }
.hero-camera { width: 39%; height: 109%; right: 0; top: -4%; position: absolute; object-fit: contain; pointer-events: none; mask-image: linear-gradient(to right,transparent,#000 15%,#000 96%,transparent); animation: reveal .55s ease-out both; }
.columns { display: grid; grid-template-columns: minmax(290px, .47fr) minmax(0,1fr); gap: 22px; align-items: start; margin-top: 22px; }
.columns > *, .main-column, .form-grid > * { min-width: 0; }
.main-column { display: grid; gap: 18px; }
.card { padding: 23px 25px; border-radius: 19px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.card-head, .dialog-head { gap: 12px; }
.card-head { margin-bottom: 21px; }
.card-head.compact { margin-bottom: 13px; }
.card h2, .dialog-head h2 { margin: 0; line-height: 1.35; font-size: 20px; letter-spacing: .012em; font-weight: 720; }
.tile { flex-shrink: 0; width: 36px; height: 36px; border-radius: 11px; justify-content: center; color: var(--tile-ink); background: var(--tile); }
.tile.mint { background: #d9eee6; color: #14664f; }
:root[data-theme="dark"] .tile.mint { background: #244b3d; color: #afe3ca; }
.tile.small { height: 31px; width: 31px; }
.tile.small .ic { width: 16px; height: 16px; }
.count, .tag { color: var(--tile-ink); background: var(--tint); border: 1px solid var(--line); border-radius: 7px; font: 600 12px/1.7 var(--mono); padding: 0 7px; }
.tag { font-family: inherit; margin-left: auto; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.auth-card .field + .field { margin-top: 15px; }
label, .token-head label { font-size: 14px; font-weight: 650; }
em { color: var(--accent); font-style: normal; }
input:not([type="checkbox"]), textarea, select { width: 100%; min-width: 0; border: 1px solid var(--field-line); border-radius: 9px; padding: 10px 13px; background-color: var(--field); color: var(--ink); outline: none; transition: border-color .16s,box-shadow .16s; }
input:not([type="checkbox"]), select { min-height: 44px; }
textarea { vertical-align: top; resize: vertical; }
select { padding-right: 9px; cursor: pointer; }
input::placeholder, textarea::placeholder, select:invalid { color: var(--subtle); font-weight: 400; }
select:disabled { cursor: default; background-color: var(--surface-2); color: var(--subtle); }
input:not([type="checkbox"]):focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb,var(--focus) 16%,transparent); }
.field small, .extra p, .guide-body p, .empty, .condition p { color: var(--muted); }
.field small { font-size: 12px; line-height: 1.6; }
.secret-wrap { position: relative; }
.secret-wrap input { padding-right: 46px; }
.input-icon { position: absolute; inset: 3px 3px 3px auto; width: 38px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); border-radius: 7px; }
.input-icon:hover, .mini-btn:hover, .text-btn:hover { color: var(--accent); }
.transport { margin: 13px 0; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
.transport > summary, .extra > summary { display: flex; align-items: center; gap: 7px; }
.transport > summary { width: max-content; color: var(--muted); font-size: 12px; padding: 2px 0; }
.chev { width: 15px; height: 15px; transition: transform .16s; }
details[open] > summary .chev { transform: rotate(180deg); }
.transport select { margin-top: 7px; font-size: 13px; }
.btn { justify-content: center; gap: 9px; min-height: 44px; padding: 9px 17px; border-radius: 10px; border: 1px solid transparent; font-size: 14px; font-weight: 650; transition: background-color .15s, transform .15s, box-shadow .15s; }
.btn .ic { width: 17px; height: 17px; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 4px 10px #133e2d24; }
.login-action { background: var(--tint); color: var(--accent); border-color: var(--field-line); width: 100%; }
.login-action:hover:not(:disabled), .outline:hover:not(:disabled) { background: var(--tile); }
.outline { background: var(--surface); color: var(--accent); border-color: var(--field-line); }
.auth-card { padding-bottom: 18px; }
.token-box { margin: 22px -25px -18px; padding: 17px 25px 19px; background: var(--surface-2); border-top: 1px solid var(--line); border-radius: 0 0 19px 19px; }
.token-head { justify-content: space-between; margin-bottom: 8px; }
.mono, code { font-family: var(--mono); }
.mini-btn, .text-btn { border: none; padding: 3px 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 550; }
.mini-btn { gap: 5px; }
.mini-btn .ic { width: 14px; height: 14px; }
#token { font-family: var(--mono); font-size: 13px; line-height: 1.65; min-height: 66px; }
#token::placeholder { font-family: var(--heading); }
.token-foot { justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--muted); }
.token-foot > span { gap: 4px; font-size: 11px; }
.token-foot .ic { height: 13px; width: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 18px; }
.full { grid-column: 1 / -1; }
.extra { padding-block: 12px; margin-top: 18px; border-block: 1px solid var(--line); }
.extra summary { font-size: 14px; font-weight: 650; }
.extra summary .chev { margin-left: auto; color: var(--muted); }
.optional-label { font-size: 11px; font-weight: 500; color: var(--subtle); }
.extra p { font-size: 13px; margin: 10px 0 12px; }
.condition { padding: 13px 15px; background: var(--warn-bg); border-radius: 10px; color: var(--warning); font-size: 13px; }
.condition p { font-size: 13px; margin: 5px 0 8px; }
.check { display: flex; align-items: start; gap: 7px; cursor: pointer; }
input[type="checkbox"] { flex-shrink: 0; height: 17px; width: 17px; margin: 2px 0; accent-color: var(--accent); }
.form-actions, .queue-actions { display: flex; align-items: center; justify-content: end; gap: 10px; }
.form-actions { margin-top: 18px; }
.queue-actions { padding-top: 14px; }
.form-actions .text-btn { margin-right: auto; }
.queue-card .card-head.compact { margin-bottom: 10px; }
.empty { margin: 0; font-size: 13px; }
.feedback, .notice { color: var(--ok); background: var(--tint); padding: 9px 12px; border-radius: 8px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.feedback { margin: 12px 0 0; }
.feedback.error, .notice.error { color: var(--danger); background: var(--danger-bg); }
.notice { margin: 12px 0; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 11px 0; border-top: 1px solid var(--line); }
.row-info { min-width: 0; display: grid; gap: 3px; overflow-wrap: anywhere; }
.row-info strong { font-size: 14px; }
.row-info small { color: var(--muted); font-size: 12px; }
.row-actions { display: flex; flex: 0 0 auto; gap: 12px; }
.row-actions button { color: var(--accent); }
.row-actions .remove { color: var(--danger); }
#receipts, #editor, #queue { scroll-margin-top: 14px; }
.receipt { border-top: 1px solid var(--line); padding: 13px 0; }
.receipt > summary { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 14px; }
.receipt-time { margin-left: auto; font: 12px var(--mono); color: var(--muted); }
.outcome { padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 650; color: var(--warning); background: var(--warn-bg); }
.outcome.success { color: var(--ok); background: var(--tint); }
.outcome.failed, .outcome.rejected { color: var(--danger); background: var(--danger-bg); }
.receipt-body { margin-top: 11px; font-size: 13px; }
.receipt-body p { margin: 6px 0; overflow-wrap: anywhere; }
.reason-list { padding-left: 22px; color: var(--danger); overflow-wrap: anywhere; }
.sub-detail { margin-top: 9px; }
.sub-detail > summary { color: var(--accent); font-weight: 600; width: fit-content; padding: 4px 0; }
.sub-detail pre { background: var(--surface-2); padding: 12px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 280px; overflow: auto; font: 12px/1.6 var(--mono); }
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 0; background: var(--surface); color: var(--ink); width: min(600px,calc(100% - 28px)); max-height: min(85vh,780px); box-shadow: 0 18px 60px #071c2040; }
dialog::backdrop { background: #061d1a8c; }
dialog[open] { display: flex; flex-direction: column; animation: reveal .16s ease-out; }
.dialog-head { flex-shrink: 0; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.dialog-head button { margin-left: auto; }
.guide-body { padding: 0 23px 21px; overflow: auto; }
.guide-body h3 { margin: 19px 0 7px; font-size: 16px; }
.guide-body p { margin: 8px 0; font-size: 14px; }
.endpoint { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; background: var(--tint); border-radius: 8px; color: var(--accent); font-size: 12px; overflow-wrap: anywhere; }
.endpoint b { font-family: var(--mono); }
.guide-cat { border-bottom: 1px solid var(--line); padding: 5px 0; font-size: 13px; }
.guide-cat summary { font-weight: 600; padding: 5px 0; }
.guide-cat ul { margin: 3px 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px 12px; color: var(--muted); }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 940px) {
  .shell { width: calc(100% - 36px); }
  .columns { gap: 16px; grid-template-columns: minmax(265px,.54fr) minmax(0,1fr); }
  .card { padding: 19px; }
  .token-box { margin: 18px -19px -19px; padding-inline: 19px; }
  .hero { min-height: 156px; padding: 26px; }
  .hero-copy { max-width: 64%; }
}
@media (max-width: 740px) {
  .top-inner { min-height: 60px; gap: 21px; }
  nav { gap: 17px; }
  .brand { font-size: 17px; gap: 7px; }
  .brand img { width: 31px; height: 31px; }
  .top-tools { gap: 10px; }
  .columns { grid-template-columns: 1fr; }
  .shell { width: min(620px,calc(100% - 28px)); }
  main.shell { padding-block: 15px 40px; }
  .hero { min-height: 145px; border-radius: 16px; }
  .hero-copy { max-width: 72%; }
  .hero p { font-size: 13px; }
  .hero-camera { width: 36%; right: -3%; }
  .columns { margin-top: 15px; }
  .card { border-radius: 16px; }
  .token-box { border-radius: 0 0 16px 16px; }
  .card-head { margin-bottom: 15px; }
  .btn { min-height: 46px; }
}
@media (max-width: 510px) {
  nav .current { display: none; }
  .top-inner { gap: 15px; }
  .nav-link { font-size: 12px; gap: 4px; }
  .nav-link .ic { width: 14px; }
  .session { font-size: 11px; gap: 6px; }
  .icon-btn { width: 33px; height: 33px; }
  .hero { align-items: start; padding: 22px 18px; min-height: 142px; }
  .hero h1 { font-size: 28px; margin-bottom: 8px; }
  .hero-copy { max-width: 79%; }
  .hero-copy p { max-width: 225px; }
  .hero-camera { width: 49%; height: 85%; right: -13%; top: 18%; opacity: .65; }
  .hero-copy { text-shadow: 0 1px 7px #143f38; }
  .columns, .main-column { gap: 14px; }
  .card { padding: 17px; }
  .token-box { margin: 16px -17px -17px; padding: 14px 17px; }
  .form-grid { gap: 13px 10px; }
  .form-grid .category { grid-column: 1 / -1; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 0 auto; }
  .form-actions .text-btn { width: 100%; text-align: left; }
  .row-actions { gap: 8px; }
  input:not([type="checkbox"]), select, textarea { font-size: 16px; }
  #token { font-size: 16px; }
}
@media (max-width: 370px) {
  .form-grid { grid-template-columns: 1fr; }
  .top-inner { gap: 10px; }
  .top-tools { gap: 8px; }
  .hero-camera { opacity: .4; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
