/* ==========================================================================
   TRC-20 Energy Console · 内部测试控制台
   深色金融科技风 · TRON 红强调色 · 无外部字体/图片/CDN
   ========================================================================== */

:root {
  --bg: #f4f7fb;
  --bg-soft: #f8fafc;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --panel-3: #eef2f8;
  --border: #dbe3ee;
  --border-strong: #c5d0df;
  --text: #142033;
  --text-dim: #344258;
  --muted: #5b6b80;
  --faint: #8492a6;
  --tron: #c8102e;
  --tron-bright: #e11d48;
  --tron-soft: rgba(200, 16, 46, 0.08);
  --green: #0f8a5f;
  --green-soft: rgba(15, 138, 95, 0.1);
  --amber: #b45309;
  --amber-soft: rgba(180, 83, 9, 0.1);
  --blue: #1d4ed8;
  --blue-soft: rgba(29, 78, 216, 0.1);
  --red: #c0392b;
  --red-soft: rgba(192, 57, 43, 0.1);
  --violet: #6d28d9;
  --violet-soft: rgba(109, 40, 217, 0.1);

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --ring: 0 0 0 3px rgba(200, 16, 46, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(200, 16, 46, 0.06), transparent 60%),
    radial-gradient(800px 380px at 95% 0%, rgba(29, 78, 216, 0.05), transparent 60%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 45%, #eef3f9 100%);
  background-attachment: fixed;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
dt,
ol,
ul {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-weight: 650;
  letter-spacing: 0.01em;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--blue);
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.04);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

::selection {
  background: rgba(235, 0, 41, 0.42);
  color: #fff;
}

/* ---------- 通用工具类 ---------- */

.mono {
  font-family: var(--font-mono);
  font-size: 0.94em;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.amount {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.04em;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.addr {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.error-text {
  color: var(--red);
  word-break: break-word;
}

.num {
  text-align: right;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 120;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--tron);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- 顶部 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px clamp(16px, 3vw, 34px);
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #ff3b30, #b40020);
  box-shadow: 0 10px 26px rgba(235, 0, 41, 0.35), inset 0 1px 0 rgba(15, 23, 42, 0.1);
}

.brand-text h1 {
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0.015em;
}

.brand-text p {
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prototype-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px clamp(16px, 3vw, 34px);
  font-size: 12px;
  color: var(--text-dim);
  background: linear-gradient(90deg, rgba(235, 0, 41, 0.16), rgba(245, 165, 36, 0.08) 58%, transparent);
  border-bottom: 1px solid var(--border);
}

.prototype-banner .sep {
  color: var(--faint);
}

.prototype-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--tron);
  box-shadow: 0 4px 14px rgba(235, 0, 41, 0.34);
}

.status-meta {
  margin-left: auto;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ---------- 布局 ---------- */

.main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 20px clamp(14px, 3vw, 34px) 8px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 0.92fr);
  gap: 16px;
  align-items: start;
}

.admin-full {
  margin-top: 16px;
  min-width: 0;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* ---------- 面板 ---------- */

.panel {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.04), transparent 160px),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04) inset, 0 14px 34px rgba(15, 23, 42, 0.08);
  overflow: clip;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.04), transparent);
}

.panel-head h2 {
  font-size: 14px;
  letter-spacing: 0.02em;
}

.panel-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

