/* =========================================================
   画室课时管家 · Visual system
   Paper, ink, terracotta and sage.
   ========================================================= */
:root {
  --ink: #18211e;
  --ink-2: #24312c;
  --ink-3: #33443d;
  --paper: #f4f1e8;
  --paper-deep: #ece7da;
  --surface: #fffdf8;
  --surface-soft: #fbf8f0;
  --line: #e4ded0;
  --line-strong: #d6cebc;
  --muted: #7c7a70;
  --muted-2: #9b978b;
  --clay: #c96445;
  --clay-deep: #a74c32;
  --clay-soft: #f7e4dc;
  --sage: #6c8b78;
  --sage-soft: #e7efe8;
  --gold: #b99254;
  --gold-soft: #f4ead6;
  --red: #b44b42;
  --red-soft: #f8e5e2;
  --green: #4e7964;
  --green-soft: #e4efe8;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(37, 42, 35, 0.04);
  --shadow: 0 12px 40px rgba(39, 44, 36, 0.07);
  --shadow-lg: 0 30px 80px rgba(25, 33, 30, 0.18);
  --font-sans: "MiSans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  background:
    radial-gradient(circle at 82% 8%, rgba(201, 100, 69, 0.055), transparent 34rem),
    radial-gradient(circle at 20% 100%, rgba(108, 139, 120, 0.07), transparent 30rem),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-weight: 600; line-height: 1.25; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img, svg { display: block; }
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
::selection { background: rgba(201, 100, 69, 0.22); }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.paper-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.28;
  background-image: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(73, 68, 52, 0.016) 4px);
  mix-blend-mode: multiply;
}

/* --------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--ink);
  color: #fffdf8;
  box-shadow: 0 8px 22px rgba(24, 33, 30, 0.14);
}
.btn-primary:hover { background: #2b3a34; }
.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: var(--line-strong); background: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #9e3c34; }
.btn-danger-soft { background: #fff7f5; border-color: #eed2cc; color: var(--red); }
.btn-danger-soft:hover { background: var(--red-soft); border-color: #e3b9b2; }
.btn-soft { background: var(--clay-soft); color: var(--clay-deep); }
.btn-soft:hover { background: #f2d8cc; }
.btn-paper { background: var(--surface); color: var(--ink); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12); }
.btn-paper:hover { background: #fff; }
.btn-outline-light {
  color: #f8f3e7;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.045);
}
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.1); }
.btn-block { width: 100%; }
.btn-mini { min-height: 34px; padding: 0 12px; font-size: 12px; background: var(--surface); border-color: var(--line); }
.icon-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  transition: background 160ms ease, color 160ms ease;
}
.icon-button:hover { background: rgba(24, 33, 30, 0.06); color: var(--ink); }
.icon-button svg { width: 19px; height: 19px; }
.text-button, .text-link {
  border: 0;
  background: transparent;
  color: var(--clay-deep);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px;
}
.text-link { display: inline-flex; gap: 6px; align-items: center; }
.text-link span { transition: transform 160ms ease; }
.text-link:hover span { transform: translateX(3px); }
.text-button:hover, .text-link:hover { color: var(--clay); }

/* --------------------------------------------------------- shell */
.app-shell { min-height: 100vh; position: relative; z-index: 1; }
.sidebar {
  position: fixed;
  z-index: 30;
  inset: 18px auto 18px 18px;
  width: 236px;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 18px;
  border-radius: 26px;
  color: #eee9dd;
  background:
    radial-gradient(circle at 20% 0%, rgba(108, 139, 120, 0.24), transparent 20rem),
    radial-gradient(circle at 110% 90%, rgba(201, 100, 69, 0.16), transparent 18rem),
    var(--ink);
  box-shadow: 0 26px 60px rgba(24, 33, 30, 0.18);
}
.brand { display: flex; align-items: center; gap: 13px; padding: 3px 8px 0; }
.brand-mark {
  position: relative;
  width: 39px; height: 39px;
  flex: 0 0 39px;
  border-radius: 50% 46% 52% 44%;
  background: var(--clay);
  box-shadow: inset -5px -6px 0 rgba(80, 30, 18, 0.15);
  transform: rotate(-8deg);
  overflow: hidden;
}
.brand-mark::before {
  content: "";
  position: absolute;
  width: 22px; height: 8px;
  left: 8px; top: 17px;
  border-radius: 100%;
  background: #f6ead8;
  transform: rotate(28deg);
  opacity: 0.92;
}
.brand-mark-dot {
  position: absolute;
  right: 7px; bottom: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 247, 231, 0.85);
}
.brand-mark.large { width: 46px; height: 46px; flex-basis: 46px; }
.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-en, .eyebrow {
  font-size: 9px;
  letter-spacing: 0.19em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}
