:root {
  /* ── fuwari 主题令牌（oklch + --hue，与博客完全一致）── */
  --hue: 250;
  --radius-large: 1rem;

  --primary: oklch(0.70 0.14 var(--hue));
  --page-bg: oklch(0.95 0.01 var(--hue));
  --card-bg: #ffffff;

  --btn-content: oklch(0.55 0.12 var(--hue));
  --btn-regular-bg: oklch(0.95 0.025 var(--hue));
  --btn-regular-bg-hover: oklch(0.9 0.05 var(--hue));
  --btn-regular-bg-active: oklch(0.85 0.08 var(--hue));
  --btn-plain-bg-hover: oklch(0.95 0.025 var(--hue));
  --btn-plain-bg-active: oklch(0.98 0.01 var(--hue));

  --deep-text: oklch(0.25 0.02 var(--hue));
  --title-active: oklch(0.6 0.1 var(--hue));

  --line: oklch(0.93 0.01 var(--hue));
  --line-soft: oklch(0.96 0.008 var(--hue));
  --meta-divider: rgba(0, 0, 0, 0.2);

  --selection-bg: oklch(0.90 0.05 var(--hue));

  /* ── 后台扩展色（基于同一 hue 派生，不引入第二套色系）── */
  --text: oklch(0.32 0.02 var(--hue));
  --text-2: oklch(0.50 0.02 var(--hue));
  --text-3: oklch(0.60 0.02 var(--hue));
  --text-4: oklch(0.75 0.015 var(--hue));

  --primary-strong: oklch(0.55 0.14 var(--hue));
  --primary-bg-soft: oklch(0.95 0.03 var(--hue));
  --primary-bg-hover: oklch(0.90 0.05 var(--hue));

  --ok: oklch(0.70 0.14 155);
  --warn: oklch(0.75 0.14 70);
  --danger: oklch(0.62 0.19 25);
  --danger-bg: oklch(0.93 0.05 25);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;

  /* ── 圆角：卡片与博客一致用 1rem，小组件 0.75/0.5rem ── */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 1rem;
  --r-xl: 1.25rem;
  --r-full: 999px;

  /* ── 阴影：柔和带主题色相 ── */
  --sh-sm: 0 2px 4px oklch(0.55 0.03 var(--hue) / 0.05);
  --sh-md: 0 4px 16px oklch(0.55 0.03 var(--hue) / 0.08);
  --sh-lg: 0 8px 28px oklch(0.55 0.04 var(--hue) / 0.12);
  --sh-xl: 0 16px 44px oklch(0.45 0.05 var(--hue) / 0.16);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t: 220ms var(--ease);
  --t-slow: 380ms var(--ease);

  --side-w: 236px;
}

/* 深色模式（博客同款 .dark 类） */
:root.dark {
  --page-bg: oklch(0.16 0.014 var(--hue));
  --card-bg: oklch(0.23 0.015 var(--hue));
  --primary: oklch(0.75 0.14 var(--hue));
  --btn-content: oklch(0.75 0.1 var(--hue));
  --btn-regular-bg: oklch(0.33 0.035 var(--hue));
  --btn-regular-bg-hover: oklch(0.38 0.04 var(--hue));
  --btn-plain-bg-hover: oklch(0.30 0.035 var(--hue));
  --deep-text: oklch(0.85 0.02 var(--hue));
  --line: oklch(0.30 0.02 var(--hue));
  --line-soft: oklch(0.27 0.015 var(--hue));
  --meta-divider: rgba(255, 255, 255, 0.2);
  --selection-bg: oklch(0.40 0.08 var(--hue));
  --text: oklch(0.92 0.01 var(--hue));
  --text-2: oklch(0.72 0.02 var(--hue));
  --text-3: oklch(0.62 0.02 var(--hue));
  --text-4: oklch(0.50 0.015 var(--hue));
  --primary-strong: oklch(0.80 0.14 var(--hue));
  --primary-bg-soft: oklch(0.30 0.04 var(--hue));
  --primary-bg-hover: oklch(0.36 0.05 var(--hue));
  --sh-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --sh-lg: 0 8px 28px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-tap-highlight-color: transparent;
  background: var(--page-bg);
  transition: background-color 300ms ease-out, color 300ms ease-out;
}

