/* ============================================================
   NORTHLINE · 设备结算处
   深色运营台主题（单文件，无外部依赖，满足 style-src 'self'）
   ============================================================ */

:root {
  --bg: #080b11;
  --bg-elevated: #0b1018;
  --panel: #101722;
  --panel-2: #141d2a;
  --panel-3: #1a2534;
  --line: #1f2b3b;
  --line-strong: #2c3c50;
  --text: #e8eef7;
  --text-soft: #c3cddd;
  --muted: #93a2b7;
  --faint: #6d7d93;
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --accent-ink: #04211f;
  --positive: #34d399;
  --warning: #f5b544;
  --danger: #f87171;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-panel: 0 24px 60px -32px rgb(0 0 0 / 0.85);
  --shadow-pop: 0 30px 80px -24px rgb(0 0 0 / 0.9);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", Consolas,
    "Liberation Mono", monospace;
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 560px at 12% -10%, rgb(45 212 191 / 0.09), transparent 62%),
    radial-gradient(900px 520px at 88% 0%, rgb(56 189 248 / 0.07), transparent 60%),
    linear-gradient(180deg, #080b11 0%, #070a0f 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 650;
  letter-spacing: 0.01em;
}

h2 {
  font-size: 17px;
  font-weight: 620;
}

h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

::selection {
  background: rgb(45 212 191 / 0.28);
  color: #fff;
}

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

.tabular,
.numeric,
input[inputmode="decimal"],
.metric-value strong {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 3vw, 34px);
  background: rgb(8 11 17 / 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #04211f;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 8px 22px -10px rgb(45 212 191 / 0.8);
}

.brand strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.brand small {
  display: block;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
}

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

.identity {
  max-width: 260px;
  overflow: hidden;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-soft);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-stamp {
  padding: 5px 11px;
  border: 1px solid rgb(45 212 191 / 0.4);
  border-radius: 999px;
  background: rgb(45 212 191 / 0.1);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.08em;
}

/* ---------------- 页面骨架 ---------------- */

.page-frame {
  width: min(100% - 32px, 1320px);
  margin: 0 auto;
  padding: 30px 0 72px;
}

.app-page,
.admin-page {
  min-height: 100vh;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-heading.admin-heading {
  align-items: center;
  flex-wrap: wrap;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.heading-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.seal {
  flex: none;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  transform: rotate(-6deg);
  border: 1px solid rgb(45 212 191 / 0.55);
  border-radius: 12px;
  box-shadow: inset 0 0 0 3px rgb(45 212 191 / 0.12);
  color: var(--accent);
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-align: center;
  opacity: 0.85;
}

/* ---------------- 指标卡 ---------------- */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  position: relative;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-elevated) 100%);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(45 212 191 / 0.35), transparent);
  opacity: 0.6;
}

.metric-card > p {
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.metric-card > small {
  display: block;
  margin-top: 8px;
  color: var(--faint);
  font-size: 12px;
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 8px;
  color: var(--text);
}

.metric-value span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 15px;
}

.metric-value .currency-label {
  font-size: 12px;
  letter-spacing: 0.08em;
}

.metric-value strong {
  font-family: var(--font-mono);
  font-size: clamp(24px, 2.7vw, 32px);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.metric-primary {
  border-color: rgb(45 212 191 / 0.38);
  background:
    radial-gradient(120% 140% at 0% 0%, rgb(45 212 191 / 0.16), transparent 58%),
    linear-gradient(180deg, var(--panel) 0%, var(--bg-elevated) 100%);
}

.metric-primary .metric-value strong {
  color: var(--accent);
  text-shadow: 0 0 28px rgb(45 212 191 / 0.35);
}

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

.compact-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
}

.compact-metric > p {
  font-size: 12.5px;
}

.compact-metric > strong {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 620;
}

/* ---------------- 面板与网格 ---------------- */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px;
}

.panel {
  padding: 20px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-elevated) 100%);
  box-shadow: var(--shadow-panel);
  min-width: 0;
}

.panel-wide {
  grid-column: span 2;
}

