/* =========================================================
   9SCRM 微信管理系统 · Glassmorphism UI
   ========================================================= */

:root {
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar-w: 248px;
  --topbar-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --btn-a: #059669;
  --btn-b: #0e7490;
}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b18;
  --bg-solid: #0f1629;
  --blob1: #10b981;
  --blob2: #3b82f6;
  --blob3: #8b5cf6;
  --blob4: #ec4899;
  --blob-op: .5;
  --glass: rgba(255, 255, 255, .055);
  --glass-2: rgba(255, 255, 255, .09);
  --glass-3: rgba(255, 255, 255, .14);
  --glass-solid: rgba(16, 23, 44, .9);
  --border: rgba(255, 255, 255, .12);
  --hl: rgba(255, 255, 255, .13);
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --text: #eef2ff;
  --text-2: rgba(226, 232, 240, .76);
  --text-3: rgba(203, 213, 225, .52);
  --shadow: 0 12px 40px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .75);
  --input: rgba(255, 255, 255, .05);
  --input-focus: rgba(255, 255, 255, .09);
  --brand: #2ee59d;
  --brand-2: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --info: #60a5fa;
  --violet: #a78bfa;
  --grid-line: rgba(255, 255, 255, .03);
  --scrim: rgba(2, 6, 23, .55);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e8eef7;
  --bg-solid: #ffffff;
  --blob1: #6ee7b7;
  --blob2: #93c5fd;
  --blob3: #c4b5fd;
  --blob4: #fbcfe8;
  --blob-op: .75;
  --glass: rgba(255, 255, 255, .42);
  --glass-2: rgba(255, 255, 255, .6);
  --glass-3: rgba(255, 255, 255, .78);
  --glass-solid: rgba(255, 255, 255, .94);
  --border: rgba(255, 255, 255, .8);
  --hl: rgba(255, 255, 255, .95);
  --line: rgba(15, 23, 42, .07);
  --line-2: rgba(15, 23, 42, .12);
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #8492a6;
  --shadow: 0 12px 40px -14px rgba(30, 41, 59, .22);
  --shadow-lg: 0 30px 80px -24px rgba(30, 41, 59, .35);
  --input: rgba(255, 255, 255, .55);
  --input-focus: rgba(255, 255, 255, .9);
  --brand: #059669;
  --brand-2: #0891b2;
  --ok: #059669;
  --warn: #c2410c;
  --danger: #e11d48;
  --info: #2563eb;
  --violet: #7c3aed;
  --grid-line: rgba(15, 23, 42, .035);
  --scrim: rgba(15, 23, 42, .3);
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .3s;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--brand) 35%, transparent); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
.i { flex-shrink: 0; display: block; }
.muted { color: var(--text-2); }
.sm { font-size: 12px; }
.hl { color: var(--brand); }
.mono { font-family: var(--mono); }
.ta-r { text-align: right; }

/* ---------- 背景光斑 ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--blob-op); will-change: transform; transition: opacity .6s; }
.b1 { width: 52vmax; height: 52vmax; left: -14vmax; top: -18vmax; background: radial-gradient(circle at 40% 40%, var(--blob1), transparent 62%); animation: drift1 26s var(--ease) infinite alternate; }
.b2 { width: 46vmax; height: 46vmax; right: -14vmax; top: -10vmax; background: radial-gradient(circle at 50% 50%, var(--blob2), transparent 62%); animation: drift2 30s var(--ease) infinite alternate; }
.b3 { width: 50vmax; height: 50vmax; left: 20vw; bottom: -26vmax; background: radial-gradient(circle at 50% 50%, var(--blob3), transparent 62%); animation: drift3 34s var(--ease) infinite alternate; }
.b4 { width: 30vmax; height: 30vmax; right: 6vw; bottom: 6vh; background: radial-gradient(circle at 50% 50%, var(--blob4), transparent 62%); opacity: calc(var(--blob-op) * .7); animation: drift4 22s var(--ease) infinite alternate; }
.grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
}
@keyframes drift1 { to { transform: translate(10vw, 8vh) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-8vw, 12vh) scale(.92); } }
@keyframes drift3 { to { transform: translate(-12vw, -6vh) scale(1.08); } }
@keyframes drift4 { to { transform: translate(-14vw, -10vh) scale(1.2); } }
@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

#app { position: relative; z-index: 1; min-height: 100%; }

/* ---------- 玻璃面板 ---------- */
.glass {
  background: linear-gradient(145deg, var(--glass-2), var(--glass));
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 var(--hl);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-solid); }
}

