/* HKTVmall 监控 · 本地总控面板样式（纯原生 CSS，无任何外链） */

:root {
  --bg: #f5f7fb;
  --bg-soft: #eef1f9;
  --panel: #ffffff;
  --panel-2: #f9fafd;
  --panel-3: #f1f4fb;
  --field-bg: #ffffff;
  --ink: #172033;
  --ink-2: #303b52;
  --muted: #5f6a85;
  --line: #e3e8f2;
  --line-strong: #d4dbea;
  --accent: #4f6ef7;
  --accent-deep: #3d56d6;
  --violet: #7c5cfc;
  --green: #10a56e;
  --green-soft: #e6f7f0;
  --green-ink: #087a52;
  --amber: #d9960b;
  --amber-soft: #fdf3dd;
  --amber-ink: #92630a;
  --red: #e0474c;
  --red-soft: #fdeaea;
  --red-ink: #b02a30;
  --blue-soft: #e9efff;
  --violet-soft: #f0ecff;
  --gray: #98a2b5;
  --gray-soft: #edf0f6;
  --gray-ink: #65708a;
  --topbar-bg: rgba(255, 255, 255, 0.86);
  --hover-btn: #f6f8ff;
  --hover-row: #fafbff;
  --empty-bg: rgba(255, 255, 255, 0.5);
  --wizard-step-bg: rgba(255, 255, 255, 0.78);
  --danger-bg: #fff7f7;
  --switch-track: #cfd6e4;
  --quick-border: #cfd9ff;
  --callout-bg: #f2f5ff;
  --callout-border: #dde4ff;
  --callout-ink: #3b4a78;
  --skeleton-base: #eef2fa;
  --skeleton-shine: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  /* iOS 级弹簧物理曲线：统一入口，禁止各组件各写一套 */
  --spring-open: cubic-bezier(0.22, 1.14, 0.36, 1);
  --spring-move: cubic-bezier(0.25, 1.08, 0.38, 1);
  --ease-close: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-press: cubic-bezier(0.2, 0, 0, 1);
  --glass-bg: rgba(255, 255, 255, 0.86);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-highlight: rgba(255, 255, 255, 0.9);
  --glass-shadow: 0 2px 6px rgba(23, 32, 51, 0.05), 0 18px 44px -18px rgba(23, 32, 51, 0.24), 0 40px 80px -40px rgba(23, 32, 51, 0.3);
  --shadow: 0 1px 2px rgba(23, 32, 51, 0.04), 0 8px 20px rgba(23, 32, 51, 0.05), 0 22px 44px -18px rgba(23, 32, 51, 0.1);
  --shadow-sm: 0 1px 2px rgba(23, 32, 51, 0.05), 0 5px 14px rgba(23, 32, 51, 0.06);
  --shadow-hover: 0 2px 4px rgba(23, 32, 51, 0.05), 0 14px 28px rgba(23, 32, 51, 0.09), 0 30px 56px -20px rgba(23, 32, 51, 0.16);
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* ───────────── 深色护眼模式：低眩光石墨深蓝，语义变量整体接管 ───────────── */

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1120;
  --bg-soft: #0e1729;
  --panel: #111827;
  --panel-2: #182235;
  --panel-3: #1e2a3f;
  --field-bg: #0f1a2c;
  --ink: #e6edf8;
  --ink-2: #c3cee2;
  --muted: #8b98b0;
  --line: #243149;
  --line-strong: #31405c;
  --accent: #7c93ff;
  --accent-deep: #a9b8ff;
  --violet: #a78bfa;
  --green: #3ddc9a;
  --green-soft: rgba(16, 165, 110, 0.16);
  --green-ink: #5fe3b0;
  --amber: #f0b229;
  --amber-soft: rgba(217, 150, 11, 0.16);
  --amber-ink: #f3c36a;
  --red: #ff7b80;
  --red-soft: rgba(224, 71, 76, 0.16);
  --red-ink: #ff9ba0;
  --blue-soft: rgba(79, 110, 247, 0.16);
  --violet-soft: rgba(124, 92, 252, 0.18);
  --gray: #7d8aa3;
  --gray-soft: rgba(152, 162, 181, 0.14);
  --gray-ink: #9aa7bd;
  --topbar-bg: rgba(11, 17, 32, 0.82);
  --hover-btn: #1b2740;
  --hover-row: #16213a;
  --empty-bg: rgba(17, 24, 39, 0.5);
  --wizard-step-bg: rgba(24, 34, 53, 0.72);
  --danger-bg: rgba(224, 71, 76, 0.12);
  --switch-track: #32405a;
  --quick-border: rgba(124, 146, 255, 0.35);
  --callout-bg: rgba(79, 110, 247, 0.12);
  --callout-border: rgba(124, 146, 255, 0.28);
  --callout-ink: #b9c6ea;
  --skeleton-base: #1b2740;
  --skeleton-shine: #2a3852;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 26px rgba(0, 0, 0, 0.32), 0 26px 52px -20px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 16px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.35), 0 16px 34px rgba(0, 0, 0, 0.4), 0 34px 60px -22px rgba(0, 0, 0, 0.6);
  --glass-bg: rgba(17, 24, 39, 0.84);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-highlight: rgba(255, 255, 255, 0.14);
  --glass-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 22px 54px -18px rgba(0, 0, 0, 0.62), 0 44px 90px -42px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1000px 480px at 6% -12%, rgba(79, 110, 247, 0.12), transparent 62%),
    radial-gradient(900px 420px at 96% 0%, rgba(124, 92, 252, 0.1), transparent 60%),
    var(--bg);
  font-size: 14px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

[data-theme="dark"] body {
  background:
    radial-gradient(1000px 480px at 6% -12%, rgba(79, 110, 247, 0.16), transparent 62%),
    radial-gradient(900px 420px at 96% 0%, rgba(124, 92, 252, 0.14), transparent 60%),
    var(--bg);
}

