/* CoolNote Ops — Ink & Seafoam */
:root {
  --bg: #e6ecf2;
  --bg-soft: #f3f6f9;
  --panel: #ffffff;
  --ink: #13202c;
  --muted: #5a6b7d;
  --line: #d4dde6;
  --accent: #0f8a7c;
  --accent-deep: #0a6b60;
  --accent-soft: rgba(15, 138, 124, 0.12);
  --danger: #e11d48;
  --success: #15803d;
  --warning: #c2410c;
  --shadow: 0 1px 2px rgba(19, 32, 44, 0.04), 0 8px 24px rgba(19, 32, 44, 0.05);
  --shadow-lg: 0 20px 52px rgba(19, 32, 44, 0.14);
  --radius: 14px;
  --radius-sm: 10px;
  --side: 248px;
  --side-collapsed: 76px;
  --header-h: 58px;
  --hub-tabs-h: 48px;
  --side-bg: #0e161e;
  --side-ink: rgba(236, 242, 247, 0.72);
  --side-ink-active: #ffffff;
  --side-hover: rgba(255, 255, 255, 0.07);
  --side-active: color-mix(in srgb, var(--accent) 78%, #0b3d38);
  --header-bg: rgba(255, 255, 255, 0.88);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --display: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-family: var(--font);
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] {
  --bg: #0b1218;
  --bg-soft: #121a22;
  --panel: #151e27;
  --ink: #e8eef4;
  --muted: #93a4b5;
  --line: #2a3644;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 22px 50px rgba(0, 0, 0, 0.45);
  --side-bg: #080d12;
  --header-bg: rgba(21, 30, 39, 0.9);
  color-scheme: dark;
}

html[data-side-theme="light"] {
  --side-bg: #f7fafc;
  --side-ink: #4b5c6d;
  --side-ink-active: var(--accent-deep);
  --side-hover: rgba(15, 138, 124, 0.08);
  --side-active: var(--accent-soft);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); }

/* —— Global scrollbars —— */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 38%, var(--line));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--muted) 58%, var(--line));
  background-clip: padding-box;
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: end; }
.grow { flex: 1; }
.block { width: 100%; }
.gap { gap: 8px; }
.error { color: var(--danger); font-size: 13px; }
.hint { color: var(--accent-deep); font-size: 13px; }
html[data-theme="dark"] .hint { color: #5eead4; }

.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.4;
  font-family: inherit;
  transition: border-color .16s, color .16s, background .16s, box-shadow .16s, transform .16s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--accent-deep);
  box-shadow: 0 4px 14px rgba(15, 138, 124, 0.08);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-deep);
  box-shadow: 0 6px 16px rgba(15, 138, 124, 0.2);
}
.btn.primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fff;
}
.btn.ghost {
  background: var(--panel);
  color: var(--ink);
}
.btn.ghost:hover {
  background: color-mix(in srgb, var(--accent-soft) 40%, var(--panel));
  color: var(--accent-deep);
}
.btn.danger {
  background: rgba(225, 29, 72, 0.08);
  color: var(--danger);
  border-color: rgba(225, 29, 72, 0.24);
}
.btn.danger:hover {
  background: rgba(225, 29, 72, 0.14);
  color: var(--danger);
}
.btn.icon {
  width: 36px; height: 36px; padding: 0;
  border-radius: 10px;
}
.btn .ico { width: 16px; height: 16px; display: inline-grid; place-items: center; }
.btn .ico svg { width: 16px; height: 16px; display: block; }

label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.field span { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  transition: border-color .15s, box-shadow .15s, background .15s;
  min-height: 36px;
  box-sizing: border-box;
}
input[type="checkbox"],
input[type="radio"] {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  max-width: 14px;
  max-height: 14px;
  padding: 0;
  margin: 0;
  border-radius: 3px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
select,
.field-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  line-height: 1.35;
  padding-right: 32px;
  background-color: var(--panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}
input:focus, select:focus, textarea:focus,
.field-select:focus, .field-input:focus {
  outline: none;
  background-color: var(--panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select:focus,
.field-select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%230a6b60' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}
.field-input,
.field-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background-color: var(--panel);
  min-height: 36px;
  box-sizing: border-box;
}
.field-select {
  padding-right: 32px;
}
.toolbar select,
.toolbar .field-select {
  width: auto;
  min-width: 120px;
  height: 34px;
  min-height: 34px;
  padding: 4px 32px 4px 10px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  background-color: var(--panel);
}

/* 旧自定义下拉残留样式（已改回原生 select，保留类名以免异常） */
.cn-select { display: contents; }
.cn-select-native { position: static !important; opacity: 1 !important; pointer-events: auto !important; width: 100% !important; height: auto !important; clip: auto; }
.cn-select-trigger,
.cn-select-menu { display: none !important; }

.sort-cell { width: 64px; white-space: nowrap; }
.sort-input {
  width: 72px;
  min-height: 34px;
  height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.sort-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--panel);
}
.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 4px;
  cursor: grab;
  color: var(--muted);
  user-select: none;
  border-radius: 6px;
  vertical-align: middle;
}
.drag-handle:active { cursor: grabbing; }
.drag-handle:hover {
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  color: var(--ink);
}
tr.is-dragging { opacity: 0.45; }
tr.drag-over td { box-shadow: inset 0 2px 0 var(--accent); }
.drawer-share { min-height: 360px; }
.drawer-tab-panel[data-share-panel] { min-height: 280px; }
.btn.is-loading { opacity: 0.7; pointer-events: none; }

/* —— Login —— */
.login-body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  position: relative;
  background: color-mix(in srgb, var(--bg) 88%, #dfe8ef);
  overflow: hidden;
}
.login-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% 18%, rgba(15, 138, 124, 0.16), transparent 60%),
    radial-gradient(700px 420px at 88% 82%, rgba(37, 99, 235, 0.08), transparent 55%);
  z-index: 0;
}
.login-hero,
.login-panel { position: relative; z-index: 1; }
.login-hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  color: #f4faf9;
  display: flex;
  align-items: flex-end;
  padding: 56px;
  background:
    linear-gradient(155deg, #0b1c1a 0%, #12332e 42%, #0f2430 100%);
}
.login-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 30% 40%, #000 20%, transparent 75%);
  opacity: .55;
  pointer-events: none;
}
.login-hero::after {
  content: "";
  position: absolute;
  width: 420px; height: 420px;
  right: -80px; top: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.28), transparent 68%);
  pointer-events: none;
}
.login-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 420px;
  animation: login-rise .55s ease both;
}
@keyframes login-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-hero-mark {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 700; font-size: 15px; letter-spacing: 0.04em;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
  margin-bottom: 28px;
}
.login-hero-eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(167, 243, 208, 0.8);
  font-weight: 600;
}
.login-hero-brand {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(42px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.login-hero-lead {
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(236, 253, 245, 0.72);
  max-width: 28ch;
}
.login-hero-points {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.login-hero-points li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  color: rgba(236, 253, 245, 0.58);
  letter-spacing: 0.01em;
}
.login-hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, #5eead4 70%, transparent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}
@media (max-width: 960px) {
  .login-hero-points { display: none; }
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 40px 28px;
}
.login-card {
  width: min(400px, 100%);
  display: grid;
  gap: 14px;
  padding: 34px 30px 30px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 22px;
  box-shadow: 0 20px 48px rgba(21, 32, 43, 0.1);
  backdrop-filter: blur(14px);
  animation: login-rise .55s .08s ease both;
}
.login-card .field {
  display: grid;
  gap: 7px;
}
.login-card .field input {
  min-height: 42px;
  border-radius: 11px;
}
.login-card-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 4px;
}
.login-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 700; font-size: 12px; letter-spacing: 0.04em;
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(15, 138, 124, 0.28);
}
.login-brand {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-size: 15px;
}
.login-brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.login-card h1 {
  margin: 10px 0 0;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.login-desc {
  margin: -2px 0 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.login-code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.login-code-btn {
  height: 42px;
  white-space: nowrap;
  background: var(--bg-soft);
  border-radius: 11px;
}
.login-submit {
  margin-top: 8px;
  height: 44px;
  font-size: 14px;
  border-radius: 11px;
  letter-spacing: 0.02em;
}
.login-hint, .login-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--panel));
}
.login-error {
  background: rgba(225, 29, 72, 0.08);
  border: 1px solid rgba(225, 29, 72, 0.18);
}

/* —— App shell —— */
.app-body {
  display: grid;
  grid-template-columns: var(--side) 1fr;
  min-height: 100vh;
  transition: grid-template-columns .22s ease;
}
.app-body.side-collapsed { grid-template-columns: var(--side-collapsed) 1fr; }

.sidebar {
  background:
    radial-gradient(520px 280px at 0% 0%, rgba(15, 138, 124, 0.22), transparent 60%),
    var(--side-bg);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  border-right: 1px solid transparent;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}
html[data-side-theme="light"] .sidebar {
  border-right-color: var(--line);
  background:
    radial-gradient(420px 240px at 0% 0%, rgba(15, 138, 124, 0.1), transparent 65%),
    var(--side-bg);
}