:root.dark { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  /* 背景光晕：极淡的两团径向光，打破大面积纯色（参照博客的 bg-field 思路） */
  background:
    radial-gradient(1100px 520px at 8% -8%, rgba(59, 130, 246, 0.055), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, rgba(147, 197, 253, 0.075), transparent 55%),
    radial-gradient(760px 620px at 50% 115%, rgba(96, 165, 250, 0.05), transparent 60%),
    var(--page-bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--primary-bg-hover); }
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

svg { display: block; flex-shrink: 0; }

/* ═══════════ 布局 ═══════════ */

.layout {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ═══════════ 侧栏 ═══════════ */

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(255, 255, 255, var(--glass-alpha, 0.72));
  backdrop-filter: blur(var(--glass-blur, 18px)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur, 18px)) saturate(1.4);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  overflow-y: auto;
}

.side__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 22px;
}

.side__logo {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--primary-bg-soft);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform var(--t-slow);
}

.side__brand:hover .side__logo { transform: scale(1.06); }

.side__logo svg {
  width: 20px;
  height: 20px;
  stroke: var(--primary-strong);
  stroke-width: 2;
  fill: none;
}

.side__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.side__sub {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.3;
}

.side__label {
  padding: 14px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-4);
}

.side__nav { display: grid; gap: 4px; }

.side__item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background-color var(--t), color var(--t), transform var(--t);
}

/* 图标容器：浅蓝圆角方块底 + 蓝描边图标（第三张参照图的风格） */
.side__item svg {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: var(--r-sm);
  background: var(--primary-bg-soft);
  color: var(--primary-strong);
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  box-sizing: border-box;
  transition: background-color var(--t), color var(--t), transform var(--t);
}

.side__item:hover {
  background: var(--line-soft);
  color: var(--text);
}

.side__item:hover svg {
  transform: scale(1.06);
}

.side__item.is-on {
  background: var(--primary-bg-soft);
  color: var(--primary-strong);
  font-weight: 600;
}

.side__item.is-on svg {
  background: var(--card-bg);
  box-shadow: var(--sh-sm);
}

.side__item .badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: var(--r-full);
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
}

.side__foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.side__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  background: var(--line-soft);
}

.side__av {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  background: var(--primary-bg-soft);
  color: var(--primary-strong);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.side__meta { min-width: 0; flex: 1; }
.side__name { font-size: 13px; font-weight: 600; }
.side__role { font-size: 11px; color: var(--text-3); }

/* ═══════════ 主区 ═══════════ */

.main { min-width: 0; display: flex; flex-direction: column; }

.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(244, 248, 253, 0.78);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.bar__title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.bar__sub { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }

.bar__right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.content { padding: 28px; flex: 1; }

/* ═══════════ 卡片 ═══════════ */

.card {
  background: var(--card-bg);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--sh-md), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  transition: box-shadow var(--t-slow), transform var(--t-slow);
}

.card:hover { box-shadow: var(--sh-lg), inset 0 1px 0 rgba(255, 255, 255, 0.85); }

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.4;
}

.card__desc { margin: 3px 0 0; font-size: 12px; color: var(--text-3); }

/* ═══════════ 指标卡（参照图：图标蓝色描边 + 浅蓝底）═══════════ */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric {
  background: var(--card-bg);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--sh-md), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  transition: transform var(--t-slow), box-shadow var(--t-slow);
}

.metric:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-lg), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.metric__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.metric__label { font-size: 12.5px; color: var(--text-3); font-weight: 500; }

/* 参照图那个图标样式：浅蓝底 + 蓝色描边图标 + 大圆角 */
.metric__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  background: var(--primary-bg-soft);
  color: var(--primary-strong);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.metric__icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.metric__value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.metric__foot {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-3);
}

.metric__bar {
  margin-top: 11px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--line-soft);
  overflow: hidden;
}

.metric__bar i {
  display: block;
  height: 100%;
  border-radius: var(--r-full);
  background: var(--primary);
  transition: width 600ms var(--ease);
}

/* ═══════════ 网格 ═══════════ */

.row { display: grid; gap: 20px; margin-bottom: 20px; }
.row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* ═══════════ CPU 堆叠条 ═══════════ */

.stackbar {
  display: flex;
  height: 40px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--line-soft);
  margin-bottom: 16px;
}