.hidden { display: none !important; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#i-play path, #i-stop rect { fill: currentColor; stroke: none; }

/* ───────────────── 顶栏 ───────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
  margin-right: auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff;
  font-weight: 800;
  font-size: 21px;
  box-shadow: 0 8px 18px rgba(79, 110, 247, 0.35);
}

.brand-text h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 版本徽章：从 /api/overview 的动态版本号渲染，低调放在标题右侧 */
.badge.version-badge {
  background: var(--blue-soft);
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

.status-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
}

.status-sep {
  width: 1px;
  height: 16px;
  background: var(--line-strong);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.dot.gray { background: var(--gray); box-shadow: 0 0 0 4px rgba(152, 162, 181, 0.15); }
.dot.green { background: var(--green); box-shadow: 0 0 0 4px rgba(16, 165, 110, 0.16); animation: breathe 2.4s ease-in-out infinite; }
.dot.amber { background: var(--amber); box-shadow: 0 0 0 4px rgba(217, 150, 11, 0.16); animation: breathe 1.8s ease-in-out infinite; }
.dot.red { background: var(--red); box-shadow: 0 0 0 4px rgba(224, 71, 76, 0.16); animation: breathe 1.2s ease-in-out infinite; }

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-divider {
  width: 1px;
  height: 22px;
  background: var(--line-strong);
  margin: 0 4px;
}

/* 浅色 / 深色护眼模式切换：图标 + 提示文案，状态持久化在 localStorage */
.theme-toggle {
  border-radius: 999px;
  gap: 6px;
  color: var(--accent-deep);
  background: var(--panel-2);
}

.theme-toggle:hover { color: var(--accent); }

.theme-icon-dark { display: none; }

[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: block; }
[data-theme="dark"] .theme-toggle { color: var(--amber); }

/* ───────────────── 按钮 ───────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:hover { background: var(--hover-btn); border-color: #b9c6ec; box-shadow: var(--shadow-sm); }
[data-theme="dark"] .btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px) scale(0.995); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }

.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 110, 247, 0.28);
}

.btn.primary:hover { filter: brightness(1.05); background: linear-gradient(135deg, var(--accent), var(--violet)); }

.btn.danger {
  border-color: #f3c3c5;
  color: var(--red);
  background: var(--danger-bg);
}

.btn.danger:hover { background: var(--red-soft); border-color: #eba1a4; }
[data-theme="dark"] .btn.danger { border-color: rgba(224, 71, 76, 0.4); }
[data-theme="dark"] .btn.danger:hover { border-color: var(--red); }

.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.sm .icon { width: 15px; height: 15px; }

.btn.icon-only { width: 36px; padding: 0; }
.btn.icon-only.sm { width: 30px; height: 30px; }

.link-btn {
  border: 0;
  background: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 2px;
}

.link-btn:hover { text-decoration: underline; }

/* ───────────────── 开关 ───────────────── */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  color: var(--ink-2);
}

.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch-track {
  width: 38px;
  height: 21px;
  border-radius: 999px;
  background: var(--switch-track);
  position: relative;
  transition: background 0.18s ease;
  flex: 0 0 auto;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease;
}

.switch input:checked + .switch-track { background: linear-gradient(135deg, var(--accent), var(--violet)); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(17px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ───────────────── 标签页 ───────────────── */

.tabs {
  position: sticky;
  top: 67px;
  z-index: 30;
  display: flex;
  gap: 6px;
  padding: 10px 24px 0;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(243, 245, 251, 0));
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px 12px 0 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.tab:hover { color: var(--accent); background: var(--hover-btn); }

.tab.active {
  color: var(--accent-deep);
  background: var(--panel);
  border-color: var(--line);
  border-bottom-color: var(--panel);
  box-shadow: 0 -4px 16px rgba(23, 32, 51, 0.05);
}

[data-theme="dark"] .tab.active { box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.4); }

/* ───────────────── 页面骨架 ───────────────── */

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 24px 80px;
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeUp 0.22s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.banner {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

.banner.danger { background: var(--red-soft); border: 1px solid #f3c3c5; color: #a52a2f; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  min-width: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card h2 { margin: 0; font-size: 15px; letter-spacing: 0.2px; }
.card h3 { margin: 0; font-size: 13.5px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

fieldset.card { margin: 0; }
fieldset.card legend { padding: 0 6px; margin-left: -6px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 2px -4px;
}

.section-head h2 { margin: 0; font-size: 16px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 11.5px; }

.hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.empty {
  margin: 0;
  padding: 22px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

.empty-state {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--empty-bg);
}

/* ───────────────── KPI ───────────────── */

.kpi-row {
  display: flex;
  gap: 14px;
}

.kpi-row .kpi {
  flex: 1 1 0;
  min-width: 0;
  /* v2.7.2：box-shadow / filter 已移出过渡列表（展开大阴影交给 ::after 只过渡 opacity，
     filter 饱和度变化随状态瞬时切换），避免弹簧挤压期间整卡重绘、毛玻璃闪烁 */
  transition:
    flex-grow 320ms var(--spring-move),
    transform 320ms var(--spring-move),
    opacity 260ms var(--spring-move),
    border-color 220ms ease,
    background-color 220ms ease;
}

/* 按下微缩，松开沿弹簧曲线回弹 */
.kpi-row .kpi:active {
  transform: scale(0.972);
  transition-duration: 110ms;
  transition-timing-function: var(--ease-press);
}

/* 仅桌面弹性布局做「手风琴挤压」；窄屏保持规整网格，绝不挤压文字 */
@media (min-width: 1201px) {
  .kpi-row.has-active-kpi .kpi.is-expanded {
    flex-grow: 1.38;
    transform: translateY(-3px) scale(1.015);
    opacity: 1;
    border-color: var(--accent);
    z-index: 2;
  }

  .kpi-row.has-active-kpi .kpi.is-expanded:hover {
    transform: translateY(-3px) scale(1.015);
  }

  .kpi-row.has-active-kpi .kpi:not(.is-expanded) {
    flex-grow: 0.9;
    opacity: 0.66;
    transform: scale(0.982);
    filter: saturate(0.85);
  }

  .kpi-row.has-active-kpi .kpi:not(.is-expanded):hover {
    opacity: 0.92;
    transform: scale(0.995);
    filter: saturate(1);
  }

  .kpi-row.has-active-kpi .kpi:not(.is-expanded):active {
    transform: scale(0.972);
  }
}

.kpi {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.18s ease, background-color 0.2s ease;
}

.kpi:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}

/* 展开态大阴影放在独立伪元素上：只过渡 opacity（GPU 合成层），
   弹性挤压期间不重绘整卡；真毛玻璃 backdrop-filter 全程保持，绝不关闭 */
.kpi::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow:
    0 3px 8px rgba(23, 32, 51, 0.06),
    0 20px 42px -16px rgba(79, 110, 247, 0.32);
  transition: opacity 240ms var(--spring-move);
}

.kpi-row.has-active-kpi .kpi.is-expanded::after {
  opacity: 1;
}

/* 只有可下钻的卡片才显示「查看明细 →」，右下角淡入，不打断原有排版 */
.kpi-link::before {
  content: "查看明细 →";
  position: absolute;
  right: 14px;
  bottom: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.18s ease, transform 0.18s ease, color 0.18s ease;
  pointer-events: none;
}

.kpi-link:hover::before,
.kpi-link:focus-visible::before { opacity: 1; transform: none; }

.kpi-link:active { transform: translateY(0) scale(0.995); }
.kpi-link:hover .kpi-icon { transform: translateY(-1px); }

.kpi-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: 0 0 auto;
  transition: transform 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}

.kpi-icon .icon { width: 20px; height: 20px; }
.kpi-icon.blue { background: var(--blue-soft); color: var(--accent); }
.kpi-icon.violet { background: var(--violet-soft); color: var(--violet); }
.kpi-icon.red { background: var(--red-soft); color: var(--red); }
.kpi-icon.green { background: var(--green-soft); color: var(--green); }
.kpi-icon.amber { background: var(--amber-soft); color: var(--amber); }

.kpi-label { margin: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi-value {
  display: block;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin: 2px 0 1px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease, transform 0.2s ease;
}
.kpi-foot { margin: 0; font-size: 11px; color: var(--muted); transition: opacity 0.18s ease; }

/* 悬停时右下角提示取代脚注，避免文字叠在一起 */
.kpi-link:hover .kpi-foot,
.kpi-link:focus-visible .kpi-foot { opacity: 0; }

/* 0 值更沉静，有数字时更有重点感 */
.kpi.is-zero .kpi-value { color: var(--muted); font-weight: 600; }
.kpi.is-zero .kpi-icon { opacity: 0.68; filter: saturate(0.7); }
.kpi.is-zero .kpi-label { font-weight: 500; }
.kpi:not(.is-zero) .kpi-value { font-weight: 800; }

/* 刷新后数值变动：450ms 轻柔脉冲（reduced-motion 下自动关闭） */
.value-pulse { animation: valuePulse 450ms ease; }

@keyframes valuePulse {
  0% { transform: scale(1); text-shadow: 0 0 0 rgba(79, 110, 247, 0); }
  35% { transform: scale(1.06); text-shadow: 0 0 18px rgba(79, 110, 247, 0.45); }
  100% { transform: scale(1); text-shadow: 0 0 0 rgba(79, 110, 247, 0); }
}

/* ───────────────── 运行状态 ───────────────── */

.facts { margin: 0; display: flex; flex-direction: column; }

.facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: 12.5px; flex: 0 0 auto; }
.facts dd { margin: 0; text-align: right; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.notify-summary { display: flex; flex-direction: column; gap: 10px; }

.mini-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px;
}

.mini-stat span { color: var(--muted); }
.mini-stat strong { font-size: 14px; overflow-wrap: anywhere; text-align: right; font-variant-numeric: tabular-nums; }

/* ───────────────── 徽章 ───────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.badge.gray, .badge.s-init { background: var(--gray-soft); color: var(--gray-ink); }
.badge.blue { background: var(--blue-soft); color: var(--accent-deep); }
.badge.green, .badge.s-ok { background: var(--green-soft); color: var(--green-ink); }
.badge.amber, .badge.s-degraded { background: var(--amber-soft); color: var(--amber-ink); }
.badge.red, .badge.s-error, .badge.s-session_expired { background: var(--red-soft); color: var(--red-ink); }
.badge.quiet { background: var(--violet-soft); color: var(--accent-deep); }
.badge.quiet.active { background: linear-gradient(135deg, #5a63d8, #7c5cfc); color: #fff; box-shadow: 0 3px 10px rgba(90, 99, 216, 0.3); }
.badge.off { background: var(--gray-soft); color: var(--gray); }

/* ───────────────── 账号卡片 ───────────────── */

.accounts-list { display: flex; flex-direction: column; gap: 14px; }

.account-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.account-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px 14px;
  background: linear-gradient(120deg, rgba(79, 110, 247, 0.05), rgba(124, 92, 252, 0.03) 45%, transparent);
  border-bottom: 1px solid var(--line);
}

.account-id { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.account-id h3 { margin: 0; font-size: 15.5px; }
.account-id p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e8edff, #f1ecff);
  color: var(--accent-deep);
  font-weight: 800;
  font-size: 15px;
  flex: 0 0 auto;
}

[data-theme="dark"] .avatar {
  background: linear-gradient(135deg, rgba(79, 110, 247, 0.24), rgba(124, 92, 252, 0.22));
  color: var(--accent-deep);
}

.account-badges { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.token-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
}

.token-mini .icon { width: 14px; height: 14px; color: var(--muted); }
.token-mini .warn { color: var(--amber); font-weight: 700; }
.token-mini .bad { color: var(--red); font-weight: 700; }

.account-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-left: auto; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 720px; }