.side-brand {
  height: var(--header-h);
  display: flex; gap: 12px; align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
html[data-side-theme="light"] .side-brand { border-bottom-color: var(--line); }
.side-brand .logo {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 700; font-size: 12px;
  letter-spacing: 0.04em;
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(15, 138, 124, 0.28);
}
.side-brand .brand-text { min-width: 0; overflow: hidden; white-space: nowrap; }
.side-brand .title {
  font-family: var(--display);
  font-weight: 700; color: #fff; font-size: 15px; letter-spacing: -0.02em;
}
html[data-side-theme="light"] .side-brand .title { color: var(--ink); }
.side-brand .sub { font-size: 11px; color: rgba(255,255,255,0.42); margin-top: 2px; letter-spacing: .04em; }
html[data-side-theme="light"] .side-brand .sub { color: var(--muted); }
.app-body.side-collapsed .side-brand { justify-content: center; padding: 0; }
.app-body.side-collapsed .brand-text { display: none; }

.side-nav {
  flex: 1; overflow: auto; display: grid; gap: 4px;
  align-content: start; padding: 14px 12px;
  scrollbar-width: thin;
}
.nav-group { border-radius: 10px; }
.nav-group-btn {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  background: transparent; color: var(--side-ink);
  border: 0; padding: 10px 12px; cursor: pointer; font-weight: 600; font-size: 13px;
  border-radius: 10px; font-family: inherit;
}
.nav-group-btn:hover { background: var(--side-hover); color: var(--side-ink-active); }
.nav-group-btn .g-label { flex: 1; text-align: left; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group-btn .g-abbr { display: none; font-weight: 700; font-size: 13px; }
.nav-chevron {
  width: 14px; height: 14px; flex-shrink: 0; opacity: 0.55;
  transition: transform .18s ease;
}
.nav-group.open .nav-chevron { transform: rotate(90deg); opacity: 0.9; }
.nav-children {
  display: none;
  padding: 4px 6px 8px 10px;
  margin: 0 4px 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}
html[data-side-theme="light"] .nav-children {
  background: rgba(15, 138, 124, 0.05);
}
.nav-group.open .nav-children { display: grid; gap: 2px; }
.nav-item {
  border: 0; background: transparent; color: var(--side-ink); text-align: left;
  padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 13px;
  display: flex; align-items: center; gap: 8px; width: 100%;
  position: relative; font-family: inherit;
}
.nav-item::before { display: none; }
.nav-item .n-ico {
  width: 16px; height: 16px; flex-shrink: 0; opacity: 0.72;
  display: inline-grid; place-items: center;
}
.nav-item .n-ico svg { width: 16px; height: 16px; display: block; }
.nav-group-btn .g-ico {
  width: 16px; height: 16px; flex-shrink: 0; opacity: 0.75;
  display: inline-grid; place-items: center;
}
.nav-group-btn .g-ico svg { width: 16px; height: 16px; display: block; }
.nav-item:hover { background: var(--side-hover); color: var(--side-ink-active); }
.nav-item.active {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.nav-item.active .n-ico { opacity: 1; }
html[data-side-theme="light"] .nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-deep);
  box-shadow: none;
}
.nav-item .n-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}
.nav-item.active .nav-badge {
  background: #fff;
  color: var(--danger);
}
html[data-side-theme="light"] .nav-item.active .nav-badge {
  background: var(--danger);
  color: #fff;
}

.app-body.side-collapsed .nav-group-btn .g-label,
.app-body.side-collapsed .nav-group-btn .g-ico,
.app-body.side-collapsed .nav-chevron,
.app-body.side-collapsed .nav-item .n-label,
.app-body.side-collapsed .nav-badge { display: none; }
.app-body.side-collapsed .nav-group-btn .g-abbr { display: inline; }
.app-body.side-collapsed .nav-children { display: none !important; }
.app-body.side-collapsed .nav-group-btn {
  justify-content: center; padding: 12px 0;
}
.app-body.side-collapsed .nav-group.open .nav-group-btn,
.app-body.side-collapsed .nav-group-btn.has-active {
  background: var(--side-active);
  color: #fff;
}
html[data-side-theme="light"] .app-body.side-collapsed .nav-group-btn.has-active {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.side-foot {
  display: flex; flex-direction: column; align-items: stretch;
  gap: 6px; padding: 10px 12px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
html[data-side-theme="light"] .side-foot { border-top-color: var(--line); }
.side-version {
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  opacity: 0.55;
  padding: 0 4px 2px;
  color: var(--side-ink);
  word-break: break-all;
}
.app-body.side-collapsed .side-version { display: none; }
.side-collapse-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; border: 0; color: var(--side-ink);
  padding: 10px; border-radius: 10px; cursor: pointer; font-size: 13px;
  font-family: inherit;
}
.side-collapse-btn:hover { background: var(--side-hover); color: var(--side-ink-active); }
.side-collapse-btn svg { width: 18px; height: 18px; }
.app-body.side-collapsed .side-collapse-btn .collapse-text { display: none; }

.workspace {
  display: flex; flex-direction: column; min-width: 0;
  width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(900px 360px at 100% -10%, rgba(15, 138, 124, 0.08), transparent 55%),
    var(--bg);
  min-height: 100vh;
}
.work-head {
  height: var(--header-h);
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 22px; background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
  gap: 12px;
}
.work-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 1 auto;
}
.work-head-left .crumb {
  min-width: 0;
  flex-shrink: 1;
}
.work-head-center {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
  max-width: 420px;
  margin: 0 auto;
}
.work-head-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* 应用切换：紧挨面包屑的轻量 chip + 下拉，避免挤占右侧工具区 */
.aid-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 168px;
  height: 34px;
  padding: 0 10px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 1;
  min-width: 0;
  user-select: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.aid-chip:hover,
