/* Shared aliases derived from the fixed design tokens. */
:root {
  --surface-1: var(--surface);
  --border-soft: var(--border);
  --ok: var(--success);
  --err: var(--danger);
  --selection-soft: color-mix(in srgb, var(--user) 12%, transparent);
}

/* 风格标题字体：书院气衬线 / 精密仪器等宽。默认 --font-title = --font-ui，
   不选风格时界面零变化。
   顶栏会话标题（.thread-title）固定用界面无衬线：它只有 14~15px，
   衬线中文在这个字号下笔画会糊（2026-10-25）。 */
.brand-text, .pane-title { font-family: var(--font-title); }
.thread-title { font-family: var(--font-ui); }

/* ── 风格选择卡片（设置 › 外观与快捷键）────────────────────────
   卡片自己带 data-style（和 theme.js 设在 <html> 上的是同一属性），
   背景/边框/色样全部走 var()，预览即真值。 */
.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: var(--sp-3);
}
.style-card {
  display: flex; flex-direction: column; gap: var(--sp-2);
  padding: var(--sp-3);
  text-align: left;
  background: var(--surface-2); color: var(--text);
  border: var(--bw) solid var(--border); border-radius: var(--r-md);
}
.style-card:hover { border-color: var(--text-dim); }
.style-card.active { border-color: var(--user); }
.style-swatch { display: flex; gap: var(--sp-1); }
.style-swatch span {
  width: 18px; height: 18px;
  border-radius: var(--r-sm); border: var(--bw) solid var(--border);
}
.style-swatch .sw-bg { background: var(--bg); }
.style-swatch .sw-surface { background: var(--surface); }
.style-swatch .sw-text { background: var(--text); }
.style-name { font-size: var(--text-base); }
.style-hint { font-size: var(--text-xs); color: var(--text-faint); }

/* ★ 系统健康状态指示器（2026-10-19 自诊断） */
.sb-health {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  cursor: pointer;
}
.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.health-ok { background: #22c55e; }
.health-warn { background: #f59e0b; }
.health-error { background: #ef4444; }
.sb-health:hover .health-dot {
  box-shadow: 0 0 4px currentColor;
}