.admin-frame > .panel {
  margin-top: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-index {
  margin-bottom: 4px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.count-chip {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  white-space: nowrap;
}

.subheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.subheading > span {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

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

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(5 8 13 / 0.55);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgb(20 29 42 / 0.7);
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-align: left;
  white-space: nowrap;
}

tbody td {
  padding: 12px 14px;
  border-top: 1px solid rgb(31 43 59 / 0.6);
  color: var(--text-soft);
  vertical-align: middle;
}

tbody tr:first-child td {
  border-top: 0;
}

tbody tr:hover td {
  background: rgb(45 212 191 / 0.045);
}

tbody td strong {
  display: block;
  color: var(--text);
  font-weight: 560;
}

tbody td small {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

.numeric {
  text-align: right;
  white-space: nowrap;
}

.strong-cell {
  color: var(--text) !important;
  font-weight: 600;
}

.cell-note {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 11.5px;
}

.table-wrap table {
  min-width: 520px;
}

.table-wrap .admin-table {
  min-width: 860px;
}

.table-wrap .wide-table {
  min-width: 1180px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.empty-state {
  padding: 30px 16px;
  color: var(--faint);
  font-size: 13px;
  text-align: center;
}

.empty-inline {
  margin: 0;
  padding: 8px 0;
  color: var(--faint);
  font-size: 12.5px;
}

/* ---------------- 状态徽标 ---------------- */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.03);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.tone-positive {
  border-color: rgb(52 211 153 / 0.35);
  background: rgb(52 211 153 / 0.1);
  color: var(--positive);
}

.tone-warning {
  border-color: rgb(245 181 68 / 0.35);
  background: rgb(245 181 68 / 0.1);
  color: var(--warning);
}

.tone-danger {
  border-color: rgb(248 113 113 / 0.35);
  background: rgb(248 113 113 / 0.1);
  color: var(--danger);
}

.tone-neutral {
  color: var(--muted);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease,
    transform 0.12s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  background: linear-gradient(140deg, var(--accent) 0%, #22c3e0 100%);
  color: var(--accent-ink);
  box-shadow: 0 10px 26px -14px rgb(45 212 191 / 0.9);
}

.button-primary:hover:not(:disabled) {
  box-shadow: 0 14px 30px -12px rgb(45 212 191 / 0.95);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
}

.button-secondary:hover:not(:disabled) {
  border-color: rgb(45 212 191 / 0.45);
  background: var(--panel-3);
}

.button-quiet {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.button-quiet:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--text);
}

.button-danger {
  border-color: rgb(248 113 113 / 0.32);
  background: rgb(248 113 113 / 0.09);
  color: #fca5a5;
}

.button-danger:hover:not(:disabled) {
  background: rgb(248 113 113 / 0.16);
}

.button-wide {
  width: 100%;
}

.table-action {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}

.text-link {
  color: var(--accent-2);
  font-size: 12.5px;
  border-bottom: 1px dashed rgb(56 189 248 / 0.4);
}

.text-link:hover {
  color: #7dd3fc;
}

.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-button:hover:not(:disabled) {
  color: var(--danger);
}

.text-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

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

.stack-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field > span,
.inline-field > span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.field input,
.field select,
.inline-field input,
.inline-field select,
.inline-form input,
.admin-withdraw-controls input,
.admin-withdraw-controls select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #0a1018;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input::placeholder,
.inline-field input::placeholder,
.admin-withdraw-controls input::placeholder {
  color: var(--faint);
}

.field input:focus,
.field select:focus,
.inline-field input:focus,
.inline-field select:focus,
.inline-form input:focus,
.admin-withdraw-controls input:focus,
.admin-withdraw-controls select:focus {
  border-color: rgb(45 212 191 / 0.6);
  box-shadow: 0 0 0 3px rgb(45 212 191 / 0.14);
  outline: none;
}

.field input:disabled {
  opacity: 0.55;
}

.field-hint {
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.6;
}

.form-error {
  padding: 8px 11px;
  border: 1px solid rgb(248 113 113 / 0.35);
  border-radius: 9px;
  background: rgb(248 113 113 / 0.1);
  color: #fca5a5;
  font-size: 12.5px;
}

.file-field {
  display: grid;
  gap: 6px;
}

.file-field > span {
  color: var(--muted);
  font-size: 12px;
}

.file-field input[type="file"] {
  width: 100%;
  padding: 9px 11px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: #0a1018;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.file-field input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.compact-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-field {
  display: grid;
  gap: 5px;
  min-width: 96px;
}

.inline-field input {
  width: 100%;
}

.grow-field {
  flex: 1 1 220px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: end;
}

.admin-form-grid .checkbox-field {
  grid-column: span 2;
}

.admin-form-grid .internal-field {
  border-left: 2px dashed rgb(245 181 68 / 0.35);
  padding-left: 12px;
}

.form-action {
  display: flex;
  align-items: flex-end;
}

.form-action .button {
  width: 100%;
}

/* ---------------- 客户台：设备 / 收款码 / 提现 ---------------- */

.device-list {
  display: grid;
  gap: 10px;
}

.device-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(10 16 24 / 0.7);
}

.device-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.device-item-head strong {
  font-size: 13.5px;
}

.device-meta,
.device-report {
  color: var(--faint);
  font-size: 12px;
  line-height: 1.7;
}

.device-report {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.device-connect {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.device-address {
  padding: 4px 8px;
  border: 1px solid rgb(45 212 191 / 0.3);
  border-radius: 7px;
  background: rgb(45 212 191 / 0.07);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11.5px;
  word-break: break-all;
}

.qr-stage {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    repeating-conic-gradient(rgb(255 255 255 / 0.025) 0% 25%, transparent 0% 50%) 0 0 /
      18px 18px,
    #0a0f17;
}

.qr-stage img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

.qr-placeholder {
  display: grid;
  gap: 8px;
  justify-items: center;
  color: var(--faint);
  text-align: center;
}

.qr-placeholder span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 17px;
  letter-spacing: 0.12em;
}

.qr-placeholder p {
  font-size: 12px;
}

.withdraw-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
}

.withdraw-form {
  display: grid;
  gap: 12px;
  align-content: start;
}

.withdraw-history {
  min-width: 0;
}

.timeline-list {
  display: grid;
  gap: 2px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 26px;
  bottom: -10px;
  width: 1px;
  background: var(--line);
}

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

.timeline-dot {
  width: 9px;
  height: 9px;
  margin: 7px 0 0 4px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 4px rgb(255 255 255 / 0.03);
}

.timeline-dot.tone-positive {
  background: var(--positive);
}

.timeline-dot.tone-warning {
  background: var(--warning);
}

.timeline-dot.tone-danger {
  background: var(--danger);
}

.timeline-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

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

.timeline-head strong {
  font-family: var(--font-mono);
  font-size: 14px;
}

.timeline-body p {
  color: var(--faint);
  font-size: 11.5px;
}

/* ---------------- 管理台：提现与任务 ---------------- */

.admin-withdraw-list {
  display: grid;
  gap: 10px;
}

.admin-withdraw-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(10 16 24 / 0.7);
}

.admin-withdraw-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-withdraw-summary strong {
  font-size: 13.5px;
}

.admin-withdraw-summary p {
  margin-top: 3px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

.withdraw-amount {
  display: flex;
  align-items: center;
  gap: 10px;
}

.withdraw-amount strong {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text);
}

.admin-withdraw-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.admin-withdraw-controls .inline-field {
  flex: 0 0 150px;
}

.admin-withdraw-controls .grow-field {
  flex: 1 1 200px;
}

.job-list {
  display: grid;
  gap: 8px;
}

.job-item {
  display: grid;
  gap: 3px;
  padding: 10px 13px;
  border-left: 2px solid rgb(45 212 191 / 0.4);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgb(10 16 24 / 0.6);
}

.job-item strong {
  font-size: 12.5px;
  color: var(--text-soft);
}

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

.job-item small {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

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

.app-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  overflow: auto;
}

.app-dialog::backdrop {
  background: rgb(4 7 11 / 0.72);
  backdrop-filter: blur(4px);
}

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 22px 24px 24px;
  margin: 0;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

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

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}