.aid-chip.open {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 4px 14px rgba(15, 138, 124, 0.1);
}
.aid-chip.open {
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--panel));
}
.aid-chip-mark {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--accent-soft) 80%, transparent);
  color: var(--accent-deep);
}
.aid-chip-mark svg { width: 13px; height: 13px; }
.aid-chip-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
  text-align: left;
}
.aid-chip-kicker {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.aid-chip-name {
  font-size: 12.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 108px;
}
.aid-chip > .caret {
  width: 12px;
  height: 12px;
  opacity: 0.45;
  flex-shrink: 0;
  transition: transform .15s;
}
.aid-chip.open > .caret { transform: rotate(180deg); opacity: 0.7; }

.aid-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(280px, calc(100vw - 48px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 45;
  display: none;
  animation: modal-pop .16s ease;
}
.aid-menu.open { display: grid; gap: 2px; }
.aid-menu-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.aid-menu-head .title {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink);
}
.aid-menu-head .hint {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
.aid-menu-item {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
  display: grid;
  gap: 2px;
  width: 100%;
}
.aid-menu-item:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.aid-menu-item.is-active {
  background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
}
.aid-menu-item .label {
  font-weight: 650;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aid-menu-item .aid {
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aid-menu-item.is-active .aid { color: var(--accent-deep); opacity: 0.85; }
.aid-menu-empty {
  padding: 14px 10px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .aid-chip { max-width: 132px; }
  .aid-chip-name { max-width: 72px; }
  .aid-chip-kicker { display: none; }
}
@media (max-width: 720px) {
  /* 窄屏仍显示应用名，避免只剩图标不知当前 aid */
  .aid-chip-kicker { display: none; }
  .aid-chip-text {
    display: flex;
    min-width: 0;
    max-width: 88px;
  }
  .aid-chip-name {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .aid-chip {
    max-width: 140px;
    width: auto;
    height: 34px;
    padding: 0 8px 0 6px;
    justify-content: flex-start;
    gap: 6px;
  }
  .aid-chip > .caret { display: none; }
  .aid-menu { left: 0; right: auto; }
}
.global-search-wrap { width: 100%; max-width: 360px; }
.global-search {
  width: 100%;
  height: 36px;
  padding: 0 14px 0 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l3 3'/%3E%3C/svg%3E") 12px center no-repeat;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.global-search:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 0 0 3px var(--accent-soft);
}
#btn-refresh.is-spinning .ico svg {
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.page-skeleton { padding: 18px; display: grid; gap: 10px; }
.page-skeleton .sk-row {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-soft) 25%, color-mix(in srgb, var(--line) 40%, var(--bg-soft)) 50%, var(--bg-soft) 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.2s ease-in-out infinite;
}
.page-skeleton .sk-row:nth-child(1) { width: 92%; }
.page-skeleton .sk-row:nth-child(2) { width: 78%; }
.page-skeleton .sk-row:nth-child(3) { width: 85%; }
@keyframes sk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.dash-health {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  margin: 0;
  border-left: 3px solid var(--accent);
}
.dash-health.is-warn { border-left-color: var(--danger); }
.dash-health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.dash-health.is-warn .dash-health-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}
.dash-health-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  font-size: 13px;
}
.dash-health-alerts { color: var(--danger); font-size: 12px; }
.modal-summary {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  word-break: break-word;
}
.detail-section {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.detail-section-head { margin-bottom: 8px; font-size: 13px; }
.share-record-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.shortcut-help {
  display: grid;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
}
.shortcut-help kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 2px 7px;
  margin-right: 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.crumb {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 13px; color: var(--muted);
}
.crumb .sep { opacity: 0.45; }
.crumb .current {
  color: var(--ink); font-weight: 700; font-size: 16px;
  font-family: var(--display);
  letter-spacing: -0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mobile-menu-btn { display: none; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  border: 1px solid var(--line); cursor: pointer;
  background: var(--panel);
  color: var(--ink); position: relative;
  transition: box-shadow .15s, border-color .15s;
}
.user-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 6px 16px rgba(15, 138, 124, 0.1);
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #2dd4bf);
  color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  font-family: var(--display);
}
.user-meta { text-align: left; line-height: 1.2; }
.user-meta .name { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta .role { font-size: 11px; color: var(--muted); }
.user-chip .caret { width: 12px; height: 12px; opacity: 0.5; }

.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 228px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px;
  display: none; z-index: 40;
  animation: modal-pop .16s ease;
}
.user-menu.open { display: grid; gap: 2px; }
.user-menu .um-head {
  padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.user-menu .um-head .em { font-size: 13px; font-weight: 600; word-break: break-all; }
.user-menu .um-head .tag {
  display: inline-block; margin-top: 6px; font-size: 11px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-deep);
  font-weight: 600;
}
.user-menu button {
  border: 0; background: transparent; text-align: left;
  padding: 9px 10px; border-radius: 9px; cursor: pointer;
  color: var(--ink); font-size: 13px; display: flex; gap: 8px; align-items: center;
  font-family: inherit;
}
.user-menu button:hover { background: var(--accent-soft); color: var(--accent-deep); }
.user-menu button.danger { color: var(--danger); }
.user-menu button.danger:hover { background: rgba(225,29,72,0.08); }

.work-main {
  padding: 16px 20px 48px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.strict-mode-banner {
  margin: 0;
  padding: 10px 22px;
  font-size: 13px;
  line-height: 1.45;
  color: #9a3412;
  background: color-mix(in srgb, #f97316 14%, var(--bg-soft));
  border-bottom: 1px solid color-mix(in srgb, #f97316 28%, var(--line));
}
html[data-theme="dark"] .strict-mode-banner {
  color: #fdba74;
  background: color-mix(in srgb, #ea580c 18%, var(--panel));
  border-bottom-color: color-mix(in srgb, #ea580c 35%, var(--line));
}

/* Theme drawer */
.theme-drawer {
  position: fixed; inset: 0; z-index: 50; display: none;
}
.theme-drawer.open { display: block; }
.theme-mask {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
}
.theme-panel {
  position: absolute; top: 0; right: 0; width: min(360px, 100vw); height: 100%;
  background: var(--panel); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; border-left: 1px solid var(--line);
  animation: drawer-in .22s ease;
}
.theme-panel .th-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 45%, var(--panel)), var(--panel));
}
.theme-panel .th-head h2 {
  margin: 0; font-size: 16px; font-family: var(--display); font-weight: 700;
}
.theme-panel .th-body { padding: 18px; overflow: auto; display: grid; gap: 18px; }
.theme-section h3 { margin: 0 0 10px; font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.theme-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.swatch.active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.theme-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-modes button, .side-modes button {
  border: 1px solid var(--line); background: var(--bg-soft); border-radius: 10px;
  padding: 11px; cursor: pointer; color: var(--ink); font-size: 13px; font-family: inherit; font-weight: 600;
}
.theme-modes button.active, .side-modes button.active {
  border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft);
}
.side-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
  width: 100%;
  min-width: 0;
}
.stat {
  background: var(--panel); border-radius: 14px; padding: 18px 18px 16px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
  min-width: 0;
  box-sizing: border-box;
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(21, 32, 43, 0.08);
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent));
}
.stat .k {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}
.stat .v {
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 700;
  margin-top: 10px;
  color: var(--ink);
  font-family: var(--display);
  letter-spacing: -0.03em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.stat .s { margin-top: 6px; font-size: 12px; color: var(--muted); }
.screen .stat .s { color: rgba(255,255,255,0.72); }
.cards.light, .stat.light { background: transparent; box-shadow: none; border: 0; }
.cards.light {
  margin-top: 8px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.stat.light::before { display: none; }

.panel {
  margin-top: 0; background: var(--panel); border-radius: 12px;
  box-shadow: none; overflow: visible;
  border: none;
}
.about-panel, .panel.panel-visible {
  overflow: visible;
}
.toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex-wrap: wrap;
}
.toolbar h2 {
  margin: 0; font-size: 15px; font-weight: 700;
  font-family: var(--display); letter-spacing: -0.02em;
}
.toolbar-split {
  flex-wrap: wrap;
  gap: 10px 16px;
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
.filter-bar.compact {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.table-wrap { overflow: auto; padding: 0; -webkit-overflow-scrolling: touch; }
.table-wrap > table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 13px;
}
table { width: 100%; border-collapse: collapse; border-spacing: 0; font-size: 13px; }
table.table-auto { table-layout: auto; }
th, td {
  padding: 0;
  border: none;
  text-align: left;
  vertical-align: middle;
}
.table-wrap table thead th {
  position: sticky;
  /* sticky 相对 .table-wrap（overflow:auto），必须 top:0；勿用 header-h 否则表头下沉留白 */
  top: 0;
  z-index: 2;
  padding: 10px 14px;
  background: var(--bg-soft);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.table-wrap table tbody tr {
  background: transparent;
  box-shadow: none;
  transition: background .12s;
}
.table-wrap table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 28%, var(--panel));
  box-shadow: none;
}
.table-wrap table tbody tr td {
  padding: 10px 14px;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  max-width: none;
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
}
.table-wrap table tbody tr td:first-child {
  border-radius: 0;
}
.table-wrap table tbody tr td:last-child {
  border-radius: 0;
}
.table-wrap table tbody tr td.actions-col,
.table-wrap table tbody tr td:has(.actions) {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}
.table-aligned th,
.table-aligned td.cell-middle {
  vertical-align: middle;
}
.table-aligned th.actions-col,
.table-aligned td.actions-col {
  vertical-align: middle;
}
.note-id-col {
  width: 56px;
  max-width: 72px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.note-uid-col {
  width: 80px;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.actions-col {
  width: auto;
  min-width: 120px;
  white-space: nowrap;
  vertical-align: middle !important;
}
.table-wrap .actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  min-height: 32px;
}
.table-wrap .actions .btn {
  padding: 5px 12px;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
}
.table-wrap .actions .btn:hover {
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--panel));
  color: var(--accent-deep);
}
.table-wrap .actions .btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-deep);
}
.table-wrap .actions .btn.primary:hover {
  background: var(--accent-deep);
  color: #fff;
}
.table-wrap .actions .btn.danger {
  background: rgba(225, 29, 72, 0.08);
  color: var(--danger);
  border-color: rgba(225, 29, 72, 0.24);
}
.table-wrap .actions .btn.ghost {
  background: transparent;
  color: var(--ink);
}
.action-menu-wrap {
  position: relative;
  display: inline-flex;
}
.action-menu.is-up {
  top: auto;
  bottom: calc(100% + 4px);
}
.panel > .filter-bar,
.reach-body .filter-bar,
.cfg-body .filter-bar,
#notes-hub-body .filter-bar,
#analytics-body .filter-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 6;
  background: color-mix(in srgb, var(--bg-soft) 94%, transparent);
  backdrop-filter: blur(8px);
}
.hub-shell .reach-body .filter-bar,
.hub-shell .cfg-body .filter-bar,
.hub-shell #notes-hub-body .filter-bar,
.hub-shell #analytics-body .filter-bar,
.reach-panel .filter-bar,
.hub-shell .filter-bar {
  top: calc(var(--header-h) + var(--hub-tabs-h));
}
/* 仅「共 N 条」且下方已有筛选栏时隐藏，避免重复占高 */
.panel > .toolbar:has(+ .filter-bar):not(:has(button)):not(:has(h2)):not(:has(.toolbar-actions)),
.reach-body > .panel > .toolbar:has(+ .filter-bar):not(:has(button)):not(:has(h2)):not(:has(.toolbar-actions)),
.cfg-body > .panel > .toolbar:has(+ .filter-bar):not(:has(button)):not(:has(h2)):not(:has(.toolbar-actions)),
#notes-hub-body > .panel > .toolbar:has(+ .filter-bar):not(:has(button)):not(:has(h2)):not(:has(.toolbar-actions)),
#analytics-body > .panel > .toolbar:has(+ .filter-bar):not(:has(button)):not(:has(h2)):not(:has(.toolbar-actions)) {
  display: none;
}
html[data-density="compact"] .table-wrap table thead th,
html[data-density="compact"] .table-wrap table tbody td {
  padding-top: 6px;
  padding-bottom: 6px;
}
html[data-density="compact"] .table-wrap table tbody td {
  font-size: 12.5px;
}
html[data-density="compact"] .btn-xs {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
}
html[data-density="compact"] .work-main {
  padding-top: 14px;
}
html[data-density="compact"] .admin-info-card {
  padding: 12px 14px;
}
html[data-density="compact"] .filter-bar {
  padding: 8px 12px;
}
html[data-density="compact"] .toolbar {
  min-height: 36px;
  padding-top: 8px;
  padding-bottom: 8px;
}
html[data-density="compact"] .cfg-tabs {
  padding-top: 6px;
}
html[data-density="compact"] .reach-body,
html[data-density="compact"] .cfg-body,
html[data-density="compact"] #notes-hub-body,
html[data-density="compact"] #analytics-body {
  padding: 8px 12px 14px;
}
.stat.is-alert .v {
  color: var(--danger);
}
.action-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 120;
  min-width: 148px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
}
.action-menu[hidden] { display: none !important; }
.action-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.action-menu button:hover {
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--panel));
}
.action-menu button.danger { color: var(--danger); }
.free-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.free-toggle.is-free {
  border-color: color-mix(in srgb, var(--success) 35%, var(--line));
  background: rgba(21,128,61,0.1);
  color: #15803d;
}
.free-toggle.is-paid {
  border-color: color-mix(in srgb, var(--warning) 35%, var(--line));
  background: rgba(194,65,12,0.08);
  color: #c2410c;
}
.btn-xs {
  padding: 3px 8px;
  font-size: 12px;
}

.linkish {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.linkish.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.check-col {
  width: 36px;
  text-align: center;
}
.drawer-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.drawer-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.drawer-tab.is-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 65%, transparent);
}
.drawer-tab-panel[hidden] {
  display: none !important;
}
.feedback-content-box,
.share-preview-text {
  white-space: pre-wrap;
  font: inherit;
  margin: 10px 0 0;
  background: var(--bg-soft);
  padding: 12px;
  border-radius: 12px;
  line-height: 1.5;
}
.reply-templates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 10px;
}
.user-hub .detail-meta {
  display: grid;
  gap: 6px;
  line-height: 1.45;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.drawer-foot-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 4px;
}
.appr-layout {
  display: grid;
  /* 左编辑 / 右预览 */
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: start;
}
.appr-layout-main {
  display: grid;
  gap: 14px;
  min-width: 0;
  order: 1;
}
.appr-layout-side {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 12px;
  order: 2;
}
.appr-section {
  border: none;
  border-radius: 12px;
  padding: 12px 0 8px;
  background: transparent;
}
.appr-section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}
.appr-preview-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 0;
}
.appr-preview-stage {
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 20px;
  padding: 24px 18px 18px;
  margin-bottom: 0;
  min-height: 220px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 12% -10%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 58%),
    radial-gradient(ellipse at 96% 28%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 52%),
    linear-gradient(168deg, color-mix(in srgb, var(--accent-soft) 62%, var(--panel)), var(--panel));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}