/* ---------- 表单 ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field.grow {
  flex: 1 1 180px;
}

.field-label {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.field-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.input {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input::placeholder {
  color: var(--faint);
}

.input:hover {
  border-color: #94a3b8;
}

.input:focus {
  outline: none;
  border-color: var(--tron);
  background: #ffffff;
  box-shadow: var(--ring);
}

.input.input-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 91, 91, 0.18);
}

.input-sm {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}

.input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-height: 0;
  padding: 0;
  accent-color: var(--tron);
  background: none;
  border: 0;
  box-shadow: none;
  cursor: pointer;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-sm {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 12px;
}

.btn-xs {
  min-height: 26px;
  padding: 2px 8px;
  font-size: 11px;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(160deg, #ff3b30, #c80526 72%);
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 10px 24px rgba(235, 0, 41, 0.32), inset 0 1px 0 rgba(15, 23, 42, 0.1);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(160deg, #ff564c, #d6082c 72%);
  box-shadow: 0 12px 28px rgba(235, 0, 41, 0.42), inset 0 1px 0 rgba(15, 23, 42, 0.1);
}

.btn-secondary {
  color: var(--text);
  background: var(--panel-3);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: #e2e8f0;
  border-color: #3d4859;
}

.btn-ghost {
  color: var(--text-dim);
  background: transparent;
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: rgba(15, 23, 42, 0.04);
  border-color: var(--border-strong);
}

.btn.danger {
  color: var(--red);
  border-color: rgba(255, 91, 91, 0.34);
}

.btn.danger:hover:not(:disabled) {
  background: var(--red-soft);
}

.btn[data-loading="true"],
.btn.is-loading {
  cursor: progress;
  opacity: 0.85;
}

.btn[data-loading="true"]::before,
.btn.is-loading::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: none;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.04);
}

.copy-btn {
  padding: 1px 7px;
  margin-left: 4px;
  font-size: 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  vertical-align: middle;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(15, 23, 42, 0.04);
}

/* ---------- 徽章 / 圆点 ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.6;
  white-space: nowrap;
  color: var(--text-dim);
  background: rgba(15, 23, 42, 0.04);
}

.badge-neutral {
  color: var(--muted);
  background: rgba(15, 23, 42, 0.04);
  border-color: var(--border-strong);
}

.badge-success {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(52, 211, 153, 0.32);
}

.badge-danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(255, 91, 91, 0.32);
}

.badge-warn {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: rgba(245, 165, 36, 0.32);
}

.badge-info {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(90, 169, 255, 0.32);
}

.badge-admin {
  color: var(--violet);
  background: var(--violet-soft);
  border-color: rgba(181, 140, 255, 0.32);
  letter-spacing: 0.08em;
}

.badge-mock {
  color: #ffd28a;
  background: rgba(245, 165, 36, 0.16);
  border-color: rgba(245, 165, 36, 0.42);
  letter-spacing: 0.08em;
}

.badge-live {
  color: #fff;
  background: linear-gradient(160deg, #ff3b30, #c80526);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(235, 0, 41, 0.4);
  letter-spacing: 0.08em;
}

.badge-testnet {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(90, 169, 255, 0.36);
}

.badge-mainnet {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(255, 91, 91, 0.4);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}

.dot-ok {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

.dot-warn {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(245, 165, 36, 0.16);
}

.dot-danger {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 91, 91, 0.16);
}

/* ---------- 通知 / 错误 / 空状态 ---------- */

.notice {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 13px 16px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
}

.notice-body {
  flex: 1 1 320px;
  min-width: 0;
}

.notice strong {
  color: #ffd28a;
  font-size: 13px;
}

.notice p {
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.55;
}

.inline-error {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 12px;
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
  background: var(--red-soft);
  border: 1px solid rgba(255, 91, 91, 0.26);
  border-radius: var(--radius-sm);
  word-break: break-word;
}

.inline-error .btn {
  margin-left: auto;
}

.empty {
  padding: 20px 12px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.04);
}

/* ---------- 表格 ---------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

.table-wrap::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 8px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #394454;
  border: 2px solid #f1f5f9;
  border-radius: 8px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: #4a5669;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-strong);
}

.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(35, 42, 53, 0.7);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.04);
}

.data-table .amount-pos {
  color: var(--green);
}

.data-table .amount-neg {
  color: var(--red);
}

.data-table .cell-sub {
  display: block;
  color: var(--faint);
  font-size: 10px;
}

.data-table .cell-mono {
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* ---------- 用户卡 / 键值 ---------- */

.user-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: linear-gradient(150deg, rgba(235, 0, 41, 0.1), rgba(15, 23, 42, 0.04) 62%), var(--bg-soft);
}

.user-card-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.user-card-main .k {
  color: var(--muted);
  font-size: 12px;
}

.user-card-main .v {
  font-size: 22px;
  font-weight: 650;
  color: #fff;
}

.kv {
  display: grid;
  gap: 7px;
}

.kv > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.kv dt {
  flex: none;
  color: var(--muted);
  font-size: 12px;
}

.kv dd {
  min-width: 0;
  color: var(--text);
  font-size: 12.5px;
  text-align: right;
  word-break: break-word;
}

.kv.compact > div {
  gap: 10px;
}

.kv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kv-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
}

.kv-line .k {
  color: var(--muted);
  font-size: 12px;
}

.kv-line .v {
  min-width: 0;
  font-size: 12.5px;
  text-align: right;
  word-break: break-all;
}

/* ---------- SKU ---------- */

.sku-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 10px;
}

.sku-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px 13px 12px;
  color: inherit;
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease,
    box-shadow 0.15s ease;
}

.sku-card:hover {
  transform: translateY(-1px);
  border-color: #3d4859;
  background: #f8fafc;
}

.sku-card[aria-checked="true"] {
  border-color: var(--tron);
  background:
    linear-gradient(150deg, rgba(235, 0, 41, 0.14), transparent 70%),
    #f8fafc;
  box-shadow: 0 0 0 1px rgba(235, 0, 41, 0.4), 0 14px 26px rgba(235, 0, 41, 0.14);
}