thead th {
  text-align: left;
  padding: 9px 14px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

thead th.num, tbody td.num { text-align: right; }

tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--hover-row); }
tbody tr { transition: background-color 0.15s ease; }

td.num { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13.5px; }
td.num.hot { color: var(--red); }
td.num.warm { color: var(--amber); }

.sub { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); }
.sub.warm { color: var(--amber); }

.store-name { font-weight: 700; }
.store-code { color: var(--muted); font-size: 10.5px; font-family: var(--mono); }

/* ───────────────── 队列与事件 ───────────────── */

.queue-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }

.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 12.5px;
}

.queue-item .q-account {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--accent-deep);
  font-size: 10.5px;
  font-weight: 700;
}

.queue-item .q-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item .q-delta { font-weight: 800; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.queue-item .q-time { color: var(--muted); font-size: 10.5px; white-space: nowrap; }

.event-list { display: flex; flex-direction: column; }
.event-list.tall { max-height: 520px; overflow-y: auto; }

.event-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 6px;
  border-bottom: 1px dashed var(--line);
}

.event-item:last-child { border-bottom: 0; }

.event-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--gray-soft);
  color: var(--muted);
  flex: 0 0 auto;
}

.event-icon .icon { width: 16px; height: 16px; }
.event-icon.new { background: var(--blue-soft); color: var(--accent); }
.event-icon.cancelled, .event-icon.alert { background: var(--red-soft); color: var(--red); }
.event-icon.qna { background: var(--green-soft); color: var(--green); }
.event-icon.review { background: var(--amber-soft); color: var(--amber); }
.event-icon.system { background: var(--violet-soft); color: var(--violet); }

.event-body { flex: 1; min-width: 0; }
.event-title { margin: 0; font-size: 12.5px; font-weight: 700; overflow-wrap: anywhere; }
.event-title.hot { color: var(--red-ink); }
.event-meta { margin: 2px 0 0; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.event-time { flex: 0 0 auto; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ───────────────── 账号编辑 ───────────────── */

.account-editor { display: flex; flex-direction: column; gap: 9px; }

.account-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) auto minmax(180px, 1.4fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
}

.account-row input[type="text"] {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--field-bg);
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
}

.account-row input[type="text"]:focus { outline: 2px solid rgba(79, 110, 247, 0.35); border-color: var(--accent); }

.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ───────────────── Token 中心 ───────────────── */

.token-center { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }

.token-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.token-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.token-card-head h3 { font-size: 14px; }
.token-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.token-cell {
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--field-bg);
  border: 1px solid var(--line);
}

.token-cell span { display: block; font-size: 10.5px; color: var(--muted); }
.token-cell strong { font-size: 12.5px; }
.token-cell strong.good { color: var(--green); }
.token-cell strong.warn { color: var(--amber); }
.token-cell strong.bad { color: var(--red); }

.token-actions { display: flex; gap: 7px; flex-wrap: wrap; }

/* ───────────────── 自检结果 ───────────────── */

.probe-panel { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

.probe-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 11px;
  background: var(--panel-2);
  padding: 12px 14px;
}

.probe-card.bad { border-left-color: var(--red); }
.probe-card.good { border-left-color: var(--green); }
.probe-card h4 { margin: 0 0 8px; font-size: 12.5px; }
.probe-card ul { margin: 0; padding-left: 16px; font-size: 11.5px; color: var(--ink-2); }
.probe-card li { margin: 3px 0; overflow-wrap: anywhere; }
.probe-card li.bad { color: var(--red); }
.probe-card li.good { color: var(--green-ink); }

/* ───────────────── 表单 ───────────────── */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.field:last-child { margin-bottom: 0; }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 11px; line-height: 1.55; }
.field.narrow { max-width: 320px; }

.field input[type="number"],
.field input[type="time"],
.field input[type="text"],
.field input[type="password"],
.field input[type="search"],
.field input[type="date"],
.field select,
.filters input,
.filters select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--field-bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  min-width: 0;
}

.field textarea,
.modal textarea {
  min-height: 120px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--field-bg);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
  color: var(--ink);
}

.field input:focus, .field select:focus, .field textarea:focus,
.filters input:focus, .filters select:focus, .modal textarea:focus {
  outline: 2px solid rgba(79, 110, 247, 0.3);
  border-color: var(--accent);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}

.check-row.indent { padding-left: 26px; }
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 auto; }

.callout {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  margin-top: 12px;
  border-radius: 10px;
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  color: var(--callout-ink);
  font-size: 11.5px;
  line-height: 1.65;
}

.callout .icon { color: var(--accent); flex: 0 0 auto; margin-top: 1px; }
.callout p { margin: 0; }