.appr-preview-card {
  text-align: center;
  padding: 6px 10px 2px;
  width: 100%;
}
.appr-preview-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: color-mix(in srgb, var(--accent-soft) 90%, var(--panel));
  color: var(--accent-deep);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 14%, transparent);
}
.appr-preview-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  font-family: var(--display);
  letter-spacing: -0.02em;
}
.appr-preview-sub {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 280px;
  margin: 0 auto;
}
.appr-preview-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}
.appr-preview-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 25%, var(--line));
}
.appr-preview-dot.is-active {
  width: 20px;
  background: var(--accent);
}
.appr-options-list {
  display: grid;
  gap: 10px;
  margin-bottom: 0;
}
.appr-option-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--panel);
  display: grid;
  gap: 10px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.appr-option-row:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 18%, var(--panel));
}
.appr-option-row.is-active {
  border-color: var(--accent);
  box-shadow: none;
  background: color-mix(in srgb, var(--accent-soft) 28%, var(--panel));
}
.appr-option-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.appr-tab-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  font: inherit;
  text-align: left;
  width: 100%;
  color: inherit;
}
button.appr-tab-card {
  appearance: none;
}
.appr-tab-card.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 65%, var(--panel));
  box-shadow: none;
}
.appr-tab-title {
  font-weight: 700;
  font-size: 14px;
  margin-top: 2px;
  line-height: 1.35;
}
.appr-qr-preview {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px dashed color-mix(in srgb, var(--accent) 28%, var(--line));
  display: inline-block;
}
.appr-qr-preview img {
  max-width: 200px;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
}
.row-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.row-check input { width: auto; min-height: 0; margin: 0; }
@media (max-width: 960px) {
  .appr-layout {
    grid-template-columns: 1fr;
  }
  .appr-layout-side {
    position: static;
  }
}
th {
  color: var(--muted); font-weight: 700; font-size: 11px;
  background: transparent;
  white-space: nowrap; letter-spacing: .07em;
  text-transform: uppercase;
}
tr:hover td { background: transparent; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.tag {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 650; line-height: 1.4;
  background: var(--accent-soft); color: var(--accent-deep);
}
.tag.ok { background: rgba(21,128,61,0.12); color: #15803d; }
.tag.warn { background: rgba(194,65,12,0.14); color: #c2410c; }
.tag.danger { background: rgba(225,29,72,0.12); color: #e11d48; }
.tag.muted { background: rgba(91,107,124,0.12); color: var(--muted); }

.empty-box {
  padding: 56px 20px; text-align: center; color: var(--muted);
}
.empty-box .ico { font-size: 36px; opacity: 0.35; margin-bottom: 8px; }
.empty-box .empty-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 6px;
}
.empty-box .empty-hint {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.panel > .toolbar > h2,
.panel-meta-title {
  margin: 0;
  font-size: 13px !important;
  font-weight: 650 !important;
  color: var(--muted) !important;
  letter-spacing: 0.02em;
  font-family: var(--font) !important;
}

.table-wrap table.sticky-cols {
  border-collapse: collapse;
  border-spacing: 0;
}
/* 仅右侧操作列吸边；首列常为复选框，不再左侧悬浮 */
.table-wrap table.sticky-cols thead th:first-child,
.table-wrap table.sticky-cols tbody td:first-child {
  position: static;
  left: auto;
  z-index: auto;
  box-shadow: none;
}
.table-wrap table.sticky-cols thead th.actions-col,
.table-wrap table.sticky-cols tbody td.actions-col {
  position: sticky;
  right: 0;
  z-index: 3;
  background: var(--panel);
  box-shadow: -4px 0 8px -6px rgba(15, 23, 42, 0.22);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
}
.table-wrap table.sticky-cols thead th.actions-col {
  background: var(--bg-soft);
  z-index: 4;
  border-bottom: 1px solid var(--line);
}
.table-wrap table.sticky-cols tbody tr:hover td.actions-col {
  background: color-mix(in srgb, var(--accent-soft) 32%, var(--panel));
}

.dash-attn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 13px;
}
.dash-attn-link {
  border: none;
  background: none;
  padding: 2px 6px;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.dash-attn-link:hover { color: var(--accent); }
.dash-attn-sep { padding: 0 2px; user-select: none; }

.stat.is-clickable {
  cursor: pointer;
  font: inherit;
  text-align: left;
  width: 100%;
  appearance: none;
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
.stat.is-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.stat.is-alert {
  border-color: color-mix(in srgb, var(--warning) 45%, var(--line));
  background: color-mix(in srgb, var(--warning) 8%, var(--panel));
}
.stat.is-alert .v { color: var(--warning); }

.share-preview-text {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  max-height: 160px;
  overflow: auto;
  margin-bottom: 8px;
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  flex-wrap: wrap;
  border-radius: 0 0 12px 12px;
}
.pager-meta {
  font-size: 12.5px;
  white-space: nowrap;
}
.pager-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}
.pager-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: color-mix(in srgb, var(--accent-soft) 40%, var(--panel));
}
.pager-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pager .pager-size,
select.pager-size {
  width: auto;
  min-width: 84px;
  max-width: 110px;
  height: 32px;
  min-height: 32px;
  padding: 0 28px 0 10px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 8px;
  background-color: var(--panel);
}

.chart-box { width: 100%; height: 420px; padding: 12px; min-width: 0; box-sizing: border-box; }
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.chart-grid .chart-box { height: 380px; }

.quick-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.quick-links .btn {
  color: #fff; border-color: rgba(255,255,255,0.22); background: rgba(255,255,255,0.1);
}
.quick-links .btn:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.16); }

.screen {
  min-height: 70vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(45, 212, 191, 0.28), transparent 42%),
    linear-gradient(160deg, #0b1c1a 0%, #12332e 48%, #0f2430 100%);
  color: #f5f8ff; border-radius: 18px; padding: 26px; box-shadow: var(--shadow);
}
.screen .cards .stat {
  background: rgba(255,255,255,0.08); color: #fff; box-shadow: none; border-color: transparent;
}
.screen .stat::before { background: #5eead4; }
.screen .stat .k { color: rgba(255,255,255,0.7); }
.screen .stat .v { color: #fff; }
.chart-bars { display: grid; gap: 10px; margin-top: 18px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 160px; gap: 10px; align-items: center; font-size: 12px; }
.bar-track { height: 10px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #5eead4, var(--accent)); }

.preview-phone {
  width: 220px; border-radius: 28px; padding: 0; border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  overflow: hidden; position: relative; display: flex; flex-direction: column;
}
.preview-phone.app-home { padding: 0 0 10px; }
.app-status {
  display: flex; justify-content: space-between; padding: 10px 14px 2px;
  font-size: 10px; font-weight: 600; opacity: 0.55;
}
.app-titlebar { padding: 2px 12px 8px; }
.app-title-row { display: flex; align-items: center; gap: 8px; }
.app-chrome {
  width: 28px; height: 28px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 12px; opacity: 0.7;
}
.app-title-block { flex: 1; min-width: 0; }
.app-title { font-size: 16px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; }
.app-sub { font-size: 9.5px; margin-top: 2px; opacity: 0.42; }
.app-search {
  margin-top: 8px; height: 28px; display: flex; align-items: center;
  padding: 0 10px; font-size: 10.5px; opacity: 0.7;
}
.app-list {
  flex: 1; overflow: hidden; padding: 4px 10px 56px;
  display: grid; gap: 8px; align-content: start;
}
.app-bookmark {
  display: flex; gap: 8px; padding: 8px 10px 8px 8px; min-height: 56px;
  align-items: stretch;
}
.app-date-tab {
  width: 36px; border-radius: 8px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 700; line-height: 1.15; padding: 4px 0;
}
.app-date-tab .d { font-size: 13px; }
.app-date-tab .m, .app-date-tab .w { font-size: 8.5px; opacity: 0.85; font-weight: 600; }
.app-note-body { min-width: 0; flex: 1; padding: 2px 2px 0 0; }
.app-note-title { font-size: 12.5px; font-weight: 650; }
.app-note-brief {
  font-size: 10.5px; margin-top: 4px; line-height: 1.35; opacity: 0.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-fab {
  position: absolute; right: 16px; bottom: 64px;
  border-radius: 50%; display: grid; place-items: center;
  font-size: 22px; font-weight: 300; line-height: 1; z-index: 2;
}
.app-tabbar {
  margin: 0 12px; height: 40px; display: grid; grid-template-columns: 1fr 1fr 1fr;
  align-items: center; justify-items: center; font-size: 11px; font-weight: 600;
  padding: 3px; position: relative; z-index: 1;
}
.app-tabbar .tab {
  width: 100%; height: 32px; display: grid; place-items: center;
}
.app-tabbar .tab.on { font-weight: 700; }
.preview-stage {
  display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap;
}
.preview-side { flex: 1; min-width: 180px; }
.batch-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 8px 14px; border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.dash { display: grid; gap: 20px; width: 100%; min-width: 0; }
.dash-home {
  width: 100%;
  max-width: none;
  display: grid;
  gap: 16px;
  padding: 0 0 20px;
  min-width: 0;
  box-sizing: border-box;
}
.dash-welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 2px 2px 0;
}
.dash-welcome-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dash-welcome-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
}
.dash-welcome-aside {
  margin: 0;
  max-width: 22ch;
  text-align: right;
  line-height: 1.45;
}
@media (max-width: 720px) {
  .dash-welcome-aside { text-align: left; max-width: none; }
}
.dash-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
  width: 100%;
  min-width: 0;
}
.dash-kpi-hero {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.dash-kpi-hero .stat {
  min-height: 110px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border, #e5e7eb));
}
.dash-kpi-hero .stat.is-money .v {
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  color: var(--accent-deep, var(--accent));
}
.tag-mini {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 12%, transparent);
}
.dash-health-chip {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  color: var(--danger);
  font-size: 12px;
  cursor: pointer;
}
.dash-health-chip:hover { filter: brightness(0.96); }
@media (max-width: 1100px) {
  .dash-kpi-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .dash-kpi-hero { grid-template-columns: 1fr; }
}
.dash-kpi .stat {
  padding: 18px 16px 16px;
  min-height: 96px;
}
.dash-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  min-width: 0;
}
.dash-charts .panel { min-width: 0; width: 100%; box-sizing: border-box; }
.dash-charts .toolbar { padding: 14px 16px; }
.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  min-width: 0;
}
.dash-grid .dash-span { grid-column: 1 / -1; }
.chart-box.sm { height: 300px; }
@media (max-width: 1100px) {
  .dash-charts { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .dash-kpi { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .chart-box.sm { height: 260px; }
}

.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer-mask {
  position: absolute; inset: 0;
  background: rgba(10, 18, 24, 0.48);
  backdrop-filter: blur(4px);
}
.drawer-panel {
  position: absolute; top: 0; right: 0; width: min(560px, 100vw); max-width: 720px; height: 100%;
  background: var(--panel);
  box-shadow: -16px 0 48px rgba(15, 23, 42, 0.16);
  display: flex; flex-direction: column;
  border-left: 1px solid var(--line);
  animation: drawer-in .24s ease;
  border-radius: 18px 0 0 18px;
}
.drawer-resizer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: ew-resize;
  z-index: 2;
}
.drawer-resizer:hover {
  background: color-mix(in srgb, var(--accent) 35%, transparent);
}
@keyframes drawer-in {
  from { transform: translateX(22px); opacity: .86; }
  to { transform: translateX(0); opacity: 1; }
}
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent-soft) 55%, var(--panel)),
    var(--panel)
  );
}
.drawer-head h2 {
  margin: 0; font-size: 17px; font-weight: 700;
  font-family: var(--display); letter-spacing: -0.02em;
}
.drawer-body { padding: 20px 22px; overflow: auto; display: grid; gap: 12px; }

.note-brief-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}
.table-aligned .note-brief-clamp {
  -webkit-line-clamp: 1;
  white-space: nowrap;
  display: block;
  text-overflow: ellipsis;
}
.note-title-cell {
  max-width: 140px;
}
.note-title-cell .note-title-line,
.note-title-cell .note-brief-clamp {
  overflow: hidden;
  text-overflow: ellipsis;
}
.note-title-cell .note-title-line {
  white-space: nowrap;
}