.stackbar i {
  display: block;
  height: 100%;
  transition: width 600ms var(--ease);
  min-width: 2px;
}

.stacklegend { display: flex; flex-wrap: wrap; gap: 8px 20px; }

.stacklegend .lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
}

.stacklegend .lg i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex-shrink: 0;
}

.stacklegend .lg b {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ═══════════ 列表 ═══════════ */

.list { display: grid; gap: 2px; }

.list__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 9px 10px;
  border-radius: var(--r-xs);
  transition: background-color var(--t);
}

.list__row:hover { background: var(--primary-bg-soft); }

.list__name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
}

.list__meta {
  font-size: 12.5px;
  text-align: right;
  color: var(--text);
  word-break: break-word;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

/* ═══════════ 表格 ═══════════ */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--t); }
.table tbody tr:hover { background: var(--primary-bg-soft); }

.table .num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* ═══════════ 标签 ═══════════ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.pill-blue { background: var(--primary-bg-soft); color: var(--primary-strong); }
.pill-green { background: #d1fae5; color: #047857; }
.pill-amber { background: #fef3c7; color: #b45309; }
.pill-red { background: #fee2e2; color: #b91c1c; }
.pill-gray { background: var(--line-soft); color: var(--text-2); }

.pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ═══════════ 按钮 ═══════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: 0;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--t), box-shadow var(--t), background-color var(--t);
}

.btn svg {
  width: 16px;
  height: 16px;
  padding: 2.5px;
  box-sizing: content-box;
  border-radius: var(--r-xs);
  background: var(--primary-bg-soft);
  color: var(--primary-strong);
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.24);
}

/* 主按钮内部图标：白底反转，保持蓝色图标可读 */
.btn-primary svg {
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary-strong);
}

.btn-primary:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.30);
}

.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: var(--card-bg);
  color: var(--text-2);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: var(--primary-bg-soft);
  color: var(--primary-strong);
  border-color: var(--primary-bg-hover);
  transform: translateY(-1px);
}

.btn-ghost:active { transform: scale(0.97); }

.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-sm svg {
  width: 14px;
  height: 14px;
  padding: 2px;
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-danger svg {
  background: rgba(255, 255, 255, 0.85);
  color: #b91c1c;
}

.btn-danger:hover { background: #fecaca; transform: translateY(-1px); }

/* ═══════════ 表单 ═══════════ */

.fld { display: grid; gap: 6px; margin-bottom: 14px; }

.fld > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.fld input, .fld select, .fld textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  transition: border-color var(--t), box-shadow var(--t);
}

.fld textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.65;
  font-family: var(--mono);
  font-size: 12.5px;
}

.fld input:focus, .fld select:focus, .fld textarea:focus {
  border-color: var(--blue-400, var(--primary));
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.fld input::placeholder, .fld textarea::placeholder { color: var(--text-4); }

/* ═══════════ 终端 ═══════════ */

.term-wrap {
  background: #0f172a;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-lg);
}

.term-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  background: #1e293b;
}

.term-head__left { display: flex; align-items: center; gap: 9px; }
.term-dots { display: flex; gap: 5px; }

.term-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}

.term-dots i:nth-child(1) { background: #f87171; }
.term-dots i:nth-child(2) { background: #fbbf24; }
.term-dots i:nth-child(3) { background: #34d399; }

.term-title {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  font-family: var(--mono);
}

.term-body { height: 460px; padding: 8px; background: #0f172a; }
.term-body .xterm { padding: 6px; }
.term-hint {
  padding: 9px 18px;
  background: #1e293b;
  font-size: 11px;
  color: #64748b;
  font-family: var(--mono);
}

.cmd-out {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--r-md);
  padding: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow-y: auto;
  margin: 0;
}

/* ═══════════ 文章列表 ═══════════ */

.art-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card-bg);
  margin-bottom: 10px;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}

.art-row:hover {
  border-color: var(--primary-bg-hover);
  box-shadow: var(--sh-md);
  transform: translateX(2px);
}

.art-row.is-private {
  background: #fffbeb;
  border-color: #fde68a;
}

.art-row.is-pinned {
  border-color: var(--primary-bg-hover);
  box-shadow: var(--sh-sm);
}

.art-row.is-pinned .art-row__title::before {
  content: "置顶";
  display: inline-block;
  margin-right: 2px;
  padding: 1px 7px;
  border-radius: var(--r-full);
  background: var(--primary-bg-soft);
  color: var(--primary-strong);
  font-size: 10px;
  font-weight: 700;
  vertical-align: 2px;
}

.art-row__title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.art-row__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-3);
  flex-wrap: wrap;
}

