/* AIOKY · 积分 · 与「负载机」控制台共用一套纸感版式 */
[hidden] { display: none !important; }

:root {
  --paper: #f4f1e8;
  --paper-2: #fbf8f1;
  --ink: #171814;
  --muted: #726e62;
  --faint: #938d7e;
  --line: #d5cebd;
  --line-soft: #e4ddce;
  --green: #194e3b;
  --green-soft: #dfe7dd;
  --orange: #c95e35;
  --red: #9e3c2f;
  --shadow: 0 18px 44px rgba(45, 40, 30, .08);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  background:
    radial-gradient(1100px 520px at 8% -10%, rgba(255, 255, 255, .8), transparent 62%),
    radial-gradient(900px 480px at 100% 0%, rgba(25, 78, 59, .05), transparent 58%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .3;
  background-image:
    linear-gradient(rgba(58, 49, 35, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 49, 35, .04) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px;
  mix-blend-mode: multiply;
  z-index: 0;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--orange); }
button, input, select, textarea { font: inherit; }

.shell {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.mono { font-family: var(--mono); }
.mono-sm { font-family: var(--mono); font-size: 12px; letter-spacing: -.01em; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── 顶栏 ─────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 241, 232, .9);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 62px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-family: var(--serif);
  font-size: 16px;
  background: var(--paper-2);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-family: var(--serif); font-size: 17px; letter-spacing: .04em; }
.brand-sub {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--faint);
}

.top-nav { display: flex; align-items: center; justify-content: flex-start; gap: 22px; flex-wrap: wrap; }
.nav-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 0 5px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
}
.nav-item:hover { color: var(--green); }
.nav-item.is-active { color: var(--ink); font-weight: 600; border-bottom-color: var(--green); }
.nav-no { font-family: var(--mono); font-size: 9px; color: #9a9588; letter-spacing: .06em; }
.nav-item.is-active .nav-no { color: var(--green); }

.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.nav-link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}
.nav-link:hover { color: var(--green); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-2);
}
.avatar {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #f6f3ea;
  font-family: var(--serif);
  font-size: 12px;
}
.user-chip .name { font-size: 12.5px; color: var(--ink); max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-button {
  border: 0;
  border-left: 1px solid var(--line-soft);
  padding: 2px 8px;
  background: transparent;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--muted);
  cursor: pointer;
}
.nav-button:hover { color: var(--orange); }

/* ── 页头 ─────────────────────────────────────────────── */
.console-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 46px 0 26px;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--faint);
}
.eyebrow span + span::before { content: "·"; margin-right: 10px; color: var(--line); }
.console-head h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.18;
  letter-spacing: -.01em;
}
.console-lede { margin: 0; max-width: 62ch; color: var(--muted); font-size: 13.5px; line-height: 1.85; }

/* ── 统计条 ───────────────────────────────────────────── */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}
.stat-strip > * {
  padding: 22px 24px 20px;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-strip > *:last-child { border-right: 0; }
.stat span, .stat-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
}
.stat b, .stat-value {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat small { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.stat.is-accent b { color: var(--green); }
.stat b.is-text { font-size: 19px; font-family: var(--sans); padding-top: 10px; }
.stat b.amount-debit, .stat .amount-debit { color: var(--red); }

/* ── 分区 ─────────────────────────────────────────────── */
.view { padding: 34px 0 6px; border-bottom: 1px solid var(--line-soft); }
.view:last-child { border-bottom: 0; }
.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.section-kicker {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--faint);
}
.view-head h2, .section-head h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(21px, 2.4vw, 26px);
  line-height: 1.3;
}
.view-head p, .section-head p { margin: 0; max-width: 66ch; font-size: 12.5px; color: var(--muted); line-height: 1.8; }

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

/* ── 控件 ─────────────────────────────────────────────── */
.field {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 12.5px;
  min-width: 140px;
  outline: none;
}
.field:focus { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
select.field { appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px; background-size: 5px 5px; background-repeat: no-repeat; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--green); color: var(--green); }
.btn.small { height: 28px; padding: 0 11px; font-size: 11.5px; font-family: var(--mono); letter-spacing: .04em; }
.btn.accent, .btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: #f7f4ec;
}
.btn.accent:hover, .btn.primary:hover { background: #123a2c; border-color: #123a2c; color: #f7f4ec; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(158, 60, 47, .4); color: var(--red); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── 面板 ─────────────────────────────────────────────── */
.panel {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
}
.login-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 34px 0 10px;
  padding: 26px 28px;
}
.login-panel h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; font-size: 22px; }
.login-panel p { margin: 0; max-width: 60ch; font-size: 12.5px; color: var(--muted); }
.panel-kicker { display: block; margin-bottom: 7px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em; color: var(--faint); }