.note-preview-html {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  line-height: 1.6;
  font-size: 14px;
  color: #1e293b;
  word-break: break-word;
}
.note-preview-html img { max-width: 100%; height: auto; border-radius: 8px; }
.note-preview-html table { border-collapse: collapse; width: 100%; }
.note-preview-html td, .note-preview-html th { border: 1px solid rgba(15, 23, 42, 0.12); padding: 6px 8px; }
.note-preview-html h1, .note-preview-html h2, .note-preview-html h3 { margin: 12px 0 6px; }

.modal-root {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center; padding: 24px;
}
.modal-root[hidden] { display: none !important; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(8, 14, 22, 0.62);
  backdrop-filter: blur(10px);
}
.modal-panel {
  position: relative;
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--muted));
  border-radius: 24px;
  box-shadow: 0 32px 90px rgba(16, 24, 32, 0.24);
  display: flex; flex-direction: column;
  max-height: min(88vh, 760px);
  animation: modal-pop .24s cubic-bezier(.22, 1, .36, 1);
  overflow: hidden;
}
.modal-panel.wide { width: min(640px, 100%); }
@keyframes modal-pop {
  from { transform: translateY(14px) scale(.96); opacity: .65; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 22px 24px 0;
  border-bottom: none;
  background: transparent;
}
.modal-head.is-confirm { display: none; }
.modal-head-text { min-width: 0; display: flex; gap: 14px; align-items: flex-start; }
.modal-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.modal-icon.is-info {
  background: color-mix(in srgb, var(--accent-soft) 90%, var(--panel));
  color: var(--accent-deep);
}
.modal-icon.is-danger {
  background: color-mix(in srgb, var(--danger) 14%, var(--panel));
  color: var(--danger);
}
.modal-icon.is-warn {
  background: color-mix(in srgb, var(--warning) 16%, var(--panel));
  color: var(--warning);
}
.modal-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  color: var(--accent); margin-bottom: 4px;
  text-transform: uppercase;
}
.modal-kicker:empty { display: none; }
.modal-head h2 {
  margin: 0; font-size: 18px; font-weight: 700; line-height: 1.4;
  font-family: var(--display); letter-spacing: -0.02em;
}
.modal-x {
  flex-shrink: 0;
  margin-top: -2px;
  border-radius: 10px;
}
.modal-body {
  padding: 8px 24px 4px;
  overflow: auto;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
}
.modal-confirm {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
  padding: 8px 6px 4px;
}
.modal-confirm .modal-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  font-size: 24px;
}
.modal-confirm .modal-confirm-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  font-family: var(--display);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.modal-body-inner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.modal-body-text { min-width: 0; flex: 1; }
.modal-body .modal-msg {
  color: var(--muted);
  margin: 0;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.65;
}
.modal-confirm .modal-msg {
  max-width: 340px;
}
.modal-body .modal-warn {
  margin-top: 12px; padding: 11px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--warning) 12%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--line));
  color: var(--ink); font-size: 12.5px;
  text-align: left;
  width: 100%;
}
.modal-foot {
  display: flex; justify-content: stretch; gap: 10px; flex-wrap: wrap;
  padding: 18px 24px 22px;
  border-top: none;
  background: transparent;
}
.modal-foot .btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  border-radius: 12px;
  font-size: 14px;
}
.modal-foot .btn.ghost {
  background: color-mix(in srgb, var(--bg-soft) 80%, var(--panel));
}
.modal-foot .btn.primary,
.modal-foot .btn.danger {
  font-weight: 700;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 18%, transparent);
}
.modal-panel.danger .modal-kicker { color: var(--danger); }
.modal-panel.confirm .modal-body {
  padding-top: 22px;
}

.filter-form {
  display: grid;
  gap: 14px;
}
.filter-form .ff-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .filter-form .ff-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
  }
}
.filter-form .ff-row { display: grid; gap: 7px; }
.filter-form label {
  font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .03em;
}
.filter-form input,
.filter-form select,
.filter-form .field-input,
.filter-form .field-select {
  width: 100%;
  border: 1px solid var(--line);
  background-color: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  min-height: 36px;
  box-sizing: border-box;
}
.filter-form select,
.filter-form .field-select {
  padding-right: 32px;
}
.filter-form .cn-select,
.filter-form .cn-select-trigger {
  display: none !important;
}
.filter-form input:focus,
.filter-form select:focus,
.filter-form .field-input:focus,
.filter-form .field-select:focus {
  outline: none;
  background-color: var(--panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.filter-form .ff-hint,
.filter-form .ff-span {
  font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0;
  padding: 10px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--panel));
}
.modal-panel.filter-modal .modal-body {
  padding-top: 16px;
}

.about-panel .about-form {
  display: grid;
  gap: 16px;
  padding: 18px 20px 22px;
}
.about-features-head h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-family: var(--display);
}
.about-features-head .small { margin: 0; }
#about-features { display: grid; gap: 12px; }
.about-feature-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-soft) 65%, var(--panel));
}
.about-feature-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.about-feature-grid .about-sub {
  grid-column: 1 / -1;
}
.about-feature-grid .about-rm {
  grid-column: 3;
  grid-row: 1;
  align-self: end;
  height: 40px;
}
.mem-plans, .mem-benefits { display: grid; gap: 12px; }
.mem-plan-row {
  padding: 14px;
  border: none;
  box-shadow: none;
  border-radius: 14px;
  background: var(--bg-soft);
}
.mem-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.mem-plan-grid .mem-plan-rm {
  height: 40px;
  align-self: end;
}
.mem-copy-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 14px;
  align-items: start;
}
.mem-benefit-preview-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent, #0f8a7c) 18%, transparent);
}
.mem-benefit-preview-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.mem-benefit-preview-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
/* 会员权益：左右铺满工作台 */
.mb-workbench {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: calc(100vh - 220px);
  max-width: none !important;
  width: 100%;
  padding-bottom: 88px;
}
.mb-workbench-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line);
}
.mb-workbench-head h3 {
  margin: 0;
  font-size: 16px;
  font-family: var(--display);
  letter-spacing: -0.02em;
}
.mb-workbench-head p {
  margin: 4px 0 0;
}
.mb-workbench-body {
  display: grid;
  grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1fr);
  gap: 0;
  flex: 1;
  min-height: 420px;
  margin-top: 0;
}
.mb-list-pane {
  border-right: 1px solid var(--line);
  padding: 12px 12px 12px 0;
  min-width: 0;
  overflow: auto;
}
.mb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mb-list-empty {
  padding: 18px 8px;
}
.mb-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.12s ease;
}
.mb-list-item:hover {
  background: var(--bg-soft);
}
.mb-list-item.is-active {
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--bg-soft));
}
.mb-list-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.mb-list-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mb-list-text strong {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mb-list-text em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mb-edit-pane {
  padding: 12px 0 12px 18px;
  min-width: 0;
}
.mb-empty {
  display: grid;
  place-items: center;
  min-height: 280px;
  color: var(--muted);
  font-size: 13.5px;
}
.mb-editor-form {
  display: grid;
  grid-template-columns: minmax(200px, 0.42fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.mb-phone-preview {
  padding: 16px;
  border-radius: 16px;
  background: var(--bg-soft);
}
.mb-phone-preview-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.mb-phone-card {
  text-align: center;
  padding: 22px 16px;
  border-radius: 14px;
  background: var(--panel);
}
.mb-fields {
  display: grid;
  gap: 12px;
}
.mb-editor-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}
.danger-text { color: var(--danger) !important; }
@media (max-width: 960px) {
  .mb-workbench-body {
    grid-template-columns: 1fr;
  }
  .mb-list-pane {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
    max-height: 220px;
  }
  .mb-edit-pane {
    padding: 14px 0 0;
  }
  .mb-editor-form {
    grid-template-columns: 1fr;
  }
  .mem-copy-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .about-feature-grid {
    grid-template-columns: 1fr;
  }
  .about-feature-grid .about-sub,
  .about-feature-grid .about-rm {
    grid-column: auto;
    grid-row: auto;
  }
  .mem-plan-grid {
    grid-template-columns: 1fr;
  }
}
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.filter-chips {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-deep);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
}
html[data-theme="dark"] .filter-chip { color: #5eead4; }
.filter-chip .x {
  border: 0; background: transparent; color: inherit; cursor: pointer;
  padding: 0 0 0 2px; font-size: 14px; line-height: 1; opacity: .7;
}
.filter-chip .x:hover { opacity: 1; }

.toast {
  position: fixed; left: 50%; top: 72px; bottom: auto; transform: translateX(-50%);
  background: #101820; color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 300;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 14px 34px rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.06);
  animation: modal-pop .18s ease;
  max-width: min(520px, calc(100vw - 32px));
  text-align: center;
  pointer-events: none;
}
.toast.is-ok {
  background: #0f766e;
  border-color: rgba(255,255,255,0.12);
}
.toast.is-error {
  background: #b42318;
  border-color: rgba(255,255,255,0.12);
}

.sys-health {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sys-health-head {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}
.sys-health-head .dash-health {
  flex: 1 1 280px;
  margin: 0;
  min-width: 0;
}
.sys-health-head > .btn {
  align-self: center;
}
.sys-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
}
.sys-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sys-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}
.sys-cards {
  margin-top: 0;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}
.sys-stat {
  margin: 0;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  cursor: default;
  appearance: none;
  -webkit-appearance: none;
}
button.sys-stat {
  cursor: pointer;
}
.sys-stat .v {
  font-size: clamp(18px, 2.1vw, 24px);
}
.sys-meter {
  margin-top: 10px;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 80%, transparent);
  overflow: hidden;
}
.sys-meter > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #22c55e));
}
.sys-meter.is-alert > i {
  background: linear-gradient(90deg, #f59e0b, #b42318);
}
.stat-hint {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

.side-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.42); z-index: 25;
  backdrop-filter: blur(2px);
}