/* ---------- 启动 / 加载 ---------- */
.boot, .loading-view { min-height: 60vh; display: grid; place-items: center; }
.loading-view.sm { min-height: 120px; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line-2); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot-err { max-width: 420px; margin: 18vh auto 0; padding: 32px; text-align: center; display: grid; gap: 12px; justify-items: center; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--glass-2); color: var(--text);
  font-size: 14px; font-weight: 500; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
  transition: background .2s, transform .2s var(--ease), box-shadow .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--glass-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary {
  color: #fff; border-color: transparent; font-weight: 600;
  background: linear-gradient(135deg, var(--btn-a), var(--btn-b));
  box-shadow: 0 10px 24px -10px rgba(5, 150, 105, .75), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: #fff; border-color: transparent; background: linear-gradient(135deg, #e11d48, #be123c); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--glass-2); border-color: var(--border); }
.btn.danger-h:hover { color: var(--danger); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { height: 46px; font-size: 15px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite;
}
.link { display: inline-flex; align-items: center; gap: 2px; color: var(--brand); text-decoration: none; font-size: 13px; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ---------- 表单 ---------- */
.input {
  width: 100%; height: 40px; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--input); color: var(--text);
  font: inherit; outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.input::placeholder { color: var(--text-3); }
.input:focus {
  border-color: color-mix(in srgb, var(--brand) 65%, transparent);
  background: var(--input-focus);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}
.input.sm { height: 34px; font-size: 13px; border-radius: 10px; }
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select.input option { background: var(--bg-solid); color: var(--text); }
input[type="datetime-local"].input { padding-right: 8px; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 16px; }
.field { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field.half { grid-column: auto; }
.f-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.f-label .req { color: var(--danger); font-style: normal; margin-left: 3px; }
.f-hint { font-size: 12px; color: var(--text-3); }
.f-info:empty { display: none; }
@media (max-width: 560px) { .field.half { grid-column: 1 / -1; } }

.input-ico { position: relative; }
.input-ico > .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-ico > .input { padding-left: 40px; }
.pwd { position: relative; }
.pwd > .input { padding-right: 42px; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text-3); cursor: pointer; border-radius: 8px;
}
.pwd-eye:hover { color: var(--text); background: var(--glass-2); }

.search { position: relative; flex: 1; min-width: 180px; }
.search > .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search > .input { padding-left: 36px; }
.search.sm > .i { left: 10px; }
.search.sm > .input { padding-left: 32px; }

/* 分段选择 */
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 13px; background: var(--input); border: 1px solid var(--line-2); width: fit-content; max-width: 100%; }
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border: 0; border-radius: 9px;
  background: transparent; color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 500;
  transition: background .2s, color .2s, box-shadow .2s;
}
.seg-opt:hover { color: var(--text); }
.seg-opt.on { background: var(--glass-3); color: var(--text); box-shadow: 0 2px 10px -4px rgba(0, 0, 0, .35), inset 0 1px 0 var(--hl); }

/* 标签多选 */
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-opt {
  --c: var(--text-3);
  height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer; font-size: 13px;
  border: 1px dashed var(--line-2); background: transparent; color: var(--text-2);
  transition: all .2s;
}
.chip-opt:hover { border-color: var(--c); color: var(--text); }
.chip-opt.on {
  border-style: solid; border-color: color-mix(in srgb, var(--c) 55%, transparent);
  background: color-mix(in srgb, var(--c) 18%, transparent);
  color: color-mix(in srgb, var(--c) 70%, var(--text));
  font-weight: 500;
}

/* 颜色 */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 28px; height: 28px; padding: 0 !important; border-radius: 50% !important;
  background: var(--c) !important; border: 2px solid transparent !important; cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25) !important;
}
.swatch.on { outline: 2px solid var(--c); outline-offset: 2px; }
.swatches.mini .swatch { width: 22px; height: 22px; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span {
  position: relative; width: 42px; height: 24px; border-radius: 999px; flex-shrink: 0;
  background: var(--line-2); transition: background .25s;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .25s var(--ease);
}
.switch input:checked + span { background: linear-gradient(135deg, var(--btn-a), var(--btn-b)); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch em { font-style: normal; color: var(--text-2); font-size: 13px; }

/* ---------- 徽章 / 标签 / 头像 ---------- */
.badge {
  --c: var(--text-3);
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 15%, transparent);
  color: color-mix(in srgb, var(--c) 78%, var(--text));
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.badge.pulse-dot .dot { animation: pulse 1.8s infinite; }
.tag {
  --c: var(--text-3);
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: 7px; font-size: 12px; white-space: nowrap; text-decoration: none;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: color-mix(in srgb, var(--c) 72%, var(--text));
  border: 1px solid color-mix(in srgb, var(--c) 26%, transparent);
}
.tag b { font-weight: 600; opacity: .75; }
a.tag:hover { background: color-mix(in srgb, var(--c) 26%, transparent); }
.tags-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.more-tag { font-size: 12px; color: var(--text-3); }
.avatar {
  display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 30%;
  color: #fff; font-weight: 600; letter-spacing: -.02em; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 12px -4px rgba(0, 0, 0, .4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .2); user-select: none;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c, var(--ok)) 60%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 14px; flex-shrink: 0;
  width: var(--sidebar-w); height: calc(100vh - 28px); height: calc(100dvh - 28px);
  margin: 14px 0 14px 14px; padding: 18px 14px 14px;
  display: flex; flex-direction: column; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; text-decoration: none; }
.brand b { display: block; font-size: 18px; letter-spacing: .02em; }
.brand small { display: block; font-size: 12px; color: var(--text-3); margin-top: 1px; }
.brand svg { filter: drop-shadow(0 6px 16px rgba(6, 182, 212, .35)); flex-shrink: 0; }
.nav { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.nav-group { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--text-3); padding: 14px 12px 6px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  height: 42px; padding: 0 12px; margin-bottom: 2px; border-radius: 12px;
  color: var(--text-2); text-decoration: none; font-weight: 500;
  transition: background .2s, color .2s;
}
.nav a:hover { background: var(--glass-2); color: var(--text); }
.nav a.active {
  color: var(--text);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 20%, transparent), color-mix(in srgb, var(--brand-2) 10%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 30%, transparent);
}
.nav a.active .i { color: var(--brand); }
.nav a.active::before {
  content: ""; position: absolute; left: -6px; top: 11px; bottom: 11px; width: 3px; border-radius: 3px;
  background: linear-gradient(var(--brand), var(--brand-2));
}
.count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; font-style: normal;
  color: #fff; background: linear-gradient(135deg, #f43f5e, #e11d48);
  box-shadow: 0 4px 10px -3px rgba(225, 29, 72, .6);
}
.side-foot { padding-top: 12px; }
.side-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); }
.side-card b { display: block; font-size: 13px; }
.side-card small { display: block; font-size: 11px; color: var(--text-3); }
.pulse { --c: var(--ok); width: 10px; height: 10px; border-radius: 50%; background: var(--c); animation: pulse 2s infinite; flex-shrink: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 14px 14px 28px 18px; }
.topbar {
  position: sticky; top: 14px; z-index: 30;
  height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 12px 0 22px;
}
.page-title { font-size: 17px; font-weight: 600; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.menu-btn { display: none !important; }
.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 10px 0 5px;
  border-radius: 13px; border: 1px solid transparent; background: transparent; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.user-chip:hover, .user-chip[aria-expanded="true"] { background: var(--glass-2); border-color: var(--border); }
.u-name { font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: 240px; padding: 8px; z-index: 60;
  background: var(--glass-solid); animation: pop .2s var(--ease);
}
.dd-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dd-head b { display: block; }
.dd-head small { display: block; color: var(--text-3); font-size: 12px; }
.dd-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px;
  border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  color: var(--text-2); text-decoration: none; font-size: 14px; text-align: left;
}
.dd-item:hover { background: var(--glass-2); color: var(--text); }
.dd-item.danger:hover { color: var(--danger); }