.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.channel-section {
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
}

.channel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.channel-head h3 { font-size: 13.5px; }
.channel-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 14px; }
.channel-fields .field { margin-bottom: 12px; }

/* 企业微信智能机器人：一键绑定接收人 */
.aibot-bind-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--blue-soft);
}
.aibot-bind-row .btn.aibot-bind {
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.aibot-bind-row .btn.aibot-bind:hover,
.aibot-bind-row .btn.aibot-bind:focus-visible {
  filter: brightness(1.06);
  color: #fff;
}
.aibot-bind-note { flex: 1 1 240px; font-size: 11.5px; line-height: 1.6; color: var(--muted); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ───────────────── 日志 ───────────────── */

.log-viewer {
  margin: 0;
  padding: 14px;
  max-height: 460px;
  overflow: auto;
  background: #0f1626;
  color: #c9d6f2;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.log-viewer.small { max-height: 220px; font-size: 11px; }

/* ───────────────── 任务 ───────────────── */

.tasks-list { display: flex; flex-direction: column; gap: 8px; }

.task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
}

.task-row:hover { border-color: var(--accent); background: var(--hover-btn); }
.task-row .t-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row .t-time { color: var(--muted); font-size: 10.5px; white-space: nowrap; }

/* ───────────────── Toast ───────────────── */

.toasts {
  position: fixed;
  top: 84px;
  right: 22px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(23, 32, 51, 0.16);
  font-size: 12.5px;
  animation: toastIn 0.22s ease both;
}

.toast.leaving { animation: toastOut 0.2s ease both; }
.toast .icon { margin-top: 1px; }
.toast.success { border-color: #bfe8d6; background: #f4fdf9; color: #086c49; }
.toast.error { border-color: #f2c2c4; background: #fff7f7; color: #a52a2f; }
.toast.info { border-color: #ccd7fb; background: #f7f9ff; color: #33427a; }

[data-theme="dark"] .toast { box-shadow: 0 16px 38px rgba(0, 0, 0, 0.55); }
[data-theme="dark"] .toast.success { border-color: rgba(61, 220, 154, 0.35); background: #0f2a20; color: #7fe6bd; }
[data-theme="dark"] .toast.error { border-color: rgba(255, 123, 128, 0.35); background: #2a1417; color: #ffb0b3; }
[data-theme="dark"] .toast.info { border-color: rgba(124, 147, 255, 0.35); background: #141d33; color: #c3cee2; }

@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

/* ───────────────── 任务抽屉 ───────────────── */

.drawer {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  width: min(460px, calc(100vw - 32px));
  background: #101828;
  color: #d7e1f5;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(9, 14, 26, 0.45);
  overflow: hidden;
  animation: drawerIn 0.24s ease both;
}

@keyframes drawerIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 8px;
}

.drawer-title { display: flex; align-items: center; gap: 9px; font-size: 13px; min-width: 0; }
.drawer-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.drawer .btn { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.14); color: #d7e1f5; }
.drawer .btn:hover { background: rgba(255, 255, 255, 0.16); box-shadow: none; }

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #8fa6ff;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.spinner.done { animation: none; border-color: var(--green); border-top-color: var(--green); }
.spinner.failed { animation: none; border-color: var(--red); border-top-color: var(--red); }

@keyframes spin { to { transform: rotate(360deg); } }

.progress { height: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }

.progress span {
  display: block;
  height: 100%;
  width: 38%;
  border-radius: 3px;
  background: linear-gradient(90deg, #4f6ef7, #8f7bff);
  animation: slide 1.15s ease-in-out infinite;
}

.progress span.done { width: 100%; animation: none; background: var(--green); }
.progress span.failed { width: 100%; animation: none; background: var(--red); }

@keyframes slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(300%); }
}

.drawer-meta { display: flex; align-items: center; gap: 10px; padding: 9px 14px 0; }
.drawer-meta .muted { color: #8fa0c0; }
.drawer-meta .badge { background: rgba(255, 255, 255, 0.1); color: #c7d4ee; }
.drawer-meta .badge.green { background: rgba(16, 165, 110, 0.2); color: #7fe0bb; }
.drawer-meta .badge.red { background: rgba(224, 71, 76, 0.2); color: #ffafb2; }

.drawer-lines {
  margin: 8px 0 0;
  padding: 6px 14px 12px;
  max-height: 190px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.65;
  color: #aebddb;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.drawer-foot { padding: 0 14px 13px; display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
#drawer-cancel { margin-right: auto; }
.drawer .btn.danger {
  background: rgba(224, 71, 76, 0.2);
  border-color: rgba(224, 71, 76, 0.45);
  color: #ffc2c4;
}
.drawer .btn.danger:hover { background: rgba(224, 71, 76, 0.32); }
#drawer-cancel.pulse { animation: cancelPulse 0.9s ease 2; }
@keyframes cancelPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 71, 76, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(224, 71, 76, 0.15); }
}

/* ───────────────── 弹窗 ───────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 22, 38, 0.55);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.16s ease both;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(9, 14, 26, 0.35);
  overflow: hidden;
  animation: modalIn 0.2s ease both;
}

@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 { margin: 0; font-size: 15px; }

.modal-body {
  padding: 18px 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-body .field { margin-bottom: 0; }
.modal-body pre {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: #0f1626;
  color: #c9d6f2;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.65;
  max-height: 50vh;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ───────────────── 操作浮窗教程 ───────────────── */

.field > span,
.check-row > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.coach-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--accent-deep);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.coach-badge:hover,
.coach-badge:focus-visible {
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 9px rgba(79, 110, 247, 0.35);
  outline: none;
  transform: translateY(-1px);
}

.coach-badge.inline { margin-left: 0; }

.coach-layer {
  position: fixed;
  z-index: 130;
  left: 0;
  top: 0;
}

.coach-card {
  width: min(334px, calc(100vw - 24px));
  max-height: min(420px, calc(100vh - 24px));
  overflow-y: auto;
  padding: 13px 15px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(23, 32, 51, 0.2);
  animation: coachIn 0.16s ease both;
}

@keyframes coachIn {
  from { opacity: 0; transform: translateY(5px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.coach-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 9px;
}

.coach-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
  margin-top: 1px;
}

.coach-head h4 {
  margin: 0;
  flex: 1;
  font-size: 13.5px;
  line-height: 1.5;
}

.coach-close {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
}

.coach-close:hover { background: var(--gray-soft); color: var(--ink); }
.coach-close .icon { width: 14px; height: 14px; }

.coach-steps {
  margin: 0 0 10px;
  padding-left: 20px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.65;
}

.coach-steps li { margin: 3px 0; }
.coach-steps li::marker { color: var(--accent); font-weight: 700; }

.coach-tip {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  color: var(--callout-ink);
  font-size: 11.5px;
  line-height: 1.65;
}

.coach-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 7px 11px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 5px 14px rgba(79, 110, 247, 0.28);
  transition: filter 0.15s ease;
}

.coach-link:hover { filter: brightness(1.07); }
.coach-link:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }

.field-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: -1px;
  padding: 4px 10px;
  border: 1px solid var(--callout-border);
  border-radius: 999px;
  background: var(--callout-bg);
  color: var(--accent-deep);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.field-link:hover,
.field-link:focus-visible {
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border-color: transparent;
  color: #fff;
  outline: none;
}

.coach-flash {
  animation: coachFlash 1.2s ease;
  border-radius: 10px;
}

@keyframes coachFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 110, 247, 0); }
  30% { box-shadow: 0 0 0 4px rgba(79, 110, 247, 0.35); }
  70% { box-shadow: 0 0 0 4px rgba(124, 92, 252, 0.25); }
}

/* ───────────────── 看板 3 步向导 ───────────────── */

.wizard {
  position: relative;
  padding: 16px 20px 15px;
  background:
    linear-gradient(120deg, rgba(79, 110, 247, 0.08), rgba(124, 92, 252, 0.05) 55%, transparent),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.wizard.ready {
  border-color: #bfe8d6;
  background:
    linear-gradient(120deg, rgba(16, 165, 110, 0.1), rgba(16, 165, 110, 0.03) 60%, transparent),
    var(--panel);
}

.wizard.ready::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--green);
}

.wizard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.wizard-title { display: flex; align-items: flex-start; gap: 10px; }

.wizard-spark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 15px;
  flex: 0 0 auto;
  box-shadow: var(--shadow-sm);
}

.wizard-title h2 { margin: 0; font-size: 15px; }

.wizard-title p { margin: 2px 0 0; }

.wizard-head .link-btn { flex: 0 0 auto; }

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.wizard-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  background: var(--wizard-step-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.wizard-step.done { border-color: #c7ebdc; background: rgba(235, 251, 245, 0.8); }

.wizard-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
}

.wizard-step.done .wizard-num { background: var(--green); }

.wizard-body { min-width: 0; flex: 1; }

.wizard-body h3 {
  margin: 0 0 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
}

.wizard-body p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.wizard-foot {
  margin: 11px 2px 0;
  font-size: 11.5px;
}

.wizard.collapsed { padding-top: 12px; padding-bottom: 12px; }
.wizard.collapsed .wizard-steps,
.wizard.collapsed .wizard-foot { display: none; }
.wizard.collapsed .wizard-title h2 { font-size: 14px; }
.wizard.collapsed .wizard-spark { display: none; }

/* ───────────────── 响应式 ───────────────── */

/* ─────────────────────────── 报表导出 ─────────────────────────── */

.report-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 16px;
  margin: 6px 0 14px;
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.report-actions .muted { margin-left: 4px; }

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 4px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-2);
}

.switch-row input { width: 18px; height: 18px; accent-color: var(--accent); }

.report-help {
  margin: 0;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.report-files { display: flex; flex-direction: column; gap: 8px; }

.report-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--ink-2);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.report-file:hover { border-color: var(--accent); background: var(--blue-soft); }

.report-file-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12.5px;
}