.art-row__acts { display: flex; align-items: center; gap: 6px; }

/* 编辑器 */
.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.editor-col { min-width: 0; }

.editor-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.editor-col__head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}

.editor-body {
  width: 100%;
  min-height: 380px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card-bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  resize: vertical;
}

.editor-body:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

/* ── 正文编辑：三种模式共用一套外观 ── */

.fld__row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fld__row b {
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

.mode-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-full);
  background: var(--line-soft);
}

.mode-switch button {
  border: 0;
  padding: 4px 11px;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--text-3);
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--t), color var(--t), box-shadow var(--t);
}

.mode-switch button:hover { color: var(--text-2); }

.mode-switch button.is-on {
  background: var(--card-bg);
  color: var(--primary-strong);
  box-shadow: var(--sh-sm);
}

.editor-rich {
  display: none;
  width: 100%;
  min-height: 380px;
  max-height: 520px;
  overflow-y: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card-bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.85;
}

.editor-rich:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.editor-rich[data-on="1"] { display: block; }

.editor-prev {
  display: none;
  width: 100%;
  min-height: 380px;
  max-height: 520px;
  overflow-y: auto;
  padding: 16px 18px;
  border: 1px solid var(--primary-bg-hover);
  border-radius: var(--r-sm);
  background: #fbfdff;
  font-size: 13.5px;
  line-height: 1.85;
}

.editor-prev[data-on="1"] { display: block; }

/* 富文本区里的标签样式 */
.editor-rich h1, .editor-rich h2, .editor-rich h3,
.editor-prev h1, .editor-prev h2, .editor-prev h3 {
  margin: 18px 0 10px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.editor-rich h1, .editor-prev h1 { font-size: 21px; }
.editor-rich h2, .editor-prev h2 { font-size: 17px; }
.editor-rich h3, .editor-prev h3 { font-size: 15px; }
.editor-rich p, .editor-prev p { margin: 0 0 12px; }

.editor-rich ul, .editor-rich ol,
.editor-prev ul, .editor-prev ol {
  margin: 0 0 12px;
  padding-left: 22px;
}

.editor-rich blockquote, .editor-prev blockquote {
  margin: 0 0 12px;
  padding: 8px 14px;
  border-left: 3px solid var(--primary-bg-hover);
  background: var(--line-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--text-2);
}

.editor-rich pre, .editor-prev pre {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: #f4f8fd;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
}

.editor-rich code, .editor-prev code {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--line-soft);
  color: var(--primary-strong);
}

.editor-rich pre code, .editor-prev pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.editor-rich a, .editor-prev a { color: var(--primary-strong); text-decoration: underline; }
.editor-rich img, .editor-prev img { max-width: 100%; border-radius: var(--r-sm); }

.editor-rich hr, .editor-prev hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.editor-rich table, .editor-prev table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 12px;
  font-size: 12.5px;
}

.editor-rich th, .editor-rich td,
.editor-prev th, .editor-prev td {
  border: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
}

.editor-rich th, .editor-prev th { background: var(--line-soft); font-weight: 600; }

/* ── 富文本工具条 ── */

.rt-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--line-soft);
}

.rt-toolbar[hidden] { display: none; }

.rt-toolbar button {
  border: 0;
  padding: 5px 10px;
  border-radius: var(--r-xs);
  background: var(--card-bg);
  color: var(--text-2);
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--t), color var(--t), transform var(--t);
}

.rt-toolbar button:hover {
  background: var(--primary-bg-soft);
  color: var(--primary-strong);
  transform: translateY(-1px);
}

.rt-toolbar button:active { transform: scale(0.95); }

.rt-sep {
  width: 1px;
  height: 16px;
  margin: 0 4px;
  background: var(--line);
}

.rt-tip {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-4);
}

/* ═══════════ 可视化块编辑器 ═══════════ */

.blocks-editor { display: none; }