.view { padding: 22px 4px 0; flex: 1; min-width: 0; }
.view-inner { animation: rise .45s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.scrim { display: none; }

@media (max-width: 960px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: auto; margin: 10px;
    background: var(--glass-solid);
    transform: translateX(calc(-100% - 24px)); transition: transform .32s var(--ease);
  }
  .shell.nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .3s; backdrop-filter: blur(2px); }
  .shell.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-flex !important; }
  .main { padding: 10px 12px 24px; }
  .topbar { top: 10px; padding: 0 8px 0 6px; height: 58px; }
  .view { padding: 18px 4px 0; }
  .u-name { display: none; }
}

/* ---------- 页面头部 / 卡片 ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 4px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.card { padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { font-size: 16px; font-weight: 600; }
.card-sub { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.card-sub h4 { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.toolbar select.input { width: auto; min-width: 140px; flex: 0 1 auto; }
.error-card { max-width: 460px; margin: 10vh auto; text-align: center; display: grid; justify-items: center; gap: 10px; padding: 32px; }
.error-card .i { color: var(--danger); }

/* ---------- 统计卡片 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { position: relative; overflow: hidden; padding: 20px; }
.stat::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 32%, transparent), transparent 70%);
  pointer-events: none;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.stat-ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
}
.stat-val { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 12px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-val small { font-size: 16px; font-weight: 500; color: var(--text-3); }
.stat-sub { margin-top: 4px; font-size: 12px; color: var(--text-3); }
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--danger); font-weight: 600; }

.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat-val { font-size: 24px; }
  .stat-ico { width: 34px; height: 34px; }
}

/* ---------- 图表 ---------- */
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-box { position: relative; width: 100%; overflow: hidden; }
.chart { display: block; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-tick { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.ch-cursor { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 4 4; }
.ch-dot { stroke: var(--bg-solid); stroke-width: 2; }
.ch-tip {
  position: absolute; pointer-events: none; min-width: 120px; padding: 10px 12px; border-radius: 12px;
  background: var(--glass-solid); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 12px;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.ch-tip b { display: block; margin-bottom: 6px; }
.ch-tip div { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.ch-tip div i { width: 8px; height: 8px; border-radius: 2px; }
.ch-tip div span { margin-left: auto; padding-left: 12px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.bars { display: flex; align-items: stretch; gap: 5px; height: 190px; }
.bar { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar-fill {
  width: 100%; max-width: 22px; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand) 60%, transparent);
  transition: height .6s var(--ease), filter .2s;
}
.bar:hover .bar-fill { filter: brightness(1.2); }
.bar-v { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 15px; }
.bar-l { font-size: 10px; color: var(--text-3); }

.funnel { display: grid; gap: 14px; }
.funnel-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.funnel-row .f-name { font-size: 13px; color: var(--text-2); }
.funnel-track { height: 30px; border-radius: 9px; background: var(--glass); overflow: hidden; position: relative; }
.funnel-fill {
  height: 100%; border-radius: 9px; min-width: 6px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 85%, transparent), color-mix(in srgb, var(--c) 45%, transparent));
  transition: width .8s var(--ease);
}
.funnel-row .f-val { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; min-width: 64px; }
.funnel-row .f-val small { font-weight: 400; color: var(--text-3); margin-left: 4px; }
.funnel-total { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--text-2); font-size: 13px; }
.funnel-total b { color: var(--text); }

/* 列表项 */
.list { display: grid; gap: 4px; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 10px; margin: 0 -10px;
  border-radius: 12px; text-decoration: none; transition: background .2s;
}
a.list-item:hover { background: var(--glass-2); }
.li-main { flex: 1; min-width: 0; }
.li-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.li-top b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-top time { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.li-sub { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }
.status-dot { --c: var(--text-3); width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.status-dot.live { animation: pulse 2s infinite; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: .03em;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover td { background: var(--glass); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td:first-child, .table th:first-child { padding-left: 4px; }
.table th.ta-r, .table td.ta-r { text-align: right; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.who small { display: block; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.row-actions { display: inline-flex; gap: 2px; align-items: center; justify-content: flex-end; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 360px; color: var(--text-2); }
.member-bar { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.member-bar .track { flex: 1; height: 6px; border-radius: 6px; background: var(--glass-2); overflow: hidden; }
.member-bar .track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

.empty { padding: 48px 16px; display: grid; justify-items: center; gap: 10px; color: var(--text-3); text-align: center; }
.empty .i { opacity: .6; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 13px; }
.pages { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pages .btn.sm { min-width: 32px; padding: 0 8px; }
.dots { color: var(--text-3); padding: 0 4px; }

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fade .2s;
}
.modal-backdrop.closing { animation: fade .18s reverse forwards; }
.modal {
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column; animation: pop .26s var(--ease);
  background: linear-gradient(150deg, var(--glass-3), var(--glass-2));
  -webkit-backdrop-filter: blur(36px) saturate(180%); backdrop-filter: blur(36px) saturate(180%);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--hl);
}
:root[data-theme="dark"] .modal { background: linear-gradient(150deg, rgba(30, 41, 70, .78), rgba(15, 22, 41, .82)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 10px 22px; }
.modal-head h3 { font-size: 17px; font-weight: 600; }
.modal-body { padding: 8px 22px 6px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; }
.confirm-msg { color: var(--text-2); line-height: 1.7; }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: min(380px, calc(100vw - 32px));
  padding: 12px 16px; border-radius: 14px; pointer-events: auto;
  background: var(--glass-solid); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  animation: toastIn .35s var(--ease);
}
.toast .i { color: var(--ok); }
.toast.err .i { color: var(--danger); }
.toast.info .i { color: var(--info); }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }
@media (max-width: 600px) { .toasts { left: 16px; right: 16px; top: 16px; bottom: auto; justify-items: stretch; } .toast { max-width: none; } }

/* ---------- 登录页 ---------- */
.auth {
  min-height: 100vh; min-height: 100dvh; max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: 48px;
  padding: 40px clamp(16px, 5vw, 64px);
}
.auth-hero { position: relative; }
.brand.big b { font-size: 22px; }
.auth-hero h1 { font-size: clamp(32px, 4.2vw, 54px); line-height: 1.14; letter-spacing: -.02em; margin: 34px 0 18px; font-weight: 800; }
.gradient-text {
  background: linear-gradient(110deg, var(--brand) 0%, var(--brand-2) 45%, var(--violet) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: 16px; color: var(--text-2); max-width: 520px; line-height: 1.8; }
.features { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 560px; }
.features li { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); }
.features li > .i { color: var(--brand); margin-top: 2px; }
.features b { display: block; font-size: 14px; }
.features span { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
/* 装饰浮卡只叠在登录框四角的留白处，不遮挡文字与输入框 */
.auth-side { position: relative; justify-self: center; width: min(420px, 100%); }
.auth-side .auth-card { width: 100%; position: relative; z-index: 1; }
.float-area { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.float-card { position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; font-size: 13px; white-space: nowrap; }
.float-card .i { color: var(--brand); }
.float-card small { display: block; font-size: 11px; color: var(--text-3); }
.float-card b { display: block; font-size: 13px; }
.fc1 { left: 0; top: -30px; translate: -42% 0; animation: bob 6s ease-in-out infinite; }
.fc2 { right: 0; bottom: -30px; translate: 22% 0; animation: bob 7s ease-in-out -3s infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.auth-card { width: min(420px, 100%); justify-self: center; padding: 36px 32px 28px; }
.auth-card h2 { font-size: 24px; font-weight: 700; }
.auth-card > .muted { margin: 6px 0 26px; }
.auth-card .form { gap: 18px; }
.login-err {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px;
  font-size: 13px; color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
}
.auth-foot { margin-top: 20px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--text-3); text-align: center; }
.auth-theme { position: fixed; right: 18px; top: 18px; z-index: 5; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (max-width: 1180px) { .float-area { display: none; } }
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 64px; }
  .auth-hero h1 { margin: 22px 0 12px; }
  .features { display: none; }
  .lead { font-size: 14px; }
}

/* ---------- 微信号卡片 ---------- */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.acc-card { padding: 20px; display: flex; flex-direction: column; gap: 16px; transition: transform .3s var(--ease), box-shadow .3s; }
.acc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg), inset 0 1px 0 var(--hl); }
.acc-top { display: flex; align-items: center; gap: 14px; }
.acc-id { flex: 1; min-width: 0; }
.acc-id h3 { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; padding: 0; border: 0; background: none;
  font-family: var(--mono); font-size: 12px; color: var(--text-3); cursor: pointer; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.copy:hover { color: var(--brand); }
.acc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.acc-stats div { padding: 10px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); text-align: center; }
.acc-stats b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.acc-stats small { color: var(--text-3); font-size: 12px; }
.acc-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-2); }
.acc-meta span { display: inline-flex; align-items: center; gap: 6px; }
.acc-remark { font-size: 13px; color: var(--text-2); padding: 10px 12px; border-radius: 10px; background: var(--glass); }
.acc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); margin-top: auto; }

/* ---------- 聊天 ---------- */
.chat {
  display: grid; grid-template-columns: 330px minmax(0, 1fr); overflow: hidden; padding: 0;
  height: calc(100vh - var(--topbar-h) - 64px); height: calc(100dvh - var(--topbar-h) - 64px); min-height: 460px;
}
.conv-pane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.conv-head { padding: 14px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.conv-head .search { min-width: 0; }
.conv-list { flex: 1; overflow-y: auto; padding: 6px; }
.conv {
  position: relative; display: flex; gap: 12px; width: 100%; padding: 11px 10px; margin-bottom: 2px;
  border: 0; border-radius: 14px; background: transparent; cursor: pointer; text-align: left;
  transition: background .15s;
}
.conv:hover { background: var(--glass-2); }
.conv.active { background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 18%, transparent), color-mix(in srgb, var(--brand-2) 10%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 25%, transparent); }
.conv-av { position: relative; }
.g-mark {
  position: absolute; right: -4px; bottom: -3px; font-size: 9px; font-style: normal; font-weight: 700;
  padding: 1px 4px; border-radius: 5px; color: #fff; background: var(--violet); border: 2px solid var(--bg-solid);
}
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.conv-top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-top time { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.conv-bot { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.conv-bot > span { flex: 1; min-width: 0; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-bot .me { font-style: normal; color: var(--text-3); }
.conv-bot .count { margin-left: 0; }
.conv-acc { display: block; margin-top: 3px; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.msg-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.msg-empty { flex: 1; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--text-3); text-align: center; padding: 24px; }
.msg-empty .big-ico {
  width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; color: var(--brand);
  background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 18%, transparent), color-mix(in srgb, var(--brand-2) 8%, transparent));
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
}
.msg-empty h3 { color: var(--text); font-size: 17px; }
.msg-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.peer { flex: 1; min-width: 0; }
.peer b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peer small { display: block; color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-btn { display: none !important; }
.msg-list { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.load-more { align-self: center; font-size: 12px; color: var(--text-3); padding: 4px 0; }
.time-sep { align-self: center; font-size: 11px; color: var(--text-3); padding: 3px 10px; border-radius: 999px; background: var(--glass); margin: 4px 0; }
.bubble-row { display: flex; gap: 10px; max-width: min(78%, 620px); align-items: flex-start; animation: rise .3s var(--ease); }
.bubble-row.out { align-self: flex-end; flex-direction: row-reverse; }
.b-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.out .b-col { align-items: flex-end; }
.sender { font-size: 12px; color: var(--text-3); padding-left: 4px; }
.bubble {
  padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; line-height: 1.6;
  background: var(--glass-2); border: 1px solid var(--border); box-shadow: inset 0 1px 0 var(--hl);
}
.in .bubble { border-top-left-radius: 5px; }
.out .bubble {
  color: #fff; border-color: transparent; border-top-right-radius: 5px;
  background: linear-gradient(135deg, var(--btn-a), var(--btn-b));
  box-shadow: 0 8px 20px -10px rgba(5, 150, 105, .7), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.bubble .m-kind { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.m-st { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); }
.m-st.pending { color: var(--warn); }
.m-st.failed { color: var(--danger); }
.composer { display: flex; gap: 10px; align-items: flex-end; padding: 12px 16px 6px; border-top: 1px solid var(--line); }
.composer .input { min-height: 44px; max-height: 160px; resize: none; padding: 11px 14px; line-height: 1.5; }
.send-btn { height: 44px; }
.composer-tip { display: flex; align-items: center; gap: 6px; padding: 2px 18px 12px; color: var(--text-3); font-size: 12px; }
@media (max-width: 960px) {
  .chat { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 112px); }
  .chat.has-active .conv-pane { display: none; }
  .chat:not(.has-active) .msg-pane { display: none; }
  .back-btn { display: inline-flex !important; }
  .msg-list { padding: 14px; }
  .bubble-row { max-width: 88%; }
  .send-btn span { display: none; }
  .send-btn { width: 44px; padding: 0; }
}

/* ---------- 群发 / 朋友圈 / 规则 ---------- */
.task-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
@media (max-width: 420px) { .task-list, .acc-grid { grid-template-columns: minmax(0, 1fr); } }
.task { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.task-top { display: flex; align-items: flex-start; gap: 12px; }
.task-ico {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; color: var(--brand);
  background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 20%, transparent), color-mix(in srgb, var(--brand-2) 8%, transparent));
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
}
.task-title { flex: 1; min-width: 0; }
.task-title h3 { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-title small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }
.task-content { color: var(--text-2); white-space: pre-wrap; word-break: break-word; padding: 12px 14px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.progress { height: 8px; border-radius: 8px; background: var(--glass-2); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .6s var(--ease); }
.task-prog { margin-top: -6px; }
.task-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.task-foot > span { display: inline-flex; align-items: center; gap: 6px; }
.info-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; font-size: 13px;
  color: var(--text-2); background: color-mix(in srgb, var(--info) 10%, transparent); border: 1px solid color-mix(in srgb, var(--info) 22%, transparent);
}
.info-pill .i { color: var(--info); }
.info-pill b { color: var(--text); }

.timeline { position: relative; display: grid; gap: 16px; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: linear-gradient(var(--brand), var(--violet), transparent); opacity: .5; }
.moment { position: relative; padding: 18px 20px; }
.moment::before {
  content: ""; position: absolute; left: -24px; top: 24px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--c, var(--brand)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--brand)) 22%, transparent);
}
.moment-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.moment-head .peer small { white-space: normal; }
.moment-body { white-space: pre-wrap; word-break: break-word; line-height: 1.75; }
.moment-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.moment-foot > span { display: inline-flex; align-items: center; gap: 6px; }

