/* ============================================
   火花面板 — 蓝金档案风
   风格参考 wz.gs0910.top：浅蓝白底 + 深藏青主色 + 金色点缀
   复古工具站特征：硬阴影 / 小圆角 / 楷体标题 / 编号方块 / Courier 标签
   ============================================ */
:root {
  color-scheme: light;
  /* 基础 */
  --bg: #edf4ff;
  --panel: #fff;
  --text: #162033;
  --muted: #66758a;
  --line: #dbe5f2;
  --shadow: 0 18px 45px rgba(37, 74, 122, 0.09);
  /* 蓝 */
  --navy-deep: #102b4b;
  --navy: #173d6c;
  --navy-hover: #102f55;
  --blue: #315e92;
  --accent: #3374db;
  --accent-strong: #245cb5;
  --accent-soft: #eaf2ff;
  --blue-line: #b9c8d8;
  --blue-border: #aebed0;
  /* 金 */
  --gold: #d3aa4f;
  --gold-deep: #b8913c;
  --gold-soft: rgba(211, 170, 79, 0.18);
  /* 功能 */
  --success: #13815d;
  --success-soft: #e6f4ef;
  --danger: #df4e55;
  --danger-soft: #fdebec;
  --warning: #b38b32;
  --warning-soft: #f3eee1;
  /* 字体 */
  --font-ui: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-kaiti: "STKaiti", "KaiTi", "FangSong", serif;
  --font-mono: "Courier New", Consolas, monospace;
  /* 硬阴影（复古工具站） */
  --shadow-hard: 4px 4px 0 rgba(23, 61, 108, 0.08);

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 0.9375rem;
  --text-md: 1.125rem;
  --text-lg: 1.5rem;
  --text-xl: 2rem;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 8px;
  --radius-xl: 14px;
  --radius-full: 9999px;

  --ease-default: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 4%, rgba(51, 116, 219, 0.16), transparent 26rem),
    radial-gradient(circle at 88% 18%, rgba(88, 171, 255, 0.1), transparent 22rem),
    linear-gradient(160deg, #f8fbff 0%, #edf4ff 50%, #f6f9fd 100%);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(51, 116, 219, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 116, 219, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  z-index: 0;
}
img, svg { display: block; }
p, h1, h2, h3, h4 { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}
:focus-visible {
  outline: 3px solid rgba(211, 170, 79, 0.55);
  outline-offset: -3px;
}
::selection { background: rgba(51, 116, 219, 0.18); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #b9c8d8; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: #8fa6bd; }

/* ---------- 布局 ---------- */
.layout { position: relative; z-index: 1; display: flex; min-height: 100vh; }

/* 侧边栏：深蓝档案风 */
.sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--navy-deep);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: var(--space-5) var(--space-3);
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(202, 222, 241, 0.16);
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2) var(--space-5);
  border-bottom: 1px solid rgba(202, 222, 241, 0.14);
  margin-bottom: var(--space-4);
}
.sidebar__logo {
  width: 40px;
  height: 40px;
  border: 1px solid #8ca6bf;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--navy), #245f9f);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar__brand-name {
  font-family: var(--font-kaiti);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #fff;
}
.sidebar__brand-sub {
  font-size: 0.625rem;
  color: #87a7c5;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.12em;
}
.sidebar__user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-2);
  margin-bottom: var(--space-3);
  background: #0c233e;
  border: 1px solid rgba(111, 145, 178, 0.4);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: #b7cce0;
}
.sidebar__user-name { color: var(--gold); font-weight: 700; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  font-size: var(--text-sm);
  color: #b7cce0;
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.nav-item svg { flex-shrink: 0; }
.nav-item:hover { background: #153658; color: #fff; }
.nav-item.is-active {
  background: #17395f;
  color: #fff;
}
.nav-item.is-active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  background: var(--gold);
}
.sidebar__foot {
  padding: var(--space-4) var(--space-2) 0;
  border-top: 1px solid rgba(202, 222, 241, 0.14);
  font-size: var(--text-xs);
  color: #6f91b2;
  line-height: 1.9;
}

.main {
  flex: 1;
  min-width: 0;
}

/* 顶栏：tool-page-head 风格 */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin: var(--space-5) clamp(var(--space-5), 4vw, var(--space-8)) var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-top: 4px solid var(--navy);
  border-bottom: 1px solid var(--blue-border);
  background: #f4f7fa;
  overflow: hidden;
}
.topbar::after {
  content: "SPARK / PANEL";
  position: absolute;
  right: 24px;
  bottom: -12px;
  color: rgba(23, 61, 108, 0.05);
  font: 900 44px/1 Georgia, serif;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.topbar__title {
  font-family: var(--font-kaiti);
  font-size: 26px;
  font-weight: 400;
  color: #142c49;
  position: relative;
  z-index: 1;
}
.topbar__sub {
  font-size: var(--text-xs);
  color: #718195;
  position: relative;
  z-index: 1;
}
.topbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  position: relative;
  z-index: 1;
}