.sku-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.sku-name {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.sku-check {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: transparent;
  font-size: 11px;
  line-height: 1;
}

.sku-card[aria-checked="true"] .sku-check {
  color: #fff;
  background: var(--tron);
  border-color: var(--tron);
}

.sku-desc {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sku-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

.sku-energy {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
}

.sku-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.sku-price .label {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.sku-price .value {
  color: #fff;
  font-family: var(--font-mono);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* ---------- 报价 / 订单 ---------- */

.quote-card,
.order-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.quote-card {
  border-top: 2px solid var(--tron);
  background:
    linear-gradient(180deg, rgba(235, 0, 41, 0.1), transparent 120px),
    var(--bg-soft);
}

.order-card {
  border-top: 2px solid var(--border-strong);
}

.quote-head,
.order-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.quote-head h3,
.order-head h3 {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.quote-head .countdown {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid rgba(245, 165, 36, 0.3);
  white-space: nowrap;
}

.quote-head .countdown.urgent {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(255, 91, 91, 0.36);
  animation: pulse-soft 1s ease-in-out infinite;
}

.quote-head .countdown.expired {
  color: var(--muted);
  background: rgba(15, 23, 42, 0.04);
  border-color: var(--border-strong);
  animation: none;
}

@keyframes pulse-soft {
  50% {
    opacity: 0.62;
  }
}

.order-head .badge {
  font-size: 11.5px;
}

.poll-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--blue);
  font-size: 11px;
  white-space: nowrap;
}

.poll-indicator.paused {
  color: var(--muted);
}

.poll-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(90, 169, 255, 0.16);
  animation: pulse-soft 1.6s ease-in-out infinite;
}

.poll-indicator.paused .poll-dot {
  animation: none;
  box-shadow: none;
}

/* ---------- 时间线 ---------- */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 0 0 14px 0;
  min-height: 30px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: 0;
  width: 1px;
  background: var(--border-strong);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  flex: none;
  width: 11px;
  height: 11px;
  margin-top: 4px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--panel);
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.timeline-label {
  font-size: 12.5px;
  color: var(--text-dim);
}

.timeline-time {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.timeline-item.is-done .timeline-dot {
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14);
}

.timeline-item.is-done .timeline-label {
  color: var(--text);
}

.timeline-item.is-active .timeline-dot {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(90, 169, 255, 0.16);
  animation: pulse-soft 1.6s ease-in-out infinite;
}

.timeline-item.is-active .timeline-label {
  color: var(--blue);
}

.timeline-item.is-error .timeline-dot {
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 91, 91, 0.16);
}

.timeline-item.is-error .timeline-label {
  color: var(--red);
}

.timeline-item.is-pending .timeline-label {
  color: var(--faint);
}

/* ---------- 账本 ---------- */

.ledger-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: linear-gradient(150deg, rgba(52, 211, 153, 0.08), rgba(15, 23, 42, 0.04) 60%), var(--bg-soft);
}

.ledger-summary span:first-child {
  color: var(--muted);
  font-size: 12px;
}

.ledger-summary .amount {
  font-size: 20px;
  font-weight: 650;
  color: #fff;
}

/* ---------- 管理区 ---------- */

.admin-panel {
  border-color: #cbd5e1;
}

.admin-summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.admin-summary::-webkit-details-marker {
  display: none;
}

.admin-summary-title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.admin-summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.18s ease;
}

.admin-panel[open] .admin-summary::after {
  transform: rotate(180deg);
}

.admin-summary:hover {
  background: rgba(15, 23, 42, 0.04);
}

.summary-hint {
  display: none;
  color: var(--faint);
  font-size: 11px;
}

@media (min-width: 1100px) {
  .summary-hint {
    display: inline;
    margin-right: 10px;
  }
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-full .admin-grid {
  align-items: start;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.subpanel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.04);
}

.subpanel.span-2 {
  grid-column: span 2;
}

.subpanel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.subpanel-head h3 {
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--text-dim);
}

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

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.stat-card .stat-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: #fff;
  word-break: break-all;
}

.stat-card .stat-value.pos {
  color: var(--green);
}

.stat-card .stat-value.neg {
  color: var(--red);
}

.stat-card .stat-sub {
  color: var(--faint);
  font-size: 10.5px;
}

.chip-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  background: rgba(15, 23, 42, 0.04);
}

