:root {
  color-scheme: dark;
  --bg: #0e0f10;
  --panel: #17191a;
  --input: #1d2021;
  --line: #333338;
  --line-subtle: #27272c;
  --text: #f6f5f5;
  --muted: #b2b1b8;
  --accent: #ff872e;
  --positive: #83dbb2;
  --danger: #ffae9c;
  --radius: 12px;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; isolation: isolate; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .53; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 24px; letter-spacing: -.02em; }
h3 { font-size: 16px; }
.fine, .label, .field-foot { color: var(--muted); font-size: 13px; }
.mono { font-family: var(--mono); }
.mute { color: var(--muted); }
.center { text-align: center; }

.detail-heading, .detail-title { display: flex; justify-content: space-between; align-items: center; gap: 15px; flex-wrap: wrap; }
.detail-heading { margin-bottom: 22px; }
.detail-title { justify-content: flex-start; gap: clamp(12px, 2vw, 26px); }
.detail-title h1 { color: var(--accent); font-size: clamp(34px, 4.2vw, 60px); line-height: 1.1; letter-spacing: -.04em; font-weight: 820; overflow-wrap: anywhere; }
.detail-title h1 small { margin-left: 7px; color: var(--text); font-size: .54em; font-weight: 730; letter-spacing: -.015em; white-space: nowrap; }
.project-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 650; white-space: nowrap; }
.project-state i { width: 8px; height: 8px; border-radius: 100%; background: currentColor; }
.project-state[data-state="open"] { color: var(--workspace-green); }
.project-state[data-state="stopped"] { color: var(--danger); }
.mint-banner { margin-bottom: 16px; padding: 13px 16px; background: #221817; border: 1px solid #704037; border-radius: var(--radius); }
.mint-banner strong { color: var(--danger); margin-right: 10px; }
.text-link { font-size: 14px; text-decoration: underline; text-decoration-color: #707079; text-underline-offset: 4px; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); min-width: 0; padding: 18px 22px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(248px, 1fr); gap: 20px; align-items: stretch; }
.market { padding: 13px 17px; }
.market-row {
  min-height: 54px; display: grid; grid-template-columns: minmax(135px, 1fr) minmax(0, 1.43fr);
  align-items: center; gap: 8px 14px; padding: 8px 17px; border-bottom: 1px solid var(--line);
}
.market-rate { background: #1a2a25; border-inline-start: 3px solid var(--workspace-green); border-radius: 6px; min-height: 62px; }
.market-label { display: flex; align-items: center; gap: 10px; font-size: clamp(14px, 1.45vw, 19px); font-weight: 700; }
.market-label img { flex: none; object-fit: contain; }
.market-figures { display: flex; align-items: baseline; gap: 3px 10px; flex-wrap: wrap; min-width: 0; }
.market-figures > p.fine { font-size: 11px; }
.market .m-value { margin: 0; font-size: clamp(17px, 1.73vw, 24px); white-space: nowrap; }
.market-row:has(.profit-negative) { background: #2b211c; border-inline-start: 3px solid #f1aa5d; border-radius: 5px; }
.market-row:has(.profit-positive) { background: #172520; border-inline-start: 3px solid #62b895; border-radius: 5px; }
.rate { display: flex; gap: 7px; align-items: baseline; }
.rate > b { font: 800 clamp(29px, 3vw, 43px)/1 var(--mono); color: var(--workspace-green); letter-spacing: -.07em; }
.rate span { font-size: 14px; font-weight: 620; white-space: nowrap; }
.rate span b { font-weight: inherit; }
.rate-limit { color: var(--muted); font-size: 11px; }
.rate-limit b { color: var(--text); }
.key-amount { color: color-mix(in srgb, var(--accent) 68%, var(--text)); font-variant-numeric: tabular-nums; white-space: nowrap; }

.vip-bar { display: grid; grid-template-columns: auto auto minmax(80px, 1fr); align-items: center; gap: 10px 15px; padding: 11px 15px; margin-bottom: 18px; }
.vip-heading, .vip-details { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; font-size: 13px; color: var(--muted); }
.vip-current, .vip-next { display: flex; align-items: center; gap: 7px; }
.vip-level { border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 6px; padding: 3px 9px; color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, var(--panel)); font: 750 16px/1.15 var(--mono); }
.vip-level-next { font-size: 14px; }
.vip-progress { height: 8px; overflow: hidden; border-radius: 6px; background: #343639; }
.vip-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--workspace-green); }

.detail-chain { margin-block: 18px; display: grid; grid-template-columns: minmax(110px, .6fr) minmax(110px, .6fr) minmax(0, 2fr); gap: 9px 18px; padding-block: 13px; }
.ref-card { min-width: 0; display: flex; flex-wrap: wrap; gap: 7px 12px; justify-content: space-between; align-items: center; }
.ref-card > div:first-child { min-width: 0; }
.ref-card .label b { color: var(--text); margin-inline-start: 6px; }
.ref-linkline { margin-top: 4px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.ref-card .row-btns { flex-shrink: 0; }
.metric { min-width: 0; }
.metric .fine { font-size: 12px; }
.m-value { display: block; margin: 3px 0; font: 710 clamp(15px, 1.55vw, 21px)/1.3 var(--mono); }
.market .danger .m-value { color: var(--danger); }
.metrics-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); padding-top: 6px; border-top: 1px solid var(--line); }
.metrics-foot b, .metrics-foot time { font-family: var(--mono); font-weight: 500; }

.operations { padding-top: 18px; scroll-margin-top: 12px; }
.steps { display: flex; align-items: stretch; gap: 18px; border-bottom: 1px solid var(--line); margin: 2px 0 15px; }
.step-pill {
  padding: 10px 12px; color: var(--muted); background: transparent; font-weight: 620;
  border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.step-pill:hover, .step-pill.active { color: var(--accent); }
.step-pill.active { border-bottom-color: var(--accent); }
.step-pill-reclaim { color: color-mix(in srgb, var(--accent) 55%, var(--text)); }
.step-pill-reclaim:hover, .step-pill-reclaim.active { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 0 20px; }
.workspace:not(.history-active) { padding: 0; background: transparent; border: 0; grid-template-rows: max-content minmax(min-content, 1fr); }
.recipient { grid-column: 1; min-width: 0; padding: 14px 20px 8px; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--panel); }
.history-active .recipient { padding: 0 0 12px; border: 0; background: none; }
.recipient .fine { margin-top: 4px; }
.panel { display: contents; }
.entry { grid-column: 1; min-width: 0; padding: 0 20px 15px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--panel); }
.workspace-result { grid-column: 2; grid-row: 1 / span 2; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 14px 20px; min-width: 0; }
.workspace-result .card-head { padding-bottom: 8px; border-bottom: 1px solid var(--line); margin: 0; }
.history-view { grid-column: 1 / -1; }
#panel-reclaim .row-btns { margin-top: 10px; }
.reclaim-note { margin-top: 10px; }
.reclaim-note strong, .prompt-reclaim-note strong { color: color-mix(in srgb, var(--accent) 68%, var(--text)); }
.reclaim-instructions {
  border-inline-start: 3px solid var(--accent);
  padding: 9px 12px;
  border-radius: 4px 8px 8px 4px;
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
  color: var(--text);
}
.reclaim-addresses { display: grid; gap: 8px; margin: 12px 0; font-size: 13px; }
.reclaim-addresses dt { color: var(--muted); }
.reclaim-addresses dd { margin: 0; overflow-wrap: anywhere; }
.registration-invite { display: inline-block; margin-left: 6px; }
.entry-note { padding-top: 10px; margin-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.empty-state { color: var(--muted); padding: 22px 0; text-align: center; font-size: 14px; }
.input-row, .row-btns, .card-head, .pager { display: flex; align-items: center; gap: 10px; }
.input-row .btn { flex: none; white-space: nowrap; }
.row-btns, .card-head { flex-wrap: wrap; }
.card-head { justify-content: space-between; margin-bottom: 10px; }
.field-foot { display: flex; justify-content: space-between; gap: 10px; margin: 3px 0 12px; font-size: 12px; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 650; }
.req { color: var(--accent); }
input, textarea {
  display: block; width: 100%; min-width: 0; padding: 9px 12px; border: 1px solid #55555d;
  color: var(--text); border-radius: 7px; background: var(--input);
}
input::placeholder, textarea::placeholder { color: #a5a5ae; opacity: 1; }
textarea { resize: vertical; min-height: 76px; }
.btn {
  display: inline-flex; justify-content: center; align-items: center; min-height: 39px; gap: 6px;
  padding: 7px 13px; border: 1px solid transparent; border-radius: 7px; font-size: 14px;
  font-weight: 630; line-height: 1.25; transition: background .15s, border-color .15s;
}
.btn-sm { min-height: 32px; padding: 5px 9px; font-size: 13px; }
.btn-y { background: var(--accent); color: #121212; }
.btn-y:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, white); color: #121212; }
.btn-ghost { color: var(--text); border-color: #55555d; background: transparent; }
.btn-ghost:hover:not(:disabled) { border-color: var(--muted); background: #242427; }
.btn-quiet { color: var(--muted); background: transparent; padding-inline: 4px; }
.btn-quiet:hover:not(:disabled) { color: var(--accent); }
.btn-reclaim { color: color-mix(in srgb, var(--accent) 68%, var(--text)); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: transparent; }
.btn-reclaim:hover { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.banner { display: none; padding: 11px 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.banner.show { display: block; }
.banner.ok { color: var(--positive); background: #15221e; border-color: #354b42; }
.banner.warn { color: #ffcf9f; background: #241c15; border-color: #6f4c31; }
.banner.err { color: var(--danger); background: #221817; border-color: #704037; }
.watch.on { color: var(--positive); }

.ledger { display: grid; grid-template-columns: minmax(0, .68fr) minmax(0, 1.32fr); gap: 16px; margin-top: 16px; }
.ledger h2 { font-size: 18px; }
.rules ul { padding: 0 0 0 17px; margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.rules li + li { margin-top: 7px; }
.rules li::marker { color: var(--accent); }
.rules b { color: var(--text); }
.table-wrap { max-width: 100%; overflow: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { border-top: 1px solid var(--line-subtle); padding: 8px 9px; }
.tbl th { color: var(--muted); font-weight: 550; text-align: left; white-space: nowrap; }
.tbl td { color: #e2e1e5; overflow-wrap: anywhere; }
.tbl td:first-child, .tbl td:last-child, .pill { white-space: nowrap; }
.tbl a { color: var(--accent); }
.pager { justify-content: flex-end; margin-top: 11px; }
.pill { font-size: 12px; border: 1px solid currentColor; border-radius: 100px; padding: 2px 6px; color: var(--muted); }
.pill.ok { color: var(--positive); }
.pill.no { color: var(--danger); }
.stats { display: flex; flex-wrap: wrap; gap: 10px; padding-block: 10px; }
.stats > div { display: grid; gap: 2px; padding-right: 8px; }
.stats span { color: var(--muted); font-size: 12px; }
.stats b { font-family: var(--mono); }
.detail-content .rain-toggle input, .workspace-sidebar .rain-toggle input { display: inline-block; width: auto; min-width: initial; padding: 0; }
.promptcard { padding: 17px 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); min-width: 0; }
.promptcard.ready { border-color: #3a5550; }
.promptcard h2 { font-size: 21px; margin-bottom: 4px; }
.prompt-reclaim-note { margin-top: 6px; }
.promptcard .prompt-actions { display: grid; gap: 8px; margin-top: 15px; }
.promptcard .btn-y { min-width: 0; min-height: 43px; background: var(--workspace-green); color: #101e1b; }
.promptcard .btn-y:hover:not(:disabled) { background: #9af0ce; }
.prompt-links { display: grid; gap: 7px; margin-top: 11px; border-top: 1px solid var(--line); padding-top: 10px; }
.prompt-box { margin-top: 7px; min-height: 150px; max-height: 420px; }
.step-pill:hover, .step-pill.active { color: var(--workspace-green); }
.step-pill.active { border-bottom-color: var(--workspace-green); }
.settlement-art { display: block; width: min(100%, 330px); height: auto; margin: -4px auto 2px; }
#preregResultCard:has(#preregTable:not([hidden])) .settlement-art { display: none; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 16px; margin-block: 20px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.toasts { position: fixed; right: 16px; bottom: 16px; max-width: calc(100vw - 32px); z-index: 5; }
.toast { margin-top: 8px; padding: 12px 16px; border: 1px solid #586e63; border-radius: 9px; background: #1b2922; color: var(--positive); }

@media (max-width: 1010px) {
  .detail-grid { gap: 12px; grid-template-columns: minmax(0, 1.75fr) minmax(205px, 1fr); }
  .market { padding: 10px; }
  .market-row { padding-inline: 10px; grid-template-columns: minmax(103px, 1fr) minmax(0, 1.4fr); }
  .card { padding-inline: 15px; }
  .vip-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .vip-progress { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .detail-heading { gap: 9px; margin-bottom: 15px; }
  .detail-title { gap: 8px; }
  .detail-grid { display: flex; flex-direction: column; }
  .detail-grid .promptcard { order: -1; }
  .detail-chain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-chain .ref-card { grid-column: 1 / -1; }
  .vip-bar { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .vip-heading { gap: 4px 7px; }
  .steps { flex-wrap: wrap; gap: 4px; }
  .step-pill { padding: 9px 6px; }
  .workspace, .ledger { grid-template-columns: minmax(0, 1fr); }
  .workspace:not(.history-active) { grid-template-rows: none; }
  .recipient, .entry, .workspace-result { padding-inline: 14px; }
  .workspace-result { grid-area: auto; margin-top: 12px; }
  .settlement-art { width: min(100%, 218px); }
  .row { grid-template-columns: minmax(0, 1fr); }
  .empty-state { padding: 15px 0; }
  .btn { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* 实际利润正负色 */
.market .profit-positive .m-value { color: var(--workspace-green); }
.market .profit-negative .m-value { color: var(--danger); }