.blocks-editor[data-on="1"] {
  display: block;
  max-height: 560px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--line-soft);
}

.block-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin: 8px 4px;
  overflow: hidden;
  transition: box-shadow var(--t), border-color var(--t), opacity var(--t);
}

.block-card:hover { border-color: var(--primary-bg-hover); box-shadow: var(--sh-sm); }

.block-card.is-dragging { opacity: 0.45; }

.block-card.is-drop-before { box-shadow: 0 -3px 0 0 var(--primary); }
.block-card.is-drop-after { box-shadow: 0 3px 0 0 var(--primary); }

.block-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--line-soft);
  border-bottom: 1px solid var(--line);
}

.block-card__drag {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-xs);
  color: var(--text-4);
  cursor: grab;
  transition: background-color var(--t), color var(--t);
}

.block-card__drag:hover { background: var(--primary-bg-soft); color: var(--primary-strong); }
.block-card__drag:active { cursor: grabbing; }

.block-card__type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-strong);
}

.block-card__type i {
  font-style: normal;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: var(--r-xs);
  background: var(--primary-bg-soft);
  font-size: 10px;
  font-weight: 800;
}

.block-card__acts {
  margin-left: auto;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity var(--t);
}

.block-card:hover .block-card__acts,
.block-card:focus-within .block-card__acts { opacity: 1; }

.block-act {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: background-color var(--t), color var(--t);
}

.block-act:hover { background: var(--primary-bg-soft); color: var(--primary-strong); }

.block-act:last-child:hover { background: #fee2e2; color: #b91c1c; }

.block-card__body {
  display: block;
  width: 100%;
  border: 0;
  padding: 10px 14px;
  background: var(--card-bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  resize: none;
  overflow: hidden;
  outline: none;
}

.block-card__body:focus {
  background: #fbfdff;
  box-shadow: inset 0 0 0 2px var(--primary-bg-hover);
  border-radius: 0 0 var(--r-md) var(--r-md);
}

.blocks-empty {
  margin: 8px 4px;
  padding: 28px 16px;
  text-align: center;
  color: var(--text-4);
  font-size: 12.5px;
  background: var(--card-bg);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
}

.blocks-addbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 4px;
  padding: 10px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.blocks-addbar__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-4);
  letter-spacing: 0.04em;
  margin-right: 4px;
}

.blocks-addbtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--card-bg);
  padding: 4px 11px 4px 5px;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color var(--t), color var(--t), border-color var(--t), transform var(--t);
}

.blocks-addbtn__icon {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: var(--r-full);
  background: var(--primary-bg-soft);
  color: var(--primary-strong);
  font-size: 10px;
  font-weight: 800;
}

.blocks-addbtn:hover {
  border-color: var(--primary-bg-hover);
  color: var(--primary-strong);
  transform: translateY(-1px);
}

/* ═══════════ 背景音乐悬浮窗 ═══════════ */

.bgm-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 180;
}

.bgm-fab__btn {
  position: relative;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--card-bg);
  color: var(--primary-strong);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--sh-lg);
  transition: transform var(--t), box-shadow var(--t);
}

.bgm-fab__btn:hover { transform: scale(1.06); }
.bgm-fab__btn:active { transform: scale(0.95); }

.bgm-fab__btn svg { width: 22px; height: 22px; }
.bgm-ico-pause { display: none; }
.bgm-fab.is-playing .bgm-ico-play { display: none; }
.bgm-fab.is-playing .bgm-ico-pause { display: block; }

/* 播放中的呼吸光环 */
.bgm-fab__ring {
  position: absolute;
  inset: -5px;
  border-radius: var(--r-full);
  border: 2px solid var(--primary-bg-hover);
  opacity: 0;
  pointer-events: none;
}

.bgm-fab.is-playing .bgm-fab__ring {
  animation: bgm-pulse 2.2s var(--ease) infinite;
}

@keyframes bgm-pulse {
  0%   { opacity: 0.7; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(1.28); }
  100% { opacity: 0;   transform: scale(1.28); }
}

.bgm-panel {
  position: absolute;
  right: 0;
  bottom: 62px;
  width: 260px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xl);
}

.bgm-panel__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 13px;
}

.bgm-panel__artist {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
}