.content {
  padding: 0 clamp(var(--space-5), 4vw, var(--space-8)) var(--space-10);
  max-width: 1120px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 9px var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-fast);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--navy-hover); }
.btn-secondary {
  background: #f8fafc;
  border-color: var(--blue-line);
  color: #234d7e;
}
.btn-secondary:hover:not(:disabled) { border-color: var(--blue); background: #e8eff7; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #c43c43; }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); }
.btn-sm { padding: 4px var(--space-3); font-size: var(--text-xs); border-radius: var(--radius-sm); }

/* ---------- 卡片 ---------- */
.card {
  background: #f8fafc;
  border: 1px solid var(--blue-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hard);
}
.card + .card { margin-top: var(--space-5); }
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid #c6d2df;
}
.card__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-md);
  font-weight: 800;
  color: #1d3048;
}
.card__title::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--gold);
}
.card__body { padding: var(--space-5); }

/* ---------- 概览统计 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-bottom: var(--space-5); }
.stat-card {
  background: #f8fafc;
  border: 1px solid var(--blue-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hard);
  padding: var(--space-4) var(--space-5);
  position: relative;
}
.stat-card__label {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7c8c9f;
  margin-bottom: var(--space-2);
}
.stat-card__value {
  font-size: var(--text-xl);
  font-weight: 900;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
  font-family: var(--font-mono);
}
.stat-card__hint { font-size: var(--text-xs); color: #718195; margin-top: 2px; }

.run-panel { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; }
.run-dot {
  width: 10px; height: 10px; border-radius: var(--radius-full);
  background: #b9c8d8;
  flex-shrink: 0;
}
.run-dot.is-running { background: var(--success); animation: pulse 1.4s ease infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(19, 129, 93, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(19, 129, 93, 0); }
}
.run-state { display: flex; align-items: center; gap: var(--space-3); }
.run-state__text { font-size: var(--text-md); font-weight: 800; }
.run-state__sub { font-size: var(--text-xs); color: var(--muted); }

/* ---------- 表格 ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--blue-line);
  border-radius: var(--radius-md);
  background: #fff;
}
.table { width: 100%; border-collapse: collapse; }
.table__th {
  padding: var(--space-3) var(--space-5);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6e8093;
  background: #edf2f6;
  border-bottom: 1px solid #d1dbe5;
  white-space: nowrap;
}
.table__td {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  vertical-align: middle;
  border-bottom: 1px solid #d1dbe5;
}
.table__body .table__row:last-child .table__td { border-bottom: none; }
.table__body .table__row:hover { background: #eef3f8; }
.table__cell-primary { font-weight: 700; color: #263c55; }
.table__cell-secondary { font-size: var(--text-xs); color: #75869a; margin-top: 2px; }
.table__td--action { text-align: right; white-space: nowrap; }
.table__td--muted { color: #75869a; }

/* ---------- 徽章 / chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
}
.badge-orange { background: var(--gold-soft); color: #8a6d1f; }
.badge-green  { background: var(--success-soft); color: var(--success); }
.badge-gray   { background: #eef2f6; color: #66758a; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: #eef3f8;
  border: 1px solid #c6d2de;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: #65788e;
  margin: 2px 4px 2px 0;
}
.chip__x { cursor: pointer; color: #8ea3b8; font-size: 0.9rem; line-height: 1; }
.chip__x:hover { color: var(--danger); }

/* ---------- 表单 ---------- */
.form__field { display: flex; flex-direction: column; gap: var(--space-2); }
.form__label {
  font-size: var(--text-sm);
  font-weight: 800;
  color: #40536a;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.form__required { color: var(--danger); }
.form__hint { font-size: var(--text-xs); color: #718195; }
.form__error {
  font-size: var(--text-xs);
  color: var(--danger);
  background: var(--danger-soft);
  border-left: 3px solid var(--danger);
  padding: var(--space-3) var(--space-4);
}

.input {
  width: 100%;
  padding: 9px var(--space-4);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--text);
  box-shadow: inset 4px 0 0 #d8e3ee;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.input::placeholder { color: #9aa9bb; }
.input:focus {
  border-color: var(--blue);
  box-shadow: inset 4px 0 0 var(--blue), 0 0 0 3px rgba(49, 94, 146, 0.12);
}
.input--error { border-color: var(--danger); }
.input-mono { font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.6; }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.7; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: '';
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-70%) rotate(45deg);
  width: 8px; height: 8px;
  border-right: 1.5px solid #7c8c9f;
  border-bottom: 1.5px solid #7c8c9f;
  pointer-events: none;
}
.select-wrap select { appearance: none; padding-right: var(--space-8); cursor: pointer; }

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--muted);
  padding: 4px 0;
}
.checkbox-label input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox-box {
  width: 17px; height: 17px;
  border: 1.5px solid var(--blue-line);
  border-radius: var(--radius-sm);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.checkbox-label input:checked + .checkbox-box {
  background: var(--navy);
  border-color: var(--navy);
}
.checkbox-label input:checked + .checkbox-box::after {
  content: '';
  width: 8px; height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

.toggle { display: inline-flex; align-items: center; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle__track {
  position: relative;
  width: 40px; height: 22px;
  background: #c6d2de;
  border-radius: var(--radius-full);
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.toggle__thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 4px rgba(37, 74, 122, 0.2);
  transition: transform 0.2s var(--ease-default);
}
.toggle input:checked ~ .toggle__track { background: var(--blue); }
.toggle input:checked ~ .toggle__track .toggle__thumb { transform: translateX(18px); }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  z-index: 400;
  background: rgba(8, 18, 30, 0.45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-6);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%;
  max-width: 540px;
  max-height: 86vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #c6d2de;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(23, 61, 108, 0.22);
  animation: modalUp 0.25s var(--ease-default);
}
@keyframes modalUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-5) var(--space-6) 0;
}
.modal__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-kaiti);
  font-size: 22px;
  font-weight: 400;
  color: var(--navy);
}
.modal__title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--gold);
}
.modal__close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: #7c8c9f;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  font-size: 1.1rem;
}
.modal__close:hover { background: #eef3f8; color: var(--navy); }
.modal__body { padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-5); }
.modal__footer {
  display: flex; justify-content: flex-end; gap: var(--space-3);
  padding: 0 var(--space-6) var(--space-6);
}

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 11px 16px;
  background: #16201c;
  color: #fff;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 700;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  min-width: 220px;
  max-width: 420px;
  animation: toastUp 0.25s var(--ease-default);
}
.toast--success { border-left: 3px solid #4caf7d; }
.toast--error   { border-left: 3px solid var(--danger); }
.toast--warning { border-left: 3px solid var(--gold); }
@keyframes toastUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 日志 ---------- */
.log-view {
  background: #0a1930;
  border: 1px solid #c6d2de;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.8;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: #bdd8f3;
}
.log-view__empty { color: #6f91b2; }
.log-line--error { color: #f0979d; }
.log-line--warning { color: #e8c96a; }

/* ---------- 空状态 ---------- */
.empty-state {
  padding: var(--space-10) var(--space-6);
  text-align: center;
}
.empty-state__icon {
  width: 48px; height: 48px;
  margin: 0 auto var(--space-4);
  border: 1px solid var(--blue-line);
  border-radius: var(--radius-md);
  background: #f5f8fc;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue);
}
.empty-state__title {
  font-family: var(--font-kaiti);
  font-size: 20px;
  font-weight: 400;
  color: #314b68;
}
.empty-state__body { font-size: var(--text-sm); color: #7a899a; margin-top: var(--space-1); }

/* ---------- 登录页 ---------- */
.login-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--blue-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow), var(--shadow-hard);
  overflow: hidden;
  animation: modalUp 0.3s var(--ease-default);
}
.login-card__top {
  position: relative;
  padding: var(--space-8) var(--space-8) var(--space-6);
  background: linear-gradient(125deg, #0b1f3b, #173d6c 54%, #245f9f);
  color: #fff;
  text-align: center;
  overflow: hidden;
}
.login-card__top::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 18%, rgba(117, 183, 255, 0.25), transparent 24%),
    linear-gradient(90deg, transparent 49.7%, rgba(255, 255, 255, 0.05) 50%, transparent 50.3%);
  background-size: auto, 40px 40px;
}
.login-card__logo {
  position: relative;
  z-index: 1;
  width: 56px; height: 56px;
  margin: 0 auto var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.04);
  display: flex; align-items: center; justify-content: center;
}
.login-card__title {
  position: relative;
  z-index: 1;
  font-family: var(--font-kaiti);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.06em;
}
.login-card__sub {
  position: relative;
  z-index: 1;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: #a9cdf3;
}
.login-card__body { padding: var(--space-6) var(--space-8) var(--space-8); }
.login-card__tabs {
  display: flex;
  gap: 0;
  border: 1px solid #a7b8c9;
  margin-bottom: var(--space-5);
}
.login-tab {
  flex: 1;
  padding: 8px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: #65788e;
  background: #f8fafc;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}
.login-tab + .login-tab { border-left: 1px solid #bac7d4; }
.login-tab.is-active {
  background: var(--navy);
  color: #fff;
}
.login-card form { display: flex; flex-direction: column; gap: var(--space-4); text-align: left; }
.login-switch {
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  color: var(--muted);
  text-align: center;
}
.login-switch a { color: var(--accent-strong); cursor: pointer; font-weight: 700; }
.login-switch a:hover { text-decoration: underline; }

/* ---------- 星期选择 ---------- */
.weekdays { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.wd-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--blue-line);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 700;
  color: #65788e;
  cursor: pointer;
  transition: all var(--duration-fast);
  display: flex; align-items: center; justify-content: center;
  background: #fff;
}
.wd-btn:hover { border-color: var(--blue); color: var(--navy); }
.wd-btn.is-on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* ---------- 移动端底部导航 ---------- */
.mobile-nav { display: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-direction: row;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    border-right: none;
    border-bottom: 3px solid var(--gold-deep);
  }
  .sidebar__brand { padding: 0 var(--space-3) 0 0; border-bottom: none; margin-bottom: 0; }
  .sidebar__logo { width: 34px; height: 34px; }
  .sidebar__brand-sub { display: none; }
  .sidebar__nav { flex-direction: row; overflow-x: auto; }
  .nav-item { white-space: nowrap; padding: 8px var(--space-3); font-size: var(--text-xs); }
  .nav-item.is-active::after { display: none; }
  .nav-item.is-active { box-shadow: inset 0 -2px var(--gold); }
  .sidebar__foot { display: none; }
  .sidebar__user { display: none; }
  .main { padding-bottom: 62px; }

  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #102b4b;
    border-top: 2px solid var(--gold-deep);
    padding: 3px var(--space-2) calc(3px + env(safe-area-inset-bottom));
  }
  .mobile-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 5px 2px;
    font-size: 0.625rem;
    font-weight: 700;
    color: #87a7c5;
    cursor: pointer;
    transition: color var(--duration-fast);
  }
  .mobile-nav__item.is-active { color: var(--gold); }

  .topbar { margin: var(--space-3) var(--space-3) var(--space-3); padding: var(--space-3) var(--space-4); }
  .topbar::after { display: none; }
  .content { padding: 0 var(--space-3) var(--space-8); }
  .stats { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
  .table__td, .table__th { padding: var(--space-3) var(--space-4); }
  .toast-wrap { width: calc(100% - 32px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
