/* 运营台沿用发行铸造厂的暗色铸造车间语汇，所有状态都用颜色和文字双重表达。 */
.admin-page { background: radial-gradient(circle at 82% -10%, rgba(200,242,75,.08), transparent 33rem), var(--ink); }
.admin-masthead { position: relative; }
.admin-header-actions { display: flex; align-items: center; gap: 25px; }
.admin-signal-status { gap: 12px; }
.admin-back { color: var(--muted); border-bottom: 1px solid #55594a; padding-bottom: 3px; font: 700 10px/1 "Courier New", monospace; text-decoration: none; letter-spacing: .08em; }
.admin-back:hover, .admin-back:focus-visible { color: var(--acid); border-color: var(--acid); }
.ghost-button { min-height: 34px; padding: 7px 11px; color: var(--muted); border: 1px solid var(--line); background: transparent; font: 700 10px/1 "Courier New", monospace; }
.ghost-button:hover, .ghost-button:focus-visible { color: var(--paper); border-color: var(--amber); }

.admin-main { width: min(1480px, 92vw); margin-bottom: 100px; }
.admin-hero { display: grid; grid-template-columns: minmax(330px, 1fr) auto minmax(250px, .72fr); gap: clamp(28px, 5vw, 78px); align-items: end; min-height: 270px; padding: 54px 0 40px; border-bottom: 1px solid var(--line); }
.admin-hero h2 { margin: 17px 0 0; font: 800 clamp(40px, 5.4vw, 72px)/1.03 "Songti SC", "SimSun", serif; letter-spacing: -.06em; }
.admin-hero h2 em { color: var(--acid); font-style: normal; }
.admin-hero > p { max-width: 330px; margin: 0; padding-left: 18px; border-left: 4px solid var(--ember); color: #c2c0b5; font-size: 13px; line-height: 1.9; }
.hero-stamp { display: grid; place-items: center; gap: 5px; width: 128px; height: 128px; padding: 17px 10px; color: var(--ink); border: 1px solid var(--acid); outline: 1px solid rgba(200,242,75,.34); outline-offset: 4px; background: var(--acid); transform: rotate(3deg); text-align: center; }
.hero-stamp span, .hero-stamp small { font: 700 9px/1.3 "Courier New", monospace; letter-spacing: .12em; }
.hero-stamp strong { font: 900 29px/.9 "Courier New", monospace; letter-spacing: -.08em; }
.hero-stamp small { letter-spacing: .04em; }

.admin-login { max-width: 820px; margin: 34px auto 0; padding: 26px 30px; border: 1px solid var(--amber); background: linear-gradient(110deg, rgba(238,189,74,.11), rgba(33,29,19,.94)); }
.admin-login > p { margin: 17px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.admin-section-title { display: flex; align-items: center; gap: 12px; }
.admin-section-title h3 { margin: 4px 0 0; color: var(--paper); font: 800 20px/1 "Songti SC", "SimSun", serif; letter-spacing: .08em; }
.micro-label { color: var(--acid); font: 700 9px/1 "Courier New", monospace; letter-spacing: .16em; }
.admin-login-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 15px; }
.admin-login-form label, .settings-form label, .source-admin-form label { color: var(--muted); }
.admin-login-form input { min-height: 47px; border-color: rgba(238,189,74,.42); }
.admin-login-form .button { min-height: 47px; }
.admin-error { min-height: 16px; color: var(--danger) !important; }

.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 34px 0 13px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.admin-toolbar strong { display: block; margin-top: 5px; color: var(--paper); font: 700 11px/1 "Courier New", monospace; }
.toolbar-actions { display: flex; align-items: center; gap: 13px; }
.api-status { color: var(--muted); font: 700 10px/1 "Courier New", monospace; letter-spacing: .08em; }
.api-status.ok { color: var(--acid); }
.api-status.bad { color: var(--danger); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.metric-card { min-height: 142px; display: grid; align-content: space-between; gap: 9px; padding: 19px 20px; background: var(--panel); border-top: 3px solid var(--line); }
.metric-card > span { color: var(--muted); font: 700 9px/1 "Courier New", monospace; letter-spacing: .1em; }
.metric-card strong { color: var(--paper); font: 800 clamp(27px, 3.1vw, 42px)/1 "Courier New", monospace; letter-spacing: -.06em; }
.metric-card small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.metric-success { border-top-color: var(--acid); }
.metric-success strong { color: var(--acid); }
.metric-unsettled { border-top-color: var(--ember); }
.metric-unsettled strong { color: #ff9a75; }
.metric-settled { border-top-color: var(--amber); }
.metric-settled strong { color: var(--amber); }
.metric-quota { border-top-color: #89916c; }

.admin-grid { display: grid; grid-template-columns: minmax(300px, .84fr) minmax(480px, 1.16fr); gap: 1px; margin-top: 1px; background: var(--line); border: 1px solid var(--line); border-top: 0; }
.admin-panel { min-width: 0; padding: 25px; background: var(--panel); }
.panel-heading { align-items: flex-start; }
.panel-note { min-height: 0; margin-bottom: 20px; }
.settings-panel { background: linear-gradient(135deg, rgba(200,242,75,.035), transparent 42%), var(--panel); }
.settings-form { gap: 16px; }
.settings-form > label { gap: 8px; }
.settings-form input[type=number] { font: 700 13px/1 "Courier New", monospace; }
.quota-toggle { display: flex !important; align-items: center; justify-content: space-between; gap: 15px; padding-bottom: 14px; border-bottom: 1px dashed #45483c; }
.toggle-control { display: inline-flex; align-items: center; gap: 8px; color: var(--paper); font: 700 10px/1 "Courier New", monospace; }
.toggle-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-control b { display: inline-flex; align-items: center; min-height: 31px; padding: 0 10px; border: 1px solid #5b604e; color: var(--muted); font-weight: 700; cursor: pointer; }
.toggle-control b::before { content: "OFF"; margin-right: 7px; color: var(--ember); }
.toggle-control input:checked + b { color: var(--ink); border-color: var(--acid); background: var(--acid); }
.toggle-control input:checked + b::before { content: "ON"; color: var(--ink); }
.quota-toggle:has(input:checked) + label { opacity: .45; }
.quota-toggle:has(input:checked) + label input { pointer-events: none; }
.money-input { display: flex; align-items: center; border: 1px solid var(--line); background: #10110f; }
.money-input:focus-within { border-color: var(--acid); box-shadow: 0 0 0 3px rgba(200,242,75,.09); }
.money-input span { padding-left: 12px; color: var(--amber); font: 700 14px/1 "Courier New", monospace; }
.money-input input { min-height: 43px; border: 0; background: transparent; box-shadow: none !important; }
.settings-actions, .source-upload-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 8px; }
.form-hint { min-height: 16px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.form-hint.ok { color: var(--acid); }
.form-hint.error { color: var(--danger); }

.sources-admin-panel { background: linear-gradient(135deg, rgba(238,189,74,.035), transparent 44%), var(--panel); }
.source-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.source-admin-form { gap: 14px; padding: 15px; border: 1px solid var(--line); background: #141611; }
.admin-file-field b { min-height: 43px; }
.source-upload-actions { padding-top: 0; }
.source-upload-actions .button { flex: 0 0 auto; }
.upload-progress { width: 100%; }
.source-list { display: grid; gap: 8px; margin-top: 17px; }
.source-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 13px; border-left: 3px solid var(--acid); background: var(--panel-2); }
.source-row.archived { border-left-color: var(--line); opacity: .7; }
.source-row-main { min-width: 0; display: grid; gap: 5px; }
.source-row-title { overflow: hidden; color: var(--paper); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.source-row-meta { color: var(--muted); font: 10px/1.4 "Courier New", monospace; }
.source-row-side { display: flex; align-items: center; gap: 9px; }
.source-status { color: var(--acid); font: 700 9px/1 "Courier New", monospace; white-space: nowrap; }
.source-status.archived { color: var(--muted); }
.source-action { color: var(--muted); border: 1px solid var(--line); background: transparent; padding: 6px 8px; font-size: 10px; cursor: pointer; }
.source-action:hover, .source-action:focus-visible { color: var(--danger); border-color: var(--danger); }
.source-action.publish:hover, .source-action.publish:focus-visible { color: var(--acid); border-color: var(--acid); }

.ledger-panel { margin-top: 30px; padding: 25px; background: linear-gradient(135deg, rgba(255,117,71,.035), transparent 40%), var(--panel); }
.ledger-heading { margin-bottom: 12px; }
.ledger-tools { display: flex; align-items: center; gap: 10px; }
.ledger-filter select { min-height: 34px; padding: 7px 9px; font-size: 10px; }
.tiny-button { min-height: 34px; padding: 7px 10px; color: var(--muted); border: 1px solid var(--line); background: transparent; font: 700 10px/1 "Courier New", monospace; }
.tiny-button:hover, .tiny-button:focus-visible { color: var(--acid); border-color: var(--acid); }
.settlement-bar { display: flex; align-items: center; justify-content: space-between; gap: 17px; margin: 18px 0 15px; padding: 12px 14px; border: 1px solid rgba(255,117,71,.38); background: rgba(255,117,71,.065); }
.settlement-bar > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 10px; }
.settlement-bar strong { color: var(--ember); font: 800 20px/1 "Courier New", monospace; }
.settlement-bar b { margin-left: 7px; color: var(--paper); font: 700 12px/1 "Courier New", monospace; }
.settlement-bar .button { min-height: 38px; padding: 8px 13px; }
.settlement-bar .button small { display: block; margin-top: 3px; }
.ledger-table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.ledger-table { width: 100%; min-width: 800px; border-collapse: collapse; text-align: left; }
.ledger-table th { padding: 12px 11px; color: var(--muted); border-bottom: 1px solid var(--line); background: #131510; font: 700 9px/1 "Courier New", monospace; letter-spacing: .08em; white-space: nowrap; }
.ledger-table td { padding: 12px 11px; color: #c8c7bd; border-bottom: 1px solid rgba(58,61,51,.66); font-size: 11px; vertical-align: middle; }
.ledger-table tr:last-child td { border-bottom: 0; }
.ledger-table tr:hover td { background: rgba(200,242,75,.035); }
.check-column { width: 36px; text-align: center !important; }
.ledger-check { width: 16px; min-height: 16px; padding: 0; accent-color: var(--acid); }
.ledger-job { display: grid; gap: 4px; min-width: 150px; }
.ledger-job strong { color: var(--paper); font-size: 11px; }
.ledger-job code, .ledger-source, .ledger-time, .ledger-batch { color: var(--muted); font: 10px/1.35 "Courier New", monospace; }
.ledger-status { display: inline-flex; align-items: center; gap: 5px; color: var(--amber); font: 700 9px/1 "Courier New", monospace; white-space: nowrap; }
.ledger-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ledger-status.success { color: var(--acid); }
.ledger-status.failed { color: var(--danger); }
.ledger-status.running { color: var(--amber); }
.ledger-status.settled { color: #9bd7ff; }
.ledger-amount { color: var(--paper); font: 700 11px/1 "Courier New", monospace; white-space: nowrap; }
.ledger-amount.muted { color: var(--muted); }
.admin-empty { min-height: 60px; display: grid; place-items: center; padding: 18px; color: var(--muted); font-size: 11px; text-align: center; }
.ledger-table .admin-empty { height: 120px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1050px) {
  .admin-hero { grid-template-columns: minmax(300px, 1fr) auto; }
  .admin-hero > p { grid-column: 1 / -1; max-width: 560px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .admin-masthead { position: static; align-items: flex-start; gap: 18px; }
  .admin-header-actions { flex-wrap: wrap; justify-content: flex-end; gap: 10px 13px; }
  .admin-signal-status > div { display: none; }
  .admin-back { order: 3; }
  .admin-main { width: 92vw; }
  .admin-hero { grid-template-columns: 1fr auto; gap: 24px; min-height: 0; padding: 43px 0 33px; }
  .admin-hero h2 { font-size: 43px; }
  .hero-stamp { width: 98px; height: 98px; padding: 12px 7px; }
  .hero-stamp strong { font-size: 23px; }
  .hero-stamp small { font-size: 7px; }
  .admin-hero > p { grid-column: 1 / -1; font-size: 12px; }
  .admin-login { padding: 22px 18px; }
  .admin-login-form { grid-template-columns: 1fr; }
  .admin-login-form .button { width: 100%; }
  .admin-toolbar { align-items: flex-start; }
  .admin-grid { margin-top: 1px; }
  .admin-panel, .ledger-panel { padding: 20px 16px; }
  .ledger-heading { align-items: flex-start; flex-direction: column; }
  .ledger-tools { width: 100%; justify-content: space-between; }
  .settlement-bar { align-items: stretch; flex-direction: column; }
  .settlement-bar .button { width: 100%; }
}
@media (max-width: 470px) {
  .admin-masthead { padding: 15px 4vw; }
  .brand { gap: 9px; }
  .brand-mark { width: 39px; height: 39px; font-size: 16px; }
  .brand p { font-size: 8px; }
  .brand h1 { font-size: 18px; letter-spacing: .08em; }
  .admin-header-actions { gap: 8px; }
  .admin-hero { grid-template-columns: 1fr; }
  .hero-stamp { justify-self: start; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 118px; padding: 14px 12px; }
  .metric-card strong { font-size: 26px; }
  .source-form-row { grid-template-columns: 1fr; }
  .source-upload-actions { align-items: stretch; flex-direction: column; }
  .source-upload-actions .button { width: 100%; }
  .ledger-tools { align-items: stretch; flex-direction: column; }
  .ledger-filter, .ledger-filter select, .tiny-button { width: 100%; }
}
