/* 小积栈 — self-hosted membership & points console */
:root {
  --ink: #101418;
  --ink-2: #1a2128;
  --ink-3: #2a333c;
  --paper: #f4f2ea;
  --paper-2: #ebe8dd;
  --card: #fffdf8;
  --line: #dedacd;
  --line-strong: #c9c4b5;
  --muted: #74786f;
  --muted-2: #9a9d94;
  --lime: #c8f56a;
  --lime-deep: #9fd33d;
  --lime-soft: #effbd4;
  --sky: #b9dcff;
  --sky-soft: #e7f2ff;
  --violet: #d8caff;
  --violet-soft: #f0eaff;
  --rose: #ffd2c9;
  --rose-soft: #fff0ec;
  --danger: #c54d38;
  --danger-soft: #fdeae6;
  --success: #2d6d49;
  --success-soft: #e7f6ed;
  --warning: #8a5a12;
  --warning-soft: #fff4d8;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 20, 24, .04), 0 8px 24px rgba(16, 20, 24, .035);
  --shadow-lg: 0 24px 80px rgba(16, 20, 24, .16);
  --font: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Noto Serif SC", "Songti SC", Georgia, serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 540px at 82% -10%, rgba(200, 245, 106, .24), transparent 65%),
    radial-gradient(700px 420px at -10% 40%, rgba(185, 220, 255, .2), transparent 60%);
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
img, svg { display: block; }
::selection { background: var(--lime); color: var(--ink); }

:focus-visible {
  outline: 3px solid rgba(159, 211, 61, .55);
  outline-offset: 2px;
}

.boot-screen {
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}
.boot-mark { display: flex; gap: 6px; }
.boot-mark span {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  background: var(--ink);
  animation: bootPulse .9s ease-in-out infinite alternate;
}
.boot-mark span:nth-child(2) { background: var(--lime-deep); animation-delay: .15s; }
.boot-mark span:nth-child(3) { animation-delay: .3s; }
@keyframes bootPulse { from { transform: translateY(0); opacity: .45; } to { transform: translateY(-7px); opacity: 1; } }

/* ---------------------------------------------------------------- auth */
.auth-page {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr);
}
.auth-hero {
  position: relative;
  overflow: hidden;
  padding: 42px clamp(32px, 5vw, 78px) 46px;
  color: #f7f5ee;
  background:
    radial-gradient(620px 420px at 96% 4%, rgba(200, 245, 106, .17), transparent 64%),
    radial-gradient(520px 420px at 8% 94%, rgba(185, 220, 255, .12), transparent 60%),
    var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}
.auth-hero::after {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(247, 245, 238, .09);
  border-radius: 50%;
  right: -170px;
  bottom: -160px;
  box-shadow: 0 0 0 70px rgba(247, 245, 238, .025), 0 0 0 140px rgba(247, 245, 238, .02);
  pointer-events: none;
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--lime);
  color: var(--ink);
  box-shadow: inset 0 -3px 0 rgba(16, 20, 24, .16);
  flex: none;
}
.brand-mark svg { width: 25px; height: 25px; }
.brand-name { font-size: 18px; }
.brand-sub { display: block; font-size: 10px; letter-spacing: .18em; color: rgba(247, 245, 238, .5); font-weight: 500; margin-top: 1px; }
.auth-hero .brand { margin-bottom: clamp(40px, 7vh, 80px); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--lime);
  border-radius: 999px;
  padding: 7px 12px;
}
.auth-hero .eyebrow { color: var(--ink); margin-bottom: 24px; }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.auth-title {
  font-family: var(--serif);
  font-size: clamp(40px, 4vw, 58px);
  line-height: 1.12;
  letter-spacing: -.045em;
  font-weight: 500;
  max-width: 100%;
}
.auth-title em { font-style: normal; color: var(--lime); }
.auth-lead {
  margin-top: 22px;
  color: rgba(247, 245, 238, .64);
  max-width: 46ch;
  font-size: 15px;
  line-height: 1.8;
}
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.hero-chip {
  border: 1px solid rgba(247, 245, 238, .16);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  color: rgba(247, 245, 238, .72);
}
.hero-preview {
  margin-top: auto;
  padding-top: 42px;
  width: min(100%, 510px);
}
.preview-card {
  background: rgba(255, 253, 248, .06);
  border: 1px solid rgba(255, 253, 248, .14);
  border-radius: 24px;
  padding: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
  transform: rotate(-1.2deg);
}
.preview-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.preview-title { font-size: 12px; color: rgba(247, 245, 238, .5); letter-spacing: .1em; }
.preview-balance { font-family: var(--serif); font-size: 42px; letter-spacing: -.04em; line-height: 1; margin-top: 4px; }
.preview-balance small { font-family: var(--font); font-size: 12px; color: var(--lime); letter-spacing: .08em; }
.preview-chip { font-size: 10px; color: var(--ink); background: var(--lime); border-radius: 999px; padding: 5px 9px; font-weight: 700; white-space: nowrap; }
.preview-bars { display: flex; align-items: end; gap: 7px; height: 74px; margin-top: 18px; }
.preview-bars span { flex: 1; border-radius: 5px 5px 2px 2px; background: rgba(247, 245, 238, .16); }
.preview-bars span:nth-child(3n) { background: var(--lime); opacity: .9; }
.preview-foot { display: flex; justify-content: space-between; margin-top: 14px; color: rgba(247, 245, 238, .42); font-size: 10px; letter-spacing: .04em; }