.bgm-panel__row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bgm-panel__row:last-child { margin-bottom: 0; }
.bgm-panel__row--btns { justify-content: flex-end; gap: 8px; }

.bgm-panel__label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  width: 28px;
  flex-shrink: 0;
}

.bgm-panel__val {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--primary-strong);
  width: 34px;
  text-align: right;
}

.bgm-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: var(--r-full);
  background: linear-gradient(to right, var(--primary), var(--primary-bg-hover));
  outline: none;
  cursor: pointer;
}

.bgm-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.4);
  cursor: pointer;
}

.bgm-rates {
  display: flex;
  gap: 4px;
  flex: 1;
}

.bgm-rates button {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card-bg);
  padding: 4px 0;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color var(--t), color var(--t);
}

.bgm-rates button:hover { border-color: var(--primary-bg-hover); color: var(--primary-strong); }

.bgm-rates button.is-on {
  background: var(--primary-bg-soft);
  color: var(--primary-strong);
  border-color: var(--primary-bg-hover);
}

.bgm-panel__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--card-bg);
  padding: 6px 11px;
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color var(--t), color var(--t);
}

.bgm-panel__btn:hover { background: var(--primary-bg-soft); color: var(--primary-strong); }
.bgm-panel__btn.is-muted { color: var(--danger); border-color: #fecaca; }

/* 全屏沉浸模式：悬浮窗撑满、深色封面背景 */
.bgm-fab:fullscreen {
  background: linear-gradient(160deg, #1e2b3c, #0f172a);
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  right: auto;
  bottom: auto;
}

.bgm-fab:fullscreen .bgm-fab__btn {
  width: 96px;
  height: 96px;
}

.bgm-fab:fullscreen .bgm-fab__btn svg { width: 40px; height: 40px; }

.bgm-fab:fullscreen .bgm-panel {
  position: static;
  width: min(420px, 80vw);
  background: rgba(30, 43, 60, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

.bgm-fab:fullscreen .bgm-panel__title,
.bgm-fab:fullscreen .bgm-panel__label { color: #cbd5e1; }
.bgm-fab:fullscreen .bgm-panel__val { color: var(--primary-bg-hover); }

.bgm-fab:fullscreen .bgm-rates button,
.bgm-fab:fullscreen .bgm-panel__btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}

.bgm-fab:fullscreen .bgm-rates button.is-on {
  background: var(--primary-strong);
  color: #fff;
  border-color: var(--primary);
}

/* ═══════════ 空态 / 加载 ═══════════ */

.empty {
  padding: 44px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid var(--primary-bg-hover);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 640ms linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════ 提示条 ═══════════ */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: var(--r-md);
  background: var(--card-bg);
  box-shadow: var(--sh-xl);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  max-width: 380px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--t), transform var(--t);
  pointer-events: none;
}

.toast.show { opacity: 1; transform: none; }
.toast.ok { border-color: #a7f3d0; }
.toast.err { border-color: #fecaca; }

.toast__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
}

.toast.err .toast__dot { background: var(--danger); }

/* ═══════════ 视图 ═══════════ */

.view { display: none; }
.view.is-on { display: block; }

/* ═══════════ 弹窗 ═══════════ */

.veil {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(30, 43, 60, 0.35);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}

body[data-modal="open"] .veil { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed;
  z-index: 160;
  top: 50%;
  left: 50%;
  width: min(880px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card-bg);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  padding: 26px;
  transform: translate(-50%, -46%) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t), transform var(--t-slow);
}

body[data-modal="open"] .modal {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal__sub { margin: 4px 0 0; font-size: 12px; color: var(--text-3); }

.modal__x {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 0;
  background: var(--line-soft);
  color: var(--text-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background-color var(--t), transform var(--t);
}

.modal__x:hover { background: var(--line); transform: rotate(90deg); }

.modal__x svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ═══════════ 响应式 ═══════════ */

@media (max-width: 1080px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-2-1 { grid-template-columns: minmax(0, 1fr); }
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }

  .side {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--side-w);
    transform: translateX(-100%);
    transition: transform 320ms var(--ease);
    z-index: 60;
    box-shadow: var(--sh-xl);
  }

  body[data-side="open"] .side { transform: translateX(0); }

  .side-veil {
    position: fixed;
    inset: 0;
    background: rgba(30, 43, 60, 0.3);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t);
  }

  body[data-side="open"] .side-veil { opacity: 1; pointer-events: auto; }

  .bar { padding: 12px 16px; }
  .content { padding: 16px; }
  .metrics { gap: 12px; }
  .row { gap: 14px; }
  .card { padding: 18px; border-radius: var(--r-md); }
  .metric { padding: 16px; border-radius: var(--r-md); }
}

@media (max-width: 560px) {
  .metrics { grid-template-columns: minmax(0, 1fr); }
  .row-3, .row-2 { grid-template-columns: minmax(0, 1fr); }
  .term-body { height: 340px; }
  .art-row { grid-template-columns: minmax(0, 1fr); }
  .art-row__acts { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ═══════════ 滚动条（对齐博客 overlayscrollbars 观感）═══════════
   博客实现要点：细圆条浮在内容上、轨道透明、手柄 hover 加粗加深、可拖拽。
   纯 CSS 等价实现（面板不引 OS 库，保持轻量）。 */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.44) transparent;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

/* 轨道透明 + 左右留 3px 呼吸位（OS 的 padding-axis 等价物） */
::-webkit-scrollbar-track {
  background: transparent;
  border-radius: var(--r-full);
  margin: 3px;
}

/* 手柄：默认 6px 视觉宽（12px 槽 - 两侧 3px 透明边），hover 长到 8px */
::-webkit-scrollbar-thumb {
  border-radius: var(--r-full);
  border: 3px solid transparent;
  background-clip: padding-box;
  background-color: rgba(100, 116, 139, 0.44);
  min-height: 33px;
  transition: background-color 0.15s;
}

::-webkit-scrollbar-thumb:hover {
  border-width: 2px;
  background-color: rgba(100, 116, 139, 0.62);
}

::-webkit-scrollbar-thumb:active {
  border-width: 2px;
  background-color: rgba(100, 116, 139, 0.78);
}

::-webkit-scrollbar-corner { background: transparent; }

::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.dark ::-webkit-scrollbar-thumb {
  background-color: rgba(203, 213, 225, 0.28);
}
.dark ::-webkit-scrollbar-thumb:hover {
  background-color: rgba(203, 213, 225, 0.45);
}
.dark ::-webkit-scrollbar-thumb:active {
  background-color: rgba(203, 213, 225, 0.6);
}

/* ═══════════ 文章列表工具栏 ═══════════ */

.art-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.art-toolbar__search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 220px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--line-soft);
  transition: border-color var(--t), background-color var(--t);
}

.art-toolbar__search:focus-within {
  border-color: var(--primary-bg-hover);
  background: var(--card-bg);
}

.art-toolbar__search svg {
  width: 15px;
  height: 15px;
  stroke: var(--text-3);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

.art-toolbar__search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
}

.art-toolbar__search input::placeholder { color: var(--text-4); }

.art-toolbar__filters {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: var(--r-full);
  background: var(--line-soft);
}

.art-toolbar__filters button {
  border: 0;
  padding: 5px 13px;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--text-3);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--t), color var(--t);
}

