:root {
  --canvas: #f5f5f1;
  --surface: #fff;
  --sidebar: #102e29;
  --primary: #28584d;
  --text: #243a32;
  --muted: #65736c;
  --border: #dfe5df;
  --brass: #a48c50;
  --success: #2d6b4f;
  --warning: #855f1c;
  --error: #a13e3b;
  --info: #385d78;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--canvas);
  font-synthesis: none;
}
:lang(zh-CN) {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brass); }
button {
  cursor: pointer;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  background: var(--surface);
  color: var(--primary);
  font-weight: 500;
}
button:hover { background: #eef3ee; border-color: #bccac0; }
button:disabled { opacity: .45; cursor: default; }
.primary { background: var(--primary); border-color: var(--primary); color: white; }
.primary:hover { background: #1d473e; color: white; }
.danger { color: var(--error); }
.quiet { border: 0; background: transparent; }
.icon { width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; }
.icon-button { display: inline-flex; align-items: center; gap: 8px; }
input, select, textarea {
  width: 100%;
  min-height: 38px;
  background: white;
  border: 1px solid #cbd5cc;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
}
label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; font-weight: 600; line-height: 1.3; letter-spacing: -.025em; }
h2 { font-size: 16px; font-weight: 600; line-height: 1.4; }
h3 { font-size: 14px; font-weight: 600; }
p { color: var(--muted); }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--sidebar);
  color: #b9cdc2;
  padding: 28px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.brand { font-size: 25px; font-weight: 600; line-height: 1.2; letter-spacing: .025em; color: #fff; padding: 0 12px; }
.brand small { display: block; font-size: 10px; letter-spacing: .12em; font-weight: 400; color: #a8bfb2; margin-top: 9px; }
.brand::before { content: ""; display: block; width: 28px; height: 2px; background: var(--brass); margin-bottom: 14px; }
.nav-toggle { display: none; }
.nav { display: grid; gap: 4px; }
.nav button { display: flex; gap: 10px; align-items: center; min-height: 44px; width: 100%; padding: 10px 12px; background: transparent; color: #b9cdc2; border: 1px solid transparent; text-align: left; font-size: 13px; font-weight: 400; }
.nav button.active { background: #24483e; color: #fff; border-left: 2px solid var(--brass); padding-left: 11px; }
.nav button:hover { color: white; background: #1b3b33; }
.sidebar footer { margin-top: auto; padding: 0 12px; color: #9db6a8; font-size: 11px; line-height: 1.8; }
.game-signature { display: block; color: #c5b57d; margin-bottom: 6px; letter-spacing: .03em; }
.main { min-width: 0; }
.top { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 32px; border-bottom: 1px solid var(--border); background: white; }
.top-context { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.account { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 12px; }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.content { padding: 28px 32px 40px; max-width: 1600px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 24px; }
.page-heading p { margin-top: 6px; font-size: 12px; }
.panel, .card, .hero { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.panel { margin-bottom: 24px; padding: 20px; min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.panel.flush .panel-head { padding: 18px 20px 0; }
.panel-head p { margin-top: 4px; font-size: 12px; }
.panel-head button { flex-shrink: 0; }
.hero-grid .panel { margin-bottom: 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); gap: 24px; margin-bottom: 24px; }
.hero { padding: 24px; position: relative; border-top: 2px solid var(--brass); }
.hero-label { font-size: 13px; color: var(--muted); }
.hero-money, .amount { font-variant-numeric: tabular-nums; font-size: 32px; font-weight: 600; letter-spacing: -.035em; line-height: 1.25; }
.hero-money { margin: 12px 0 10px; }
.hero-money span, .amount span { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.hero p { font-size: 12px; max-width: 480px; }
.hero-bottom { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #edf0ea; }
.hero-bottom .amount { font-size: 20px; margin-top: 4px; }
.balance-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.balance-summary > div { padding: 20px; }
.balance-summary > div + div { border-left: 1px solid var(--border); }
.balance-summary .amount { font-size: 24px; margin: 12px 0 8px; }
.identity-strip { display: flex; gap: 24px; padding: 16px 20px; border-top: 1px solid var(--border); grid-column: 1 / -1; }
.identity-strip strong { display: block; margin-top: 4px; color: var(--text); font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.card { padding: 18px 20px; text-align: left; }
.card .amount { display: block; margin-top: 10px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; color: var(--muted); font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid .panel { margin-bottom: 0; }
.invite-bar { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 24px; }
.invite-main { min-width: 0; flex: 1; }
.invite-main p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; font-size: 12px; }
.invite-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--primary); letter-spacing: .035em; }
.policy-note { margin-top: 24px; display: flex; align-items: start; gap: 10px; font-size: 12px; color: var(--muted); }
.policy-note .icon { width: 16px; height: 16px; flex-basis: 16px; margin-top: 2px; color: var(--brass); }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 4px; padding: 3px 7px; font-size: 11px; font-weight: 500; color: #64736a; background: #f0f2ee; white-space: nowrap; }
.badge::before { content: ""; height: 5px; width: 5px; border-radius: 50%; background: currentColor; }
.badge.success { color: var(--success); background: #eaf3ec; }
.badge.warning, .badge.test { color: var(--warning); background: #faf1dd; }
.badge.error { color: var(--error); background: #faeae7; }
.badge.info { color: var(--info); background: #eaf0f5; }
.table-wrap { overflow: auto; max-height: 65vh; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
th { position: sticky; top: 0; z-index: 1; background: #f8f9f6; font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
td { height: 48px; min-width: 84px; padding: 12px 16px; border-bottom: 1px solid #edf0e9; vertical-align: middle; white-space: nowrap; }
td button { min-width: 60px; white-space: nowrap; }
.table-date { display: inline-block; min-width: 104px; max-width: 140px; white-space: normal; word-break: keep-all; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fcfdf9; }
th.numeric, td.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-title { display: block; font-weight: 500; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 6px; justify-content: end; white-space: nowrap; }
.actions button { min-height: 32px; padding: 5px 8px; font-size: 12px; }
.form { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.form label { min-width: 150px; flex: 1; }
.form.vertical { display: grid; gap: 16px; }
.form.vertical label { min-width: 0; }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.filters .form { flex: 1; }
.filters .form label { flex: 0 1 210px; }
.filters .form button { height: 38px; }
.totals { display: flex; gap: 24px; padding: 12px 0 18px; font-variant-numeric: tabular-nums; font-size: 13px; }
.totals strong { color: var(--text); margin-left: 6px; font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.pager .actions { justify-content: end; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 32px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty > .icon { color: #8ba394; width: 26px; height: 26px; }
.empty p { max-width: 400px; font-size: 12px; }
.loading { display: grid; place-content: center; min-height: 240px; gap: 12px; color: var(--muted); text-align: center; }
.loading::before { content: ""; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; margin: auto; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading::before { animation: none; } }
.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(500px, 100vw); max-width: 100vw; height: 100%; max-height: 100%; border: 0; border-left: 1px solid var(--border); padding: 0; color: var(--text); background: var(--surface); box-shadow: -12px 0 40px #102e291a; }
.drawer::backdrop, .confirm::backdrop { background: #14271f50; }
.drawer-header { padding: 24px; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); }
.drawer-body { padding: 24px; overflow: auto; height: calc(100% - 83px); }
.drawer-confirm { padding: 24px; overflow: auto; height: calc(100% - 83px); }
.drawer-confirm > p { margin: 12px 0 24px; }
.drawer-confirm .actions { margin-top: 24px; }
.inline-notice { padding: 12px; margin-bottom: 20px; border: 1px solid #e5b8b0; border-radius: 6px; color: var(--error); background: #faeae7; }
.details { display: grid; grid-template-columns: 110px 1fr; gap: 12px 16px; margin: 0 0 24px; font-size: 13px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.drawer .form { margin-top: 24px; }
.drawer .form button { min-height: 40px; }
summary { cursor: pointer; color: var(--muted); font-size: 12px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f6f8f3; border-radius: 6px; padding: 12px; font-size: 11px; }
.confirm { border: 1px solid var(--border); border-radius: 10px; padding: 24px; max-width: 420px; width: calc(100% - 32px); color: var(--text); }
.confirm p { margin: 12px 0 20px; }
.confirm .actions { justify-content: end; }
.login-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 440px; min-height: 100vh; }
.login-brand { padding: 64px; background: var(--sidebar); color: #e2ece4; display: flex; flex-direction: column; justify-content: space-between; }
.login-brand .brand { padding: 0; }
.login-brand h1 { font-size: 40px; max-width: 480px; line-height: 1.2; font-weight: 500; }
.login-brand p { color: #a8bfb2; max-width: 460px; margin-top: 16px; }
.login-panel { padding: 40px; display: flex; flex-direction: column; justify-content: center; background: white; }
.login-panel h1 { margin-bottom: 10px; }
.login-panel .form { margin-top: 28px; }
.login-panel footer { margin-top: 32px; font-size: 12px; color: var(--muted); }
#notice { position: fixed; right: 24px; bottom: 24px; display: none; max-width: 430px; background: var(--sidebar); color: white; padding: 14px 18px; border-radius: 6px; z-index: 100; box-shadow: 0 8px 30px #102e2920; font-size: 13px; }
#notice.visible { display: block; }
#notice.error { background: var(--error); }
.spacer { margin-top: 24px; }
.stack { display: grid; gap: 16px; }
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; gap: 16px; }
  .content { padding: 24px; }
  .top { padding: 12px 24px; }
  .grid { gap: 16px; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { padding: 8px 16px; gap: 8px; }
  .brand-row { display: flex; align-items: center; justify-content: space-between; }
  .brand { padding: 0; font-size: 20px; }
  .nav-toggle { display: inline-flex; gap: 8px; align-items: center; color: white; background: transparent; border-color: #456258; }
  .nav-toggle:hover { color: white; background: #24483e; }
  .brand::before { display: none; }
  .brand small, .sidebar footer { display: none; }
  .nav { display: none; gap: 4px; }
  .menu-open .nav { display: grid; grid-template-columns: 1fr 1fr; padding: 4px 0; }
  .nav button { width: auto; min-height: 44px; padding: 8px 10px; }
  .nav .icon { width: 16px; height: 16px; flex-basis: 16px; }
  .nav button.active { border-left: 0; border-bottom: 2px solid var(--brass); padding-left: 10px; }
  .top { padding: 4px 16px; min-height: 44px; gap: 8px; }
  .top-context > span:first-child { display: none; }
  .account { gap: 8px; }
  .account-name { max-width: 105px; }
  .account button { white-space: nowrap; flex-shrink: 0; padding: 4px; }
  .content { padding: 24px 16px; }
  .page-heading { margin-bottom: 20px; }
  h1 { font-size: 24px; }
  .hero { padding: 20px; }
  .hero-money { font-size: 32px; overflow-wrap: anywhere; }
  .hero-bottom { align-items: start; flex-direction: column; gap: 12px; }
  .balance-summary > div { padding: 16px; }
  .balance-summary .amount { font-size: 22px; }
  .identity-strip { gap: 16px; flex-wrap: wrap; padding: 16px; }
  .cards { gap: 8px; }
  .card { padding: 14px 12px; }
  .card .amount { font-size: 26px; }
  .card-footer { font-size: 10px; }
  .card-footer .icon { display: none; }
  .grid { grid-template-columns: 1fr; }
  .panel { padding: 16px; margin-bottom: 20px; }
  .invite-bar { padding: 16px; gap: 12px; flex-wrap: wrap; }
  .invite-main { flex-basis: 60%; }
  .invite-bar .icon { display: none; }
  .filters { align-items: stretch; }
  .filters .form { flex-basis: 100%; }
  .filters .form label { flex: 1 1 130px; }
  button, .form button { min-height: 44px; }
  .totals { flex-wrap: wrap; gap: 8px 16px; }
  .table-wrap { max-height: none; }
  th, td { padding-left: 12px; padding-right: 12px; }
  .panel-head { gap: 8px; flex-wrap: wrap; }
  .panel-head > .actions { flex-basis: 100%; justify-content: flex-start; }
  .panel-head button { font-size: 12px; }
  .drawer-header, .drawer-body, .drawer-confirm { padding: 20px 16px; }
  .details { grid-template-columns: 100px 1fr; }
  .login-wrap { display: block; }
  .login-brand { min-height: 260px; padding: 32px 24px; }
  .login-brand h1 { font-size: 28px; margin-top: 32px; }
  .login-brand p { font-size: 13px; }
  .login-panel { padding: 32px 24px; }
  #notice { left: 16px; right: 16px; bottom: 16px; }
}

textarea { resize: vertical; min-height: 104px; font: inherit; }

.invite-qr { display: grid; justify-items: center; gap: 16px; }
.invite-qr canvas { max-width: 100%; height: auto; }
.team-search { margin-bottom: 16px; }