.auth-panel {
  padding: 38px clamp(24px, 4vw, 68px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--paper);
  min-height: 100svh;
}
.auth-panel-top { position: absolute; top: 28px; right: 34px; font-size: 12px; color: var(--muted); }
.auth-box { width: min(100%, 410px); margin: 0 auto; }
.auth-mobile-brand { display: none; margin-bottom: 28px; }
.auth-kicker { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.auth-box h2 { font-family: var(--serif); font-size: 36px; letter-spacing: -.035em; font-weight: 500; margin-top: 8px; }
.auth-desc { color: var(--muted); margin-top: 8px; font-size: 14px; }
.auth-bonus {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 20px;
  padding: 12px 14px;
  background: var(--lime-soft);
  border: 1px solid #d9efa9;
  border-radius: 14px;
  font-size: 12px;
  color: #3d5113;
}
.auth-bonus strong { font-size: 15px; }
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 22px;
}
.tab {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.tab.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(16, 20, 24, .08); }
.field { display: grid; gap: 7px; margin-bottom: 15px; }
.field label { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.field .hint { font-size: 11px; color: var(--muted); font-weight: 400; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: rgba(255, 253, 248, .78);
  border-radius: 12px;
  padding: 12px 13px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.input::placeholder, .textarea::placeholder { color: #aaa99e; }
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--ink);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(16, 20, 24, .06);
}
.textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fffdf8; }
.btn-primary:hover { background: var(--ink-3); }
.btn-lime { background: var(--lime); color: var(--ink); border-color: #b4e553; }
.btn-lime:hover { background: #d4ff81; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: rgba(16, 20, 24, .04); }
.btn-soft { background: var(--paper-2); color: var(--ink); }
.btn-soft:hover { background: #e2dfd3; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #fbdcd5; }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-block { width: 100%; padding: 13px 18px; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-error { color: var(--danger); font-size: 12px; min-height: 18px; }
.auth-fine { color: var(--muted); font-size: 11px; text-align: center; margin-top: 16px; line-height: 1.7; }
.auth-support { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); text-align: center; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100svh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  background: var(--ink);
  color: #f7f5ee;
  padding: 26px 16px 18px;
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow-y: auto;
}
.sidebar .brand { padding: 0 8px 24px; }
.sidebar .brand-mark { width: 37px; height: 37px; border-radius: 11px; }
.sidebar .brand-sub { color: rgba(247, 245, 238, .38); }
.nav-section { margin-top: 14px; }
.nav-label { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: rgba(247, 245, 238, .32); padding: 0 12px 8px; font-weight: 650; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  color: rgba(247, 245, 238, .62);
  font-size: 13px;
  font-weight: 520;
  margin-bottom: 2px;
  transition: background .15s ease, color .15s ease;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .82; }
.nav-item:hover { background: rgba(247, 245, 238, .06); color: #fffdf8; }
.nav-item.active { background: var(--lime); color: var(--ink); font-weight: 650; }
.nav-item.active svg { opacity: 1; }
.nav-item .nav-badge { margin-left: auto; font-size: 10px; background: rgba(247, 245, 238, .12); border-radius: 999px; padding: 1px 7px; }
.nav-item.active .nav-badge { background: rgba(16, 20, 24, .14); }
.sidebar-grow { flex: 1; min-height: 28px; }
.sidebar-card {
  background: rgba(247, 245, 238, .055);
  border: 1px solid rgba(247, 245, 238, .09);
  border-radius: 15px;
  padding: 13px;
  margin: 12px 0;
  font-size: 11px;
  color: rgba(247, 245, 238, .55);
  line-height: 1.6;
}
.sidebar-card strong { display: block; color: rgba(247, 245, 238, .9); font-size: 12px; margin-bottom: 3px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 11px 8px 0; border-top: 1px solid rgba(247, 245, 238, .1); }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  background: var(--lime);
  flex: none;
}
.avatar.small { width: 28px; height: 28px; font-size: 10px; }
.sidebar-user-name { font-size: 12px; font-weight: 600; color: rgba(247, 245, 238, .9); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-role { font-size: 10px; color: rgba(247, 245, 238, .4); }
.sidebar-user .icon-btn { margin-left: auto; color: rgba(247, 245, 238, .58); background: rgba(247, 245, 238, .06); border-color: rgba(247, 245, 238, .12); }
.sidebar-user .icon-btn:hover { color: #fff; background: rgba(247, 245, 238, .12); }

.main { min-width: 0; padding: 0 clamp(18px, 3vw, 38px) 50px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 74px;
  padding: 13px 0;
  background: rgba(244, 242, 234, .86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 19px; letter-spacing: -.015em; line-height: 1.2; }
.topbar-title p { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.points-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px 7px 8px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.points-pill .coin { width: 19px; height: 19px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  display: inline-grid;
  place-items: center;
  color: var(--ink-2);
  transition: background .15s ease;
}
.icon-btn:hover { background: var(--paper-2); }
.icon-btn svg { width: 17px; height: 17px; }
.menu-btn { display: none; }
.page { max-width: 1280px; margin: 0 auto; padding-top: 24px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h2 { font-family: var(--serif); font-size: clamp(28px, 3vw, 40px); font-weight: 500; letter-spacing: -.035em; line-height: 1.1; }
.page-head p { color: var(--muted); margin-top: 7px; font-size: 13px; max-width: 62ch; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-head h3 { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.section-head p { font-size: 11px; color: var(--muted); margin-top: 2px; }
.section-link { font-size: 11px; font-weight: 650; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.section-link:hover { color: var(--ink); }

/* ---------------------------------------------------------------- common */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: clamp(18px, 2.4vw, 26px); }
.muted { color: var(--muted); }
.tiny { font-size: 11px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.w-full { width: 100%; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.divider { height: 1px; background: var(--line); border: 0; margin: 18px 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
}
.chip-lime { background: var(--lime-soft); color: #4c6514; }
.chip-sky { background: var(--sky-soft); color: #315b83; }
.chip-violet { background: var(--violet-soft); color: #5d4795; }
.chip-rose { background: var(--rose-soft); color: #984434; }
.chip-neutral { background: var(--paper-2); color: var(--muted); }
.chip-success { background: var(--success-soft); color: var(--success); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-warning { background: var(--warning-soft); color: var(--warning); }
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.empty { padding: 42px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--paper-2); display: grid; place-items: center; margin: 0 auto 12px; color: var(--muted); }
.empty-icon svg { width: 22px; height: 22px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 13px; font-size: 12px; line-height: 1.6; }
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.alert-info { background: var(--sky-soft); color: #2f5577; border: 1px solid #cfe5f9; }
.alert-warn { background: var(--warning-soft); color: #6f4a12; border: 1px solid #f3dfad; }
.alert-danger { background: var(--danger-soft); color: #8f3627; border: 1px solid #f4cec6; }
.alert-lime { background: var(--lime-soft); color: #405712; border: 1px solid #d9efa9; }

/* ---------------------------------------------------------------- dashboard */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.dash-grid > * { min-width: 0; }
.dash-main .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-grid.admin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.balance-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(460px 260px at 105% -8%, rgba(200, 245, 106, .25), transparent 60%),
    linear-gradient(140deg, #151b21, #101418 65%);
  color: #f7f5ee;
  padding: clamp(22px, 3vw, 32px);
  min-height: 218px;
  display: flex;
  flex-direction: column;
}
.balance-card::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -100px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(200, 245, 106, .22);
  border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(200, 245, 106, .035), 0 0 0 72px rgba(200, 245, 106, .025);
}
.balance-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; z-index: 1; }
.balance-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(247, 245, 238, .48); }
.balance-value { display: flex; align-items: baseline; gap: 9px; margin-top: 9px; position: relative; z-index: 1; }
.balance-value strong { font-family: var(--serif); font-size: clamp(48px, 6vw, 72px); line-height: .95; font-weight: 500; letter-spacing: -.055em; }
.balance-value span { color: var(--lime); font-size: 12px; font-weight: 650; letter-spacing: .06em; }
.balance-meta { display: flex; flex-wrap: wrap; gap: 16px; color: rgba(247, 245, 238, .58); font-size: 11px; margin-top: 15px; position: relative; z-index: 1; }
.balance-meta strong { color: rgba(247, 245, 238, .9); font-weight: 600; }
.balance-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 24px; position: relative; z-index: 1; }
.balance-actions .btn-ghost { color: #f7f5ee; border-color: rgba(247, 245, 238, .24); }
.balance-actions .btn-ghost:hover { background: rgba(247, 245, 238, .08); }
.balance-corner { position: absolute; right: 24px; top: 24px; color: var(--lime); opacity: .85; z-index: 1; }
.balance-corner svg { width: 27px; height: 27px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 15px 16px; box-shadow: var(--shadow-sm); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 11px; color: var(--muted); }
.stat-icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--paper-2); color: var(--ink-2); }
.stat-icon svg { width: 15px; height: 15px; }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.04em; margin-top: 6px; line-height: 1.1; }
.stat-value small { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.stat-hint { font-size: 10px; color: var(--muted-2); margin-top: 4px; }
.side-stack { display: flex; flex-direction: column; gap: 14px; }
.quick-tool { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.quick-tool-btn { width: 100%; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
.quick-tool-btn:hover { background: rgba(244, 242, 234, .5); }
.quick-tool:last-child { border-bottom: 0; padding-bottom: 0; }
.quick-tool:first-child { padding-top: 0; }
.tool-glyph { width: 38px; height: 38px; border-radius: 11px; background: var(--lime-soft); display: grid; place-items: center; font-weight: 750; font-size: 14px; flex: none; }
.tool-glyph.sky { background: var(--sky-soft); } .tool-glyph.violet { background: var(--violet-soft); } .tool-glyph.rose { background: var(--rose-soft); }
.quick-tool-main { min-width: 0; flex: 1; }
.quick-tool-name { display: block; font-size: 12px; font-weight: 650; }
.quick-tool-desc { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cost { font-size: 10px; color: var(--muted); white-space: nowrap; background: var(--paper-2); padding: 2px 6px; border-radius: 999px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; padding-bottom: 0; }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime-deep); margin-top: 6px; flex: none; }
.feed-dot.minus { background: var(--rose); }
.feed-main { flex: 1; min-width: 0; }
.feed-title { font-size: 11px; line-height: 1.45; }
.feed-time { font-size: 10px; color: var(--muted-2); margin-top: 2px; }
.feed-amount { font-size: 11px; font-weight: 700; white-space: nowrap; }
.feed-amount.plus { color: var(--success); }
.feed-amount.minus { color: var(--danger); }

.chart-card { padding: 18px 20px 14px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.chart-legend { display: flex; gap: 12px; font-size: 10px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; }
.chart { display: flex; align-items: end; gap: 5px; height: 136px; margin-top: 18px; padding-top: 8px; border-bottom: 1px solid var(--line); position: relative; }
.chart-col { flex: 1; height: 100%; display: flex; align-items: end; justify-content: center; gap: 2px; position: relative; min-width: 0; }
.chart-col .bar { width: min(9px, 40%); border-radius: 3px 3px 0 0; min-height: 2px; transition: height .4s ease; }
.chart-col .bar.credit { background: var(--lime); }
.chart-col .bar.debit { background: var(--ink-2); opacity: .82; }
.chart-col .bar.runs { background: var(--sky); }
.chart-col:hover .bar { filter: brightness(.9); }
.chart-labels { display: flex; gap: 5px; margin-top: 7px; }
.chart-labels span { flex: 1; text-align: center; font-size: 8px; color: var(--muted-2); min-width: 0; white-space: nowrap; }
.chart-labels span.hidden-label { color: transparent; }
.chart-empty { height: 136px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }

.announcement {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #e4dfc9;
  background: #fbf7e8;
  border-radius: 13px;
  font-size: 12px;
  color: #645c3d;
  margin-bottom: 18px;
}
.announcement svg { width: 16px; height: 16px; flex: none; }
.announcement .chip { margin-left: auto; flex: none; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: inherit; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th {
  text-align: left;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: rgba(244, 242, 234, .45);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(244, 242, 234, .38); }
.table .strong { font-weight: 650; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table .sub { color: var(--muted); font-size: 10px; margin-top: 2px; }
.table-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.table-toolbar .input, .table-toolbar .select { width: auto; min-width: 150px; padding: 8px 11px; font-size: 12px; border-radius: 9px; }
.table-toolbar .search { flex: 1; min-width: 180px; max-width: 320px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.pagination-actions { display: flex; gap: 6px; }
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-tab { border: 0; background: transparent; padding: 6px 11px; border-radius: 999px; font-size: 11px; color: var(--muted); font-weight: 600; }
.filter-tab:hover { background: var(--paper-2); }
.filter-tab.active { background: var(--ink); color: #fffdf8; }
.amount-pos { color: var(--success); font-weight: 700; }
.amount-neg { color: var(--danger); font-weight: 700; }
.user-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.user-cell .avatar { width: 30px; height: 30px; font-size: 10px; }
.user-cell-name { font-size: 12px; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-cell-email { font-size: 10px; color: var(--muted); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- plans */
.plans-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan-card { position: relative; display: flex; flex-direction: column; padding: 24px; overflow: hidden; }
.plan-card.featured { border-color: var(--ink); box-shadow: 0 16px 50px rgba(16, 20, 24, .1); }
.plan-card.featured::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--lime); }
.plan-badge { position: absolute; top: 18px; right: 18px; }
.plan-accent { width: 38px; height: 38px; border-radius: 11px; background: var(--lime-soft); display: grid; place-items: center; font-size: 16px; font-weight: 750; }
.plan-card[data-accent="sky"] .plan-accent { background: var(--sky-soft); }
.plan-card[data-accent="violet"] .plan-accent { background: var(--violet-soft); }
.plan-card[data-accent="rose"] .plan-accent { background: var(--rose-soft); }
.plan-name { font-size: 18px; font-weight: 700; margin-top: 18px; letter-spacing: -.02em; }
.plan-sub { font-size: 11px; color: var(--muted); min-height: 34px; margin-top: 4px; }
.plan-price { display: flex; align-items: baseline; gap: 3px; margin-top: 16px; }
.plan-price .currency { font-size: 15px; font-weight: 650; }
.plan-price strong { font-family: var(--serif); font-size: 43px; line-height: 1; font-weight: 500; letter-spacing: -.04em; }
.plan-price .period { color: var(--muted); font-size: 11px; margin-left: 4px; }
.plan-points { margin-top: 14px; padding: 11px 12px; background: var(--paper); border-radius: 10px; font-size: 12px; }
.plan-points strong { font-size: 18px; letter-spacing: -.02em; }
.plan-points .bonus { color: var(--success); font-size: 10px; margin-left: 4px; }
.plan-features { list-style: none; padding: 0; margin: 16px 0 20px; font-size: 11px; color: var(--muted); display: grid; gap: 7px; }
.plan-features li { display: flex; gap: 7px; align-items: flex-start; }
.plan-features svg { width: 13px; height: 13px; color: var(--success); flex: none; margin-top: 1px; }
.plan-card .btn { margin-top: auto; }
.redeem-card { display: flex; align-items: center; gap: 22px; margin-top: 20px; padding: 20px 24px; }
.redeem-card .redeem-text { flex: 1; }
.redeem-card h3 { font-size: 14px; }
.redeem-card p { font-size: 11px; color: var(--muted); margin-top: 3px; }
.redeem-form { display: flex; gap: 7px; width: min(100%, 380px); }
.redeem-form .input { text-transform: uppercase; letter-spacing: .08em; font-family: var(--mono); font-size: 12px; }

/* ---------------------------------------------------------------- tools */
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tool-card { display: flex; flex-direction: column; padding: 18px; min-height: 170px; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(16, 20, 24, .07); border-color: var(--line-strong); }
.tool-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.tool-card .tool-glyph { width: 44px; height: 44px; border-radius: 13px; font-size: 15px; }
.tool-card h3 { font-size: 14px; margin-top: 14px; }
.tool-card p { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.6; flex: 1; }
.tool-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.tool-category { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.tool-cost { font-size: 10px; color: var(--muted); }
.tool-cost strong { color: var(--ink); }
.tool-result { margin-top: 14px; background: var(--ink); color: #e8efe0; border-radius: 12px; padding: 14px; font-family: var(--mono); font-size: 11px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; }
.tool-form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.tool-form-row > * { flex: 1; min-width: 120px; }
.checkline { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.checkline input { accent-color: var(--ink); width: 15px; height: 15px; }
.copy-row { display: flex; gap: 6px; align-items: center; }
.copy-row .input { flex: 1; font-family: var(--mono); font-size: 11px; }

/* ---------------------------------------------------------------- API */
.api-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 18px; }
.code-block { background: var(--ink); color: #dce7d0; border-radius: 13px; padding: 15px 17px; font-family: var(--mono); font-size: 10.5px; line-height: 1.8; overflow-x: auto; position: relative; }
.code-block .comment { color: #7f8d76; }
.code-block .key { color: var(--lime); }
.code-block .str { color: #ffd8a8; }
.code-label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; font-weight: 650; }
.key-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.key-row:last-child { border-bottom: 0; }
.key-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--paper-2); display: grid; place-items: center; flex: none; }
.key-icon svg { width: 16px; height: 16px; }
.key-main { flex: 1; min-width: 0; }
.key-name { font-size: 12px; font-weight: 650; }
.key-meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.key-prefix { font-family: var(--mono); font-size: 10px; background: var(--paper-2); padding: 2px 6px; border-radius: 5px; }
.secret-reveal { background: var(--lime-soft); border: 1px solid #d9efa9; border-radius: 13px; padding: 15px; margin-top: 14px; }
.secret-reveal p { font-size: 11px; color: #4e631d; margin-bottom: 8px; }

/* ---------------------------------------------------------------- admin */
.admin-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; background: rgba(200, 245, 106, .14); color: var(--lime); border-radius: 999px; padding: 3px 7px; margin-left: 8px; vertical-align: 2px; }
.admin-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; background: var(--ink); color: rgba(247, 245, 238, .72); border-radius: 13px; margin-bottom: 18px; font-size: 11px; }
.admin-banner strong { color: #fff; }
.admin-banner .chip { background: rgba(200, 245, 106, .14); color: var(--lime); }
.admin-metric { padding: 17px 18px; }
.admin-metric .stat-value { font-size: 27px; }
.admin-metric .trend { font-size: 10px; color: var(--success); margin-top: 2px; }
.recent-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 16px; }
.activity-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-main { flex: 1; min-width: 0; }
.activity-title { font-size: 11px; }
.activity-sub { font-size: 9px; color: var(--muted-2); margin-top: 1px; }
.activity-amount { font-size: 11px; font-weight: 700; white-space: nowrap; }
.tool-rank { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.rank-num { font-family: var(--serif); font-size: 18px; color: var(--muted-2); width: 20px; }
.rank-bar { height: 5px; border-radius: 99px; background: var(--paper-2); flex: 1; overflow: hidden; }
.rank-bar span { display: block; height: 100%; border-radius: inherit; background: var(--lime-deep); }
.rank-value { font-size: 10px; color: var(--muted); white-space: nowrap; }
.settings-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 92px; }
.settings-nav button { text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 9px; font-size: 12px; color: var(--muted); }
.settings-nav button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 650; }
.settings-section { display: none; }
.settings-section.active { display: block; }
.setting-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 300px); gap: 22px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row h4 { font-size: 13px; }
.setting-row p { font-size: 11px; color: var(--muted); margin-top: 2px; max-width: 48ch; }
.setting-row .input, .setting-row .select { font-size: 12px; padding: 9px 11px; }
.switch { position: relative; display: inline-flex; align-items: center; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 99px; transition: background .15s ease; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .15s ease; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--lime); }

/* ---------------------------------------------------------------- modal */
#modal-root, .modal-root { position: fixed; inset: 0; z-index: 300; display: none; }
#modal-root.open, .modal-root.open { display: block; }
/* 背景层可滚动：弹窗比视口高时，整页还能上下拖，不会把顶部/底部裁掉 */
.modal-backdrop {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(16, 20, 24, .48);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .15s ease;
}
.modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(540px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s cubic-bezier(.2, .8, .2, 1);
}
.modal.wide { width: min(820px, 100%); }
.modal.xwide { width: min(1020px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 16px; padding: 22px 24px 0; flex: none; }
.modal-head h3 { font-family: var(--serif); font-size: 24px; font-weight: 500; letter-spacing: -.03em; line-height: 1.2; }
.modal-head p { font-size: 11px; color: var(--muted); margin-top: 3px; }
.modal-close { margin-left: auto; flex: none; }
.modal-body { padding: 20px 24px 24px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 24px 24px; flex: none; }
.modal-foot.spread { justify-content: space-between; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }

/* ---------------------------------------------------------------- toast */
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 400; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
body.modal-open .toast-root { top: 18px; bottom: auto; }
.toast {
  pointer-events: auto;
  background: var(--ink);
  color: #f7f5ee;
  border-radius: 12px;
  padding: 11px 15px;
  font-size: 12px;
  box-shadow: 0 14px 40px rgba(16, 20, 24, .24);
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 360px;
  animation: toastIn .22s ease;
}
.toast.error { background: #7e2c20; }
.toast.success { background: #1f4d34; }
.toast svg { width: 15px; height: 15px; flex: none; }
.toast.out { animation: toastOut .2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------------- misc */
.loading-block { padding: 50px; display: grid; place-items: center; color: var(--muted); font-size: 12px; gap: 12px; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
.error-page { min-height: 60svh; display: grid; place-content: center; text-align: center; gap: 10px; }
.error-page .code { font-family: var(--serif); font-size: 72px; line-height: 1; letter-spacing: -.05em; }
.page-foot { margin-top: 42px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; font-size: 10px; color: var(--muted-2); }
.shell-overlay { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mobile-only { display: none; }
.hidden { display: none !important; }

@media (max-width: 1120px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .side-stack { display: grid; grid-template-columns: 1fr 1fr; }
  .plans-grid { gap: 12px; }
  .plan-card { padding: 20px; }
  .api-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .recent-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 262px; transform: translateX(-104%); transition: transform .22s ease; box-shadow: 20px 0 60px rgba(16, 20, 24, .25); }
  .shell.nav-open .sidebar { transform: translateX(0); }
  .shell.nav-open .shell-overlay { display: block; position: fixed; inset: 0; background: rgba(16,20,24,.42); z-index: 35; backdrop-filter: blur(2px); }
  .menu-btn { display: inline-grid; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { min-height: 100svh; padding-top: 76px; }
  .auth-mobile-brand { display: inline-flex; }
  .auth-panel-top { top: 22px; right: 22px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .stat-grid.admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans-grid { grid-template-columns: 1fr; max-width: 520px; }
  .plan-sub { min-height: 0; }
  .redeem-card { flex-direction: column; align-items: flex-start; }
  .redeem-form { width: 100%; }
  .mobile-only { display: initial; }
}

@media (max-width: 700px) {
  body { font-size: 14px; }
  .main { padding: 0 14px 36px; }
  .topbar { min-height: 66px; padding: 10px 0; }
  .topbar-title h1 { font-size: 17px; }
  .topbar-title p { display: none; }
  .topbar-actions .points-pill { display: none; }
  .page { padding-top: 18px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; }
  .side-stack { grid-template-columns: 1fr; }
  .stat-grid { gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 21px; }
  .balance-card { min-height: 196px; border-radius: 22px; }
  .balance-value strong { font-size: 52px; }
  .balance-actions { padding-top: 20px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 0; }
  .redeem-card { padding: 16px; }
  .redeem-form { flex-direction: column; }
  .table th, .table td { padding: 10px 11px; }
  .table-toolbar { padding: 11px; }
  .table-toolbar .search { max-width: none; }
  .pagination { padding: 10px 11px; flex-wrap: wrap; }
  .modal-backdrop { padding: 10px; align-items: flex-end; }
  .modal {
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
  }
  .modal-head { padding: 18px 18px 0; }
  .modal-body { padding: 16px 18px 18px; }
  .modal-foot { padding: 0 18px calc(18px + env(safe-area-inset-bottom)); }
  body.modal-open .toast-root { top: 12px; left: 12px; right: 12px; bottom: auto; }
  .modal-foot .btn { flex: 1; }
  .chart { height: 112px; }
  .chart-labels span:nth-child(even) { color: transparent; }
  .setting-row { grid-template-columns: 1fr; gap: 8px; }
  .page-foot { flex-direction: column; gap: 6px; }
  .toast-root { right: 12px; left: 12px; bottom: 12px; }
  .toast { max-width: none; }
  .admin-banner { flex-direction: column; align-items: flex-start; }
  .secret-reveal .copy-row { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------ landing / auth modal */
:root {
  --red: #e63946;
  --red-deep: #c02b38;
}
.btn-red {
  background: var(--red);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(230, 57, 70, .22);
}
.btn-red:hover { background: var(--red-deep); }
.btn-xl { padding: 16px 30px; font-size: 15px; border-radius: 16px; }

.landing {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(18px, 4vw, 56px) 40px;
}
.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
}
.landing-brand .brand-sub { color: var(--muted); }
.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(28px, 6vh, 70px) 0;
}
.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
}
.landing-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.landing-title {
  font-family: var(--serif);
  font-size: clamp(34px, 6vw, 66px);
  line-height: 1.08;
  letter-spacing: -.03em;
  font-weight: 500;
  margin: 26px 0 0;
}
.landing-title em { font-style: normal; color: var(--red); }
.landing-lead {
  max-width: 48ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(14px, 1.5vw, 16px);
  line-height: 1.75;
}
.landing-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: clamp(26px, 4vh, 40px);
}
.landing-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}
.landing-chips span {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 12px;
}
.landing-note { margin-top: 22px; color: var(--muted); font-size: 12px; }
.landing-note a { color: var(--red); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }

.auth-modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 18px; }
.auth-backdrop { position: absolute; inset: 0; background: rgba(16, 20, 24, .52); backdrop-filter: blur(3px); }
.auth-dialog {
  position: relative;
  width: min(100%, 440px);
  max-height: 92svh;
  overflow: auto;
  background: var(--card);
  border-radius: 24px;
  padding: clamp(26px, 4vw, 38px);
  box-shadow: var(--shadow-lg);
}
.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.auth-close:hover { background: var(--paper-2); color: var(--ink); }
.auth-dialog .auth-box { width: 100%; }
.auth-dialog .auth-bonus { margin-top: 18px; }

@media (max-width: 640px) {
  .landing-title { font-size: 40px; }
  .landing-actions { width: 100%; }
  .landing-actions .btn { width: 100%; }
}

/* ------------------------------------------------------- dashboard launchers */
.action-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  min-height: 170px;
  padding: 26px 28px;
  border: 0;
  border-radius: var(--radius-xl);
  text-align: left;
  color: #fff;
  background: linear-gradient(135deg, #ef4b58, #c02b38);
  box-shadow: 0 18px 44px rgba(230, 57, 70, .22);
  transition: transform .15s ease, box-shadow .15s ease;
}
.action-card:hover { transform: translateY(-2px); box-shadow: 0 22px 50px rgba(230, 57, 70, .28); }
.action-card-dark { background: linear-gradient(135deg, #2a333c, #101418); box-shadow: 0 18px 44px rgba(16, 20, 24, .2); }
.action-card-dark:hover { box-shadow: 0 22px 50px rgba(16, 20, 24, .26); }
.action-card .action-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .16);
  margin-bottom: 6px;
}
.action-card .action-title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.action-card .action-desc { font-size: 12px; color: rgba(255, 255, 255, .74); }

@media (max-width: 700px) {
  .action-duo { grid-template-columns: 1fr; }
  .action-card { min-height: 132px; padding: 20px 22px; }
  .topbar-actions .btn { padding: 6px 9px; font-size: 11px; }
}

/* --------------------------------------------------------- video job panel */
.video-job { margin-top: 14px; }
.video-progress {
  height: 10px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
}
.video-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), var(--lime-deep));
  transition: width .4s ease;
}

/* ------------------------------------------------- 一人付扫码支付 */
.opc-qr-box { margin: 16px auto 2px; max-width: 260px; text-align: center; }
.opc-qr {
  display: block;
  width: 216px;
  height: 216px;
  margin: 0 auto 8px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(16, 20, 24, .06);
}
@media (max-width: 760px) {
  .opc-qr { width: 176px; height: 176px; }
}
