/* 默认：浅色渐变（可在「系统设置」切换为深色） */
:root {
  --bg: #e8edf7;
  --panel: #ffffff;
  --panel2: #eef2fa;
  --text: #1a2240;
  --muted: #5c678a;
  --accent: #3b6fd9;
  --accent2: #6b4fc9;
  --border: rgba(26, 34, 64, 0.1);
  --ok: #059669;
  --err: #dc2626;
  --alert-ok-fg: #047857;
  --alert-err-fg: #b91c1c;
  --radius: 12px;
  --page-bg: radial-gradient(1000px 520px at 12% -6%, rgba(59, 111, 217, 0.11), transparent 55%),
    radial-gradient(760px 420px at 98% 4%, rgba(107, 79, 201, 0.08), transparent 50%),
    linear-gradient(180deg, #fafbfd 0%, #eef2f9 40%, #e8edf5 100%);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html[data-theme="dark"] {
  --bg: #0b1020;
  --panel: #121a32;
  --panel2: #1a2444;
  --text: #e8ecf7;
  --muted: #8b95b3;
  --accent: #6c9eff;
  --accent2: #a78bfa;
  --border: rgba(255, 255, 255, 0.08);
  --ok: #34d399;
  --err: #f87171;
  --alert-ok-fg: #a7f3d0;
  --alert-err-fg: #fecaca;
  --page-bg: radial-gradient(1200px 600px at 10% -10%, rgba(108, 158, 255, 0.18), transparent),
    radial-gradient(900px 500px at 100% 0%, rgba(167, 139, 250, 0.15), transparent),
    var(--bg);
}

/* 浅色变体主题 */
html[data-theme="ocean"] {
  --bg: #e6f4f7;
  --panel: #ffffff;
  --panel2: #e8f6fa;
  --text: #123240;
  --muted: #4a6d7c;
  --accent: #0d9488;
  --accent2: #0284c7;
  --border: rgba(13, 148, 136, 0.14);
  --ok: #059669;
  --err: #dc2626;
  --alert-ok-fg: #047857;
  --alert-err-fg: #b91c1c;
  --page-bg: radial-gradient(900px 480px at 8% -8%, rgba(13, 148, 136, 0.14), transparent 52%),
    radial-gradient(720px 420px at 96% 4%, rgba(2, 132, 199, 0.12), transparent 48%),
    linear-gradient(185deg, #f5fcfd 0%, #e3f4f8 45%, #dceef5 100%);
}
html[data-theme="warm"] {
  --bg: #f3eee8;
  --panel: #fffdfb;
  --panel2: #faf6f1;
  --text: #2c2419;
  --muted: #7d7268;
  --accent: #c2410c;
  --accent2: #c8781a;
  --border: rgba(44, 36, 25, 0.1);
  --ok: #15803d;
  --err: #b91c1c;
  --alert-ok-fg: #166534;
  --alert-err-fg: #b91c1c;
  --page-bg: radial-gradient(960px 500px at 14% -6%, rgba(194, 65, 12, 0.08), transparent 55%),
    linear-gradient(180deg, #fffdfb 0%, #f5ebe3 48%, #efe4db 100%);
}
html[data-theme="mint"] {
  --bg: #e8f5ee;
  --panel: #ffffff;
  --panel2: #eef8f2;
  --text: #14261c;
  --muted: #556b5f;
  --accent: #16a34a;
  --accent2: #059669;
  --border: rgba(22, 163, 74, 0.14);
  --ok: #15803d;
  --err: #dc2626;
  --alert-ok-fg: #166534;
  --alert-err-fg: #b91c1c;
  --page-bg: radial-gradient(880px 460px at 10% -8%, rgba(22, 163, 74, 0.11), transparent 52%),
    linear-gradient(180deg, #fbfffc 0%, #e8f5ee 50%, #dff0e8 100%);
}
html[data-theme="rose"] {
  --bg: #f5eaf0;
  --panel: #ffffff;
  --panel2: #faf0f5;
  --text: #301828;
  --muted: #7a5f6a;
  --accent: #db2777;
  --accent2: #a855f7;
  --border: rgba(219, 39, 119, 0.12);
  --ok: #059669;
  --err: #dc2626;
  --alert-ok-fg: #047857;
  --alert-err-fg: #b91c1c;
  --page-bg: radial-gradient(920px 480px at 12% -6%, rgba(219, 39, 119, 0.1), transparent 52%),
    radial-gradient(700px 400px at 94% 2%, rgba(168, 85, 247, 0.09), transparent 48%),
    linear-gradient(180deg, #fffafc 0%, #f7eaf3 50%, #f0dfea 100%);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
}

/* 带侧栏的后台页：视口内分区，仅主区域滚动，侧栏不随内容滚动 */
body:not(.login-page) {
  height: 100vh;
  overflow: hidden;
  display: flex;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.layout {
  display: flex;
  flex: 1;
  width: 100%;
  min-height: 0;
  min-width: 0;
}

.sidebar {
  flex: 0 0 220px;
  width: 220px;
  min-height: 0;
  align-self: stretch;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  font-size: 1.5rem;
  color: var(--accent2);
}

.brand small {
  display: block;
  color: var(--muted);
  font-weight: normal;
  margin-top: 0.15rem;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav a {
  color: var(--muted);
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
}
.nav a:hover {
  background: var(--panel2);
  color: var(--text);
}
.nav a.active {
  background: linear-gradient(90deg, rgba(108, 158, 255, 0.2), transparent);
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: calc(0.75rem - 3px);
}

.nav .nav-as-link {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav .nav-as-link:hover {
  background: var(--panel2);
  color: var(--text);
}

.hub-msg-banner {
  flex-shrink: 0;
  margin: 0.35rem 0 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(108, 158, 255, 0.45);
  background: rgba(108, 158, 255, 0.16);
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}
.hub-msg-banner[hidden] {
  display: none !important;
}
.hub-msg-banner__icon-new {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
}
.hub-msg-banner__new-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(255, 102, 102, 0.35));
}
.hub-msg-banner__text {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.84rem;
}
.hub-msg-banner__btn {
  flex-shrink: 0;
  padding: 0.4rem 0.75rem !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
}

.sidebar-msg-center {
  display: block;
  margin: 0 0 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px dashed rgba(108, 158, 255, 0.35);
  text-align: center;
  transition: background 0.12s, color 0.12s;
}
.sidebar-msg-center:hover {
  background: var(--panel2);
  color: var(--text);
  text-decoration: none;
}
.sidebar-msg-center.is-active {
  background: linear-gradient(90deg, rgba(108, 158, 255, 0.2), transparent);
  color: var(--text);
  border-left: 3px solid var(--accent);
  border-style: solid;
  padding-left: calc(0.75rem - 3px);
}

.hub-msg-center-page__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}
.hub-msg-center-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.hub-msg-center-item {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel2);
}
.hub-msg-center-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.hub-msg-center-item__id {
  font-weight: 700;
  color: var(--accent);
}
.hub-msg-center-item__tag {
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  background: rgba(59, 111, 217, 0.12);
  color: var(--accent);
  font-weight: 600;
}
.hub-msg-center-item__tag--forced {
  background: rgba(220, 38, 38, 0.12);
  color: var(--err);
}
.hub-msg-center-item__time {
  margin-left: auto;
}
.hub-msg-center-item__title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}
.hub-msg-center-item__body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
}
.hub-msg-center-item__imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.hub-msg-center-item__imglink img {
  max-width: min(100%, 320px);
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--border);
  vertical-align: middle;
}

.hub-msg-normal-hint {
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

.hub-msg-normal-overlay,
.hub-msg-forced-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}
.hub-msg-normal-panel {
  width: 100%;
  max-width: min(26rem, 100%);
  max-height: min(80vh, 560px);
  overflow: auto;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 1rem 1.1rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}
.hub-msg-normal-title {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.hub-msg-normal-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.hub-msg-normal-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.hub-msg-normal-item h3 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
}
.hub-msg-normal-body {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}
.hub-msg-modal__imgs {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.hub-msg-modal__imgs img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.hub-msg-normal-actions {
  margin-top: 0.85rem;
  display: flex;
  justify-content: flex-end;
}

.hub-msg-forced-panel {
  width: 100%;
  max-width: min(24rem, 100%);
  max-height: min(88vh, 640px);
  overflow: auto;
  border-radius: var(--radius);
  background: var(--panel);
  border: 2px solid var(--err);
  padding: 1.1rem 1.15rem;
  box-shadow: 0 24px 64px rgba(220, 38, 38, 0.25);
}
.hub-msg-forced-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--err);
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  margin-bottom: 0.65rem;
}
.hub-msg-forced-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.hub-msg-forced-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}
.hub-msg-forced-actions {
  margin-top: 1rem;
}
body.hub-forced-open {
  overflow: hidden;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.link-out {
  color: var(--err);
}

.main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 1.5rem 2rem 2rem;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sidebar-backdrop {
  display: none;
}

.mobile-nav-toggle {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.mobile-nav-toggle__bars {
  position: relative;
  display: block;
  width: 1.2rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.mobile-nav-toggle__bars::before,
.mobile-nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.mobile-nav-toggle__bars::before {
  top: -6px;
}
.mobile-nav-toggle__bars::after {
  top: 6px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.topbar h1 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
}

.alert {
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-ok {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--alert-ok-fg);
}
.alert-err {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--alert-err-fg);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .alert-ok {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.28);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .alert-err {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.25);
}

.grid {
  display: grid;
  gap: 1rem;
}
.grid-3 {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* 总览：左侧 KPI + 中间营业 + 右侧图表；随宽度降级为「KPI 通栏 + 下排两列」再降为单列 */
.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, min(28vw, 360px)) minmax(220px, min(34vw, 400px));
  gap: 1.1rem;
  align-items: start;
  margin-bottom: 1.25rem;
  min-width: 0;
}
.dashboard-hero > .dashboard-kpi-stack,
.dashboard-hero > .dashboard-biz,
.dashboard-hero > .dashboard-charts {
  min-width: 0;
}
.dashboard-hero > .dashboard-biz {
  align-self: start;
}

/* 中等宽度：避免三列最小宽度之和挤爆主区域 → KPI 一行占满，营业控制台与右侧图表并排 */
@media (max-width: 1480px) and (min-width: 1024px) {
  .dashboard-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
  }
  .dashboard-hero > .dashboard-kpi-stack {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .dashboard-hero > .dashboard-biz {
    grid-column: 1;
    grid-row: 2;
  }
  .dashboard-hero > .dashboard-charts {
    grid-column: 2;
    grid-row: 2;
  }
}

/* 平板 / 小窗口：单列纵向排列（原 1280 断点略提前，减少横向滚动与错位） */
@media (max-width: 1023px) {
  .dashboard-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .dashboard-hero > .dashboard-kpi-stack,
  .dashboard-hero > .dashboard-biz,
  .dashboard-hero > .dashboard-charts {
    grid-column: 1;
    grid-row: auto;
  }
  .dashboard-charts {
    flex-direction: column;
    flex-wrap: nowrap;
  }
  .dashboard-charts .dash-viz {
    flex: 1 1 auto;
    max-width: 100%;
    min-width: 0;
  }
}
.dashboard-kpi-stack {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.dashboard-kpi-stack .grid {
  margin: 0;
}

/* 总览 · 快捷访问（默认可用于页内任意位置） */
.dash-quick-links {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem 1.1rem;
  border-radius: var(--radius);
  background: linear-gradient(
    165deg,
    rgba(22, 30, 58, 0.55) 0%,
    rgba(14, 18, 36, 0.42) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.dash-quick-links__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.85rem;
}
.dash-quick-links__title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
}
.dash-quick-links__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.65rem;
}
@media (min-width: 720px) {
  .dash-quick-links__grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }
}
.dash-quick-links__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 5.25rem;
  padding: 0.65rem 0.5rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
  text-align: center;
}
.dash-quick-links__item:hover {
  text-decoration: none;
  border-color: rgba(108, 158, 255, 0.45);
  background: rgba(108, 158, 255, 0.1);
  transform: translateY(-1px);
}
.dash-quick-links__icon {
  width: 2.1rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0.15rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.dash-quick-links__svg {
  width: 100%;
  height: 100%;
  display: block;
  flex-shrink: 0;
}
.dash-quick-links__label {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
}
.dash-quick-links__sub {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.2;
  margin-top: -0.15rem;
}

/* 左侧栏：营业概况下横向快捷入口 */
.dash-quick-links--in-kpi {
  margin: 0;
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.dash-quick-links__head--inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.dash-quick-links--horizontal .dash-quick-links__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.45rem;
  align-items: stretch;
  justify-content: flex-start;
}
.dash-quick-links--horizontal.dash-quick-links {
  padding: 0.65rem 0.75rem 0.75rem;
}
.dash-quick-links--horizontal .dash-quick-links__item {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  min-height: 0;
  min-width: 0;
  padding: 0.38rem 0.65rem 0.38rem 0.45rem;
  text-align: left;
}
.dash-quick-links--horizontal .dash-quick-links__icon {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0.16rem;
  border-radius: 10px;
  flex-shrink: 0;
}
.dash-quick-links--horizontal .dash-quick-links__label {
  font-size: 0.78rem;
  white-space: nowrap;
}
.dash-quick-links--horizontal .dash-quick-links__sub {
  display: none;
}
@media (min-width: 640px) {
  .dash-quick-links--horizontal .dash-quick-links__icon {
    width: 2.65rem;
    height: 2.65rem;
    padding: 0.18rem;
  }
}
@media (max-width: 520px) {
  .dash-quick-links--horizontal .dash-quick-links__icon {
    width: 2.15rem;
    height: 2.15rem;
    padding: 0.14rem;
  }
  .dash-quick-links--horizontal .dash-quick-links__label {
    font-size: 0.72rem;
  }
}

/* 营业控制台内：今日营业时长下方的常用大图标 */
.dash-quick-spotlight {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.65rem 0.55rem 0.7rem;
  border-radius: var(--radius);
  background: linear-gradient(
    165deg,
    rgba(22, 30, 58, 0.55) 0%,
    rgba(14, 18, 36, 0.42) 100%
  );
  border: 1px solid rgba(108, 158, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.dash-quick-spotlight__title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  text-align: center;
}
.dash-quick-spotlight__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  flex: 1;
  align-content: stretch;
}
.dash-quick-spotlight__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.35rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
  text-align: center;
  min-height: 5.5rem;
}
.dash-quick-spotlight__item:hover {
  text-decoration: none;
  border-color: rgba(108, 158, 255, 0.5);
  background: rgba(108, 158, 255, 0.12);
  transform: translateY(-1px);
}
.dash-quick-spotlight__icon {
  width: 3.35rem;
  height: 3.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0.2rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.dash-quick-spotlight__svg {
  width: 100%;
  height: 100%;
  display: block;
  flex-shrink: 0;
}
@media (min-width: 900px) {
  .dash-quick-spotlight__icon {
    width: 3.75rem;
    height: 3.75rem;
    padding: 0.25rem;
  }
  .dash-quick-spotlight__item {
    min-height: 6.25rem;
  }
}
.dash-quick-spotlight__label {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}
.dash-quick-spotlight--in-biz {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  border-left: none;
  border-right: none;
  border-bottom: none;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
}
.dash-quick-spotlight--in-biz .dash-quick-spotlight__title {
  text-align: left;
  margin-bottom: 0.45rem;
}
.dash-quick-spotlight--in-biz .dash-quick-spotlight__grid {
  gap: 0.4rem;
}

.dash-all-stores-biz {
  border-radius: var(--radius);
  padding: 0.85rem 1rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.07);
  min-width: 0;
}
.dash-all-stores-biz__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.65rem;
}
.dash-all-stores-biz__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
.dash-all-stores-biz .muted.tiny {
  font-size: 0.72rem;
}
.dash-all-stores-biz__table {
  margin: 0;
}
.dash-all-stores-biz__table .data {
  margin: 0;
  font-size: 0.84rem;
}
.dash-all-stores-biz__table .data th,
.dash-all-stores-biz__table .data td {
  padding: 0.45rem 0.55rem;
}
.dash-all-stores-biz__actions {
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.member-modal__panel--wide {
  max-width: min(36rem, 94vw);
  width: 100%;
}

.dashboard-charts {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}
.dash-viz {
  position: relative;
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem 0.85rem;
  background: linear-gradient(
    165deg,
    rgba(22, 30, 58, 0.92) 0%,
    rgba(14, 18, 36, 0.85) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.dash-viz::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0.55;
  pointer-events: none;
}
.dash-viz__title {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: none;
}
.dash-viz__hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
  opacity: 0.9;
}
.dash-viz__canvas-wrap {
  position: relative;
  height: 200px;
  max-height: 38vh;
}
.dash-viz__canvas-wrap--short {
  height: 160px;
}

/* 总览 · 本月营业额前三名领奖台（沿用短图区域高度） */
.dash-viz__canvas-wrap--podium {
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0 0.15rem;
}
.dash-rank-podium {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.dash-rank-slot {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
}
.dash-rank-slot__medal {
  width: 2.35rem;
  height: 2.35rem;
  flex-shrink: 0;
  margin-bottom: 0.12rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.22));
}
.dash-rank-slot--1 .dash-rank-slot__medal {
  width: 2.65rem;
  height: 2.65rem;
}
.dash-rank-medal-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.dash-rank-slot__badge {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.06rem;
}
.dash-rank-slot__badge--gold {
  color: #f9d525;
  text-shadow: 0 0 12px rgba(253, 220, 58, 0.35);
}
.dash-rank-slot__name {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  max-height: 2.4em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}
.dash-rank-slot__amt {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.2rem;
  white-space: nowrap;
}
.dash-rank-slot__amt--gold {
  color: #fde047;
  text-shadow: 0 0 10px rgba(253, 224, 71, 0.25);
}
.dash-rank-slot__base {
  width: 100%;
  border-radius: 7px 7px 3px 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.dash-rank-slot__base--1 {
  height: 3.35rem;
  background: linear-gradient(180deg, #fde047 0%, #ca8a04 55%, #a16207 100%);
}
.dash-rank-slot__base--2 {
  height: 2.45rem;
  background: linear-gradient(180deg, #f4f4f5 0%, #b8b8b8 55%, #71717a 100%);
}
.dash-rank-slot__base--3 {
  height: 1.85rem;
  background: linear-gradient(180deg, #fdba74 0%, #ea580c 55%, #9a3412 100%);
}
.dash-rank-slot--1 {
  transform: translateY(-2px);
}

html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-rank-slot__amt--gold {
  color: #ca8a04;
  text-shadow: none;
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-rank-slot__badge--gold {
  color: #ca8a04;
  text-shadow: none;
}

/* 总览 · 营业控制台（中间栏，渐变面板） */
.dashboard-biz {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0.65rem 0.75rem 0.7rem;
  border-radius: var(--radius);
  background: radial-gradient(120% 80% at 50% 0%, rgba(108, 158, 255, 0.14), transparent 55%),
    linear-gradient(165deg, rgba(22, 32, 62, 0.97) 0%, rgba(12, 16, 34, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.dashboard-biz::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.08), transparent 42%);
}
.dashboard-biz > * {
  position: relative;
  z-index: 1;
}
.dash-biz-store-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.dash-biz-store-row label {
  font-size: 0.78rem;
  color: var(--muted);
}
.dash-biz-select {
  flex: 1;
  min-width: 8rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  font-size: 0.88rem;
}
.dash-biz-heading {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.45rem;
  letter-spacing: 0.03em;
}

.dash-biz-status {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}
.dash-biz-status-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.38rem;
  background: var(--muted);
}
.dash-biz-status--idle .dash-biz-status-dot {
  background: rgba(139, 149, 179, 0.85);
}
.dash-biz-status--open {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.09);
}
.dash-biz-status--open .dash-biz-status-dot {
  background: var(--ok);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.55);
  animation: dash-biz-pulse 2s ease-in-out infinite;
}
.dash-biz-status--closed {
  border-color: rgba(108, 158, 255, 0.28);
  background: rgba(108, 158, 255, 0.07);
}
.dash-biz-status--closed .dash-biz-status-dot {
  background: var(--accent);
  animation: none;
}
.dash-biz-status--paused {
  border-color: rgba(108, 158, 255, 0.28);
  background: rgba(108, 158, 255, 0.07);
}
.dash-biz-status--paused .dash-biz-status-dot {
  background: var(--accent);
  animation: none;
}
@keyframes dash-biz-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.65;
    transform: scale(1.2);
  }
}
.dash-biz-status-title {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}
.dash-biz-status-desc {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.12rem;
  line-height: 1.4;
}