.report-file-meta { flex: 0 0 auto; color: var(--muted); font-size: 12px; }

.report-file-go {
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1200px) {
  .kpi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .topbar { gap: 10px; padding: 10px 14px; }
  .brand { min-width: 0; }
  .brand-text p { display: none; }
  .status-cluster { order: 3; width: 100%; justify-content: center; }
  .topbar-actions { order: 2; margin-left: auto; }
  .tabs { top: 0; position: static; padding: 10px 14px 0; overflow-x: auto; }
  .tab { white-space: nowrap; }
  .page { padding: 14px 14px 90px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kpi-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard-steps { grid-template-columns: 1fr; }
  .account-row { grid-template-columns: 1fr; }
  .account-actions { margin-left: 0; }
  .toasts { top: auto; bottom: 18px; left: 14px; right: 14px; max-width: none; }
}

@media (max-width: 620px) {
  .kpi-row { display: grid; grid-template-columns: 1fr; }
  .kpi-value { font-size: 24px; }
  .token-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .status-cluster { flex-wrap: wrap; border-radius: 14px; }
  .btn span { display: none; }
  .topbar-actions .btn { width: 36px; padding: 0; }
  .topbar-actions .switch-label { display: none; }
  .topbar-actions { justify-content: flex-end; gap: 6px; }
  .theme-toggle .theme-label { display: none; }
  .theme-toggle { width: 36px; padding: 0; }
  .drawer { right: 10px; bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ═══════════════════════ 日常模式 / 管理员模式 ═══════════════════════ */

body.mode-daily .admin-only { display: none !important; }
body.mode-admin .daily-only { display: none !important; }
body.mode-daily .tab-panel { display: none !important; }
body.mode-admin #panel-daily { display: none !important; }

.daily { display: flex; flex-direction: column; gap: 16px; }

.daily-kpi { margin-top: 2px; }

.daily-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  border: 1px solid #f1d9a4;
  color: #7a5300;
  font-size: 14.5px;
}

[data-theme="dark"] .daily-alert {
  border-color: rgba(240, 178, 41, 0.35);
  color: var(--amber-ink);
}
.daily-alert .icon { width: 22px; height: 22px; color: var(--amber); }
.daily-alert div { display: flex; flex-direction: column; gap: 2px; }
.daily-alert strong { font-size: 15px; }
.daily-alert span { font-size: 13px; color: #8a6414; }
[data-theme="dark"] .daily-alert span { color: var(--amber-ink); }

/* 「账号与店铺」：沿用监控大盘的整洁表格卡片，左侧色条表示状态 */
.daily-stores { display: flex; flex-direction: column; gap: 14px; }

.daily-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gray);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.daily-card.ok { border-left-color: var(--green); }
.daily-card.warn { border-left-color: var(--amber); }
.daily-card.bad { border-left-color: var(--red); }

.daily-state {
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--gray-soft);
  color: var(--muted);
}
.daily-state.ok { background: var(--green-soft); color: var(--green); }
.daily-state.warn { background: var(--amber-soft); color: var(--amber); }
.daily-state.bad { background: var(--red-soft); color: var(--red); }

.daily-login {
  min-height: 42px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  justify-content: center;
}

/* 「通知与队列」里的行内小按钮与动态小字 */
.daily-stat-value { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.daily-inline-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.daily-notify-bad { color: var(--red); font-weight: 700; }
.daily-hint { margin: 12px 0 0; }
.daily-statusbar { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

.daily-report-top {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 14px;
  align-items: end;
}
.daily-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.daily-type { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.daily-quick .btn.quick,
.daily-type .btn.quick {
  min-height: 54px;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  background: var(--blue-soft);
  border-color: var(--quick-border);
  color: var(--accent-deep);
}
.daily-type .btn.quick { min-height: 48px; font-size: 14.5px; }
.daily-quick.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  filter: saturate(0.6);
}
.daily-quick .btn.quick.active,
.daily-type .btn.quick.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(79, 110, 247, 0.28);
}

.daily-more { margin-top: 12px; }
.daily-more summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.daily-more-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.daily-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.btn.big { min-height: 52px; font-size: 15.5px; font-weight: 700; padding: 0 22px; }
.daily-actions .btn.big { flex: 1 1 220px; justify-content: center; }

.daily-files { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.daily-files .daily-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  text-decoration: none;
}
.daily-files .daily-file:hover { border-color: var(--accent); background: var(--blue-soft); }
.daily-file-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-file-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }

.sub-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}
.sub-title { margin: 0 0 8px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }

.snippet-box {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  border: 1px dashed var(--line-strong);
}
.snippet-box ol { margin: 8px 0; padding-left: 20px; font-size: 13px; color: var(--ink-2); }
.snippet-box li { margin: 3px 0; }
.snippet-box pre {
  margin: 8px 0;
  padding: 10px;
  max-height: 150px;
  overflow: auto;
  border-radius: 8px;
  background: #0f1626;
  color: #d6e0ff;
  font-family: var(--mono);
  font-size: 11.5px;
  white-space: pre-wrap;
  word-break: break-all;
}