.dialog-context {
  color: var(--muted);
  font-size: 12.5px;
}

.secret-card > p {
  color: var(--muted);
  font-size: 12.5px;
}

.secret-value {
  display: block;
  padding: 12px 14px;
  border: 1px solid rgb(45 212 191 / 0.35);
  border-radius: 10px;
  background: rgb(45 212 191 / 0.07);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  word-break: break-all;
  user-select: all;
}

/* ---------------- 提示条 ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 60;
  max-width: min(440px, calc(100vw - 32px));
  padding: 11px 18px;
  transform: translateX(-50%);
  border: 1px solid rgb(45 212 191 / 0.4);
  border-radius: 999px;
  background: rgb(16 23 34 / 0.96);
  color: var(--text);
  font-size: 13px;
  text-align: center;
  box-shadow: var(--shadow-pop);
  animation: toast-in 0.22s ease-out;
}

.toast.is-error {
  border-color: rgb(248 113 113 / 0.5);
  color: #fecaca;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ---------------- 登录页 ---------------- */

.login-page {
  padding: 32px 16px 56px;
}

.login-stage {
  width: min(100%, 1080px);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.intro-points {
  display: grid;
  gap: 9px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.intro-points li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.intro-points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgb(45 212 191 / 0.12);
}

.intro-points strong {
  color: var(--text-soft);
  font-weight: 600;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(8 12 18 / 0.7);
}

.auth-tab {
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.auth-tab.is-active {
  background: var(--panel-3);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgb(45 212 191 / 0.3);
}

.auth-tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.register-result {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgb(45 212 191 / 0.35);
  border-radius: var(--radius);
  background: rgb(45 212 191 / 0.06);
}

.register-result-title {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.register-actions {
  display: flex;
  gap: 10px;
}

.register-actions .button {
  flex: 1;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  cursor: pointer;
}

.checkbox-field input {
  margin-top: 3px;
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.login-brief {
  display: grid;
  gap: 16px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-elevated) 100%);
  box-shadow: var(--shadow-panel);
}

.brief-heading h2 {
  margin-bottom: 4px;
}

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

.brief-card {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(10 16 24 / 0.6);
}

.brief-card h3 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
}

.brief-card p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.brief-tag {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
}

.calculator {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid rgb(45 212 191 / 0.25);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 160% at 0% 0%, rgb(45 212 191 / 0.1), transparent 60%),
    rgb(10 16 24 / 0.7);
}