.art-toolbar__filters button:hover { color: var(--text-2); }

.art-toolbar__filters button.is-on {
  background: var(--card-bg);
  color: var(--primary-strong);
  box-shadow: var(--sh-sm);
}

.art-toolbar__bulk {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--primary-bg-soft);
}

.art-toolbar__bulk[hidden] { display: none; }

.art-toolbar__count {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-strong);
  margin-right: 4px;
}

/* 行选择框 */
.art-row__check {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  border: 1.5px solid var(--line);
  background: var(--card-bg);
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: background-color var(--t), border-color var(--t);
}

.art-row__check.is-on {
  background: var(--primary);
  border-color: var(--primary);
}

.art-row__check.is-on::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.art-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

/* ═══════════ 快速预览弹窗 ═══════════ */

.pv-modal {
  position: fixed;
  z-index: 170;
  top: 50%;
  left: 50%;
  width: min(820px, 92vw);
  max-height: 86vh;
  display: none;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  transform: translate(-50%, -50%);
  overflow: hidden;
}

body[data-preview="open"] .pv-modal { display: flex; }

body[data-preview="open"] .veil {
  opacity: 1;
  pointer-events: auto;
}

.pv-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.pv-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.pv-modal__meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-3);
}

.pv-modal__body {
  padding: 22px 26px 28px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.85;
}