.notice-line {
  margin-bottom: 16px;
  padding: 9px 12px;
  border-left: 2px solid var(--orange);
  background: rgba(201, 94, 53, .06);
  font-size: 12px;
  color: var(--muted);
}

.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border: 1px solid var(--line); background: var(--paper-2); }
.kv { padding: 14px 18px; border-right: 1px solid var(--line-soft); }
.kv:last-child { border-right: 0; }
.kv span { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.kv b { font-weight: 500; font-size: 13.5px; }
.kv b.is-text { font-weight: 500; }

/* ── 充值套餐 ─────────────────────────────────────────── */
.package-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.package {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-2);
  transition: border-color .15s, box-shadow .15s;
}
.package:hover { border-color: var(--green); box-shadow: var(--shadow); }
.package-name { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.package-points { font-family: var(--serif); font-size: 25px; line-height: 1.3; color: var(--green); }
.package-note { font-size: 11.5px; color: var(--muted); }
.package .btn { margin-top: 8px; align-self: flex-start; }

/* ── 表格 ─────────────────────────────────────────────── */
.table-wrap { border: 1px solid var(--line); border-radius: 2px; background: var(--paper-2); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .35);
  white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(25, 78, 59, .04); }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.tag.credit, .tag.ok { border-color: rgba(25, 78, 59, .35); background: var(--green-soft); color: var(--green); }
.tag.debit, .tag.bad { border-color: rgba(158, 60, 47, .35); background: rgba(158, 60, 47, .08); color: var(--red); }
.tag.hold, .tag.warn { border-color: rgba(201, 94, 53, .35); background: rgba(201, 94, 53, .08); color: var(--orange); }
.tag.info { border-color: rgba(25, 78, 59, .25); color: var(--green); }

.amount-credit { font-family: var(--mono); color: var(--green); font-variant-numeric: tabular-nums; }
.amount-debit { font-family: var(--mono); color: var(--red); font-variant-numeric: tabular-nums; }

.empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 44px 22px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, .3);
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}
.empty strong { font-family: var(--serif); font-weight: 400; font-size: 16px; color: var(--ink); }
.more-line { margin: 16px 0 0; text-align: center; }
.empty-note { margin: 0; padding: 20px 2px; color: var(--muted); font-size: 12.5px; }
#topupSection:not([hidden]) + .empty-note,
#holdsSection:not([hidden]) + .empty-note { display: none; }

/* ── 管理台 ───────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.stats .stat { padding: 20px 22px; border-right: 1px solid var(--line-soft); }
.stats .stat:last-child { border-right: 0; }
.stats .stat-value { font-family: var(--serif); font-size: 30px; font-variant-numeric: tabular-nums; line-height: 1.2; }

.tabs { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 6px 0 0; border-bottom: 1px solid var(--line); }
.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 6px 0 8px;
  background: transparent;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.tab:hover { color: var(--green); }
.tab.is-active { color: var(--ink); font-weight: 600; border-bottom-color: var(--green); }

.section, .view.section { padding: 30px 0 8px; border-bottom: 1px solid var(--line-soft); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}
.detail { border: 1px solid var(--line); background: var(--paper-2); padding: 20px 22px; }
.detail h3 { margin: 0 0 4px; font-family: var(--serif); font-weight: 400; font-size: 21px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(23, 24, 20, .45);
  z-index: 60;
}
.modal-backdrop.is-open { display: grid; }
.modal {
  width: min(520px, 100%);
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-2);
  box-shadow: 0 30px 70px rgba(23, 24, 20, .25);
}
.modal h3 { margin: 0 0 14px; font-family: var(--serif); font-weight: 400; font-size: 22px; }
.form-grid { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row label { font-size: 11.5px; color: var(--muted); }
.form-row .field { width: 100%; height: 34px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 14px);
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 2px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 80;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding: 18px 0 30px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}

@media (max-width: 980px) {
  .topbar-inner { grid-template-columns: 1fr; gap: 10px; padding: 10px 0; }
  .top-nav { justify-content: flex-start; gap: 18px; overflow-x: auto; }
  .top-actions { justify-content: flex-start; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip > *:nth-child(2n) { border-right: 0; }
  .stat-strip > * { border-bottom: 1px solid var(--line-soft); }
  .console-head { flex-direction: column; align-items: flex-start; gap: 18px; padding-top: 32px; }
  .view-head, .section-head { flex-direction: column; align-items: flex-start; }
  .login-panel { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 720px) {
  .shell { width: calc(100% - 28px); }
  .nav-no { display: none; }
  .stat-strip { grid-template-columns: 1fr; }
  .stat-strip > * { border-right: 0; }
  .kv { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .footer { flex-direction: column; gap: 6px; }
}