.health-list { display: flex; flex-direction: column; gap: 10px; }
.health-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.health-item .health-flag {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: var(--gray-soft);
}
.health-item.ok { border-color: #bfe8d6; background: var(--green-soft); }
.health-item.ok .health-flag { background: #cdefe0; }
.health-item.warn { border-color: #f1d9a4; background: var(--amber-soft); }
.health-item.warn .health-flag { background: #fbe7bd; }
.health-item.error { border-color: #f6cdcd; background: var(--red-soft); }
.health-item.error .health-flag { background: #f8d7d7; }
.health-body { min-width: 0; flex: 1; }
.health-body h4 { margin: 0 0 3px; font-size: 14px; }
.health-body p { margin: 0; font-size: 13px; color: var(--ink-2); }
.health-fix { margin-top: 8px; }
.health-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* 手机上也要能看清大按钮文字（覆盖上面的 .btn span 隐藏） */
@media (max-width: 620px) {
  body.mode-daily .btn span { display: inline; }
  body.mode-daily .topbar-actions .btn { width: auto; padding: 0 12px; }
  body.mode-daily .theme-toggle { width: 36px; padding: 0; }
  body.mode-daily .theme-toggle .theme-label { display: none; }
  body.mode-daily .account-head { gap: 10px; }
  body.mode-daily .account-id { min-width: 0; }
  body.mode-daily .daily-login { min-height: 40px; }
  /* 手机上也尽量一屏看完 7 列，实在放不下才横向滑动 */
  body.mode-daily .daily-card table { min-width: 460px; }
  body.mode-daily .daily-card thead th,
  body.mode-daily .daily-card tbody td { padding: 9px 8px; }
  body.mode-daily .daily-card tbody td.num { font-size: 13px; }
  .daily-report-top { grid-template-columns: 1fr; }
  .daily-quick { grid-template-columns: 1fr; }
  .daily-type { grid-template-columns: 1fr; }
  .daily-actions .btn.big { flex: 1 1 100%; }
}

/* 账号行：多了「显示别名」输入框，宽屏 5 列（窄屏仍按 900px 媒体查询单列） */
@media (min-width: 901px) {
  .account-row { grid-template-columns: minmax(140px, 1.1fr) minmax(130px, 1fr) auto minmax(170px, 1.3fr) auto; }
}

/* ───────────────── 多条定时计划（v2.7） ───────────────── */

.schedule-card .hint { margin: 2px 0 0; }

.schedule-list { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }

.schedule-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 13px 15px 13px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  transition: border-color 0.18s ease, background-color 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}

/* 左侧状态色条：已启用为柔和绿，停用降饱和一眼区分 */
.schedule-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--line-strong);
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.schedule-row.is-enabled::before { background: var(--green); box-shadow: 0 0 8px rgba(16, 165, 110, 0.35); }
.schedule-row.is-disabled { opacity: 0.68; filter: saturate(0.72); }
.schedule-row.is-disabled:hover { opacity: 0.92; filter: saturate(0.9); }
.schedule-row.is-enabled { border-color: var(--line); }

.schedule-row-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.schedule-row-top .sched-label {
  flex: 1 1 180px;
  min-width: 120px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--field-bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}

.schedule-row-top .sched-label:focus {
  outline: 2px solid rgba(79, 110, 247, 0.3);
  border-color: var(--accent);
}

.schedule-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
}

.schedule-row.is-enabled .schedule-toggle { color: var(--green-ink); }

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px 10px;
  align-items: end;
}

.schedule-grid .field { margin-bottom: 0; }
.schedule-grid .field span { font-size: 11.5px; }

.sched-types {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.sched-types label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}

.schedule-row-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.schedule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.schedule-row .num-link { font-size: 12.5px; }

/* ───────────────── 就地展开明细面板（iOS 弹簧 / 毛玻璃） ───────────────── */

/* 外层 0fr → 1fr：让下方内容被丝滑推开；收起干脆利落 */
.kpi-inline-wrap,
.store-inline-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 210ms var(--ease-close);
}

.kpi-inline-wrap.is-open,
.store-inline-wrap.is-open {
  grid-template-rows: 1fr;
  transition: grid-template-rows 340ms var(--spring-move);
}

.inline-popover-clip {
  min-height: 0;
  overflow: hidden;
}

/* 展开动画结束后放开裁剪，让多层环境阴影完整透出 */
.inline-popover-clip.is-settled { overflow: visible; }

.inline-popover-card {
  position: relative;
  margin: 12px 0 4px;
  padding: 0;
  border-radius: 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  transform-origin: var(--caret-x, 50%) top;
  transform: scale(0.92) translateY(-10px);
  opacity: 0;
  transition: transform 210ms var(--ease-close), opacity 160ms var(--ease-close);
  will-change: transform, opacity;
}

.kpi-inline-wrap.is-open .inline-popover-card,
.store-inline-wrap.is-open .inline-popover-card {
  transform: scale(1) translateY(0);
  opacity: 1;
  transition: transform 340ms var(--spring-open), opacity 200ms ease;
}

[data-theme="dark"] .inline-popover-card {
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow), 0 0 0 1px rgba(255, 255, 255, 0.02);
}

/* 顶部指向小三角：跟着被点卡片底部正中横移 */
.inline-popover-caret {
  position: absolute;
  top: -6px;
  left: var(--caret-x, 50%);
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--glass-bg);
  border-left: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-highlight);
  transition: left 320ms var(--spring-move);
  pointer-events: none;
  z-index: 2;
}

.store-inline-wrap .inline-popover-caret { display: none; }

.inline-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 11px;
  border-bottom: 1px solid var(--line);
}

.inline-popover-title { min-width: 0; }
.inline-popover-title h3 { margin: 0; font-size: 15.5px; letter-spacing: -0.2px; }
.inline-popover-title p { margin: 3px 0 0; }
.inline-popover-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.inline-body {
  max-height: 440px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.inline-body::-webkit-scrollbar { width: 8px; height: 8px; }
.inline-body::-webkit-scrollbar-track { background: transparent; }
.inline-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line-strong);
  border: 2px solid transparent;
  background-clip: padding-box;
}
.inline-body::-webkit-scrollbar-thumb:hover { background: var(--gray); background-clip: padding-box; }

/* 明细项每行 24ms 交错淡入，前 8 行封顶 192ms；只动 transform + opacity */
.drill-item.is-stagger {
  animation: drillStagger 300ms var(--spring-move) both;
  animation-delay: var(--stagger-delay, 0ms);
}