/* —— 筛选栏 / 排序表头 / 风格示意 / 信息卡片 —— */
.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.filter-bar--with-meta {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.filter-bar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
  padding-right: 4px;
}
.filter-bar--with-meta .filter-bar-chips {
  grid-column: 1 / -1;
}
.filter-bar-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}
.filter-bar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.filter-bar-chips {
  grid-column: 1 / -1;
  width: 100%;
  padding-top: 2px;
}
.filter-bar--fields-only {
  grid-template-columns: 1fr;
}
.filter-bar--with-meta.filter-bar--fields-only {
  grid-template-columns: auto minmax(0, 1fr);
}
@media (max-width: 900px) {
  .filter-bar--with-meta {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .filter-bar-meta {
    grid-column: 1 / -1;
    padding-right: 0;
  }
}
.filter-field {
  width: auto;
  min-width: 132px;
  max-width: 220px;
  height: 34px;
  min-height: 34px;
  padding: 4px 10px;
  font-size: 13px;
  background: var(--panel);
}
.filter-bar select.filter-field,
.filter-bar .field-select {
  padding-right: 28px;
}
.filter-field-sm { min-width: 110px; max-width: 160px; }
.filter-bar .cn-select--field { min-width: 132px; max-width: 200px; }
.filter-bar .cn-select-trigger { display: none !important; }

@media (max-width: 720px) {
  .filter-bar {
    grid-template-columns: 1fr;
  }
  .filter-bar-actions {
    justify-content: flex-start;
  }
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color .15s;
}
.sortable-th:hover { color: var(--accent-deep); }
.sortable-th.is-active { color: var(--accent-deep); font-weight: 700; }

.style-thumb {
  display: inline-flex;
  vertical-align: middle;
}
.style-thumb-bg {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: grid;
  place-items: center;
}
.style-thumb-inner {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.style-thumb-bar {
  position: absolute;
  top: 6px; left: 6px; right: 6px;
  height: 5px;
  border-radius: 99px;
}
.style-thumb-block {
  position: absolute;
  left: 6px; right: 6px;
  bottom: 6px;
  height: 18px;
  border-radius: 6px;
}
.style-thumb-dot {
  position: absolute;
  right: 4px; bottom: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
}

.admin-form-card {
  padding: 0 16px 20px;
  display: grid;
  gap: 14px;
  max-width: 640px;
}
.panel-hint { padding: 0 16px 10px; margin: 0; }

.admin-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 0 16px 20px;
}
.admin-info-card {
  border: none;
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--bg-soft);
  box-shadow: none;
  display: grid;
  gap: 10px;
}
.admin-info-card.is-off { opacity: .72; }
.admin-info-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.admin-info-card-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
}
.admin-info-card-body {
  line-height: 1.45;
  min-height: 2.4em;
}
.admin-info-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.detail-meta {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
}
.mail-preview-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel);
  max-height: 420px;
  overflow: auto;
}
.mail-preview-text {
  white-space: pre-wrap;
  font: inherit;
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  max-height: 420px;
  overflow: auto;
}

@media (max-width: 1100px) {
  .work-head-center { display: none; }
  .chart-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .user-meta { display: none; }
}
@media (max-width: 960px) {
  .login-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .login-hero {
    min-height: 0;
    padding: 20px 22px 16px;
    align-items: flex-end;
    order: 2;
  }
  .login-panel {
    order: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px 12px;
  }
  .login-hero-brand { font-size: 28px; }
  .login-hero-lead,
  .login-hero-mark { display: none; }
  .login-hero-eyebrow { margin-bottom: 4px; }
  .login-card {
    border-radius: 18px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
  }
  .app-body { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-105%);
    transition: transform .22s ease; width: var(--side);
  }
  .app-body.side-open .sidebar { transform: translateX(0); }
  .app-body.side-open .side-backdrop { display: block; }
  .mobile-menu-btn { display: inline-flex; }
  .app-body.side-collapsed { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .login-body { grid-template-rows: auto 1fr; }
  .login-hero { padding: 20px 18px 12px; }
  .login-panel { padding: 0 12px 24px; }
  .login-card { padding: 20px 16px 22px; }
  .login-code-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .login-code-btn { width: 100%; }
}

/* —— WebView / 手机壳：强制窄屏运营台适配 —— */
html.ops-webview,
html.ops-webview body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html.ops-webview.side-drawer-open,
html.ops-webview.side-drawer-open body {
  overflow: hidden !important;
  touch-action: none;
}
html.ops-webview .app-body {
  grid-template-columns: 1fr !important;
  min-height: 100dvh;
}
html.ops-webview .sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 36;
  transform: translateX(-105%);
  transition: transform .22s ease;
  width: min(var(--side), 86vw);
  max-width: 320px;
}
html.ops-webview .side-backdrop {
  z-index: 35;
}
html.ops-webview .app-body.side-open .sidebar {
  transform: translateX(0);
}
html.ops-webview .app-body.side-open .side-backdrop {
  display: block;
}
html.ops-webview .mobile-menu-btn {
  display: inline-flex !important;
}
html.ops-webview #btn-side-collapse {
  display: none !important;
}
html.ops-webview .app-body.side-collapsed {
  grid-template-columns: 1fr !important;
}
html.ops-webview .app-body.side-collapsed .sidebar .n-label,
html.ops-webview .app-body.side-collapsed .sidebar .g-label,
html.ops-webview .app-body.side-collapsed .sidebar .brand-text,
html.ops-webview .app-body.side-collapsed .sidebar .g-abbr {
  display: revert;
}
html.ops-webview .work-head-center,
html.ops-webview .user-meta {
  display: none !important;
}
html.ops-webview {
  --header-h: 52px;
}
html.ops-webview .work-main {
  padding: 12px 10px calc(28px + env(safe-area-inset-bottom, 0px));
  min-width: 0;
}
html.ops-webview .work-head {
  padding: 8px 10px;
  gap: 8px;
}
html.ops-webview .login-body {
  grid-template-columns: 1fr !important;
  grid-template-rows: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
html.ops-webview .login-hero {
  display: none !important;
}
html.ops-webview .login-panel {
  order: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 14px calc(24px + env(safe-area-inset-bottom, 0px));
}
html.ops-webview .login-card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border-radius: 18px;
  padding: 22px 16px 24px;
}
html.ops-webview .login-code-row {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 8px;
}
html.ops-webview .login-code-btn {
  width: 100%;
}
html.ops-webview .appr-layout,
html.ops-webview .cfg-appr-shell .about-form.appr-layout {
  grid-template-columns: 1fr !important;
  gap: 12px;
}
/* 编辑优先：预览放到表单下方，避免占首屏 */
html.ops-webview .appr-layout-side {
  position: static !important;
  order: 2;
}
html.ops-webview .appr-layout-main {
  order: 1;
}
html.ops-webview .appr-preview-stage {
  min-height: 120px;
  padding: 14px 12px;
  border-radius: 16px;
}
html.ops-webview .cfg-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 10px 0;
  gap: 4px;
}
html.ops-webview .cfg-tab {
  flex-shrink: 0;
  font-size: 12.5px;
  padding: 8px 10px;
}
html.ops-webview .cfg-appr-shell,
html.ops-webview .cfg-form-shell,
html.ops-webview .about-panel {
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}
html.ops-webview .cfg-appr-shell .about-form.appr-layout,
html.ops-webview .cfg-appr-hint,
html.ops-webview .cfg-form-hint,
html.ops-webview .cfg-form-body {
  padding-left: 10px;
  padding-right: 10px;
}
html.ops-webview .cfg-sticky-save {
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
html.ops-webview .panel,
html.ops-webview .list-panel,
html.ops-webview .hub-shell {
  border-radius: 12px;
}
html.ops-webview .table-wrap {
  margin: 0 -2px;
}
html.ops-webview .filter-bar {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 8px;
}
html.ops-webview .filter-bar .filter-field,
html.ops-webview .filter-bar .field-input,
html.ops-webview .filter-bar .field-select {
  min-width: 0 !important;
  max-width: none !important;
  width: 100%;
}
html.ops-webview .filter-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
html.ops-webview .mo-summary {
  grid-template-columns: 1fr 1fr !important;
}
html.ops-webview .drawer {
  inset: 0;
  width: auto;
  max-width: none;
  z-index: 45;
}
html.ops-webview .drawer-panel {
  width: 100% !important;
  max-width: 100vw !important;
  border-radius: 0;
}
html.ops-webview .drawer-share,
html.ops-webview .drawer-share .tab-panel {
  min-height: 0 !important;
}
html.ops-webview .modal-panel {
  width: min(100vw - 24px, 520px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
}
html.ops-webview .toast {
  top: calc(12px + env(safe-area-inset-top, 0px));
  max-width: calc(100vw - 24px);
}
html.ops-webview .btn.icon {
  width: 44px;
  height: 44px;
}
@media (max-width: 420px) {
  html.ops-webview .mo-summary {
    grid-template-columns: 1fr !important;
  }
  html.ops-webview .cards {
    grid-template-columns: 1fr 1fr;
  }
}

.cfg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.hub-shell {
  padding: 0;
  overflow: hidden;
}
.hub-shell > .cfg-tabs {
  position: sticky;
  top: var(--header-h);
  z-index: 7;
  background: color-mix(in srgb, var(--bg-soft) 96%, transparent);
  backdrop-filter: blur(8px);
}
/* .cfg-tab / .cfg-body 权威样式见下方「全功能界面统一优化」 */
.cfg-body,
.reach-body,
#notes-hub-body,
#analytics-body {
  border-top: 0;
}
.reach-body > .panel,
.cfg-body > .panel,
#notes-hub-body > .panel,
#analytics-body > .panel {
  border: none;
  box-shadow: none;
  padding: 0;
  overflow: visible;
  background: transparent;
  border-radius: 0;
}
/* hub 内嵌 list-panel 恢复为实心卡片（覆盖上方透明化） */
.cfg-body > .panel.list-panel,
.reach-body > .panel.list-panel,
#notes-hub-body > .panel.list-panel,
#analytics-body > .panel.list-panel {
  border: none;
  box-shadow: none;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 0;
  overflow: visible;
}
.reach-body .toolbar:first-child,
.cfg-body .toolbar:first-child,
#notes-hub-body .toolbar:first-child,
#analytics-body .toolbar:first-child {
  padding-top: 2px;
}
.reach-body .actions-col {
  min-width: 168px;
}
.dash-shortcuts {
  display: none; /* 总览改由 KPI / 待办条直达，避免重复入口 */
}
.dash-shortcut {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.dash-shortcut:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}
.cfg-runtime {
  display: grid;
  gap: 16px;
  padding-bottom: 72px;
}
.cfg-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cfg-section-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.cfg-section-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}
.cfg-section-head p {
  margin: 0;
}
.cfg-section-body {
  max-width: none;
  padding: 16px;
}
.cfg-trial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.cfg-trial-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 24px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-soft);
}
.cfg-trial-row > span:first-child {
  font-size: 13px;
  font-weight: 600;
}
.cfg-trial-row .field-input {
  margin: 0;
}
@media (max-width: 720px) {
  .cfg-trial-grid {
    grid-template-columns: 1fr;
  }
}
.cfg-sticky-save {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: none;
}
#cfg-dirty-hint.is-dirty {
  color: #d48806;
  font-weight: 600;
}
.cfg-sticky-save .btn.primary.is-dirty {
  box-shadow: 0 0 0 2px color-mix(in srgb, #d48806 45%, transparent);
}
@media (max-width: 720px) {
  .cfg-sticky-save {
    flex-direction: column;
    align-items: stretch;
  }
  .dash-shortcuts {
    gap: 6px;
  }
}
.pager .pager-size {
  min-width: 84px;
  height: 32px;
  font-size: 12.5px;
}
.search-panel .search-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border, #eee);
}
.search-panel .search-section-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}
.search-panel .search-section > div + div {
  margin-top: 6px;
}