.sidebar .brand-en { color: rgba(238, 233, 221, 0.46); font-size: 8px; letter-spacing: 0.16em; }
.brand-cn { font-family: var(--font-serif); font-size: 16px; letter-spacing: 0.04em; white-space: nowrap; }
.sidebar-label {
  margin: 45px 12px 11px;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: rgba(238, 233, 221, 0.34);
  font-weight: 700;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: rgba(238, 233, 221, 0.7);
  font-size: 13.5px;
  transition: background 160ms ease, color 160ms ease;
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.8; }
.nav-item:hover { background: rgba(255, 255, 255, 0.055); color: #fff; }
.nav-item.active { background: #f4efe3; color: var(--ink); font-weight: 600; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); }
.nav-item.active svg { opacity: 1; color: var(--clay-deep); }
.nav-dot {
  margin-left: auto;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #e4785a;
  box-shadow: 0 0 0 4px rgba(228, 120, 90, 0.13);
}
.sidebar-bottom { margin-top: auto; padding: 18px 8px 2px; }
.backup-note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 12px 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 12px;
}
.backup-note strong { display: block; font-size: 11px; color: rgba(255, 253, 246, 0.85); font-weight: 600; }
.backup-note span:not(.pulse-dot) { display: block; font-size: 9.5px; color: rgba(238, 233, 221, 0.42); margin-top: 2px; }
.pulse-dot {
  width: 6px; height: 6px;
  flex: 0 0 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: #8bb49a;
  box-shadow: 0 0 0 4px rgba(139, 180, 154, 0.1);
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 10px 3px;
  font-size: 11px;
  color: rgba(238, 233, 221, 0.45);
}
.sidebar-link:hover { color: #fff; }
.sidebar-link svg { width: 14px; height: 14px; }
.version { color: rgba(238, 233, 221, 0.26); font-size: 9px; padding: 14px 10px 0; letter-spacing: 0.03em; }
.sidebar-scrim { position: fixed; inset: 0; background: rgba(14, 20, 18, 0.5); z-index: 25; backdrop-filter: blur(3px); }

.main-shell { margin-left: 272px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 74px;
  padding: 0 38px 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(214, 206, 188, 0.6);
}
.topbar-context { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; letter-spacing: 0.02em; }
.context-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--sage); }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.topbar-link:hover { color: var(--ink); }
.topbar-link svg { width: 16px; height: 16px; }
.avatar {
  display: inline-flex;
  width: 33px; height: 33px;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--ink-2);
  color: #f8f2e5;
  font-family: var(--font-serif);
  font-size: 14px;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--line-strong);
}
.mobile-menu { display: none; margin-left: -8px; }
.content { width: 100%; max-width: 1500px; margin: 0 auto; padding: 34px 40px 64px; flex: 1; }
.site-footer {
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 40px 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  border-top: 1px solid rgba(214, 206, 188, 0.55);
}