.dash-biz-actions-form {
  margin: 0 0 0.55rem;
}
.dash-biz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.dash-biz-btn {
  position: relative;
  z-index: 3;
  min-height: 2.35rem;
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(108, 158, 255, 0.3);
}
.dash-biz-btn--secondary {
  opacity: 0.78;
}
.dash-biz-btn--recommended {
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.5);
}
.dashboard-biz .btn-primary.dash-biz-btn--recommended:hover {
  filter: brightness(1.06);
}
.dash-biz-clock-block {
  text-align: center;
  margin-bottom: 0.55rem;
  padding: 0.4rem 0 0.25rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.dash-live-clock {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI", monospace;
  font-size: clamp(1.05rem, 2.8vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  text-shadow: 0 0 24px rgba(108, 158, 255, 0.35);
}
.dash-live-clock-cap {
  margin-top: 0.15rem;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.dash-biz-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.45rem;
  font-size: 0.78rem;
}
.dash-biz-metric {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.38rem 0.45rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.dash-biz-metric--span {
  grid-column: 1 / -1;
}
.dash-biz-metric-label {
  font-size: 0.68rem;
  color: var(--muted);
}
.dash-biz-metric-val {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  word-break: break-all;
}
.dash-biz-ymd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.35rem;
}
.dash-biz-ymd-num {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}
.dash-biz-ymd-unit {
  font-size: 0.78rem;
  color: var(--muted);
  margin-right: 0.25rem;
}
.dash-biz-sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.65rem;
  line-height: 1.4;
}
.dash-biz-todaydur {
  font-size: 0.88rem;
}
.dash-biz-footnote {
  margin: 0.45rem 0 0;
  line-height: 1.4;
  font-size: 0.65rem;
}
.tiny {
  font-size: 0.72rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  min-width: 0;
}

.card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.card .stat {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.table-wrap {
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data th,
table.data td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table.data th {
  background: var(--panel2);
  color: var(--muted);
  font-weight: 600;
}

table.data tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
}
.badge-open {
  background: rgba(52, 211, 153, 0.15);
  color: var(--ok);
}
.badge-prep {
  background: rgba(108, 158, 255, 0.15);
  color: var(--accent);
}
.badge-closed {
  background: rgba(248, 113, 113, 0.12);
  color: var(--err);
}

form.inline-actions {
  display: inline;
}

.btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
html[data-theme="dark"] .btn-primary {
  color: #0b1020;
  text-shadow: none;
}
.btn-primary:hover {
  filter: brightness(1.08);
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-danger {
  background: rgba(248, 113, 113, 0.2);
  color: var(--err);
  border: 1px solid rgba(248, 113, 113, 0.4);
}
html[data-theme="dark"] .btn-danger {
  color: #fecaca;
}

.form-grid {
  display: grid;
  gap: 0.85rem 1rem;
  max-width: 520px;
}
.form-grid.two {
  grid-template-columns: 1fr 1fr;
}

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  font-size: 0.9rem;
}

input[type="file"].feedback-file-input,
.feedback-form input[type="file"] {
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

.form-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.5rem;
}

/* 登录页：左侧品牌 + 右侧登录区（卡片与底部横向二维码） */
.login-page-shell {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(400px, 580px);
  gap: 2rem 3rem;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  align-items: start;
}

.login-brand {
  padding-top: 0.35rem;
  justify-self: start;
  text-align: left;
  width: 100%;
  max-width: 560px;
}

.login-brand__logo {
  display: block;
  max-width: 320px;
  width: 100%;
  height: auto;
}

.login-brand__lead {
  margin: 1rem 0 1.35rem;
  font-size: 1.2rem;
  line-height: 1.55;
  font-weight: 600;
  color: var(--text);
}

.login-brand__art {
  max-width: 520px;
}

.login-brand__art img {
  width: 100%;
  height: auto;
  display: block;
}

.login-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 580px;
  justify-self: stretch;
}

.login-stack .login-card {
  max-width: 580px;
  width: 100%;
}

.login-stack .login-card--tabs {
  max-width: 580px;
  width: 100%;
}

.login-support-bar {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.35rem;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.45rem;
  box-shadow: 0 12px 40px rgba(26, 34, 64, 0.08);
}

html[data-theme="dark"] .login-support-bar {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.login-support-bar__qr {
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
}

.login-support-bar__copy {
  flex: 1;
  min-width: 0;
}

.login-support-bar__intro {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

.login-support-bar__list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text);
}

.login-support-bar__list li {
  margin-bottom: 0.55rem;
}

.login-support-bar__list li:last-child {
  margin-bottom: 0;
}

.login-support-bar__hint {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

@media (max-width: 960px) {
  .login-page-shell {
    grid-template-columns: 1fr;
    max-width: 580px;
    gap: 1.75rem;
  }

  .login-brand {
    text-align: center;
  }

  .login-brand__logo {
    margin-left: auto;
    margin-right: auto;
  }

  .login-brand__art {
    margin-left: auto;
    margin-right: auto;
  }

  .login-stack {
    justify-self: stretch;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .login-support-bar {
    flex-direction: column;
    text-align: center;
  }

  .login-support-bar__qr {
    margin: 0 auto;
  }
}

/* 登录 / 授权页：表单 + 右侧公众号二维码 */
.login-page-layout {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem 2rem;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}

.login-page-layout .login-card {
  flex: 1 1 320px;
  max-width: 420px;
}

/* 多租户：单卡片三标签（授权激活 / 总店登录 / 分店登录） */
.login-page-layout--tabs {
  max-width: 920px;
  align-items: flex-start;
}
.login-page-layout--tabs .login-card--tabs {
  flex: 1 1 520px;
  max-width: 560px;
}
.login-card--tabs {
  padding-top: 1.35rem;
}
.login-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin: -1.35rem -2rem 1.25rem;
  padding: 0 0.25rem;
}
.login-tab-btn {
  flex: 1;
  padding: 0.75rem 0.35rem;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.login-tab-btn:hover {
  color: var(--text);
}
.login-tab-btn.is-active {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
}
.login-tab-panel {
  display: none;
}
.login-tab-panel.is-active {
  display: block;
}

/* 多租户：登录页双卡片（授权注册 + 账号登录） */
.login-page-layout--dual {
  max-width: 1080px;
}
.login-dual-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  align-items: stretch;
  flex: 1 1 560px;
  max-width: 720px;
}
.login-dual-cards .login-card {
  flex: 1 1 280px;
  max-width: none;
}
.login-card--compact {
  padding: 1.35rem 1.5rem;
}
.login-card__title {
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
  font-weight: 700;
}
.login-card .sub.small {
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

.login-qr-panel {
  flex: 0 1 260px;
  min-width: 220px;
  max-width: 280px;
}

.login-qr-panel__inner {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 12px 40px rgba(26, 34, 64, 0.08);
  text-align: center;
}

html[data-theme="dark"] .login-qr-panel__inner {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.login-qr-panel__img {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  margin: 0 auto 1rem;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.login-qr-panel__line {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text);
}

.login-qr-panel__line:last-child {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .login-page-layout {
    flex-direction: column;
    align-items: stretch;
  }
  .login-qr-panel {
    flex: 1 1 auto;
    max-width: none;
    order: 1;
  }
  .login-page-layout .login-card {
    order: 0;
    max-width: none;
  }
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(26, 34, 64, 0.12);
}
html[data-theme="dark"] .login-card {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.login-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}
.login-card .sub {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.hint {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.tabs a {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.tabs a:hover {
  background: var(--panel2);
  color: var(--text);
  text-decoration: none;
}

.tabs a.active {
  background: linear-gradient(135deg, rgba(108, 158, 255, 0.25), rgba(167, 139, 250, 0.15));
  border-color: rgba(108, 158, 255, 0.35);
  color: var(--text);
}

.members-archive-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 960px) {
  .members-archive-layout {
    grid-template-columns: 1fr;
  }
}
tr.members-row-sel td {
  background: rgba(108, 158, 255, 0.07);
}
.members-side-card {
  position: sticky;
  top: 0.5rem;
}

.member-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
.member-modal.is-open {
  display: flex;
}
.member-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(2px);
}
.member-modal__panel {
  position: relative;
  width: 100%;
  max-width: 26rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.member-modal__title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.member-modal__body {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 1rem;
}
.member-modal__body p {
  margin: 0 0 0.55rem;
}
.member-modal__body p:last-child {
  margin-bottom: 0;
}
.member-modal__hint {
  color: var(--muted);
  font-size: 0.85rem;
}
.member-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.member-modal__actions .btn {
  width: 100%;
  justify-content: center;
}
.member-modal__actions--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.member-modal__actions--inline .btn {
  flex: 1 1 auto;
  min-width: 6.5rem;
  width: auto;
}

.money-in {
  color: #047857;
}
html[data-theme="dark"] .money-in {
  color: #6ee7b7;
}

.money-out {
  color: #b91c1c;
}
html[data-theme="dark"] .money-out {
  color: #fca5a5;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

.card-title {
  color: var(--text);
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.row-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
}

.inline-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-right: 0.25rem;
}

.btn.sm {
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
}

.readonly-num {
  opacity: 0.75;
  cursor: not-allowed;
}

.finance-preview .preview-lines strong {
  color: var(--accent);
}

/* 财务：简化操作与日期/月份导航 */
.form-grid-tight {
  gap: 0.65rem 0.75rem;
}

.finance-date-block label,
.finance-quick-form label {
  margin-bottom: 0.2rem;
}

.finance-date-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.finance-date-input {
  min-height: 2.5rem;
  font-size: 1rem;
  max-width: 11.5rem;
}

.date-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.btn-chip {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-chip:hover {
  border-color: rgba(108, 158, 255, 0.45);
  background: rgba(108, 158, 255, 0.12);
}

.seg-toggle {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.seg-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem;
  margin: 0;
  cursor: pointer;
  background: var(--panel2);
  color: var(--muted);
  font-size: 0.875rem;
}

.seg-item:has(input:checked),
.seg-item.seg-active {
  background: rgba(108, 158, 255, 0.22);
  color: var(--text);
  font-weight: 600;
}

.seg-item input {
  margin: 0;
  accent-color: var(--accent);
}

.finance-adv summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  user-select: none;
}

.finance-adv summary:hover {
  color: var(--accent);
}

.finance-preview-compact {
  margin-top: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel2);
}

.finance-preview-compact .preview-lines {
  margin-top: 0.25rem;
  font-size: 0.95rem;
}

.finance-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.25rem;
}

.finance-month-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.finance-month-input {
  min-height: 2.35rem;
  font-size: 1rem;
  padding: 0.35rem 0.5rem;
}

.finance-filter-rest {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.finance-filter-rest select {
  min-width: 8.5rem;
}

.finance-export-fold summary {
  user-select: none;
}

/* 进销存：商品弹窗方块选择 */
.inv-picker-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.inv-picker-label {
  flex: 1;
  min-width: 0;
}

.inv-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem;
  padding-top: 4vh;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.inv-modal.is-open {
  pointer-events: auto;
  opacity: 1;
}

.inv-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.inv-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  max-height: min(82vh, 900px);
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 1rem 1.1rem 1.1rem;
  overflow: hidden;
}

.inv-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.inv-modal-close {
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.2rem 0.55rem;
}

.inv-picker-search {
  width: 100%;
  margin-bottom: 0.75rem;
}

.inv-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.55rem;
  overflow-y: auto;
  padding: 0.15rem;
  -webkit-overflow-scrolling: touch;
}

.inv-picker-card {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s;
  font: inherit;
}

.inv-picker-card:hover {
  border-color: rgba(108, 158, 255, 0.45);
  transform: translateY(-1px);
}

.inv-picker-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.inv-picker-card-sku {
  margin-bottom: 0.45rem;
}

.inv-picker-card-stats {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
}

.inv-picker-stat strong {
  color: var(--ok);
}

.inv-picker-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.5rem;
}

body.inv-modal-open .main {
  pointer-events: none;
}

@media (max-width: 768px) {
  body:not(.login-page) {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    display: block;
  }

  body:not(.login-page).nav-drawer-open {
    overflow: hidden;
  }

  .layout {
    display: block;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
  }

  body.nav-drawer-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(288px, 86vw);
    max-width: 100%;
    flex: none;
    z-index: 1050;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    border-right: 1px solid var(--border);
    border-bottom: none;
    box-shadow: 12px 0 48px rgba(0, 0, 0, 0.2);
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    padding: max(0.85rem, env(safe-area-inset-top, 0px)) 1rem 1rem
      max(1rem, env(safe-area-inset-left, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.nav-drawer-open .sidebar {
    transform: translateX(0);
  }

  .nav {
    flex-direction: column;
    flex-wrap: nowrap;
    width: auto;
    gap: 0.25rem;
  }

  .sidebar-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    flex-wrap: nowrap;
  }

  .sidebar-foot .user {
    width: 100%;
    word-break: break-word;
  }

  .main {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: auto;
    overflow-y: visible;
    flex: none;
    padding: max(0.65rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px))
      max(1.25rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  }

  .topbar h1 {
    font-size: clamp(1.05rem, 4.2vw, 1.28rem);
  }

  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-backdrop {
    transition: none;
  }
}

/* —— 系统设置页、后台同步提示、偏好 —— */
.settings-grid {
  display: grid;
  gap: 1rem;
  max-width: 720px;
}
.settings-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}
.settings-card--danger {
  border-color: rgba(239, 68, 68, 0.42);
  background: linear-gradient(
    165deg,
    rgba(239, 68, 68, 0.07) 0%,
    var(--panel) 42%
  );
}
.settings-card h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 600;
}
.settings-card p.hint {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
}
.settings-field {
  margin-bottom: 0.85rem;
}
.settings-field:last-child {
  margin-bottom: 0;
}
.settings-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.settings-field select,
.settings-field input[type="text"] {
  max-width: 100%;
  width: min(100%, 22rem);
}
.settings-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.settings-inline label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  margin: 0;
  cursor: pointer;
}
.settings-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.settings-saved {
  font-size: 0.85rem;
  color: var(--ok);
  min-height: 1.25rem;
}