/* —— 布局优化：Tab 角标 / 窄屏搜索 / flyout —— */
.cfg-tab {
  position: relative;
}
.cfg-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--danger, #e11d48);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}
.cfg-tabs {
  margin-bottom: 0;
}
.crumb-tab {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-intent {
  margin-top: 4px;
  font-size: 12px;
}
.search-toggle-btn { display: none; }
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 16px 16px;
}
.search-overlay[hidden] { display: none; }
.search-overlay-panel {
  width: min(560px, 100%);
  background: var(--panel);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  gap: 10px;
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
}
.side-flyout {
  position: fixed;
  z-index: 35;
  min-width: 180px;
  max-width: 240px;
  padding: 8px;
  border-radius: 10px;
  background: var(--side-bg, #0f172a);
  color: var(--side-ink, #e2e8f0);
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
  display: none;
  gap: 2px;
}
.side-flyout.open { display: grid; }
.side-flyout .nav-item {
  width: 100%;
  justify-content: flex-start;
}
.drawer-head h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 72px);
}
.theme-drawer { z-index: 50; }
.drawer { z-index: 40; }
.modal-root, #modal-root { z-index: 60; }
.table-wrap {
  position: relative;
}
@media (max-width: 960px) {
  .work-head-center { display: none; }
  .search-toggle-btn { display: inline-flex; }
  .cfg-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .appr-layout {
    grid-template-columns: 1fr;
  }
  .appr-layout-main,
  .appr-layout-side { order: initial; }
  .table-wrap::after {
    content: "左右滑动查看更多";
    position: sticky;
    right: 0;
    bottom: 8px;
    float: right;
    margin: -28px 8px 0 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(15,23,42,.65);
    color: #fff;
    font-size: 11px;
    pointer-events: none;
  }
}

.col-settings { position: relative; }
.col-settings-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 25;
  min-width: 148px;
  padding: 8px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  display: grid;
  gap: 4px;
}
.col-set-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 500;
  padding: 4px 2px;
}
.col-set-item input[type="checkbox"] {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
}
.filter-bar-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.filter-bar-inline .field-select,
.filter-bar-inline .filter-field,
#style-filter {
  width: auto;
  min-width: 120px;
  max-width: 160px;
  flex: 0 0 auto;
}
mark.search-hit {
  background: color-mix(in srgb, var(--accent) 28%, #fde68a);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}
[data-col][hidden] { display: none !important; }

.html-sandbox {
  width: 100%;
  min-height: 240px;
  height: min(60vh, 520px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.modal-require {
  display: block;
  margin-top: 14px;
  text-align: left;
  font-size: 13px;
}
.modal-require code {
  font-weight: 700;
}
.modal-require .field-input {
  margin-top: 8px;
  width: 100%;
}

.search-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.search-section-head .search-section-title {
  margin: 0;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-size: 13px;
}

/* —— 第二轮布局审查补丁 —— */
.work-main {
  max-width: 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
#page-root > .dash,
#page-root > .dash-home,
#page-root > .panel,
#page-root > .hub-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.panel {
  overflow: visible;
}
.about-panel,
.panel.panel-visible {
  overflow: visible;
}
.toolbar {
  min-height: 44px;
}
.toolbar > .muted.small:only-child,
.toolbar > .muted.small:first-child:nth-last-child(1) {
  /* 仅一条「共 N 条」时更紧凑 */
  padding: 2px 0;
}
.batch-bar .btn {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
}
.check-col {
  width: 40px;
  max-width: 44px;
  text-align: center;
}
.table-wrap table tbody tr:last-child td {
  border-bottom: none;
}
/* 亮主题 ghost/默认按钮文字始终可读（避免与面板同色看不见） */
html[data-theme="light"] .btn.ghost,
html[data-theme="light"] .btn:not(.primary):not(.danger) {
  color: var(--ink);
  background: var(--panel);
}
html[data-theme="light"] .btn.ghost:hover,
html[data-theme="light"] .btn:not(.primary):not(.danger):hover {
  color: var(--accent-deep);
}
html[data-theme="light"] .table-wrap .actions .btn {
  color: var(--ink);
}
html[data-theme="light"] .table-wrap .actions .btn.primary {
  color: #fff;
}
/* 筛选栏右侧按钮在窄宽下不挤扁 */
.filter-bar-actions .btn {
  white-space: nowrap;
  flex-shrink: 0;
}
/* 顶栏三区在中等宽度避免互相挤压 */
@media (max-width: 1100px) {
  .work-head-center {
    max-width: 280px;
  }
  .user-meta .role {
    display: none;
  }
}
/* 侧栏折叠时工作区占满 */
.app-body.side-collapsed .work-main {
  max-width: none;
}
/* 空状态单元格居中 */
.table-wrap td:has(.empty-box) {
  max-width: none;
  white-space: normal;
  text-align: center;
  padding: 24px 14px;
}

/* —— 功能布局优化 —— */
.list-panel > .filter-bar:first-child {
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
.batch-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 6;
  background: color-mix(in srgb, var(--bg-soft) 96%, transparent);
  backdrop-filter: blur(8px);
}
.hub-shell .batch-bar {
  top: calc(var(--header-h) + var(--hub-tabs-h));
}
.sys-health-head .dash-health.panel,
.dash-home > .dash-health.panel {
  margin: 0;
  border: none;
  box-shadow: none;
}
.pager {
  padding: 10px 14px;
}
/* list-panel 勿用 overflow:hidden，否则粘性筛选栏/表头会被裁切 */
#page-root > .panel.list-panel,
#page-root > .panel.panel-visible {
  overflow: visible;
}

/* —— 全功能界面统一优化（共享壳层） —— */
#page-root > .panel,
#page-root > .hub-shell,
#page-root > .mo-home,
#page-root > .dash-home,
#page-root > .dash,
#page-root > .sys-health,
#page-root > .search-panel {
  animation: page-fade-in .28s ease both;
}
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

#page-root > .panel.list-panel,
#page-root > .panel:not(.hub-shell) {
  box-shadow: none;
  border: none;
  border-radius: var(--radius);
}
#page-root > .hub-shell {
  box-shadow: none;
  border: none;
  border-radius: var(--radius);
  background: var(--panel);
  overflow: visible;
}
/* 嵌套 list-panel：无描边/阴影 */
#page-root > .mo-home > .panel.list-panel,
#page-root .cfg-body > .panel.list-panel,
#page-root .reach-body > .panel.list-panel,
#page-root #notes-hub-body > .panel.list-panel,
#page-root #analytics-body > .panel.list-panel {
  box-shadow: none;
  border: none;
  border-radius: var(--radius);
  background: var(--panel);
}

.work-main {
  padding: 18px 22px 56px;
}

/* Hub / 子 Tab：分段控件 */
.cfg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-soft) 88%, var(--panel)), var(--bg-soft));
}
.hub-shell > .cfg-tabs {
  top: var(--header-h);
}
.cfg-tab {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  margin-bottom: 0;
  border-bottom: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.cfg-tab:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
.cfg-tab.is-active {
  color: var(--accent-deep);
  background: var(--panel);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  border-bottom-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  box-shadow: 0 2px 8px rgba(15, 138, 124, 0.08);
  font-weight: 700;
}
.cfg-tab-label { line-height: 1.2; }
.cfg-body,
.reach-body,
#notes-hub-body,
#analytics-body {
  padding: 12px 14px 20px;
  background: color-mix(in srgb, var(--bg) 55%, var(--panel));
}
html[data-theme="dark"] .cfg-body,
html[data-theme="dark"] .reach-body,
html[data-theme="dark"] #notes-hub-body,
html[data-theme="dark"] #analytics-body {
  background: color-mix(in srgb, var(--bg) 70%, var(--panel));
}

/* 筛选栏 */
.filter-bar {
  padding: 12px 14px;
  gap: 10px 14px;
  background: color-mix(in srgb, var(--bg-soft) 92%, var(--panel));
}
.filter-field,
.filter-bar .field-input,
.filter-bar .field-select {
  height: 36px;
  min-height: 36px;
  border-radius: 10px;
  background: var(--panel);
}
.filter-bar-actions .btn {
  height: 36px;
  border-radius: 10px;
  padding: 0 14px;
}
.filter-bar-meta .muted {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* 表格 */
.table-wrap table thead th {
  padding: 11px 14px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--muted) 92%, var(--ink));
  background: color-mix(in srgb, var(--bg-soft) 88%, var(--panel));
}
.table-wrap table tbody tr td {
  padding: 11px 14px;
}
.table-wrap table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--bg-soft) 42%, transparent);
}
.table-wrap table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 36%, var(--panel));
}
.table-wrap .actions .btn {
  border-radius: 9px;
  padding: 5px 11px;
}

/* 空状态 */
.empty-box {
  padding: 48px 20px 52px;
  display: grid;
  place-items: center;
  gap: 0;
}
.empty-box .empty-ico {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent-soft) 80%, var(--panel)), var(--bg-soft));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  color: var(--accent-deep);
}
.empty-box .empty-ico .ico,
.empty-box .ico {
  font-size: 22px;
  opacity: 0.9;
  margin: 0;
  line-height: 1;
}
.empty-box .empty-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.empty-box .empty-hint {
  max-width: 36ch;
}