/* --------------------------------------------------------- hero */
.hero {
  position: relative;
  min-height: 292px;
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.75fr);
  gap: 40px;
  align-items: center;
  overflow: hidden;
  color: #f7f2e7;
  background:
    radial-gradient(circle at 82% 20%, rgba(108, 139, 120, 0.2), transparent 22rem),
    radial-gradient(circle at 3% 100%, rgba(201, 100, 69, 0.22), transparent 24rem),
    var(--ink);
  box-shadow: 0 18px 50px rgba(24, 33, 30, 0.14);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.13;
  background-image: repeating-linear-gradient(115deg, transparent 0, transparent 6px, rgba(255,255,255,0.08) 7px);
  pointer-events: none;
}
.eyebrow.light { color: rgba(247, 242, 231, 0.52); }
.hero-copy { position: relative; z-index: 1; }
.hero h1 {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: clamp(31px, 3.4vw, 45px);
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.28;
}
.hero h1 em { font-style: normal; color: #e8a087; }
.hero-sub { margin-top: 14px; color: rgba(247, 242, 231, 0.58); font-size: 13px; letter-spacing: 0.02em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; position: relative; z-index: 2; }
.hero-side { position: relative; z-index: 2; align-self: end; padding-bottom: 6px; }
.hero-search {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 16px 17px 13px;
}
.hero-search > label { display: block; font-size: 10px; color: rgba(247, 242, 231, 0.48); margin-bottom: 9px; letter-spacing: 0.08em; }
.hero-search-row { display: flex; align-items: center; gap: 9px; }
.hero-search-row svg { width: 17px; height: 17px; flex: 0 0 17px; color: rgba(247, 242, 231, 0.48); }
.hero-search-row input {
  width: 100%; min-width: 0;
  border: 0; outline: none;
  background: transparent;
  color: #fffdf7;
  font-size: 13px;
}
.hero-search-row input::placeholder { color: rgba(247, 242, 231, 0.32); }
.hero-search-row button {
  width: 31px; height: 31px;
  flex: 0 0 31px;
  border: 0;
  border-radius: 50%;
  background: #f4efe3;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}
.hero-hint { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 10px; color: rgba(247, 242, 231, 0.38); }
.mini-dot { width: 5px; height: 5px; border-radius: 50%; background: #e8a087; }
.hero-brush {
  position: absolute;
  width: 260px; height: 260px;
  right: -70px; bottom: -160px;
  border-radius: 50%;
  border: 44px solid rgba(201, 100, 69, 0.22);
  filter: blur(2px);
  transform: rotate(-18deg);
  pointer-events: none;
}

/* --------------------------------------------------------- stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 168px;
  padding: 20px 20px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  overflow: hidden;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.stat-card.accent {
  background: linear-gradient(145deg, #fffaf3, #fdf0e9);
  border-color: #eed8cc;
}
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-icon { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 10px; }
.stat-icon svg { width: 17px; height: 17px; }
.stat-icon.sage { background: var(--sage-soft); color: var(--sage); }
.stat-icon.gold { background: var(--gold-soft); color: #9d7b43; }
.stat-icon.clay { background: var(--clay-soft); color: var(--clay-deep); }
.stat-icon.ink { background: #e9ece7; color: var(--ink-3); }
.stat-arrow { color: var(--muted-2); font-size: 13px; opacity: 0; transform: translate(-3px, 3px); transition: opacity 160ms ease, transform 160ms ease; }
.stat-card:hover .stat-arrow { opacity: 1; transform: translate(0, 0); }
.stat-label { margin-top: 19px; font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.stat-value { margin-top: 1px; font-family: var(--font-serif); font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.stat-note { margin-top: auto; padding-top: 9px; font-size: 10px; color: var(--muted-2); }

/* --------------------------------------------------------- panels */
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.8fr); gap: 16px; margin-top: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 23px 24px; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.panel-head h2 { margin-top: 5px; font-family: var(--font-serif); font-size: 20px; }
.panel-head.compact { margin-bottom: 6px; }
.panel-desc { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.round-link {
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.round-link:hover { background: var(--paper); color: var(--ink); }
.dashboard-side { display: flex; flex-direction: column; gap: 14px; }
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-height: 65px;
  padding: 10px 2px;
  border-top: 1px solid #eee9df;
}
.activity-item:first-child { border-top: 0; }
.activity-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 43px;
  background: var(--paper);
  border-radius: 10px;
  line-height: 1.2;
}
.activity-date strong { font-family: var(--font-serif); font-size: 16px; }
.activity-date span { font-size: 8px; color: var(--muted); letter-spacing: 0.05em; }
.activity-main { min-width: 0; }
.activity-main strong { display: block; font-size: 13px; font-weight: 600; }
.activity-main span { display: block; margin-top: 1px; font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hours-pill {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 28px;
  padding: 0 10px;
  border-radius: 99px;
  font-size: 12px !important;
  font-weight: 700;
  margin: 0 !important;
  white-space: nowrap;
}
.hours-pill.consume { color: var(--clay-deep); background: var(--clay-soft); }
.hours-pill.recharge { color: var(--green); background: var(--green-soft); }
.hours-pill.negative { color: #fff; background: var(--red); }
.warning-panel { padding-bottom: 18px; }
.warning-list { display: flex; flex-direction: column; margin: 0 0 14px; }
.warning-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px dashed #ebe5d8;
}
.warning-mini:first-child { border-top: 0; }
.warning-mini-person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.warning-avatar {
  width: 29px; height: 29px;
  flex: 0 0 29px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--font-serif);
  font-size: 12px;
  color: var(--ink-2);
}
.warning-mini-person div { min-width: 0; }
.warning-mini-person strong { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warning-mini-person span { font-size: 9px; color: var(--muted-2); }
.warning-mini-hours { font-size: 11px; font-weight: 700; color: var(--clay-deep); white-space: nowrap; }
.warning-mini-hours.debt { color: var(--red); }
.backup-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 18px;
}
.backup-icon {
  width: 35px; height: 35px; flex: 0 0 35px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--sage-soft);
  color: var(--sage);
}
.backup-icon svg { width: 17px; height: 17px; }
.backup-copy { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.backup-copy strong { font-size: 11.5px; }
.backup-copy span { font-size: 9.5px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shortcut-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding: 24px 27px;
  background: linear-gradient(110deg, #ece8db, #f3efe5);
  border: 1px solid #e1dacb;
  border-radius: var(--radius);
}
.shortcut-strip h2 { font-family: var(--font-serif); font-size: 19px; margin-top: 3px; }
.shortcut-links { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.shortcut-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.66);
  border: 1px solid rgba(214, 206, 188, 0.7);
  font-size: 11px;
  transition: background 160ms ease;
}
.shortcut-links a:hover { background: var(--surface); }
.shortcut-links span { color: var(--clay); font-size: 9px; font-weight: 700; }

/* --------------------------------------------------------- page head */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin: 8px 0 24px; }
.page-head h1 { font-family: var(--font-serif); font-size: clamp(29px, 3vw, 38px); margin-top: 8px; letter-spacing: 0.01em; }
.page-head p { margin-top: 8px; color: var(--muted); font-size: 12.5px; max-width: 670px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

/* --------------------------------------------------------- toolbar */
.toolbar-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.segmented { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--paper); }
.segment {
  border: 0;
  background: transparent;
  padding: 8px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.segment.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 5px rgba(30, 35, 29, 0.08); }
.segment-count { font-size: 9px; min-width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: rgba(24, 33, 30, 0.07); padding: 0 5px; }
.segment.active .segment-count { background: var(--clay-soft); color: var(--clay-deep); }
.search-box { position: relative; display: flex; align-items: center; width: 270px; max-width: 100%; }
.search-box svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted-2); pointer-events: none; }
.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  transition: border-color 160ms ease, background 160ms ease;
}
.search-box input:focus { border-color: var(--line-strong); background: var(--surface); }
.search-box input::placeholder { color: var(--muted-2); }
.search-box.slim { width: 100%; }
.search-box.slim input { height: 35px; background: var(--surface); border-color: var(--line); }
.toolbar-spacer { flex: 1; }
.list-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 4px 10px; }
.result-count { font-size: 11px; color: var(--muted); }
.subtle-tip { font-size: 10px; color: var(--muted-2); }