#app-settings-toast-host {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
  pointer-events: none;
  max-width: min(92vw, 320px);
}
.app-settings-toast {
  pointer-events: none;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  animation: app-toast-in 0.22s ease-out;
}
html[data-theme="dark"] .app-settings-toast {
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
}
.app-settings-toast--ok {
  border-color: rgba(52, 211, 153, 0.35);
}
.app-settings-toast--err {
  border-color: rgba(248, 113, 113, 0.4);
}
@keyframes app-toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.pref-compact-tables table.data th,
body.pref-compact-tables table.data td {
  padding: 0.4rem 0.55rem;
  font-size: 0.84rem;
}

body.pref-reduce-motion *,
body.pref-reduce-motion *::before,
body.pref-reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

body.pref-font-large .main {
  font-size: 1.0625rem;
}
body.pref-font-large .main .small,
body.pref-font-large .main .tiny {
  font-size: inherit;
}
body.pref-font-large .main .small {
  font-size: 0.9rem;
}
body.pref-font-large .main .tiny {
  font-size: 0.8rem;
}

/* —— 浅色主题：总览页右侧与图表与左侧 KPI 统一为浅色卡片体系（避免「半深半浅」割裂） —— */
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .card {
  box-shadow: 0 1px 3px rgba(26, 34, 64, 0.04), 0 8px 24px rgba(26, 34, 64, 0.05);
  border-color: rgba(26, 34, 64, 0.08);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .table-wrap {
  border-color: rgba(26, 34, 64, 0.1);
  box-shadow: 0 1px 2px rgba(26, 34, 64, 0.04);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dashboard-biz {
  background: linear-gradient(165deg, #ffffff 0%, #f7f9fe 48%, #eef3fc 100%);
  border: 1px solid rgba(26, 34, 64, 0.1);
  box-shadow: 0 4px 24px rgba(26, 34, 64, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dashboard-biz::before {
  background: linear-gradient(135deg, rgba(59, 111, 217, 0.07), transparent 48%);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-viz {
  background: linear-gradient(165deg, #ffffff 0%, #f6f8fd 100%);
  border: 1px solid rgba(26, 34, 64, 0.1);
  box-shadow: 0 2px 16px rgba(26, 34, 64, 0.06);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-quick-links {
  background: linear-gradient(165deg, #ffffff 0%, #f4f7fd 100%);
  border: 1px solid rgba(26, 34, 64, 0.1);
  box-shadow: 0 2px 16px rgba(26, 34, 64, 0.05);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-quick-links--horizontal.dash-quick-links {
  background: linear-gradient(165deg, #fbfcff 0%, #f0f4fc 100%);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-quick-links__item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(26, 34, 64, 0.1);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-quick-links__item:hover {
  background: rgba(59, 111, 217, 0.08);
  border-color: rgba(59, 111, 217, 0.35);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-quick-links__icon {
  background: rgba(59, 111, 217, 0.06);
  border: 1px solid rgba(26, 34, 64, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-quick-spotlight {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 252, 0.98) 100%);
  border: 1px solid rgba(59, 111, 217, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-quick-spotlight__item {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(26, 34, 64, 0.1);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-quick-spotlight__item:hover {
  background: rgba(59, 111, 217, 0.09);
  border-color: rgba(59, 111, 217, 0.35);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-quick-spotlight__icon {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(26, 34, 64, 0.1);
  box-shadow: 0 1px 3px rgba(26, 34, 64, 0.06);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-quick-spotlight--in-biz {
  border-top-color: rgba(26, 34, 64, 0.1);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-all-stores-biz {
  background: linear-gradient(165deg, #ffffff 0%, #f6f8fd 100%);
  border: 1px solid rgba(26, 34, 64, 0.1);
  box-shadow: 0 2px 14px rgba(26, 34, 64, 0.05);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-all-stores-biz__actions {
  border-top-color: rgba(26, 34, 64, 0.08);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-biz-status {
  background: rgba(59, 111, 217, 0.05);
  border-color: rgba(26, 34, 64, 0.1);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-biz-status--open {
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.28);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-biz-status--open .dash-biz-status-dot {
  box-shadow: 0 0 10px rgba(5, 150, 105, 0.45);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-biz-status--closed,
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-biz-status--paused {
  background: rgba(59, 111, 217, 0.06);
  border-color: rgba(59, 111, 217, 0.22);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-biz-clock-block {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(26, 34, 64, 0.1);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-live-clock {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 20px rgba(59, 111, 217, 0.15);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .dash-biz-metric {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(26, 34, 64, 0.08);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .member-modal__backdrop {
  background: rgba(26, 34, 64, 0.38);
}
html:is([data-theme="light"], [data-theme="ocean"], [data-theme="warm"], [data-theme="mint"], [data-theme="rose"]) .member-modal__panel {
  box-shadow: 0 18px 48px rgba(26, 34, 64, 0.14);
}

/* —— 新手引导（欢迎弹窗 + 分步气泡） —— */
#sp-onboard-root {
  position: fixed;
  inset: 0;
  z-index: 11050;
  pointer-events: none;
}

#sp-onboard-root > * {
  pointer-events: auto;
}

body.sp-onboard-modal-open {
  overflow: hidden;
}

.sp-onboard-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(80vh, 520px);
  overflow: auto;
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.sp-onboard-modal__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.sp-onboard-modal__body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 1rem;
}

.sp-onboard-modal__actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.45rem;
}

@media (min-width: 420px) {
  .sp-onboard-modal__actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .sp-onboard-modal__actions .btn {
    min-width: 6.5rem;
  }
}

.sp-onboard--modal::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 0;
  pointer-events: auto;
}

.sp-onboard--tour {
  pointer-events: none;
}

.sp-onboard-tour__dim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 0;
  pointer-events: auto;
}

.sp-onboard-tour__hole {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  border: 2px solid var(--accent);
  border-radius: 10px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12), 0 12px 40px rgba(0, 0, 0, 0.25);
}

.sp-onboard-popover {
  position: fixed;
  z-index: 2;
  width: min(19rem, calc(100vw - 2rem));
  padding: 0.9rem 1rem 0.75rem;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.sp-onboard-popover__title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.sp-onboard-popover__text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.sp-onboard-popover__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sp-onboard-popover__step {
  font-size: 0.72rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .sp-onboard-modal {
    transition: none;
  }
}

/* —— 使用手册（侧栏入口，可搜索） —— */
#sp-handbook-root {
  position: fixed;
  inset: 0;
  z-index: 11100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
#sp-handbook-root.is-open {
  display: flex;
}
#sp-handbook-root .sp-handbook-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(3px);
}
#sp-handbook-root .sp-handbook-panel {
  position: relative;
  width: 100%;
  max-width: min(40rem, 100%);
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.sp-handbook-head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sp-handbook-head h2 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.sp-handbook-search {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
}
.sp-handbook-search::placeholder {
  color: var(--muted);
  opacity: 0.85;
}
.sp-handbook-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.65rem 1rem 1rem;
  -webkit-overflow-scrolling: touch;
}
.sp-handbook-empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
  font-size: 0.88rem;
}
.sp-handbook-section {
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.sp-handbook-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.sp-handbook-section h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.sp-handbook-section .sp-handbook-body {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
}
.sp-handbook-section .sp-handbook-body p {
  margin: 0 0 0.5rem;
}
.sp-handbook-section .sp-handbook-body ul {
  margin: 0.35rem 0 0.5rem;
  padding-left: 1.1rem;
}
.sp-handbook-section .sp-handbook-body li {
  margin-bottom: 0.35rem;
}
.sp-handbook-section .sp-handbook-body strong {
  color: var(--text);
}
.sp-handbook-section mark {
  background: rgba(108, 158, 255, 0.28);
  color: inherit;
  padding: 0 0.12em;
  border-radius: 2px;
}
.sp-handbook-foot {
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
}
body.sp-handbook-open {
  overflow: hidden;
}

/* 授权管理页 */
.license-manage-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.9rem;
  align-items: baseline;
}
.license-manage-dl dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}
.license-manage-dl dd {
  margin: 0;
  color: var(--text);
  word-break: break-all;
}
.license-manage-code {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.license-manage-expired {
  color: var(--err);
  font-weight: 600;
}

/* 授权即将到期：右下角提醒（每次整页加载出现，关闭仅隐藏当前页） */
.sp-license-renew-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 12000;
  max-width: 20rem;
  padding: 0.85rem 1rem 0.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
  font-size: 0.82rem;
  line-height: 1.45;
}
html[data-theme="dark"] .sp-license-renew-toast {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
.sp-license-renew-toast__close {
  position: absolute;
  top: 0.35rem;
  right: 0.4rem;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}
.sp-license-renew-toast__close:hover {
  background: var(--panel2);
  color: var(--text);
}
.sp-license-renew-toast__title {
  display: block;
  margin: 0 1.5rem 0.35rem 0;
  font-size: 0.92rem;
  color: #b45309;
}
html[data-theme="dark"] .sp-license-renew-toast__title {
  color: #fbbf24;
}
.sp-license-renew-toast__body {
  margin: 0 0 0.5rem;
  color: var(--text);
}
.sp-license-renew-toast__link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}
@media (max-width: 768px) {
  .sp-license-renew-toast {
    right: 0.65rem;
    bottom: 0.65rem;
    left: 0.65rem;
    max-width: none;
  }
}
