:root {
  font-family: system-ui, -apple-system, sans-serif;
  color: #1b2928;
  background: #f4f6f4;
  font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; display: flex; }

/* ---------- 侧边栏 ---------- */
aside {
  width: 224px;
  background: #132e2b;
  color: #fff;
  min-height: 100vh;
  padding: 38px 20px;
  position: fixed;
  top: 0;
  bottom: 0;
}
.brand { font-size: 21px; font-weight: 750; letter-spacing: 2px; }

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 56px;
}
.navitem {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c2d8d1;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.navitem:hover { background: #1e3b36; filter: none; }
.navitem .navnum {
  font-size: 10px;
  letter-spacing: 1px;
  color: #7fa396;
  font-variant-numeric: tabular-nums;
  transition: color .15s ease;
}
.navitem.active { background: #284540; color: #fff; }
.navitem.active .navnum { color: #b8d7cd; }

.sidebottom {
  position: absolute;
  bottom: 30px;
  color: #a1bcb4;
  font-size: 11px;
  line-height: 2;
}

/* ---------- 主区域 ---------- */
main {
  margin-left: 224px;
  padding: 48px 5vw;
  max-width: 1500px;
  width: calc(100% - 224px);
}
.eyebrow { font-size: 11px; letter-spacing: 2px; color: #51776d; font-weight: 700; }
h1 { font-size: 34px; letter-spacing: -1px; margin: 14px 0; }
p { color: #65746f; line-height: 1.8; }

header { margin-bottom: 26px; position: relative; padding-right: 130px; }
header #logout { position: absolute; top: 2px; right: 0; margin: 0; }

/* 分栏：一次只显示一个板块 */
.view { display: none; }
.view.active { display: block; }

/* 移动端分栏条 */
.mobile-nav { display: none; }

.notice {
  background: #edf2df;
  color: #52612e;
  border: 1px solid #dce5c3;
  padding: 16px;
  border-radius: 9px;
  font-size: 13px;
  margin-bottom: 24px;
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 24px 0; }
.stats article { background: white; border: 1px solid #e0e6e1; border-radius: 12px; padding: 22px; }
.stats small { display: block; color: #77847e; }
.stats strong { display: block; font-size: 35px; margin: 13px 0 3px; font-weight: 600; }
.stats strong.words { font-size: 23px; }
.amber { color: #997229; }

.panel {
  background: white;
  border: 1px solid #e0e6e1;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 22px;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
h2 { font-size: 18px; margin: 0; }
.heading span, .hint { font-size: 12px; color: #7a8881; }

form { display: flex; align-items: flex-end; gap: 14px; }
label { display: block; font-size: 12px; color: #65746f; }
label.wide { flex: 1; }
input {
  display: block;
  border: 1px solid #d6dfd8;
  border-radius: 7px;
  background: #fbfcfa;
  padding: 12px;
  font: inherit;
  color: #203b31;
  min-width: 0;
}
label input, label select { margin-top: 8px; width: 100%; }
select {
  display: block;
  border: 1px solid #d6dfd8;
  border-radius: 7px;
  background: #fbfcfa;
  padding: 12px;
  font: inherit;
  color: #203b31;
}
#search { min-width: 240px; }
#faucet label { flex: 1; }

button {
  border: 0;
  background: #1b5848;
  color: white;
  padding: 12px 16px;
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}
button:hover { filter: brightness(.93); }
button.secondary {
  background: #edf2ee;
  color: #285443;
  margin-right: 8px;
  margin-bottom: 4px;
  font-size: 12px;
}

table { width: 100%; border-collapse: collapse; text-align: left; }
th { font-size: 11px; letter-spacing: 1px; color: #7b8982; padding: 14px 0; border-bottom: 1px solid #e9eeea; }
td { padding: 20px 0; border-bottom: 1px solid #edf1ee; }
td b { display: block; margin-bottom: 7px; }
code { font-size: 11px; color: #71817a; word-break: break-all; }
.green { color: #287653; }
.muted { color: #7b8982; }
#empty { text-align: center; padding: 28px; }
footer { color: #8a958f; font-size: 11px; margin-top: 24px; }

#message { color: #285443; font-size: 13px; min-height: 18px; margin-bottom: 14px; }

dialog {
  border: 1px solid #d5dfd8;
  border-radius: 14px;
  padding: 28px;
  max-width: 580px;
  width: 92%;
  box-shadow: 0 20px 100px #173d3533;
}
dialog::backdrop { background: #122b2877; }
textarea {
  width: 100%;
  height: 105px;
  resize: none;
  border: 1px solid #d5dfd8;
  border-radius: 8px;
  padding: 12px;
  margin: 18px 0;
  font-size: 13px;
}
.tablewrap { overflow: auto; }

/* ---------- 余额查询记录 ---------- */
:where(#balance-query-panel) .balance-query-filter { margin: 18px 0; }
:where(#balance-query-panel) .balance-query-table { min-width: 760px; }
:where(#balance-query-panel) th, :where(#balance-query-panel) td { padding-right: 18px; vertical-align: top; }
:where(#balance-query-panel) th:nth-child(1) { width: 160px; }
:where(#balance-query-panel) th:nth-child(2) { min-width: 240px; }
:where(#balance-query-panel) th:nth-child(3) { width: 70px; }
:where(#balance-query-panel) th:nth-child(4) { min-width: 150px; }
:where(#balance-query-panel) td small { display: block; margin-top: 6px; color: #7b8982; font-size: 11px; }
:where(#balance-query-panel) code { display: block; line-height: 1.6; }
:where(#balance-query-panel) button:disabled { opacity: .6; cursor: wait; }
.balance-query-warning { color: #98652b; }
#balance-query-empty { padding: 18px 0; text-align: center; }
#balance-query-status { overflow-wrap: anywhere; }

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  aside { display: none; }
  main { margin: 0; width: 100%; padding: 26px 18px; }
  form { flex-direction: column; align-items: stretch; }
  .stats { grid-template-columns: 1fr; gap: 10px; }
  .stats article { padding: 16px; }
  .stats strong { font-size: 28px; }
  .stats strong.words { font-size: 20px; }
  .heading { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 28px; }
  td { min-width: 120px; }
  header { padding-right: 0; }
  header #logout { position: static; margin: 0 0 14px; }

  .mobile-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 20px;
  }
  .mobile-nav button {
    flex: 0 0 auto;
    background: #e8eeea;
    color: #3c5b51;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 999px;
  }
  .mobile-nav button.active { background: #1b5848; color: #fff; }
  .mobile-nav button:hover { filter: none; }
  #search { min-width: 0; width: 100%; }
}