@keyframes drillStagger {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* 店铺表格：数字单元格高亮 + 整行微高亮 + 行内推开 */
tbody tr.store-row { transition: background-color 220ms var(--spring-move); }
tbody tr.store-row.is-active-row > td { background: var(--blue-soft); }
tbody tr.store-row.is-active-row > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.num-link.is-active-cell {
  background: var(--blue-soft);
  color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px var(--accent);
}

tr.store-expand-row > td {
  padding: 0;
  background: transparent;
  border-bottom: 1px solid var(--line);
}

tbody tr.store-expand-row:hover > td { background: transparent; }
.store-inline-wrap .inline-popover-card { margin: 10px 0 14px; transform: scale(0.95) translateY(-6px); }

.drill-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.drill-tab {
  flex: 0 0 auto;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.drill-tab:hover { border-color: var(--accent); color: var(--accent); }
.drill-tab.active { background: var(--blue-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }

.drill-errors {
  margin: 10px 14px 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--amber-soft);
  border: 1px solid #f1d9a4;
  color: #7a5300;
  font-size: 12px;
  line-height: 1.55;
}

.drill-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 加载中的骨架屏：3 条 shimmer 扫光占位，替代生硬「加载中…」 */
.drill-skeleton { display: flex; flex-direction: column; gap: 10px; }

.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}

.skeleton-row { display: flex; align-items: center; gap: 8px; }

.skeleton-line {
  display: block;
  height: 11px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--skeleton-base) 20%, var(--skeleton-shine) 38%, var(--skeleton-base) 56%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-dot {
  width: 26px;
  height: 11px;
  border-radius: 999px;
  background: var(--skeleton-base);
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-line.w-20 { width: 20%; }
.skeleton-line.w-30 { width: 30%; }
.skeleton-line.w-45 { width: 45%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-85 { width: 85%; }

@keyframes shimmer {
  0% { background-position: 130% 0; }
  100% { background-position: -130% 0; }
}

.drill-item {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.drill-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }

.drill-item-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.drill-waybill {
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* 复制按钮：成功后短暂变绿「已复制 ✓」，1.5 秒自动复原 */
.link-btn.copy-btn { transition: color 0.18s ease; }
.link-btn.copy-btn.copied { color: var(--green); font-weight: 700; }
.link-btn.copy-btn.copied::after { content: ""; }

.drill-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.drill-item-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

/* 「查看商品」箭头旋转 + 商品清单柔和展开 */
.drill-goods-btn { gap: 6px; }

.drill-arrow {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease, margin-top 0.2s ease;
}

.drill-goods-btn.is-open .drill-arrow { transform: rotate(-135deg); margin-top: 3px; }

.drill-entries {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px dashed var(--line-strong);
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: entriesIn 0.22s ease both;
}

@keyframes entriesIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.drill-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

/* 56×56 商品主图缩略图：可点放大；无图 / 加载失败时平滑降级为纯 CSS+SVG 占位框 */
.drill-entry-thumb {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(120% 120% at 22% 8%, var(--panel-3), transparent 72%),
    var(--panel-2);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--gray);
}

button.drill-entry-thumb {
  cursor: zoom-in;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

button.drill-entry-thumb:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

button.drill-entry-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.drill-entry-thumb:active { transform: scale(0.97); }

.drill-thumb-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  transition: opacity 0.25s ease;
}

.drill-thumb-fallback svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drill-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.drill-thumb-img.is-loaded { opacity: 1; }
.drill-entry-thumb.is-broken .drill-thumb-img { display: none; }
.drill-entry-thumb.is-broken { cursor: default; }

.drill-entry-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drill-entry-name { min-width: 0; overflow-wrap: anywhere; }

.drill-entry-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.drill-entry-meta { color: var(--muted); font-size: 11px; font-family: var(--mono); }

/* 颜色 / 尺码规格标签 */
.drill-spec {
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel-3);
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.6;
  white-space: nowrap;
}

/* ───────────────── 商品大图预览（Lightbox） ───────────────── */

body.lightbox-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(9, 14, 26, 0.62);
  backdrop-filter: blur(10px) saturate(1.15);
  animation: fadeIn 0.18s ease both;
}

/* FLIP 放大 / 缩回期间：只让图片自己做弹簧位移，figure 不抢动画 */
.lightbox.is-opening { animation: fadeIn 0.18s ease both; }
.lightbox.is-opening .lightbox-figure { animation: none; }
.lightbox.is-closing { animation: fadeOut 210ms var(--ease-close) both; }
.lightbox.is-closing .lightbox-figure { animation: none; }
.lightbox.is-closing .lightbox-caption,
.lightbox.is-closing .lightbox-close {
  opacity: 0;
  transition: opacity 140ms var(--ease-close);
}

@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

.lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: min(760px, 100%);
  max-height: calc(100vh - 80px);
  animation: lightboxIn 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes lightboxIn {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 30px 80px rgba(3, 7, 18, 0.55);
  object-fit: contain;
  will-change: transform;
}

.lightbox-caption {
  max-width: 100%;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #172033;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  overflow-wrap: anywhere;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  background: rgba(255, 255, 255, 0.9);
  color: #172033;
}

[data-theme="dark"] .lightbox-caption {
  background: rgba(24, 34, 53, 0.92);
  color: var(--ink);
}

[data-theme="dark"] .lightbox-close {
  background: rgba(24, 34, 53, 0.92);
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .lightbox-figure { animation: none; }
  button.drill-entry-thumb { transition: none; }
}

.drill-content {
  margin: 7px 0 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.drill-stars { color: var(--amber); font-size: 12px; letter-spacing: 1px; }

/* ───────── 深色模式下的细节收口：徽章 / 表单 / 表格 / 抽屉不留刺眼白块 ───────── */

[data-theme="dark"] .banner.danger { border-color: rgba(224, 71, 76, 0.35); color: var(--red-ink); }
[data-theme="dark"] .wizard.ready { border-color: rgba(61, 220, 154, 0.35); }
[data-theme="dark"] .wizard-step.done { border-color: rgba(61, 220, 154, 0.3); background: rgba(16, 165, 110, 0.12); }
[data-theme="dark"] .health-item.ok { border-color: rgba(61, 220, 154, 0.3); }
[data-theme="dark"] .health-item.ok .health-flag { background: rgba(16, 165, 110, 0.25); }
[data-theme="dark"] .health-item.warn { border-color: rgba(240, 178, 41, 0.32); }
[data-theme="dark"] .health-item.warn .health-flag { background: rgba(217, 150, 11, 0.25); }
[data-theme="dark"] .health-item.error { border-color: rgba(255, 123, 128, 0.32); }
[data-theme="dark"] .health-item.error .health-flag { background: rgba(224, 71, 76, 0.25); }
[data-theme="dark"] .drill-errors { border-color: rgba(240, 178, 41, 0.35); color: var(--amber-ink); }
[data-theme="dark"] .probe-card { border-color: var(--line); }
[data-theme="dark"] .report-file:hover { border-color: var(--accent); }
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--muted); }
[data-theme="dark"] table { color: var(--ink-2); }
[data-theme="dark"] thead th { color: var(--muted); }
[data-theme="dark"] .kpi-icon.blue { background: rgba(79, 110, 247, 0.18); }
[data-theme="dark"] .kpi-icon.violet { background: rgba(124, 92, 252, 0.2); }
[data-theme="dark"] .kpi-icon.red { background: rgba(224, 71, 76, 0.18); }
[data-theme="dark"] .kpi-icon.green { background: rgba(16, 165, 110, 0.18); }
[data-theme="dark"] .kpi-icon.amber { background: rgba(217, 150, 11, 0.2); }

/* KPI 卡片与店铺表格数字 */
.kpi-link { cursor: pointer; }
.kpi-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kpi-link:hover .kpi-value { color: var(--accent); }

.num-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  margin: -3px -2px;
  padding: 2px 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.num-link:hover { background: var(--blue-soft); color: var(--accent-deep); }