.calculator-copy h3 {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 14px;
}

.calculator-copy p {
  color: var(--muted);
  font-size: 12.5px;
}

.calculator-copy strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
}

.calculator-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.calculator-form .inline-field {
  min-width: 110px;
}

.estimate-result {
  min-width: 140px;
  padding: 9px 14px;
  border: 1px solid rgb(45 212 191 / 0.4);
  border-radius: 10px;
  background: rgb(45 212 191 / 0.1);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 620;
  text-align: right;
  white-space: nowrap;
}

.login-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11.5px;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-elevated) 100%);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.login-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 52px 46px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(120% 110% at 0% 0%, rgb(45 212 191 / 0.16), transparent 60%),
    radial-gradient(120% 120% at 100% 100%, rgb(56 189 248 / 0.12), transparent 62%);
}

.login-intro h1 {
  font-size: clamp(30px, 3.6vw, 42px);
  letter-spacing: 0.02em;
}

.login-lead {
  max-width: 30ch;
  color: var(--muted);
  font-size: 14px;
}

.ledger-mark {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 10px;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
}

.ledger-mark span {
  position: relative;
  padding: 0 14px;
  border-left: 1px solid var(--line-strong);
}

.ledger-mark span:first-child {
  padding-left: 0;
  border-left: 0;
}

.login-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 52px 44px;
}

.card-heading h2 {
  margin-bottom: 6px;
  font-size: 20px;
}

.card-heading p {
  color: var(--muted);
  font-size: 13px;
}

.login-footnote {
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.7;
}

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

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

  .panel-wide {
    grid-column: span 1;
  }

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

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

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

  .login-intro {
    padding: 36px 30px 28px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .login-card {
    padding: 30px;
  }

  .login-lead {
    max-width: none;
  }

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

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

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

  .calculator-form {
    justify-content: space-between;
  }

  .page-heading {
    align-items: flex-start;
  }

  .seal {
    display: none;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 10px 14px;
  }

  .identity {
    max-width: 150px;
  }

  .page-frame {
    width: calc(100% - 24px);
    padding: 22px 0 56px;
  }

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

  .panel {
    padding: 16px 15px 18px;
    border-radius: var(--radius);
  }

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

  .admin-form-grid .checkbox-field {
    grid-column: span 1;
  }

  .login-brief {
    padding: 18px 16px;
  }

  .register-actions {
    flex-direction: column;
  }

  .estimate-result {
    width: 100%;
    text-align: center;
  }

  .dialog-card {
    padding: 18px 16px 20px;
  }

  .login-page {
    padding: 14px;
  }

  .login-intro {
    padding: 28px 22px 22px;
  }

  .login-card {
    padding: 24px 22px;
  }

  .toast {
    bottom: 16px;
  }
}

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