/* --------------------------------------------------------- tables */
.panel.table-panel { padding: 5px 0 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.data-table th {
  padding: 15px 18px 11px;
  text-align: left;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 14px 18px; border-bottom: 1px solid #f0ebe1; vertical-align: middle; font-size: 12.5px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 140ms ease; }
.data-table tbody tr.clickable:hover { background: #fbf8f1; cursor: pointer; }
.data-table .num { text-align: right; }
.data-table .actions-col { text-align: right; width: 178px; }
.data-table th.num { padding-right: 18px; }
.student-cell { display: flex; align-items: center; gap: 10px; }
.student-avatar {
  width: 33px; height: 33px;
  flex: 0 0 33px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
  border: 1px solid #e7e0d1;
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--ink-2);
}
.student-cell strong { display: block; font-weight: 600; font-size: 13px; }
.student-cell small { display: block; font-size: 9px; color: var(--muted-2); margin-top: 1px; }
.pinyin-tag { display: inline-flex; padding: 3px 7px; border-radius: 5px; background: var(--paper); color: var(--muted); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 10px; letter-spacing: 0.08em; }
.hours-number { font-family: var(--font-serif); font-size: 17px; font-weight: 600; }
.hours-number.negative { color: var(--red); }
.hours-number.zero { color: var(--gold); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.badge-active { background: var(--green-soft); color: var(--green); }
.badge-archived { background: #eeeae1; color: #8d897d; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-gold { background: var(--gold-soft); color: #96743b; }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; opacity: 0.65; transition: opacity 160ms ease; }
tr:hover .row-actions { opacity: 1; }
.row-action {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.row-action:hover { border-color: var(--line-strong); color: var(--ink); background: var(--surface-soft); }
.row-action.danger { color: var(--red); border-color: #efd6d1; background: #fffafa; }
.row-action.danger:hover { color: #96342c; border-color: #e3bcb5; background: var(--red-soft); }
.table-loading, .drawer-loading { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 11px; }
.spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid #e7e0d2;
  border-top-color: var(--clay);
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { padding: 55px 20px; text-align: center; color: var(--muted); }
.empty-state .empty-mark { width: 45px; height: 45px; border-radius: 50%; margin: 0 auto 12px; background: var(--paper); display: flex; align-items: center; justify-content: center; color: var(--muted-2); }
.empty-state strong { display: block; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.empty-state p { margin-top: 4px; font-size: 11px; color: var(--muted-2); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 13px; padding: 15px 18px; border-top: 1px solid #f0ebe1; }
.page-btn { border: 1px solid var(--line); background: var(--surface); padding: 7px 11px; border-radius: 8px; font-size: 10.5px; color: var(--muted); cursor: pointer; }
.page-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong); }
.page-btn:disabled { opacity: 0.4; cursor: default; }
.page-status { font-size: 10px; color: var(--muted-2); min-width: 66px; text-align: center; }
.skeleton-row {
  height: 50px;
  border-radius: 9px;
  margin: 7px 0;
  background: linear-gradient(90deg, #f5f1e8 25%, #fbf8f1 50%, #f5f1e8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* --------------------------------------------------------- filter / summary */
.filter-card {
  padding: 18px 20px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.filters { display: flex; align-items: flex-end; gap: 11px; flex-wrap: wrap; }
.filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 112px; }
.filter-field > span { font-size: 9.5px; color: var(--muted); letter-spacing: 0.04em; }
.filter-field.search-filter { flex: 1 1 210px; max-width: 300px; }
.filter-field.date-filter { min-width: 130px; flex: 0 1 140px; }
.filter-actions { display: flex; gap: 7px; margin-left: auto; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap svg { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--muted-2); pointer-events: none; }
.input-wrap .input { padding-left: 34px; }
.input {
  width: 100%;
  height: 39px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  font-size: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.input:focus { border-color: #bcae97; box-shadow: 0 0 0 3px rgba(201, 100, 69, 0.08); }
.input::placeholder { color: var(--muted-2); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 17px, calc(100% - 11px) 17px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; padding-right: 28px; }
.quick-ranges { display: flex; align-items: center; gap: 8px; padding-top: 10px; margin-top: 10px; border-top: 1px dashed #eee8dc; font-size: 9.5px; color: var(--muted-2); }
.quick-ranges button { border: 0; background: transparent; padding: 2px 3px; color: var(--muted); font-size: 9.5px; cursor: pointer; }
.quick-ranges button:hover { color: var(--clay); }
.summary-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.summary-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  font-size: 9.5px;
  color: var(--muted);
}
.summary-chip strong { color: var(--ink); font-size: 13px; font-family: var(--font-serif); font-weight: 600; }
.summary-chip.consume strong { color: var(--clay-deep); }
.summary-chip.recharge strong { color: var(--green); }
.summary-chip.note strong { font-family: var(--font-sans); font-size: 10px; color: var(--muted); }
.type-label { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; }
.type-label i { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.type-label.consume { color: var(--clay-deep); }
.type-label.consume i { background: var(--clay); }
.type-label.recharge { color: var(--green); }
.type-label.recharge i { background: var(--green); }
.remark-cell { max-width: 230px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--muted); }
.date-mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 10.5px; color: var(--muted); }

/* --------------------------------------------------------- modal / drawer */
dialog { padding: 0; border: 0; background: transparent; color: var(--ink); }
dialog::backdrop { background: rgba(16, 22, 19, 0.48); backdrop-filter: blur(5px); animation: fadeIn 160ms ease; }
dialog[open] { animation: dialogIn 180ms cubic-bezier(0.22, 1, 0.36, 1); }
.modal { width: min(480px, calc(100vw - 28px)); max-height: calc(100dvh - 32px); }
.modal-wide { width: min(920px, calc(100vw - 28px)); }
.modal-card {
  background: var(--surface);
  border-radius: 22px;
  padding: 28px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.modal-head h2 { margin-top: 5px; font-family: var(--font-serif); font-size: 24px; }
.modal-copy { font-size: 11.5px; color: var(--muted); margin: 10px 0 19px; line-height: 1.7; }
.modal-icon { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--red-soft); color: var(--red); font-family: var(--font-serif); font-size: 20px; margin-bottom: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 17px; border-top: 1px solid #eee8dc; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.field > span { font-size: 10.5px; color: var(--ink-2); font-weight: 600; }
.field > span b { color: var(--clay); font-weight: 600; }
.field small { font-size: 9.5px; color: var(--muted-2); }
.field .input { height: 43px; background: var(--surface-soft); }
.input-large { height: 54px !important; font-family: var(--font-serif); font-size: 24px !important; font-weight: 600; padding-left: 15px !important; }
.form-grid.two { display: grid; grid-template-columns: 1fr 1.25fr; gap: 12px; }
.form-preview { margin-top: 13px; padding: 10px 12px; border-radius: 8px; background: var(--sage-soft); font-size: 10.5px; color: var(--green); }
.form-alert { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: 8px; font-size: 11px; margin: 12px 0; }
.form-alert:empty { display: none; }
.quick-values { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.quick-values button {
  flex: 1;
  min-width: 38px;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.quick-values button:hover { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.student-inline { display: flex; align-items: center; gap: 10px; padding: 11px 13px; background: var(--paper); border-radius: 10px; }
.student-inline .student-avatar { width: 30px; height: 30px; flex-basis: 30px; background: var(--surface); }
.student-inline strong { font-size: 12.5px; }
.student-inline span { font-size: 10px; color: var(--muted); }

.danger-panel {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 14px;
  border-radius: 11px;
  background: var(--red-soft);
  border: 1px solid #efd0ca;
}
.danger-mark {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 16px;
}
.danger-panel strong { display: block; color: var(--red); font-size: 11.5px; }
.danger-panel p { margin-top: 2px; color: #8d544d; font-size: 10px; line-height: 1.6; }
.delete-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.delete-summary .student-avatar { width: 36px; height: 36px; flex-basis: 36px; background: var(--paper); }
.delete-summary-main { min-width: 0; }
.delete-summary-main strong { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.delete-summary-main > span { display: block; margin-top: 2px; font-size: 10px; color: var(--muted); }
.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 15px;
  padding: 11px 12px;
  border-radius: 9px;
  background: #fff8f5;
  color: #8d544d;
  font-size: 10.5px;
  line-height: 1.6;
  cursor: pointer;
}
.checkbox-line input {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  flex: 0 0 15px;
  accent-color: var(--red);
  cursor: pointer;
}
.delete-footnote { margin-top: 8px; font-size: 9.5px; color: var(--muted-2); }

.drawer {
  width: min(610px, 100vw);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  border-radius: 0;
  overflow: hidden;
}
.drawer-shell { height: 100%; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.drawer-top { display: flex; align-items: center; justify-content: space-between; padding: 20px 27px 10px; }
.drawer-content { overflow-y: auto; padding: 0 27px 32px; }
.drawer-profile { display: flex; align-items: center; gap: 15px; padding: 11px 0 21px; }
.profile-avatar {
  width: 62px; height: 62px; flex: 0 0 62px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
  border: 1px solid var(--line);
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--ink-2);
}
.profile-meta h2 { font-family: var(--font-serif); font-size: 27px; }
.profile-meta-row { display: flex; align-items: center; gap: 7px; margin-top: 5px; flex-wrap: wrap; }
.drawer-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric { background: var(--surface-soft); border: 1px solid #eee8dc; border-radius: 11px; padding: 11px 12px; }
.metric span { display: block; font-size: 9px; color: var(--muted); }
.metric strong { display: block; margin-top: 2px; font-family: var(--font-serif); font-size: 21px; font-weight: 600; }
.metric strong.negative { color: var(--red); }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 22px; }
.drawer-actions .btn { min-height: 36px; padding: 0 13px; font-size: 11px; }
.mini-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.mini-head h3 { font-family: var(--font-serif); font-size: 17px; }
.mini-head span { font-size: 9.5px; color: var(--muted-2); }
.history-list { display: flex; flex-direction: column; }
.history-item { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px dashed #ece6da; }
.history-main { display: flex; gap: 10px; align-items: flex-start; }
.history-date { min-width: 84px; font-size: 10.5px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.history-info strong { display: block; font-size: 11px; font-weight: 600; }
.history-info span { display: block; font-size: 9.5px; color: var(--muted-2); margin-top: 2px; }
.history-hours { font-weight: 700; font-size: 13px; white-space: nowrap; }
.history-hours.consume { color: var(--clay-deep); }
.history-hours.recharge { color: var(--green); }
.history-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding-top: 14px; }
.drawer-link-row { display: flex; justify-content: flex-end; padding-top: 12px; }
.history-empty { text-align: center; padding: 34px 10px; font-size: 11px; color: var(--muted-2); }
.drawer-tip { margin-top: 14px; background: var(--paper); border-radius: 9px; padding: 10px 12px; font-size: 9.5px; color: var(--muted); }

/* --------------------------------------------------------- batch */
.batch-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr); gap: 22px; }
.student-picker { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.picker-head { display: flex; gap: 10px; align-items: center; padding: 9px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.picker-head .text-button { white-space: nowrap; font-size: 10px; }
.picker-list { height: 395px; overflow-y: auto; padding: 5px; }
.picker-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 8px; cursor: pointer; }
.picker-item:hover { background: var(--surface-soft); }
.picker-item input { width: 15px; height: 15px; accent-color: var(--clay); flex: 0 0 15px; cursor: pointer; }
.picker-avatar { width: 27px; height: 27px; flex: 0 0 27px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--paper); font-family: var(--font-serif); font-size: 11px; }
.picker-info { flex: 1; min-width: 0; }
.picker-info strong { display: block; font-size: 11.5px; font-weight: 600; }
.picker-info span { display: block; font-size: 9px; color: var(--muted-2); }
.picker-hours { font-size: 10px; color: var(--muted); white-space: nowrap; }
.picker-hours.negative { color: var(--red); font-weight: 700; }
.batch-settings { display: flex; flex-direction: column; gap: 0; }
.selected-summary { padding: 8px 11px; margin-bottom: 2px; background: var(--clay-soft); color: var(--clay-deep); border-radius: 9px; font-size: 11px; }
.selected-summary strong { font-family: var(--font-serif); font-size: 18px; }
.batch-quick button { flex: 0 1 52px; }
.batch-result { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--green-soft); color: var(--green); font-size: 10.5px; line-height: 1.7; }
.batch-result.error { background: var(--red-soft); color: var(--red); }

/* --------------------------------------------------------- warnings page */
.threshold-card {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 24px 27px;
  background:
    radial-gradient(circle at 0% 0%, rgba(201, 100, 69, 0.09), transparent 18rem),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.threshold-copy { flex: 1 1 380px; }
.threshold-copy h2 { margin-top: 5px; font-family: var(--font-serif); font-size: 25px; }
.threshold-copy h2 span { color: var(--clay); }
.threshold-copy p { margin-top: 6px; font-size: 11px; color: var(--muted); max-width: 550px; }
.threshold-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.threshold-form > label { font-size: 9.5px; color: var(--muted); display: block; margin-bottom: 5px; }
.threshold-control { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-soft); }
.threshold-control button { width: 34px; height: 42px; border: 0; background: transparent; color: var(--muted); font-size: 17px; cursor: pointer; }
.threshold-control button:hover { background: var(--paper); color: var(--ink); }
.threshold-control input { width: 68px; height: 42px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); outline: 0; text-align: center; font-family: var(--font-serif); font-size: 19px; font-weight: 600; background: transparent; }
.threshold-form .btn { height: 42px; }
.threshold-legend { flex: 0 0 100%; display: flex; gap: 22px; padding-top: 13px; border-top: 1px dashed #ece5d8; font-size: 9.5px; color: var(--muted); }
.threshold-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.legend-dot.green { background: var(--green); }
.legend-dot.red { background: var(--red); }
.warning-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.warning-stat { padding: 17px 19px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; display: flex; flex-direction: column; }
.warning-stat span { font-size: 10px; color: var(--muted); }
.warning-stat strong { font-family: var(--font-serif); font-size: 26px; line-height: 1.4; }
.warning-stat small { margin-top: auto; font-size: 9px; color: var(--muted-2); }
.warning-stat.green { background: linear-gradient(130deg, #fffdf8, #edf4ed); border-color: #d8e6da; }
.warning-stat.green strong { color: var(--green); }
.warning-stat.red { background: linear-gradient(130deg, #fffdf8, #fbece9); border-color: #efd4ce; }
.warning-stat.red strong { color: var(--red); }
.table-head { padding: 18px 20px 0; margin-bottom: 0; }
.warning-table td { padding-top: 13px; padding-bottom: 13px; }
.info-note { display: flex; gap: 11px; padding: 16px 18px; margin-top: 14px; background: var(--gold-soft); border: 1px solid #eadcc1; border-radius: 12px; color: #7c6437; }
.info-note svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.info-note strong { display: block; font-size: 11px; }
.info-note p { margin-top: 2px; font-size: 10px; opacity: 0.82; }

/* --------------------------------------------------------- guide */
.guide-hero {
  position: relative;
  padding: 38px 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  color: #f7f2e7;
  background:
    radial-gradient(circle at 85% 10%, rgba(201, 100, 69, 0.22), transparent 22rem),
    radial-gradient(circle at 30% 120%, rgba(108, 139, 120, 0.22), transparent 24rem),
    var(--ink);
}
.guide-hero h1 { font-family: var(--font-serif); font-size: clamp(30px, 3.6vw, 43px); margin-top: 12px; line-height: 1.3; }
.guide-hero p { margin-top: 10px; font-size: 12px; color: rgba(247, 242, 231, 0.55); max-width: 600px; }
.guide-status { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); border-radius: 12px; min-width: 240px; }
.guide-status .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(185, 146, 84, 0.13); }
.guide-status strong { display: block; font-size: 10.5px; font-weight: 600; }
.guide-status span:not(.status-dot) { display: block; margin-top: 1px; font-size: 9px; color: rgba(247, 242, 231, 0.42); }
.guide-status.configured .status-dot { background: #8fbb9d; box-shadow: 0 0 0 4px rgba(143, 187, 157, 0.13); }
.guide-layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: 25px; margin-top: 20px; align-items: start; }
.guide-aside { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 13px; }
.guide-aside-card { padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; display: flex; flex-direction: column; gap: 3px; }
.guide-aside-card .eyebrow { margin-bottom: 6px; }
.guide-aside-card a { padding: 6px 5px; font-size: 10.5px; color: var(--muted); border-radius: 5px; }
.guide-aside-card a:hover { color: var(--clay-deep); background: var(--surface-soft); }
.guide-tip-card { padding: 16px; border-radius: 13px; background: var(--sage-soft); border: 1px solid #d6e4d9; }
.guide-tip-card strong { display: block; font-size: 10.5px; color: var(--green); }
.guide-tip-card p { font-size: 9.5px; color: #587361; margin-top: 4px; }
.guide-main { display: flex; flex-direction: column; gap: 15px; }
.guide-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 25px; scroll-margin-top: 20px; }
.guide-section-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 15px; }
.section-num { width: 31px; height: 31px; flex: 0 0 31px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-family: var(--font-serif); font-size: 12px; color: var(--clay-deep); background: var(--clay-soft); }
.guide-section-head h2 { font-family: var(--font-serif); font-size: 21px; }
.guide-section-head p { margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.command-table { border-top: 1px solid var(--line); }
.command-row { display: grid; grid-template-columns: minmax(170px, 0.62fr) minmax(0, 1.38fr); gap: 22px; align-items: center; padding: 14px 0; border-bottom: 1px dashed #eee8dc; }
.command-row.highlight { background: #fdf5ef; margin: 0 -10px; padding: 14px 10px; border-radius: 9px; border-bottom-color: transparent; }
.command-meta h3 { font-size: 12px; font-weight: 600; }
.command-meta p { margin-top: 2px; font-size: 9.5px; color: var(--muted-2); line-height: 1.5; }
.command-code { display: flex; align-items: center; gap: 7px; min-width: 0; }
.command-code code { display: block; flex: 1; padding: 9px 11px; background: var(--ink); color: #f0eadc; border-radius: 7px; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 10.5px; overflow-x: auto; white-space: nowrap; }
.copy-btn { flex: 0 0 auto; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 9.5px; cursor: pointer; }
.copy-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option-card { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; }
.option-card > span { display: block; font-size: 9.5px; color: var(--muted); margin-bottom: 5px; }
.option-card code { font-size: 10.5px; color: var(--clay-deep); background: var(--clay-soft); padding: 3px 6px; border-radius: 4px; }
.option-card p { margin-top: 7px; font-size: 9.5px; color: var(--muted-2); }
.simulator { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--surface-soft); }
.simulator-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--paper); border-bottom: 1px solid var(--line); }
.sim-label { font-size: 9.5px; color: var(--muted); }
.simulator-bar .text-button { font-size: 9.5px; }
.simulator-form { display: flex; gap: 9px; padding: 13px; align-items: flex-end; }
.simulator-form textarea { flex: 1; resize: vertical; min-height: 70px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); outline: none; font-size: 11.5px; line-height: 1.6; }
.simulator-form textarea:focus { border-color: #bcae97; }
.simulator-form .btn { height: 42px; }
.simulator-warning { margin: 0 13px 13px; padding: 9px 11px; background: var(--gold-soft); color: #80683b; border-radius: 7px; font-size: 9.5px; }
.simulator-reply { display: flex; gap: 10px; margin: 0 13px 14px; padding: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.reply-avatar { width: 27px; height: 27px; flex: 0 0 27px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--ink); color: #f6f0e2; font-family: var(--font-serif); font-size: 11px; }
.simulator-reply pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--font-sans); font-size: 10.5px; line-height: 1.8; color: var(--ink-2); }
.setup-steps { display: flex; flex-direction: column; gap: 0; }
.setup-step { display: flex; gap: 13px; padding: 11px 0; border-bottom: 1px dashed #eee8dc; }
.setup-step > span { width: 23px; height: 23px; flex: 0 0 23px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--paper); font-size: 9.5px; color: var(--muted); }
.setup-step h3 { font-size: 11.5px; }
.setup-step p { margin-top: 1px; font-size: 9.8px; color: var(--muted); }
.setup-step code { background: var(--paper); padding: 1px 4px; border-radius: 3px; font-size: 9px; }
.setup-note { margin-top: 12px; padding: 11px 13px; border-radius: 8px; background: var(--sage-soft); color: #587361; font-size: 9.7px; line-height: 1.7; }

/* --------------------------------------------------------- login */
.login-body { min-height: 100vh; background: var(--paper); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.08fr 0.92fr; padding: 18px; gap: 18px; }
.login-art {
  position: relative;
  min-height: calc(100vh - 36px);
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 8%, rgba(108, 139, 120, 0.28), transparent 25rem),
    radial-gradient(circle at 100% 100%, rgba(201, 100, 69, 0.25), transparent 28rem),
    var(--ink);
  color: #f5efe3;
  padding: 40px;
  display: flex;
  flex-direction: column;
}
.login-brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 2; }
.login-brand .brand-en { color: rgba(245, 239, 227, 0.42); }
.login-brand-cn { font-family: var(--font-serif); font-size: 18px; margin-top: 2px; }
.login-quote { margin: auto 0; position: relative; z-index: 2; max-width: 450px; }
.quote-mark { font-family: var(--font-serif); font-size: 72px; line-height: 0.6; color: var(--clay); opacity: 0.6; display: block; height: 36px; }
.login-quote p { font-family: var(--font-serif); font-size: clamp(30px, 3.6vw, 45px); line-height: 1.45; margin-top: 20px; }
.quote-line { display: block; width: 48px; height: 2px; background: var(--clay); margin: 26px 0 13px; }
.login-quote small { font-size: 10px; color: rgba(245, 239, 227, 0.42); letter-spacing: 0.12em; }
.art-orbit { position: absolute; border: 1px solid rgba(245, 239, 227, 0.12); border-radius: 50%; }
.orbit-one { width: 520px; height: 520px; right: -200px; top: -180px; }
.orbit-two { width: 720px; height: 720px; right: -300px; top: -290px; border-color: rgba(245, 239, 227, 0.06); }
.art-stroke { position: absolute; width: 220px; height: 72px; right: 50px; bottom: 65px; border-radius: 100%; border: 17px solid rgba(201, 100, 69, 0.3); transform: rotate(-17deg); filter: blur(1px); }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 40px; }
.login-form-wrap { width: min(360px, 100%); }
.login-form-wrap h1 { font-family: var(--font-serif); font-size: 38px; margin-top: 8px; }
.login-sub { margin: 9px 0 22px; color: var(--muted); font-size: 12px; }
.login-form { margin-top: 6px; }
.login-form .field { margin-top: 0; }
.login-form .field > span { color: var(--muted); font-size: 10px; }
.login-form .input { height: 47px; background: var(--surface); }
.login-form .btn { margin-top: 18px; height: 47px; }
.login-hint { margin-top: 18px; font-size: 9.5px; color: var(--muted-2); text-align: center; }
.login-foot { position: absolute; bottom: 32px; font-size: 9px; color: var(--muted-2); letter-spacing: 0.05em; }
.form-alert { margin: 0 0 14px; }

/* --------------------------------------------------------- toast */
.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  min-width: 250px;
  max-width: 390px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 11px;
  background: var(--ink);
  color: #f8f3e7;
  box-shadow: 0 14px 40px rgba(24, 33, 30, 0.22);
  font-size: 11px;
  line-height: 1.55;
  animation: toastIn 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: auto;
}
.toast.success { border-left: 3px solid #8fbb9d; }
.toast.error { border-left: 3px solid #df8a7b; }
.toast.info { border-left: 3px solid #d6b678; }
.toast .toast-icon { font-size: 13px; line-height: 1.4; }
.toast .toast-text { flex: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes dialogIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } }

/* --------------------------------------------------------- responsive */
@media (max-width: 1220px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-side { display: grid; grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: minmax(0, 1.3fr) minmax(250px, 0.7fr); }
  .guide-layout { grid-template-columns: 190px minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(calc(-100% - 30px)); transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1); }
  .sidebar.open { transform: translateX(0); }
  .main-shell { margin-left: 0; }
  .mobile-menu { display: inline-flex; }
  .topbar { padding: 0 22px; }
  .content { padding: 27px 22px 50px; }
  .site-footer { padding: 18px 22px 25px; }
  .hero { grid-template-columns: 1fr; gap: 26px; }
  .hero-side { align-self: auto; max-width: 420px; }
  .guide-layout { grid-template-columns: 1fr; }
  .guide-aside { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .shortcut-strip { align-items: flex-start; flex-direction: column; }
  .shortcut-links { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .page-head { flex-direction: column; align-items: flex-start; gap: 17px; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-head h1 { font-size: 31px; }
  .toolbar-panel { flex-wrap: wrap; }
  .search-box { width: 100%; }
  .toolbar-spacer { display: none; }
  .dashboard-side { grid-template-columns: 1fr; }
  .hero { padding: 30px 24px; border-radius: 22px; }
  .content { padding: 22px 15px 45px; }
  .topbar { padding: 0 15px; height: 63px; }
  .topbar-context { font-size: 10px; }
  .topbar-link { font-size: 0; gap: 0; }
  .topbar-link svg { width: 18px; height: 18px; }
  .site-footer { padding: 16px 16px 22px; font-size: 9px; flex-direction: column; gap: 5px; }
  .stats-grid { gap: 9px; }
  .stat-card { min-height: 145px; padding: 15px; }
  .stat-value { font-size: 27px; }
  .stat-label { margin-top: 14px; }
  .panel { padding: 18px 16px; }
  .filters { align-items: stretch; }
  .filter-field, .filter-field.date-filter, .filter-field.search-filter { flex: 1 1 45%; max-width: none; min-width: 0; }
  .filter-actions { margin-left: 0; width: 100%; }
  .filter-actions .btn { flex: 1; }
  .summary-chips { gap: 6px; }
  .summary-chip { padding: 6px 10px; font-size: 9px; }
  .guide-hero { padding: 28px 23px; flex-direction: column; align-items: flex-start; }
  .guide-aside { grid-template-columns: 1fr; }
  .guide-section { padding: 19px 16px; }
  .command-row { grid-template-columns: 1fr; gap: 8px; padding: 13px 0; }
  .command-row.highlight { margin: 0 -7px; padding: 13px 7px; }
  .option-grid { grid-template-columns: 1fr; }
  .threshold-card { gap: 17px; padding: 19px; }
  .threshold-form { width: 100%; align-items: flex-end; }
  .threshold-form .btn { flex: 1; }
  .threshold-legend { flex-direction: column; gap: 5px; }
  .warning-stats { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .warning-stat { padding: 12px 11px; }
  .warning-stat strong { font-size: 23px; }
  .warning-stat small { display: none; }
  .batch-layout { grid-template-columns: 1fr; }
  .picker-list { height: 230px; }
  .modal-card { padding: 21px 18px; }
  .modal-wide { width: calc(100vw - 18px); }
  .drawer { width: 100vw; }
  .drawer-content { padding: 0 18px 26px; }
  .drawer-top { padding: 15px 18px 8px; }
  .drawer-metrics { gap: 6px; }
  .metric { padding: 9px; }
  .metric strong { font-size: 18px; }
  .history-item { gap: 8px; }
  .history-date { min-width: 72px; font-size: 9px; }
  .simulator-form { flex-direction: column; align-items: stretch; }
  .form-grid.two { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .login-art { display: none; }
  .login-panel { min-height: calc(100vh - 20px); background: var(--surface); border-radius: 22px; padding: 30px 22px; }
  .login-form-wrap h1 { font-size: 33px; }
  .login-foot { bottom: 20px; }
  .toast-stack { left: 14px; right: 14px; bottom: 14px; }
  .toast { min-width: 0; max-width: none; width: 100%; }
  .threshold-copy h2 { font-size: 22px; }
  .shortcut-links { gap: 6px; }
  .shortcut-links a { font-size: 10px; padding: 8px 10px; }
  .data-table th, .data-table td { padding-left: 13px; padding-right: 13px; }
}
@media (max-width: 460px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 130px; }
  .hero h1 { font-size: 30px; }
  .hero-actions .btn { flex: 1; }
  .filter-field, .filter-field.date-filter, .filter-field.search-filter { flex-basis: 100%; }
  .segmented { width: 100%; }
  .segment { flex: 1; justify-content: center; }
  .warning-stats { grid-template-columns: 1fr; }
  .drawer-actions .btn { flex: 1; }
  .drawer-metrics { grid-template-columns: 1fr 1fr 1fr; }
  .metric span { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

/* --------------------------------------------------------- accounts & auth */
.topbar-password {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  padding: 4px;
}
.topbar-password:hover { color: var(--ink); }
.topbar-password svg { width: 15px; height: 15px; }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-avatar {
  width: 28px; height: 28px;
  flex: 0 0 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(201, 100, 69, 0.9);
  color: #fffdf8;
  font-family: var(--font-serif);
  font-size: 12px;
}
.sidebar-user div { min-width: 0; }
.sidebar-user strong { display: block; color: rgba(255, 253, 246, 0.86); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user span:not(.sidebar-avatar) { display: block; color: rgba(238, 233, 221, 0.4); font-size: 9px; }
.self-tag {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--clay-soft);
  color: var(--clay-deep);
  font-size: 8px;
  font-weight: 600;
}
.account-checkbox { margin-top: 13px; background: var(--sage-soft); color: var(--green); }
.account-table .row-actions { opacity: 1; }
.account-table td { font-size: 11.5px; }
.login-form .field + .field { margin-top: 14px; }
@media (max-width: 760px) {
  .topbar-password { font-size: 0; gap: 0; }
  .topbar-password svg { width: 18px; height: 18px; }
  .topbar-actions { gap: 10px; }
}