.num-link:active { transform: scale(0.96); }
.num-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 760px) {
  .inline-popover-head { padding: 13px 14px 10px; }
  .inline-popover-card { margin: 10px 0 4px; border-radius: 16px; }
  .inline-body { padding: 12px 12px 20px; max-height: 380px; }
  .schedule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ───────────────── 店铺行「查库存」入口 + 库存毛玻璃面板（v2.8.0） ───────────────── */

.store-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.store-cell-main { min-width: 0; }

/* 低调入口：默认只有极淡描边，hover / 键盘聚焦才浮到前景 */
.store-stock-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.store-stock-btn .icon { width: 12px; height: 12px; }
.store-stock-btn:hover {
  color: var(--accent-deep);
  border-color: var(--accent);
  background: var(--blue-soft);
}
.store-stock-btn:active { transform: scale(0.96); }
.store-stock-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.inv-card { overflow: hidden; }

.inv-head { align-items: center; }

.inv-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.inv-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
}

.inv-chip b {
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.inv-chip.is-out b { color: var(--red); }
.inv-chip.is-low b { color: var(--amber); }

.inv-stores {
  display: flex;
  gap: 6px;
  padding: 9px 14px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.inv-stores::-webkit-scrollbar { display: none; }

.inv-store-pill {
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}
.inv-store-pill:hover { border-color: var(--accent); color: var(--accent); }
.inv-store-pill.is-active {
  background: var(--blue-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.inv-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.inv-search {
  flex: 1 1 210px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field-bg);
  color: var(--muted);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.inv-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.14);
}
.inv-search .icon { width: 14px; height: 14px; flex: 0 0 auto; }
.inv-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
}
.inv-search input::-webkit-search-cancel-button { cursor: pointer; }

.inv-filters { display: flex; flex: 0 0 auto; gap: 6px; }

.inv-pill,
.inv-sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}
.inv-pill:hover,
.inv-sort:hover { border-color: var(--accent); color: var(--accent); }
.inv-pill.is-active {
  background: var(--blue-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.inv-count {
  min-width: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.inv-pill.is-active .inv-count { background: rgba(79, 110, 247, 0.16); color: var(--accent-deep); }

.inv-sort { flex: 0 0 auto; margin-left: auto; }

.inv-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 18px;
  max-height: 460px;
}

.inv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.inv-item:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* 48×48 缩略图：点击复用全局 FLIP 灯箱从原位飞出 */
.inv-thumb {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.inv-thumb.is-placeholder { border-style: dashed; color: var(--gray); }
.inv-thumb.is-placeholder .icon { width: 20px; height: 20px; opacity: 0.7; }

.inv-main { flex: 1 1 auto; min-width: 0; }

.inv-name {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.35;
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.inv-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.inv-sku { font-family: var(--mono); }

.inv-stock-wrap {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 62px;
}

.inv-stock {
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.inv-stock.is-out { color: var(--red); }
.inv-stock.is-low { color: var(--amber); }

.inv-more {
  width: 100%;
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--accent-deep);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}
.inv-more:hover { border-color: var(--accent); background: var(--blue-soft); }
.inv-more:active { transform: scale(0.995); }
.inv-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.inv-foot {
  margin: 2px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 10.5px;
}

[data-theme="dark"] .inv-item { background: rgba(255, 255, 255, 0.03); }
[data-theme="dark"] .inv-chip,
[data-theme="dark"] .inv-pill,
[data-theme="dark"] .inv-sort,
[data-theme="dark"] .inv-store-pill,
[data-theme="dark"] .inv-more { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .inv-count { background: rgba(255, 255, 255, 0.08); }

@media (max-width: 760px) {
  .store-stock-btn span { display: none; }
  .store-stock-btn { width: 24px; padding: 0; justify-content: center; }
  .inv-head { flex-wrap: wrap; }
  .inv-head .inline-popover-actions { width: 100%; justify-content: flex-end; }
  .inv-toolbar { gap: 7px; }
  .inv-search { flex: 1 1 100%; }
  .inv-sort { margin-left: 0; }
  .inv-body { max-height: 360px; }
  .inv-stock-wrap { min-width: 52px; }
}


/* ═════════════ v2.9.0 · 外网只读共享（访客登录 / 只读态 / 管理员设置卡） ═════════════ */

.guest-only { display: none !important; }
.brand-sub-guest { display: none; }

body.role-guest .guest-only { display: inline-flex !important; align-items: center; gap: 10px; }
body.role-guest .daily-only,
body.role-guest .admin-only,
body.role-guest .tabs,
body.role-guest .guest-hide,
body.role-guest #daily-export-wecom,
body.role-guest #daily-open-exports,
body.role-guest #daily-files { display: none !important; }
body.role-guest .brand-sub-local { display: none; }
body.role-guest .brand-sub-guest { display: block; }
body.role-guest .topbar-divider { display: none; }
body.role-guest .topbar-actions { gap: 10px; }

.guest-share-bar { align-items: center; }
.guest-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--accent-deep);
  background: linear-gradient(135deg, var(--blue-soft), var(--violet-soft));
  border: 1px solid var(--quick-border);
  box-shadow: var(--shadow-sm);
}
.guest-badge .icon { width: 15px; height: 15px; }

/* 外网只读共享设置卡 */
.panel-share-card { margin-top: 18px; }
.share-state {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 14px;
}
.share-password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
}
.share-password-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 4px; }
.danger-callout { background: var(--red-soft); border: 1px solid var(--red-soft); color: var(--red-ink); }
.danger-callout .icon { color: var(--red); }
.share-secret-box {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 16px 0;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px dashed var(--line-strong);
}
.share-secret-box code {
  font-family: var(--mono);
  font-size: 20px;
  letter-spacing: 0.05em;
  color: var(--ink);
  word-break: break-all;
}

/* 访客口令登录页（独立、零业务数据） */
.guest-login-page {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 12% 8%, var(--blue-soft), transparent 62%),
    radial-gradient(760px 480px at 88% 92%, var(--violet-soft), transparent 60%),
    var(--bg);
}
.guest-login-card {
  width: min(430px, 100%);
  padding: 36px 32px 30px;
  border-radius: 28px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}
.guest-login-logo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  box-shadow: 0 10px 26px -10px var(--accent);
}
.guest-login-card h1 { margin: 18px 0 6px; font-size: 22px; letter-spacing: 0.01em; }
.guest-login-card .guest-login-sub { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.guest-login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-deep);
  background: var(--blue-soft);
  border: 1px solid var(--quick-border);
}
.guest-login-form { display: grid; gap: 12px; }
.guest-login-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.guest-login-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-size: 16px;
  font-family: var(--font);
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.guest-login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--blue-soft); }
.guest-login-submit {
  height: 48px;
  border: none;
  border-radius: 14px;
  font-size: 15.5px;
  font-weight: 700;
  font-family: var(--font);
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  box-shadow: 0 12px 26px -12px var(--accent);
  transition: transform 0.16s var(--ease-press), filter 0.16s ease;
}
.guest-login-submit:hover { filter: brightness(1.05); }
.guest-login-submit:active { transform: scale(0.985); }
.guest-login-submit:disabled { opacity: 0.65; cursor: progress; }
.guest-login-error {
  margin: 2px 0 0;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--red-ink);
  background: var(--red-soft);
}
.guest-login-error.hidden { display: none; }
.guest-login-foot { margin: 20px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.guest-login-foot a { color: var(--accent-deep); text-decoration: none; }

@media (max-width: 720px) {
  .share-password-row { grid-template-columns: 1fr; }
  .guest-login-card { padding: 30px 22px 24px; border-radius: 22px; }
}

/* allowExport=false 时，连库存下钻里的「导出 Excel」也一并隐藏 */
body.guest-no-export [data-inv-export],
body.guest-no-export #daily-export-download { display: none !important; }