.test-box { display: flex; flex-wrap: wrap; gap: 10px; }
.test-box .search { flex: 1 1 260px; }
.test-result { margin-top: 14px; }
.test-result:empty { display: none; }
.result-card { display: flex; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--glass); }
.result-card.hit { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 8%, transparent); }
.result-card .i { margin-top: 2px; }
.result-card.hit > .i { color: var(--ok); }
.result-card b { display: block; margin-bottom: 4px; }
.result-card p { color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.kw { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }

/* ---------- 设置 ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: minmax(0, 1fr); } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; word-break: break-all; }
.code-row { display: flex; align-items: center; gap: 8px; }
.code-row code, .code-block {
  font-family: var(--mono); font-size: 12px; padding: 9px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--bg-solid) 55%, transparent); border: 1px solid var(--line-2);
  word-break: break-all;
}
.code-row code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
.code-block { display: block; white-space: pre-wrap; line-height: 1.7; color: var(--text-2); margin: 0; }
.step-list { margin: 0; padding-left: 18px; color: var(--text-2); display: grid; gap: 6px; font-size: 13px; }
.section-gap { display: grid; gap: 14px; }
.tag-mgr { display: grid; gap: 16px; }
.tag-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tag-add .input { flex: 1 1 160px; }
.tag-list { display: grid; gap: 4px; max-height: 340px; overflow-y: auto; }
.tag-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; }
.tag-row:hover { background: var(--glass); }
.tag-row .muted { margin-left: auto; }
