/* 便签 SaaS · 管理后台样式（零构建，无外部字体 / 图标依赖） */
:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --sub: #64748b;
  --line: #e6ebf3;
  --line-2: #d7deea;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: #eef0ff;
  --green: #0f9f6e;
  --green-soft: #e7f8f1;
  --red: #e5484d;
  --red-soft: #feecec;
  --amber: #b7791f;
  --amber-soft: #fdf3e2;
  --sidebar: #0b1220;
  --sidebar-2: #111a2e;
  --sidebar-line: rgba(255, 255, 255, 0.08);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.22);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
button, input, select { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- 通用按钮 / 控件 ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 600;
  line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.24);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: #fff; border-color: var(--line-2); color: var(--ink-2); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger:hover { filter: brightness(1.05); }
.btn.block { width: 100%; padding: 12px 16px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; filter: none; }
.link {
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  padding: 4px;
}
.link:hover { text-decoration: underline; }
.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--accent-soft); border-color: #c7ccff; color: var(--accent); }

/* ---------- 登录 ---------- */
.login-view {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 60px;
  background: radial-gradient(1200px 700px at 15% -10%, #e9e7ff 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 0%, #dff7ff 0%, transparent 55%),
    linear-gradient(160deg, #f7f8fc 0%, #eef1f9 100%);
  overflow: hidden;
}
.login-bg span {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.5;
  animation: float 12s ease-in-out infinite;
}
.login-bg span:nth-child(1) { width: 200px; height: 200px; left: 8%; top: 16%; background: linear-gradient(135deg, #c7d2fe, #a5b4fc); }
.login-bg span:nth-child(2) { width: 260px; height: 260px; right: 6%; top: 48%; background: linear-gradient(135deg, #bae6fd, #99f6e4); animation-delay: -4s; }
.login-bg span:nth-child(3) { width: 140px; height: 140px; left: 22%; bottom: 12%; background: linear-gradient(135deg, #fde68a, #fca5a5); animation-delay: -8s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}
.login-card {
  position: relative;
  width: min(430px, 100%);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  padding: 30px 30px 24px;
  box-shadow: 0 30px 80px rgba(30, 41, 59, 0.16);
  z-index: 2;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}
.brand-logo svg { width: 24px; height: 24px; fill: currentColor; stroke: none; }
.brand-logo.small { width: 38px; height: 38px; border-radius: 11px; }
.brand-logo.small svg { width: 20px; height: 20px; }
.brand h1 { font-size: 20px; letter-spacing: 0.2px; }
.brand p { color: var(--sub); font-size: 12px; margin-top: 2px; }
.login-head { margin: 28px 0 20px; }
.login-head h2 { font-size: 24px; letter-spacing: -0.3px; }
.login-head p { color: var(--sub); margin-top: 6px; font-size: 13px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.field input, .input, .select {
  width: 100%;
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .input:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.login-error {
  background: var(--red-soft);
  color: #b4252b;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.login-hint {
  margin-top: 18px;
  color: var(--sub);
  font-size: 12px;
  text-align: center;
  line-height: 1.6;
}
.login-hint b { color: var(--ink-2); }
.login-hint code { background: #f1f5fb; padding: 1px 5px; border-radius: 5px; }
.login-foot { position: relative; z-index: 2; margin-top: 22px; color: #8b96a8; font-size: 12px; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 22px; }
.side-brand b { display: block; font-size: 15px; letter-spacing: 0.2px; }
.side-brand span { display: block; font-size: 11px; color: #7f8aa3; margin-top: 2px; letter-spacing: 0.4px; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #9aa6bd;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #e2e8f0; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(124, 58, 237, 0.16));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.25);
}
.nav-item.active svg { color: #a5b4fc; }
.nav-item.danger { color: #fda4af; margin-top: 4px; }
.nav-item.danger:hover { background: rgba(229, 72, 77, 0.12); color: #fecdd3; }
.side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--sidebar-line); }
.side-tip { font-size: 11px; color: #6f7b93; padding: 0 12px 10px; line-height: 1.5; }
.side-version { font-size: 10px; color: #55617a; padding: 10px 12px 0; letter-spacing: 0.4px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 26px;
  background: rgba(244, 246, 251, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar h2 { font-size: 20px; letter-spacing: -0.3px; }
.topbar p { color: var(--sub); font-size: 12px; margin-top: 3px; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.menu-btn { display: none; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--sub);
  white-space: nowrap;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.16); }
.pill.ok { color: var(--green); border-color: #c8efe0; background: #f2fbf7; }
.pill.ok i { background: var(--green); box-shadow: 0 0 0 3px rgba(15, 159, 110, 0.14); }
.pill.down { color: var(--red); border-color: #f6cfd1; background: #fff5f5; }
.pill.down i { background: var(--red); box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.14); }
.admin-user {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #111827, #334155);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}
.content { padding: 24px 26px 48px; max-width: 1440px; width: 100%; margin: 0 auto; }
.page { display: flex; flex-direction: column; gap: 18px; }

/* ---------- 卡片 / 指标 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-size: 15px; letter-spacing: -0.2px; }
.card-head p { color: var(--sub); font-size: 12px; margin-top: 3px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.metric::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--tint, rgba(79, 70, 229, 0.08));
}
.metric-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tint, var(--accent-soft));
  color: var(--tone, var(--accent));
  flex-shrink: 0;
}
.metric-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.metric-body { min-width: 0; }
.metric-label { font-size: 12px; color: var(--sub); }
.metric-value { font-size: 30px; font-weight: 700; letter-spacing: -0.8px; line-height: 1.15; margin-top: 2px; }
.metric-sub { font-size: 11px; color: var(--sub); margin-top: 3px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* ---------- 趋势 ---------- */
.legend { display: flex; gap: 12px; font-size: 11px; color: var(--sub); }
.lg { display: inline-flex; align-items: center; gap: 5px; }
.lg::before { content: ""; width: 9px; height: 9px; border-radius: 3px; }
.lg.created::before { background: var(--accent); }
.lg.updated::before { background: #c7d2fe; }
.trend {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 8px 4px 0;
  height: 214px;
}
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; height: 100%; }
.trend-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 5px; }
.trend-bar {
  width: 28%;
  max-width: 18px;
  border-radius: 5px 5px 2px 2px;
  min-height: 3px;
  background: var(--accent);
  transition: height 0.35s ease;
}
.trend-bar.updated { background: #c7d2fe; }
.trend-bar:hover { filter: brightness(1.08); }
.trend-label { font-size: 11px; color: var(--sub); white-space: nowrap; }
.trend-col.today .trend-label { color: var(--accent); font-weight: 700; }
.trend-axis { display: flex; justify-content: space-between; color: #94a3b8; font-size: 10px; padding: 8px 4px 0; border-top: 1px dashed var(--line); }

/* ---------- 标签 / 审计 ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; min-height: 34px; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f4f6fb;
  border: 1px solid var(--line);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
}
.tag-chip b {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 1px 7px;
}
.divider { height: 1px; background: var(--line); margin: 18px 0 16px; }
.audit { display: flex; flex-direction: column; gap: 11px; }
.audit-item { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.audit-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.audit-dot.danger { background: var(--red); }
.audit-dot.login { background: var(--green); }
.audit-text { flex: 1; min-width: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-text span { color: var(--sub); }
.audit-time { color: #94a3b8; font-size: 11px; white-space: nowrap; }
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 12px;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}
.empty svg { width: 34px; height: 34px; fill: none; stroke: #cbd5e1; stroke-width: 1.5; stroke-linecap: round; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .search {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 0 12px;
  height: 40px;
}
.toolbar .search svg { width: 17px; height: 17px; fill: none; stroke: #94a3b8; stroke-width: 1.8; }
.toolbar .search input { border: 0; outline: none; flex: 1; min-width: 0; background: transparent; padding: 0; height: 100%; }
.toolbar .select { width: auto; min-width: 130px; height: 40px; padding: 0 30px 0 12px; }
.toolbar .input { width: 220px; height: 40px; }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table thead th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #8491a5;
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 13px 12px;
  border-bottom: 1px solid #eff3f8;
  vertical-align: middle;
  font-size: 13px;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafbff; }
.data-table .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.data-table .muted { color: var(--sub); font-size: 12px; }
.data-table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.mini-btn {
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink-2);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.mini-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.mini-btn.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.space-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.space-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.space-name { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--ink-2); max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-sub { font-size: 11px; color: var(--sub); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; }
.note-cell { max-width: 360px; }
.note-title { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.note-preview { color: var(--sub); font-size: 12px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #f1f5fb;
  color: var(--sub);
  white-space: nowrap;
}
.badge.type { background: var(--accent-soft); color: var(--accent); }
.badge.trash { background: var(--red-soft); color: var(--red); }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.tag-mini { display: inline-flex; gap: 4px; flex-wrap: wrap; max-width: 180px; }
.tag-mini span { background: #f4f6fb; border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; font-size: 11px; color: var(--ink-2); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; flex-wrap: wrap; }
.pager-info { color: var(--sub); font-size: 12px; }
.pager-btns { display: flex; gap: 6px; align-items: center; }
.pager-btns .mini-btn { min-width: 34px; text-align: center; }
.pager-btns .mini-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pager-page { font-size: 12px; color: var(--sub); padding: 0 4px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 36px; color: var(--sub); font-size: 12px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #e2e8f0; border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 系统 ---------- */
.system-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; background: linear-gradient(135deg, #ffffff, #f7f9ff); }
.system-hero .hero-left { display: flex; align-items: center; gap: 16px; }
.system-status-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-soft);
  color: var(--green);
}
.system-status-icon.down { background: var(--red-soft); color: var(--red); }
.system-status-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.system-hero h3 { font-size: 18px; }
.system-hero p { color: var(--sub); font-size: 12px; margin-top: 4px; }
.system-hero .hero-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.stat b { display: block; font-size: 24px; letter-spacing: -0.5px; }
.stat span { font-size: 11px; color: var(--sub); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; }
.fact { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.fact:last-child, .fact:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.fact span { color: var(--sub); }
.fact b { font-weight: 600; text-align: right; word-break: break-all; }
.metric-card-small { display: flex; flex-direction: column; gap: 8px; }
.metric-card-small .label { font-size: 11px; color: var(--sub); letter-spacing: 0.2px; }
.metric-card-small .value { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.metric-card-small .hint { font-size: 11px; color: #94a3b8; }

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
  z-index: 60;
  opacity: 0;
  transition: opacity 0.2s;
}
.drawer-mask.open { opacity: 1; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(500px, 94vw);
  background: #fff;
  z-index: 70;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.22, 0.8, 0.32, 1);
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 { font-size: 17px; letter-spacing: -0.2px; }
.drawer-head p { color: var(--sub); font-size: 11px; margin-top: 3px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 28px; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #fbfcff; }
.drawer-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.drawer-stat { background: #f7f9fd; border: 1px solid var(--line); border-radius: 11px; padding: 10px; text-align: center; }
.drawer-stat b { display: block; font-size: 19px; letter-spacing: -0.4px; }
.drawer-stat span { font-size: 10px; color: var(--sub); }
.drawer-section { margin-bottom: 22px; }
.drawer-section h4 { font-size: 12px; letter-spacing: 0.4px; text-transform: uppercase; color: #8491a5; margin: 0 0 10px; }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.setting-box { background: #f7f9fd; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.setting-box span { display: block; font-size: 10px; color: var(--sub); }
.setting-box b { display: block; font-size: 13px; margin-top: 3px; }
.mini-note-list { display: flex; flex-direction: column; gap: 8px; }
.mini-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}
.mini-note:hover { border-color: #c7d2fe; background: #fbfbff; }
.mini-note-main { flex: 1; min-width: 0; }
.mini-note-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-note-sub { font-size: 10px; color: var(--sub); margin-top: 2px; }
.mini-note-arrow { color: #94a3b8; font-size: 14px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.18s;
}
.modal-mask.open { opacity: 1; }
.modal {
  width: min(620px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s;
}
.modal-mask.open .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfcff; border-radius: 0 0 18px 18px; }
.confirm-text { color: var(--ink-2); line-height: 1.7; font-size: 13px; }
.confirm-text b { color: var(--ink); }
.note-detail { display: flex; flex-direction: column; gap: 14px; }
.note-detail .meta-row { display: flex; flex-wrap: wrap; gap: 6px; }
.note-detail .body { background: #f8fafd; border: 1px solid var(--line); border-radius: 12px; padding: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); max-height: 300px; overflow-y: auto; }
.check-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; font-size: 13px; color: var(--ink-2); }
.check-item .box { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.check-item .box.on { background: var(--green-soft); border-color: #b9e9d7; color: var(--green); font-size: 11px; }
.check-item.done { color: #94a3b8; text-decoration: line-through; }
.kv { display: grid; grid-template-columns: 94px 1fr; gap: 8px 12px; font-size: 12px; }
.kv span { color: var(--sub); }
.kv b { font-weight: 500; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 40px));
  background: #0f172a;
  color: #fff;
  border-radius: 11px;
  padding: 11px 16px;
  font-size: 13px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #b4232a; }
.toast.success { background: #0b7a56; }

/* ---------- 响应式 ---------- */
@media (max-width: 1120px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.24s;
    box-shadow: 24px 0 60px rgba(15, 23, 42, 0.2);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .sidebar-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    z-index: 25;
  }
  .topbar { padding: 14px 18px; }
  .content { padding: 18px 18px 40px; }
}
@media (max-width: 640px) {
  .topbar h2 { font-size: 18px; }
  .topbar p { display: none; }
  .topbar-right .pill { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 14px; gap: 10px; }
  .metric-icon { width: 38px; height: 38px; border-radius: 10px; }
  .metric-icon svg { width: 19px; height: 19px; }
  .metric-value { font-size: 24px; }
  .card { padding: 16px; border-radius: 14px; }
  .toolbar .input, .toolbar .select { width: 100%; }
  .toolbar .search { min-width: 100%; }
  .grid-3 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .drawer-stats { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .login-card { padding: 24px 20px 20px; border-radius: 20px; }
  .login-view { padding: 20px 14px 40px; }
  .trend { gap: 6px; }
  .trend-bar { width: 34%; }
}
