*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body.adm {
  font-family: Arial, "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: #f4f4f4; color: #111; font-size: 13px; line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* ---------- login ---------- */
.adm-login { min-height: 100vh; display: grid; place-items: center; background: #111; }
.adm-login-box { width: min(380px, 100%); background: #fff; padding: 32px; }
.adm-logo { font-size: 24px; font-weight: 800; letter-spacing: -1px; }
.adm-logo span { font-size: 11px; font-weight: 700; letter-spacing: 2px; color: #999; margin-left: 4px; }
.adm-login-sub { font-size: 12px; color: #888; margin: 6px 0 22px; }
.adm-login form { display: grid; gap: 8px; }
.adm-login label { font-size: 12px; font-weight: 700; margin-top: 6px; }
.adm-login input {
  height: 40px; border: 1px solid #dcdcdc; padding: 0 12px; outline: 0; border-radius: 2px;
}
.adm-login input:focus { border-color: #000; }
.adm-btn {
  height: 38px; padding: 0 16px; border: 1px solid #d0d0d0; background: #fff; font-weight: 700;
  font-size: 12px; border-radius: 2px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.adm-btn:hover { border-color: #000; }
.adm-btn-dark { background: #000; color: #fff; border-color: #000; height: 44px; margin-top: 12px; }
.adm-btn-dark:hover { background: #222; }
.adm-btn-sm { height: 30px; padding: 0 10px; font-size: 11px; }
.adm-btn-warn { background: #fff4e5; border-color: #ffd9a8; color: #8a4b00; }
.adm-back { display: inline-block; margin-top: 18px; font-size: 12px; color: #777; text-decoration: underline; }

/* ---------- shell ---------- */
#shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.adm-side { background: #111; color: #fff; padding: 20px 0; display: flex; flex-direction: column; }
.adm-side .adm-logo { padding: 0 20px 20px; color: #fff; }
.adm-side .adm-logo span { color: #666; }
#nav { display: grid; gap: 2px; padding: 0 10px; }
#nav a { padding: 10px 12px; border-radius: 3px; font-size: 13px; color: #bbb; font-weight: 600; }
#nav a:hover { background: #1d1d1d; color: #fff; }
#nav a.on { background: #fff; color: #000; }
.adm-side-foot { margin-top: auto; padding: 18px 20px 0; display: grid; gap: 8px; font-size: 12px; color: #888; }
.adm-side-foot a { color: #ccc; }
.adm-side-foot button { text-align: left; color: #ccc; }
.adm-side-foot button:hover { color: #fff; text-decoration: underline; }

.adm-main { padding: 22px 26px 60px; min-width: 0; }
.adm-top { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.adm-top h1 { font-size: 20px; font-weight: 800; }
.adm-user { margin-left: auto; font-size: 12px; color: #888; }

/* ---------- kpi ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid #e6e6e6; padding: 16px; border-radius: 2px; }
.kpi span { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .6px; }
.kpi b { display: block; font-size: 24px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; }
.kpi.acc b { color: #fa6338; }

/* ---------- panels ---------- */
.panel { background: #fff; border: 1px solid #e6e6e6; border-radius: 2px; padding: 18px; }
.panel + .panel { margin-top: 14px; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.panel-head .sp { margin-left: auto; font-size: 12px; color: #888; }

/* ---------- bulk bar ---------- */
.bulk {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fffbea; border: 1px solid #ffe9a8; padding: 12px 14px; border-radius: 2px; margin-bottom: 14px;
}
.bulk b { font-size: 12px; }
.bulk select, .bulk input {
  height: 32px; border: 1px solid #ddd; padding: 0 8px; border-radius: 2px; background: #fff; font-size: 12px;
}
.bulk input[type=number] { width: 96px; }
.bulk .hint { font-size: 11px; color: #8a6d00; }

/* ---------- table ---------- */
.tbl-wrap { background: #fff; border: 1px solid #e6e6e6; border-radius: 2px; overflow: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 12px; }
table.t th {
  text-align: left; padding: 10px 10px; background: #fafafa; border-bottom: 1px solid #e6e6e6;
  font-weight: 700; color: #666; white-space: nowrap; font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
}
table.t td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr:hover td { background: #fcfcfc; }
table.t img { width: 42px; height: 54px; object-fit: cover; border-radius: 2px; display: block; }
.cell-title { max-width: 300px; }
.cell-title .t1 { font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cell-title .t2 { color: #999; font-size: 11px; margin-top: 2px; }
.pin {
  width: 86px; height: 32px; border: 1px solid #dcdcdc; padding: 0 8px; border-radius: 2px;
  font-weight: 800; font-size: 13px; text-align: right; background: #fff;
}
.pin:focus { border-color: #000; outline: 2px solid #f0f0f0; }
.pin.dirty { border-color: #fa6338; background: #fff8f5; }
.pin.flash { animation: flash .8s ease; }
@keyframes flash { 0% { background: #d8f5d8; } 100% { background: #fff; } }
.disc { font-weight: 800; color: #fa6338; }
.st { display: inline-block; padding: 1px 7px; border-radius: 2px; font-size: 11px; font-weight: 700; }
.st.on { background: #e8f5e9; color: #1a7f37; }
.st.off { background: #f0f0f0; color: #888; }
.row-acts { display: flex; gap: 6px; white-space: nowrap; }
.empty-row { text-align: center; color: #999; padding: 40px !important; }

/* ---------- modal ---------- */
#modal .mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 20px; z-index: 200;
}
#modal .box { width: min(600px, 100%); background: #fff; border-radius: 2px; padding: 22px; max-height: 90vh; overflow: auto; }
#modal h3 { font-size: 16px; margin-bottom: 16px; }
#modal .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#modal .f { display: grid; gap: 5px; margin-bottom: 12px; }
#modal .f label { font-size: 11px; font-weight: 700; color: #666; text-transform: uppercase; letter-spacing: .4px; }
#modal .f input, #modal .f select, #modal .f textarea {
  height: 38px; border: 1px solid #dcdcdc; padding: 0 10px; border-radius: 2px; outline: 0; background: #fff;
}
#modal .f textarea { height: auto; min-height: 70px; padding: 8px 10px; }
#modal .f input:focus { border-color: #000; }
#modal .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* ---------- toast ---------- */
#toast { position: fixed; top: 18px; right: 18px; z-index: 300; display: grid; gap: 8px; justify-items: end; }
.toast-item {
  background: #111; color: #fff; padding: 10px 16px; border-radius: 2px; font-size: 12px; font-weight: 600;
  animation: tin .18s ease;
}
.toast-item.err { background: #c81e1e; }
.toast-item.ok { background: #1a7f37; }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- misc ---------- */
.tagline { font-size: 11px; color: #999; }
.stat-list { display: grid; gap: 8px; font-size: 12px; }
.stat-line { display: flex; justify-content: space-between; border-bottom: 1px dashed #eee; padding-bottom: 6px; }
.delta-up { color: #c81e1e; font-weight: 700; }
.delta-dn { color: #1a7f37; font-weight: 700; }
code { background: #f4f4f4; padding: 1px 5px; border-radius: 2px; font-size: 11px; }

@media (max-width: 900px) {
  #shell { grid-template-columns: 1fr; }
  .adm-side { flex-direction: row; align-items: center; gap: 12px; padding: 10px; overflow-x: auto; }
  .adm-side .adm-logo { padding: 0 10px; font-size: 18px; }
  #nav { display: flex; }
  .adm-side-foot { display: none; }
  .adm-main { padding: 14px; }
  .cell-title { max-width: 160px; }
}

/* 钱包地址列 */
table.t td.wallet {
  font-family: Consolas, monospace; font-size: 11px; word-break: break-all;
  max-width: 260px; color: #333;
}
