/* CoolNote Ops — Ink & Seafoam */
:root {
  --bg: #e9eef3;
  --bg-soft: #f4f7fa;
  --panel: #ffffff;
  --ink: #15202b;
  --muted: #5b6b7c;
  --line: #d7e0e8;
  --accent: #0f8a7c;
  --accent-deep: #0a6b60;
  --accent-soft: rgba(15, 138, 124, 0.12);
  --danger: #e11d48;
  --success: #15803d;
  --warning: #c2410c;
  --shadow: 0 1px 2px rgba(21, 32, 43, 0.04), 0 10px 28px rgba(21, 32, 43, 0.06);
  --shadow-lg: 0 18px 48px rgba(21, 32, 43, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --side: 248px;
  --side-collapsed: 76px;
  --header-h: 60px;
  --side-bg: #101820;
  --side-ink: rgba(236, 242, 247, 0.72);
  --side-ink-active: #ffffff;
  --side-hover: rgba(255, 255, 255, 0.06);
  --side-active: color-mix(in srgb, var(--accent) 78%, #0b3d38);
  --header-bg: rgba(255, 255, 255, 0.86);
  --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;
}

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-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;
  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: 12px; min-width: 0; }
.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; }
.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: 20px 22px 56px; }

.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(4, minmax(0, 1fr)); gap: 14px; }
.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;
}
.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; }
.stat .v {
  font-size: 28px; font-weight: 700; margin-top: 10px; color: var(--ink);
  font-family: var(--display); letter-spacing: -0.03em;
}
.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; }
.stat.light::before { display: none; }

.panel {
  margin-top: 0; background: var(--panel); border-radius: 12px;
  box-shadow: none; overflow: visible;
  border: 1px solid var(--line);
}
.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;
  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 {
  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; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.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; }
.dash-home {
  width: 100%;
  max-width: 1280px;
  display: grid;
  gap: 20px;
  padding: 4px 2px 24px;
}
.dash-kpi {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.dash-kpi .stat {
  padding: 18px 16px 16px;
  min-height: 96px;
}
.dash-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  min-width: 0;
}
.dash-charts .panel { min-width: 0; }
.dash-charts .toolbar { padding: 14px 16px; }
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dash-grid .dash-span { grid-column: 1 / -1; }
.chart-box.sm { height: 300px; }
@media (max-width: 960px) {
  .dash-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-charts { grid-template-columns: 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: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-soft) 65%, var(--panel));
}
.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-benefit-grid {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.mem-benefit-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-soft) 65%, var(--panel));
  display: grid;
  gap: 12px;
}
.mem-benefit-preview {
  text-align: center;
  padding: 10px 12px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  border: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
}
.mem-benefit-preview-icon {
  width: 28px;
  height: 28px;
  margin: 0 auto 6px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent, #1677ff) 18%, transparent);
}
.mem-benefit-preview-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.mem-benefit-preview-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.35;
}
.mem-benefit-grid .mem-benefit-sub {
  grid-column: 1 / -2;
}
.mem-benefit-grid .mem-benefit-rm {
  grid-column: -2 / -1;
  grid-row: 1;
  align-self: end;
  height: 40px;
}
.danger-text { color: var(--danger) !important; }
@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,
  .mem-benefit-grid {
    grid-template-columns: 1fr;
  }
  .mem-benefit-grid .mem-benefit-sub,
  .mem-benefit-grid .mem-benefit-rm {
    grid-column: auto;
    grid-row: auto;
  }
}
.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%; bottom: 28px; transform: translateX(-50%);
  background: #101820; color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 80;
  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;
}

.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-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-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: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  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(2, minmax(0, 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 { flex-direction: column; align-items: stretch; }
  .login-code-btn { width: 100%; }
}

.cfg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px 16px 0;
  border-bottom: 1px solid var(--line);
}
.cfg-tab {
  padding: 8px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: -1px;
}
.cfg-tab.is-active {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.cfg-body,
.reach-body {
  padding: 12px 16px 20px;
  border-top: 0;
}
.reach-body > .panel,
.cfg-body > .panel {
  border: none;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}
.reach-body .actions-col {
  min-width: 148px;
}
.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: none;
  width: 100%;
  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;
}