.pv-modal__body h1, .pv-modal__body h2, .pv-modal__body h3 {
  margin: 20px 0 10px;
  line-height: 1.35;
  font-weight: 700;
}

.pv-modal__body h1 { font-size: 22px; }
.pv-modal__body h2 { font-size: 18px; }
.pv-modal__body h3 { font-size: 16px; }
.pv-modal__body p { margin: 0 0 13px; }

.pv-modal__body ul, .pv-modal__body ol {
  margin: 0 0 13px;
  padding-left: 24px;
}

.pv-modal__body blockquote {
  margin: 0 0 13px;
  padding: 9px 15px;
  border-left: 3px solid var(--primary-bg-hover);
  background: var(--line-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--text-2);
}

.pv-modal__body pre {
  margin: 0 0 13px;
  padding: 13px 15px;
  border-radius: var(--r-sm);
  background: #f4f8fd;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
}

.pv-modal__body code {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--line-soft);
  color: var(--primary-strong);
}

.pv-modal__body pre code { padding: 0; background: transparent; color: inherit; }
.pv-modal__body a { color: var(--primary-strong); text-decoration: underline; }
.pv-modal__body img { max-width: 100%; border-radius: var(--r-sm); }
.pv-modal__body table { border-collapse: collapse; width: 100%; margin-bottom: 13px; }
.pv-modal__body th, .pv-modal__body td { border: 1px solid var(--line); padding: 8px 11px; text-align: left; }
.pv-modal__body th { background: var(--line-soft); font-weight: 600; }

/* 品牌 logo：用站点头像（与博客一致） */
.side__logo-img {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
  transition: transform var(--t-slow);
}
.side__brand:hover .side__logo-img { transform: scale(1.06); }


/* ═══ 侧栏暗色切换按钮（fuwari LightDarkSwitch 同款交互）═══ */
.side__theme-btn {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  display: grid;
  place-items: center;
  transition: background-color var(--t), color var(--t);
}

.side__theme-btn:hover {
  background: var(--btn-plain-bg-hover);
  color: var(--primary);
}

.side__theme-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  grid-area: 1 / 1;
}

.side__theme-btn .ico-sun { display: none; }
:root.dark .side__theme-btn .ico-sun { display: block; }
:root.dark .side__theme-btn .ico-moon { display: none; }

/* 深色下其他组件细节适配 */
:root.dark .card,
:root.dark .metric { border-color: var(--line); }
:root.dark .bar {
  border-bottom-color: var(--line);
}
:root.dark .pill-blue { background: var(--primary-bg-soft); color: var(--primary); }
:root.dark .pill-green { background: oklch(0.30 0.05 155); color: oklch(0.78 0.13 155); }
:root.dark .pill-amber { background: oklch(0.30 0.05 70); color: oklch(0.80 0.13 70); }
:root.dark .pill-red { background: oklch(0.30 0.06 25); color: oklch(0.72 0.17 25); }
:root.dark .pill-gray { background: var(--btn-regular-bg); color: var(--text-2); }
:root.dark .btn-ghost { background: var(--card-bg); }
:root.dark .btn-danger { background: var(--danger-bg); color: oklch(0.72 0.17 25); }
:root.dark .art-row.is-private { background: oklch(0.28 0.04 70); border-color: oklch(0.35 0.05 70); }
:root.dark .term-wrap { border: 1px solid var(--line); }

:root.dark .toast { background: var(--card-bg); border-color: var(--line); }
:root.dark .toast.ok { border-color: oklch(0.35 0.06 155); }
:root.dark .toast.err { border-color: oklch(0.35 0.08 25); }
:root.dark .modal { background: var(--card-bg); }
:root.dark .pill-blue { background: var(--primary-bg-soft); color: var(--primary); }
:root.dark .contact-card .ct-icon,
:root.dark .contact__icon { background: var(--primary-bg-soft); color: var(--primary); }
:root.dark .seg button { color: var(--text-2); }
:root.dark .seg button.is-on { background: var(--card-bg); color: var(--primary); }
:root.dark .btn-code { background: var(--btn-regular-bg); color: var(--btn-content); }