/* 骨架屏 */
.page-skeleton--list {
  padding: 0;
  overflow: hidden;
}
.page-skeleton--list .sk-filter {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.page-skeleton--list .sk-filter .sk-row { height: 36px; border-radius: 10px; flex: 1; max-width: 220px; }
.page-skeleton--list .sk-filter .sk-row--sm { max-width: 140px; }
.page-skeleton--list .sk-filter .sk-row--btn { max-width: 88px; margin-left: auto; }
.page-skeleton--list .sk-line {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.7fr;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.page-skeleton--list .sk-line .sk-row { height: 12px; margin: 0; width: 100%; }

/* KPI / 卡片 */
.stat,
.dash-kpi .stat {
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.stat::before {
  width: 4px;
  border-radius: 0 3px 3px 0;
}
.admin-info-card,
.cfg-section {
  border-radius: 14px;
  transition: none;
}
.admin-info-card:hover,
.cfg-section:hover {
  border-color: transparent;
  box-shadow: none;
}
/* App 设置内不做卡片悬浮抬升 */
.cfg-panel .cfg-section:hover {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}
.cfg-section-head {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 35%, var(--bg-soft)), var(--bg-soft));
}
.cfg-section-head h3 {
  font-family: var(--display);
  letter-spacing: -0.02em;
}

/* —— App 设置：压扁嵌套卡片 —— */
.cfg-panel .cfg-body {
  background: var(--panel);
  padding: 16px 18px 24px;
}
.cfg-panel .cfg-runtime {
  gap: 0;
  padding-bottom: 80px;
  max-width: 920px;
}
.cfg-panel .cfg-runtime.cfg-runtime-wide,
.cfg-panel .cfg-runtime.cfg-runtime-fill {
  max-width: none;
  width: 100%;
}
.cfg-panel .cfg-section {
  border: none;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  border-bottom: 1px solid var(--line);
  padding: 18px 0 20px;
  transition: none;
}
.cfg-panel .cfg-section:last-of-type {
  border-bottom: none;
}
.cfg-panel .cfg-section-head {
  background: transparent;
  border-bottom: none;
  padding: 0 0 10px;
}
.cfg-panel .cfg-section-body,
.cfg-panel .cfg-section-body.admin-form-card {
  display: grid;
  gap: 14px;
  padding: 0;
  max-width: none;
  background: transparent;
  box-shadow: none;
  border: none;
}
.cfg-panel .cfg-subhead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 4px;
  margin: 0;
}
.cfg-panel .cfg-sticky-save {
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  box-shadow: none;
}

/* 批量条 / 分页 */
.batch-bar {
  padding: 10px 14px;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent-soft) 55%, var(--bg-soft)), var(--bg-soft));
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--bg-soft) 50%, var(--panel));
  border-top: 1px solid var(--line);
}
.pager-btn {
  border-radius: 9px;
  min-width: 32px;
  height: 32px;
}

/* 工具栏 / Tag / Toast */
.toolbar {
  padding: 12px 16px;
  background: color-mix(in srgb, var(--panel) 92%, var(--bg-soft));
}
.tag {
  padding: 3px 10px;
  letter-spacing: 0.01em;
}
.toast {
  border-radius: 14px;
  padding: 12px 20px;
  backdrop-filter: blur(8px);
}

/* 顶栏 / 侧栏微调 */
.work-head {
  box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 80%, transparent);
}
.global-search {
  height: 38px;
  background-color: color-mix(in srgb, var(--bg-soft) 55%, var(--panel));
}
.crumb .current {
  font-size: 15px;
}
.nav-item.active {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 42%, transparent), color-mix(in srgb, var(--accent) 18%, transparent));
}
html[data-side-theme="light"] .nav-item.active {
  background: var(--accent-soft);
}

/* 抽屉 / 详情 */
.drawer-panel {
  border-radius: 20px 0 0 20px;
}
.drawer-body > .detail-meta,
.drawer-body > .admin-form-card {
  border-radius: 12px;
}
.detail-meta {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 28%, var(--bg-soft)), var(--bg-soft));
}

/* 图表区 */
.chart-box {
  border-radius: 0 0 var(--radius) var(--radius);
}
.dash-charts .panel,
.dash-grid .panel {
  border: none;
  border-radius: var(--radius);
  box-shadow: none;
  overflow: hidden;
}
.dash-attn {
  border-radius: 14px;
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent-soft) 50%, var(--panel)), var(--panel));
}

/* 系统健康 */
.sys-health .panel,
.sys-meter {
  border-radius: 14px;
}

/* 赞赏 / 风格卡 */
.appr-tab-card,
.appr-option-row {
  border-radius: 12px;
}
.style-thumb-bg {
  border-radius: 14px;
}

/* 登录页统一气质 */
.login-hero {
  background:
    linear-gradient(155deg, #0a1816 0%, #12352f 40%, #0e2832 100%);
}
.login-card {
  border-radius: 24px;
  gap: 15px;
  padding: 36px 32px 32px;
}
.login-submit {
  box-shadow: 0 10px 24px rgba(15, 138, 124, 0.28);
}

/* 窄屏 */
@media (max-width: 960px) {
  .work-main { padding: 14px 12px 40px; }
  .cfg-tabs { flex-wrap: nowrap; padding: 10px 12px; }
  .cfg-tab { flex-shrink: 0; }
  .page-skeleton--list .sk-line { grid-template-columns: 1fr 1fr; }
  .page-skeleton--list .sk-line .sk-row:last-child { display: none; }
}
@media (max-width: 560px) {
  .filter-bar-actions .btn.primary { flex: 1; }
}

/* —— 账单管理 —— */
.mo-home {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.mo-alert {
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.5;
}
.mo-alert a {
  color: #c2410c;
  font-weight: 650;
}
.mo-summary {
  margin: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.mo-stat .v {
  font-variant-numeric: tabular-nums;
}
.mo-stat-paid::before {
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 25%, transparent));
}
.mo-stat-refund::before {
  background: linear-gradient(180deg, #c2410c, color-mix(in srgb, #c2410c 25%, transparent));
}
.mo-stat-refund .v {
  color: #c2410c;
  font-size: clamp(18px, 2vw, 24px);
}
.mo-table th.num,
.mo-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mo-amt {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  font-family: var(--display);
  letter-spacing: -0.02em;
}
.mo-amt.is-paid { color: #15803d; }
.mo-amt.is-refund { color: #c2410c; }
.mo-trade { font-size: 12px; }
.mo-time-sub { margin-top: 2px; opacity: 0.85; }
.mo-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.mo-drawer-amt {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--display);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.mo-drawer-dl {
  margin: 0;
  display: grid;
  gap: 12px;
}
.mo-drawer-dl > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  align-items: start;
}
.mo-drawer-dl dt {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding-top: 2px;
}
.mo-drawer-dl dd { margin: 0; word-break: break-all; }
.mo-drawer-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
@media (max-width: 1280px) {
  .mo-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .mo-summary { grid-template-columns: 1fr; }
}

/* App 设置 tabs：对齐赞赏页 appr-layout */
.cfg-appr-shell {
  display: grid;
  gap: 0;
  padding-bottom: 12px;
}
.cfg-appr-shell > .toolbar {
  margin: 0;
  border-radius: 12px 12px 0 0;
}
.cfg-appr-hint {
  margin: 0;
  padding: 0 16px 10px;
}
.cfg-appr-shell .about-form.appr-layout {
  padding: 4px 16px 8px;
}
/* 无 App 预览的表单页（试用 / 支付通知 / 广告） */
.cfg-form-shell {
  display: grid;
  gap: 0;
  padding-bottom: 12px;
  max-width: 920px;
}
.cfg-form-hint {
  margin: 0;
  padding: 0 16px 12px;
}
.cfg-form-body {
  display: grid;
  gap: 4px;
  padding: 0 16px 8px;
}
.cfg-form-shell > .toolbar {
  margin: 0;
}
html.ops-webview .cfg-form-shell {
  max-width: none;
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}
.cfg-trial-summary {
  width: 100%;
  display: grid;
  gap: 10px;
  text-align: left;
}
.cfg-trial-summary-head {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--display);
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 4px;
}
.cfg-trial-summary-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 280px;
  overflow: auto;
}
.cfg-trial-summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  padding: 6px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
.cfg-trial-summary-list li strong {
  font-weight: 650;
  white-space: nowrap;
}
.cfg-plan-preview {
  width: 100%;
  display: grid;
  gap: 12px;
  text-align: left;
}
.cfg-plan-preview-headline {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--display);
  line-height: 1.35;
}
.cfg-plan-preview-list {
  display: grid;
  gap: 8px;
}
.cfg-plan-preview-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  display: grid;
  gap: 4px;
  transition: border-color .15s, background .15s;
}
.cfg-plan-preview-card.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--panel));
}
.cfg-plan-preview-price {
  font-size: 15px;
  font-weight: 700;
}
.cfg-plan-preview-orig {
  font-size: 12px;
  color: var(--muted);
  text-decoration: line-through;
}
.cfg-plan-preview-hint {
  justify-self: start;
  margin-top: 2px;
}
.cfg-plan-preview-foot {
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}
.cfg-mail-preview {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 10px;
}
.cfg-mail-preview-subject {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--display);
  padding-bottom: 8px;
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 28%, var(--line));
}
.cfg-mail-preview-meta {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 12.5px;
}
.cfg-mail-preview-meta div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.cfg-mail-preview-meta dt {
  color: var(--muted);
  margin: 0;
}
.cfg-mail-preview-meta dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}
.cfg-about-preview-feats {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  text-align: left;
  width: 100%;
}
.cfg-about-preview-feats li {
  font-size: 12.5px;
  padding: 6px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
.cfg-about-preview-feats strong {
  display: block;
  font-size: 13px;
}
.cfg-about-preview-feats span {
  color: var(--muted);
}
.cfg-ads-preview {
  width: 100%;
  display: grid;
  gap: 8px;
  text-align: left;
}
.cfg-ads-preview-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  padding: 7px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
.cfg-ads-preview-row span {
  color: var(--muted);
}
.cfg-ads-preview-row strong {
  font-weight: 650;
  text-align: right;
}
.cfg-appr-shell .appr-section .appr-fields-grid,
.cfg-form-shell .appr-section .appr-fields-grid {
  display: grid;
  gap: 12px;
}
.cfg-appr-shell .appr-section .appr-fields-grid.cols-2,
.cfg-form-shell .appr-section .appr-fields-grid.cols-2 {
  grid-template-columns: 1fr 1fr;
}
.cfg-appr-shell .appr-section .appr-fields-grid.cols-3,
.cfg-form-shell .appr-section .appr-fields-grid.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.cfg-appr-shell .inline-checks,
.cfg-form-shell .inline-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 720px) {
  .cfg-appr-shell .appr-section .appr-fields-grid.cols-2,
  .cfg-appr-shell .appr-section .appr-fields-grid.cols-3,
  .cfg-appr-shell .inline-checks,
  .cfg-form-shell .appr-section .appr-fields-grid.cols-2,
  .cfg-form-shell .appr-section .appr-fields-grid.cols-3,
  .cfg-form-shell .inline-checks {
    grid-template-columns: 1fr;
  }
}
.about-feature-row.appr-option-row {
  cursor: default;
}
.mem-plan-row.appr-option-row,
.mem-benefit-row.appr-option-row {
  cursor: pointer;
}
.mem-plan-row.appr-option-row .mem-plan-grid {
  cursor: default;
}