.chip strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pricing-name {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.pricing-id {
  display: block;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.data-table td .input-sm {
  min-width: 84px;
  max-width: 112px;
}

.admin-full .subpanel.span-2 .table-wrap {
  overflow-x: auto;
}

/* ---------- 弹窗 ---------- */

.token-dialog {
  width: min(540px, calc(100vw - 28px));
  padding: 0;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.token-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.token-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 18px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-head h2 {
  font-size: 16px;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.token-dialog .hint {
  padding: 9px 11px;
  border: 1px solid rgba(245, 165, 36, 0.24);
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: var(--text-dim);
}

.token-dialog .hint strong {
  color: #ffd28a;
}

/* ---------- Toast ---------- */

.toast-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.5;
  background: #eef2f8;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toast-in 0.18s ease-out;
}

.toast.is-success {
  border-left-color: var(--green);
}

.toast.is-error {
  border-left-color: var(--red);
}

.toast.is-warn {
  border-left-color: var(--amber);
}

.toast .toast-close {
  margin-left: auto;
  padding: 0 4px;
  color: var(--faint);
  font-size: 15px;
  line-height: 1;
  background: none;
  border: 0;
}

.toast .toast-close:hover {
  color: var(--text);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- 页脚 ---------- */

.footer {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 34px) 30px;
  color: var(--faint);
  font-size: 11.5px;
}

.footer strong {
  color: var(--text-dim);
}

.footer-meta {
  margin-top: 2px;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 300;
  padding: 14px;
  color: var(--text);
  text-align: center;
  background: var(--red-soft);
  border: 1px solid rgba(255, 91, 91, 0.4);
  border-radius: var(--radius-sm);
}

/* ---------- 响应式 ---------- */

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .column {
    gap: 14px;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 13.5px;
  }

  .topbar {
    padding: 12px 14px;
  }

  .brand-text h1 {
    font-size: 15.5px;
  }

  .brand-text p {
    font-size: 11px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .badge-row {
    order: 3;
    width: 100%;
  }

  .prototype-banner {
    padding: 8px 14px;
    font-size: 11px;
  }

  .status-meta {
    width: 100%;
    margin-left: 0;
  }

  .main {
    padding: 14px 12px 4px;
  }

  .panel-body {
    padding: 13px;
  }

  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .subpanel.span-2 {
    grid-column: span 1;
  }

  .field-row {
    flex-direction: column;
    align-items: stretch;
  }

  .field-row .field.grow {
    flex: 0 0 auto;
  }

  .field-row > .btn {
    width: 100%;
    margin-top: 2px;
  }

  .admin-full {
    margin-top: 14px;
  }

  .btn {
    min-height: 40px;
  }

  .btn-sm {
    min-height: 34px;
  }

  .sku-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .user-card-main .v {
    font-size: 20px;
  }

  .quote-head .countdown {
    margin-left: 0;
  }

  .poll-indicator {
    margin-left: 0;
  }

  .toast-root {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }
}

@media (max-width: 420px) {
  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .kv > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
  }

  .kv dd {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.gas-info .kv-line {
  align-items: flex-start;
}

.gas-info .kv-line .v {
  word-break: break-all;
}

.gas-info .gas-copy {
  margin-left: 6px;
}


.iso-settings-row {
  align-items: flex-end;
}

.iso-settings-row .field {
  flex: 1 1 170px;
}

.iso-settings-row .btn {
  flex: none;
}



/* ===== 正式浅色主题覆盖 ===== */
.topbar {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: var(--border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}
.login-card,
.panel,
.subpanel {
  background: #ffffff;
}
.admin-panel,
.admin-content,
.panel-head {
  background: #f8fafc;
}
.dialog {
  background: #ffffff;
}
.dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.data-table thead th {
  background: #f1f5f9;
  color: var(--muted);
}
.data-table td {
  border-bottom-color: var(--border);
}
.data-table tbody tr:hover {
  background: #f8fafc;
}
.input {
  background: #ffffff;
}
.user-card-main .v,
.sku-price .value,
.ledger-summary .amount,
.stat-card .stat-value {
  color: var(--text);
}
.badge-success { border-color: rgba(15, 138, 95, 0.25); }
.badge-danger { border-color: rgba(192, 57, 43, 0.25); }
.badge-warn { border-color: rgba(180, 83, 9, 0.25); }
.secret-value,
code,
pre {
  color: var(--text);
}
.icon-btn:hover {
  background: #f1f5f9;
}


.admin-recharge-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.admin-recharge-transfer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (max-width: 900px) {
  .admin-recharge-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

#admin-users-table td:last-child {
  white-space: nowrap;
}

.admin-recharge-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 10px;
}

.admin-recharge-transfer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 900px) {
  .admin-recharge-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.users-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.users-toolbar .input {
  flex: 1 1 260px;
  min-width: 180px;
}
@media (max-width: 760px) {
  .iso-settings-row {
    flex-direction: column;
    align-items: stretch;
  }

  .iso-settings-row .field {
    flex: 0 0 auto;
    width: 100%;
  }

  .iso-settings-row .btn {
    width: 100%;
  }
}

