/* ===== 2026-06-24 upstream sync (be6a75c) — knowledge graph + suggest UI + visual refresh ===== */

/* ISSUE-239: 自托管 Inter 变量字体（woff2 单文件覆盖 100-900 全字重）
   prod 面向大陆用户，Google Fonts CDN 不可达，故自托管于 /fonts/。
   font-display: swap → FOIT 防住，加载完成前用系统字体兜底。 */
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ISSUE-239: Inter 拉丁字符优先；CJK 中文回落 PingFang/YaHei（Inter 不含汉字）
   — * 选择器加 Inter 作首选，覆盖 UI 中绝大多数数字/英文/标点。 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

:root {
  /* ===== 统一设计 Token（Refactor #2, 2026-07-13） ===== */

  /* —— 间距 —— */
  --spacing-nav-content: 26px;
  --spacing-block: 16px;
  --spacing-element: 12px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;

  /* —— 字号（收敛 15 种 px → 6 档）—— */
  --font-title-primary: 18px;   /* 兼容旧引用，= --font-title */
  --font-title-secondary: 16px; /* 兼容旧引用，= --font-subtitle */
  --font-text-normal: 14px;     /* 兼容旧引用，= --font-body */
  --font-text-hint: 12px;       /* 兼容旧引用，= --font-hint */
  --font-title: 18px;           /* 页面主标题 */
  --font-subtitle: 16px;        /* 次级标题 */
  --font-body: 14px;            /* 正文 */
  --font-label: 13px;           /* 标签/小标题 */
  --font-hint: 12px;            /* 说明/注释 */
  --font-caption: 11px;         /* 最小字 */

  /* —— 行距 —— */
  --lh-tight: 1.4;   /* 单行/标题 */
  --lh-base: 1.6;    /* 正文 */
  --lh-loose: 1.8;   /* 多行说明 */

  /* —— 文字色（ISSUE-238: 暗色化翻转——亮字 slate 色阶）—— */
  --color-title: #f1f5f9;       /* slate-100 标题 */
  --color-text: #e2e8f0;        /* slate-200 正文 */
  --color-text-2: rgba(226, 232, 240, 0.72); /* 兼容旧引用 */
  --color-hint: #94a3b8;        /* slate-400 说明/弱化 */
  --color-placeholder: #64748b; /* slate-500 占位符 */

  /* —— 品牌色（ISSUE-237: 紫蓝 AI 指纹 → 蓝青商务渐变，D4 锁定全量替换）—— */
  --accent-primary: #3b82f6;        /* blue-500 主色（ISSUE-237 新增） */
  --accent-cyan:    #06b6d4;        /* cyan-500 渐变终点 / 独立 accent（ISSUE-237 新增） */
  --accent-glow:    rgba(6, 182, 212, 0.35); /* 青色光晕（ISSUE-237 新增，为 ISSUE-238 准备） */
  --gradient-brand: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --color-accent: #2563eb;       /* 链接/激活/强调（原 9 种蓝统一） */
  --color-accent-hover: #1d4ed8; /* 蓝悬停 */
  --color-brand-purple: #7c6fcd; /* 紫色强调（保留兼容旧引用；渐变已不再使用） */
  --color-primary: var(--accent-primary); /* ISSUE-237 步骤 2: 显式定义原幽灵变量，消除 #25b7a8 fallback */

  /* —— 状态色（收敛 3 套红/绿/橙 → 各 1 个）—— */
  --color-danger: #ef4444;  /* 原 #ef4444/#e53935/#e11d48 统一 */
  --color-success: #22c55e; /* 原 #22c55e/#34d399/#059669 统一 */
  --color-warning: #f59e0b; /* 原 #f59e0b/#f97316 统一 */
  --color-expiry: #B8860B;  /* 兼容旧引用 */

  /* —— 背景与边框（ISSUE-238: 暗色化——深海蓝底 + slate 半透明边框 + 三层表面）—— */
  --color-bg:         #060912;                    /* 深海蓝 RGB(6,9,18) ~3% 亮度，非纯黑 */
  --color-bg-subtle:  rgba(28, 38, 58, 0.82);     /* Level 2 卡片面 */
  --color-surface:    rgba(15, 23, 42, 0.55);     /* 玻璃面（主卡） */
  --color-surface-glass: rgba(15, 23, 42, 0.55);
  --color-surface-2:  rgba(30, 41, 59, 0.50);     /* 次级表面 */
  --color-surface-input: rgba(6, 12, 22, 0.92);   /* Level 3 输入框凹陷（ISSUE-238 新增） */
  --color-surface-header: rgba(10, 14, 26, 0.80); /* header/sidebar（ISSUE-238 新增） */
  --color-surface-modal: #101827;                 /* 不透明弹窗面板（ISSUE-285：ISSUE-238 暗色化把 surface 改玻璃面后弹窗透底；玻璃美学属于页面卡片，modal 必须不透明） */
  --color-border:        rgba(148, 163, 184, 0.12);
  --color-border-strong: rgba(148, 163, 184, 0.20);
  --color-border-plain:  rgba(148, 163, 184, 0.18);
  --color-border-brand:        rgba(59, 130, 246, 0.08);  /* ISSUE-238 新增 */
  --color-border-brand-hover:  rgba(59, 130, 246, 0.15);  /* ISSUE-238 新增 */

  /* —— 阴影/圆角/缓动（ISSUE-237 步骤 6: 提前对齐 redesign 终态值为 ISSUE-238 准备；亮色下略重但不违和）—— */
  --shadow-sm:   0 4px 16px rgba(0, 0, 0, 0.30);
  --shadow-md:   0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg:   0 16px 48px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.25);
  --radius-xs: 6px;     /* ISSUE-237 步骤 6 新增：thumb / pill-small */
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* —— ISSUE-238 步骤 7: badge 语义 + 表格暗色别名 —— */
  --badge-green-bg: rgba(16,185,129,0.10);  --badge-green-fg: #34d399;
  --badge-red-bg:   rgba(239,68,68,0.10);   --badge-red-fg:   #f87171;
  --badge-amber-bg: rgba(251,191,36,0.08);  --badge-amber-fg: #fbbf24;
  --badge-blue-bg:  rgba(59,130,246,0.10);  --badge-blue-fg:  #60a5fa;
  --badge-gray-bg:  rgba(51,65,85,0.40);    --badge-gray-fg:  #94a3b8;
  --text-link: #60a5fa;   /* 表格 th 文字（暗色蓝） */
  --text-cell: #cbd5e1;   /* 表格 td 文字（slate-300） */
}

body {
  background-color: var(--color-bg);
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--color-text);
  height: 100vh;
  overflow: hidden;
}

/* ISSUE-238 步骤 2: 双 radial 光晕（左上蓝 + 右下青），固定层不滚动 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(59, 130, 246, 0.08), transparent 70%),
    radial-gradient(circle at 85% 90%, rgba(6, 182, 212, 0.06), transparent 70%);
}

/* ISSUE-239: 极淡 SVG fractal noise 颗粒（opacity 0.025），消除纯色深蓝的「塑料感」
   不滚动（fixed）、不挡点击（pointer-events:none）、混合模式 overlay 让颗粒只在中亮区显。
   肉眼几乎看不到，但质感提升明显。*/
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ISSUE-238 步骤 2: 主内容提到 body::before 之上 */
.app { position: relative; z-index: 1; }

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  min-height: 84px;
  background: var(--color-surface-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  color: var(--color-title);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--color-border-brand);
  overflow: visible;
}

/* ISSUE-04: split header into a sidebar-width cell (logo, over the sidebar) +
   a main cell (tip / user / expiry) whose left edge = sidebar right and whose
   right padding matches .main (24px). So .tip left-aligns to the content column
   (sidebar right edge) and .sys-expiry right-aligns to the page content's right
   edge. */
.header-side {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 14px 20px;
}

.header-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px 14px 0;
}

.header .logo {
  font-size: 20px;
  font-weight: 600;
  flex-shrink: 0;
}

.header .tip {
  font-size: 16px;
  font-weight: 600;
  opacity: 1;
  margin: 0;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-height: 42px;
}

.header .user {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.14);
  color: var(--color-title);
  flex-shrink: 0;
}

.header .sys-expiry {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-expiry);
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}


.container {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 0;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  background: var(--color-surface-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--color-border-brand);
  padding: 10px 10px 14px;
  overflow-y: auto;
  align-self: stretch;
  height: 100%;
  box-shadow: none;
}

.menu-section {
  padding: 6px 0;
}

.menu-section + .menu-section {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.menu-item {
  padding: 12px 14px 12px 44px;
  margin: 6px 6px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.18s var(--ease-out), color 0.18s var(--ease-out);
  font-size: 14px;
  position: relative;
  user-select: none;
}

.menu-item::before {
  content: "";
  width: 16px;
  height: 16px;
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: var(--radius-xs);
  background: rgba(148, 163, 184, 0.14);
}

.menu-item:hover {
  background: rgba(59, 130, 246, 0.10);
}

.menu-item.active {
  background: var(--gradient-brand);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.22);
}

.menu-item.active::before {
  background: rgba(255, 255, 255, 0.32);
}

.sub-menu {
  padding: 10px 14px 10px 56px;
  font-size: 13px;
  color: var(--color-hint);
  cursor: pointer;
  transition: background 0.18s var(--ease-out), color 0.18s var(--ease-out);
  margin: 2px 6px;
  border-radius: var(--radius-sm);
  position: relative;
  user-select: none;
}

.sub-menu::before {
  content: "";
  width: 6px;
  height: 6px;
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: var(--radius-pill);
  background: rgba(148, 163, 184, 0.24);
}

.sub-menu:hover {
  background: rgba(59, 130, 246, 0.10);
  color: var(--color-text);
}

.sub-menu.active {
  background: rgba(59, 130, 246, 0.16);
  color: var(--color-title);
  font-weight: 700;
}

.main {
  flex: 1;
  padding: 20px 24px;
  min-width: 0;
  background: transparent;
  overflow-y: auto;
  overflow-x: hidden;
}

.content {
  width: 100%;
  margin-top: 16px; /* 与上方标签栏拉开间距 */
}

.card {
  background: var(--color-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--color-border-brand);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  color: var(--color-text);
  transition: box-shadow 0.18s var(--ease-out), border-color 0.18s var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-brand-hover);
}

.dashboard-grid {
  display: grid;
  gap: 16px;
  align-items: stretch;
}

.stat-value {
  font-size: 22px;
  font-weight: 900;
  margin-top: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--color-border);
  background: var(--badge-gray-bg);
  color: var(--badge-gray-fg);
}

.badge-gray {
  background: var(--badge-gray-bg);
  border-color: rgba(148, 163, 184, 0.18);
  color: var(--badge-gray-fg);
}

.badge-green {
  background: var(--badge-green-bg);
  border-color: rgba(16, 185, 129, 0.22);
  color: var(--badge-green-fg);
}

.badge-red {
  background: var(--badge-red-bg);
  border-color: rgba(239, 68, 68, 0.22);
  color: var(--badge-red-fg);
}

.badge-blue {
  background: var(--badge-blue-bg);
  border-color: rgba(59, 130, 246, 0.22);
  color: var(--badge-blue-fg);
}

.page-center {
  max-width: 980px;
  margin: 0 auto;
}

.page-shell {
  padding: 16px;
}

/* !important 必须保留：question-bank/article-writing/article-manager/media-publish/
   publish-manager 5 页的 .page-center 带 inline style="max-width:1100px/980px"，
   inline style 优先级高于任何非 !important 规则（特异性只裁决规则间平局，inline 在整个
   规则层之上）。ISSUE-237 步骤 8 误删 !important → 5 页 inline 限制重新生效 → 固定宽度
   不适配浏览器。恢复 !important 压制 inline style。 */
.page-shell .page-center {
  max-width: 100% !important;
  margin: 0 !important;
}

.page-muted {
  color: var(--color-hint);
  font-size: var(--font-text-hint);
}

.page-hint {
  color: var(--color-accent-hover);
  font-size: 13px;
}

.page-hint a {
  color: var(--color-accent-hover);
  text-decoration: none;
}

.page-hint a:hover {
  text-decoration: underline;
}

.action-row {
  display: flex;
  justify-content: center;
  margin: 18px 0;
}

.action-download-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 18px 0;
}

.action-download-row .big-action {
  transform: scale(0.8);
  transform-origin: right center;
}

@media (max-width: 900px) {
  .action-download-row {
    flex-direction: column;
    align-items: center;
  }
}

/* ISSUE-237 步骤 5: 4 副本（.btn-primary/.btn-solid/.big-action/.logout-btn）共享主声明，
   原 4 份逐字节重复的 CSS 合并为单一规则。差异（.logout-btn letter-spacing:2px）单写。 */
.btn-primary,
.btn-solid,
.big-action,
.logout-btn {
  min-width: 80px;
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--gradient-brand);
  color: var(--color-bg);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.big-action:hover {
  background: rgba(37, 183, 168, 0.08);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.report {
  margin-top: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  min-height: 280px;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.report-header {
  padding: 10px 12px;
  font-size: var(--font-text-hint);
  color: var(--color-hint);
}

.report-body {
  height: 100%;
  /* ISSUE-189: 纵向限高 + 滚动——诊断长文档不再把汇总板块顶到底。max-height:70vh
     覆盖所有诊断页（.report-body 全局）；与 ISSUE-70 横向 overflow-x:auto 互补，
     纵向溢出走 overflow-y:auto。.report 非 flex 容器，无需 min-height:0 技巧。 */
  max-height: 70vh;
  overflow-y: auto;
  /* ISSUE-70: markdown 内容溢出左边界。padding + overflow-x auto + word-break
     三件套防长 URL / 长 table cell / 长 code block 撑破容器。 */
  padding: 12px 14px;
  overflow-x: auto;
  overflow-wrap: break-word;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text, #1f2937);
}

/* ISSUE-70: markdown 渲染元素排版。配合 diag-common.js renderMarkdown 输出。 */
.report-body h1,
.report-body h2,
.report-body h3,
.report-body h4,
.report-body h5,
.report-body h6 {
  margin: 14px 0 6px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text, #1f2937);
}
.report-body h1 { font-size: 18px; }
.report-body h2 { font-size: 16px; }
.report-body h3 { font-size: 15px; }
.report-body h4,
.report-body h5,
.report-body h6 { font-size: 14px; }

.report-body p {
  margin: 6px 0;
}

.report-body ul,
.report-body ol {
  margin: 6px 0;
  padding-left: 22px;
}

/* ISSUE-205 复发加固：article-writing `.aw-result-box` 也需要同样的 list
   padding + list-style-type，且显式 `display: list-item` 防 inline `<li>`
   被 reset 为 `display: block` 后 marker 不显示；`!important` 兜底防
   specificity 不足被覆盖（用户复报 2026-08-12 即使 commit 26d5774 已部署
   仍见序号全显 1.）。 */
.aw-result-box ul,
.aw-result-box ol {
  margin: 6px 0;
  padding-left: 22px;
}
.aw-result-box ol { list-style-type: decimal !important; }
.aw-result-box ul { list-style-type: disc !important; }
.aw-result-box li {
  display: list-item !important;
  margin: 2px 0;
}

.report-body li {
  margin: 2px 0;
}

.report-body code {
  padding: 1px 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
}

.report-body pre {
  margin: 8px 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  overflow-x: auto;
  font-size: 12px;
}

.report-body strong {
  font-weight: 600;
}

/* Markdown table：宽内容横向滚动，不撑破容器 */
.report-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
}

.report-body th,
.report-body td {
  padding: 6px 10px;
  border: 1px solid var(--color-border, #e5e7eb);
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: break-word;
}

.report-body th {
  background: rgba(0, 0, 0, 0.03);
  font-weight: 600;
}

.download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 13px;
  color: var(--color-accent);
  cursor: pointer;
  user-select: none;
}

.download:hover {
  text-decoration: underline;
}

.section {
  margin-top: 18px;
}

.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-danger);
  margin: 10px 0 6px;
}

.textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: var(--radius-md);
  background: var(--color-surface-input);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--color-text);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.20);
  transition: border-color 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out), background 0.16s var(--ease-out);
}

.textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.60);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.20), 0 0 0 3px rgba(59, 130, 246, 0.20);
  background: var(--color-surface-input);
}

.textarea-full {
  min-height: calc(100vh - 220px);
  resize: none;
}

.editor-shell {
  height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editor-shell .textarea {
  flex: 1;
  min-height: 0;
}

@media (max-width: 900px) {
  .textarea-full {
    min-height: calc(100vh - 260px);
  }
  .editor-shell {
    height: calc(100vh - 220px);
  }
}

.pill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out), border-color 0.16s var(--ease-out), background 0.16s var(--ease-out);
}

.pill.active {
  background: var(--gradient-brand);
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
  color: var(--color-bg);
}

.pill.active .pill-name,
.pill.active .pill-sub {
  color: var(--color-bg);
}

.pill.active .pill-icon {
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-bg);
}

.pill:hover {
  transform: translateY(-1px);
}

.pill-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(37, 183, 168, 0.10);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(15, 23, 42, 0.82);
  font-weight: 800;
  font-size: 12px;
  overflow: hidden;
}

.pill-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: inherit;
}

.ai-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: inherit;
}

.llm-svg-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.llm-fallback {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: var(--color-title);
}

.icon-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.pill-name {
  font-size: 12px;
  color: var(--color-text);
  font-weight: 700;
}

.pill-sub {
  font-size: 11px;
  color: var(--color-hint);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.04) 0%, rgba(6, 182, 212, 0.03) 100%);
  opacity: 0.6;
  pointer-events: none;
}

.card > * {
  position: relative;
  z-index: 1;
}

.loading {
  padding: 24px;
  text-align: center;
  color: var(--color-hint);
}

.empty {
  padding: 24px;
  text-align: center;
  color: var(--color-hint);
}

.page-title {
  font-size: var(--font-title-primary);
  font-weight: 700;
  color: var(--color-title);
  margin-bottom: 10px;
}

.page-desc {
  color: var(--color-hint);
  font-size: 14px;
}

.hidden {
  display: none !important;
}

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

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-right {
  justify-content: flex-end;
}

.btn-solid:hover,
.btn-primary:hover,
.logout-btn:hover {
  opacity: 0.9;
}

.btn-solid:active,
.btn-primary:active,
.btn-icon:active,
.big-action:active,
.pill:active {
  transform: translateY(0);
  filter: brightness(0.99);
}

.btn-active,
button.btn-active {
  background: var(--gradient-brand) !important;
  color: #ffffff !important;
  border-color: var(--accent-primary) !important;
}

button.btn-active:hover {
  filter: brightness(0.98);
}

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out), background 0.16s var(--ease-out), border-color 0.16s var(--ease-out);
}

.btn-icon:hover {
  background: rgba(59, 130, 246, 0.10);
  border-color: var(--color-border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.select,
.input {
  height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(59, 130, 246, 0.28);
  background: var(--color-surface-input);
  padding: 0 12px;
  font-size: 12px;
  color: var(--color-text);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.20);
  transition: border-color 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out), background 0.16s var(--ease-out);
}

/* ISSUE-238 补漏：自定义输入类（kb-input 等）未定义 color/background 的元素级兜底——
   input/textarea 不继承正文字色，UA 默认黑字白底在暗色下不可读（用户报知识库
   企业定位/企业介绍编辑框深底黑字）。specificity (0,0,1) 低于任何类，不覆盖 .input 等 */
input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="file"]),
textarea,
select {
  color: var(--color-text);
  background: var(--color-surface-input);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-placeholder);
}

.input::placeholder,
.textarea::placeholder {
  font-size: 12px;
}

.select:focus,
.input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.60);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.20), 0 0 0 3px rgba(59, 130, 246, 0.20);
  background: var(--color-surface-input);
}

.input {
  min-width: 260px;
}

.table-wrap {
  border-radius: var(--radius-md);
  overflow: auto;
  max-height: calc(100vh - 240px);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  box-shadow: var(--shadow-sm);
}

.table-wrap.square {
  border-radius: 2px;
}

.note-box {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--color-surface-2);
  box-shadow: var(--shadow-sm);
}

.note-red {
  color: var(--color-danger);
  font-size: 13px;
  line-height: 1.8;
}


.modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 18, 0.80);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

/* ISSUE-136: 导入 partial-success warnings 弹窗 */
.kb-warnings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 18, 0.80);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100001;
  padding: 24px;
}

.kb-warnings-modal {
  background: rgba(15, 23, 42, 0.90);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--color-border-brand-hover);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(59, 130, 246, 0.10);
  overflow: hidden;
}

.kb-warnings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
}

.kb-warnings-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-title);
}

.kb-warnings-close {
  border: none;
  background: none;
  font-size: 22px;
  color: var(--color-hint);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.kb-warnings-close:hover {
  color: var(--color-danger);
}

.kb-warnings-body {
  padding: 16px 20px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text);
}

.kb-warnings-note {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #f0f9ff;
  border-radius: 8px;
  color: #1e40af;
  font-size: 13px;
}

.kb-warnings-note-error {
  background: #fef2f2;
  color: #991b1b;
}

.kb-warnings-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kb-warnings-list li {
  padding: 8px 10px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.kb-warnings-list li:last-child {
  border-bottom: none;
}

.kb-warnings-loc {
  font-weight: 600;
  color: var(--color-hint);
  margin-right: 4px;
}

.kb-warnings-footer {
  padding: 12px 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
}

.kb-warnings-ok {
  height: 36px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--gradient-brand, var(--gradient-brand));
  color: var(--color-bg);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.modal.show {
  display: flex;
}

.modal-card {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  background: rgba(15, 23, 42, 0.90);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-brand-hover);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(59, 130, 246, 0.10);
  /* ISSUE-208: 弹窗骨架系统性缺陷——块级容器 + max-height + overflow:hidden 在
     内容超视口时把 .modal-actions 裁剪掉（用户报「审核通过」「保存」按钮看不见）。
     flex column 让 body flex:1 自适应 + actions flex-shrink:0 永远可见。
     覆盖 article-manager 审核弹窗 + 编辑弹窗 + 所有用 .modal-card 的页面。
     全局 grep 21 文件用此 class，子结构均为 head→body→actions，flex column 兼容。 */
  display: flex;
  flex-direction: column;
}

.modal-head {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: var(--gradient-brand);
  color: var(--color-bg);
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0; /* ISSUE-208: 防 flex column 压缩 head */
}

.modal-head > div {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-body {
  padding: 12px;
  overflow: auto;
  flex: 1 1 auto;       /* ISSUE-208: body 自适应高度 + 内容超出滚动 */
  min-height: 0;        /* flex 子项必加，否则内容撑爆 */
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;       /* ISSUE-208: 按钮区永远可见，不被裁剪 */
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.thumb {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  height: 96px;
  background: var(--color-surface-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-hint);
  font-size: 12px;
}

.u-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.u-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.u-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill-small {
  padding: 6px 10px;
  border-radius: 2px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: var(--color-bg);
  font-size: 12px;
  color: var(--color-title);
}

@media (max-width: 900px) {
  .thumb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th,
td {
  border-bottom: 1px solid var(--color-border);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-cell);
  text-align: left !important;
  white-space: nowrap;
  line-height: 1.6;
  vertical-align: middle;
}

.cell-wrap {
  white-space: normal !important;
  word-break: break-word;
  overflow: visible;
}

th {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.02) 100%);
  color: var(--text-link);
  font-weight: 700;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
  word-break: break-word;
}

tr:hover td {
  background: rgba(59, 130, 246, 0.04);
}

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

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-pill);
  border: 2px solid rgba(15, 23, 42, 0.06);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.34);
}

.op {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--accent-primary);
  cursor: pointer;
  font-size: 12px;
}

.op:hover {
  text-decoration: underline;
}

.op-danger {
  color: var(--color-danger);
}

.op-danger:hover {
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .sidebar {
    width: 200px;
  }
}

@media (max-width: 900px) {
  body {
    height: auto;
    overflow: auto;
  }
  .app {
    height: auto;
  }
  .header .tip {
    display: none;
  }
  .container {
    flex-direction: column;
    position: static;
    overflow: visible;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    position: relative;
    transform: none;
    transition: none;
    box-shadow: none;
    height: auto;
  }
  .sidebar:hover {
    transform: none;
  }
  .main {
    padding-left: 20px;
    overflow: visible;
  }
}

/* ===== 诊断模块整改样式 v2 ===== */
.diag-page-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.diag-page-title {
  font-size: var(--font-title-primary);
  font-weight: 700;
  color: var(--color-title);
  margin-bottom: 10px;
}

.diag-page-desc {
  font-size: 13px;
  color: var(--color-hint);
  line-height: 1.6;
}

.diag-page-desc-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.diag-text-small {
  font-size: 12px;
  line-height: 1.8;
}

.diag-page-meta {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.diag-desc {
  font-size: 14px;
  color: var(--color-text-2);
  line-height: 1.8;
  text-align: center;
  margin-bottom: 12px;
}

.diag-info-block {
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.diag-info-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-title);
  margin-bottom: 4px;
}

.diag-info-hint {
  font-size: 12px;
  color: var(--color-hint);
  margin-bottom: 12px;
}

.diag-info-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.diag-info-table.three-col td.diag-label {
  width: 100px;
  font-size: 12px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
}

.diag-info-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.diag-info-table td.diag-label {
  width: 130px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-2);
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}

.diag-info-table td.diag-label.nowrap {
  white-space: nowrap;
  line-height: 1.2;
  font-size: 12px;
}

.diag-info-table td.diag-label.wide {
  width: 170px;
}

.diag-info-table td.diag-field {
  font-size: 13px;
}

.diag-info-table tr {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.diag-info-table input,
.diag-info-table textarea {
  width: 100%;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 2px;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  background: var(--color-surface-input);
  color: var(--color-text);
}

.diag-info-table input {
  height: 32px;
}

.diag-info-table textarea {
  padding: 8px 10px;
  min-height: 88px;
  line-height: 1.6;
  resize: vertical;
}

.diag-info-table input.prefilled,
.diag-info-table textarea.prefilled {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-1);
  cursor: default;
  resize: none;
}

.diag-info-table input.manual-input,
.diag-info-table textarea.manual-input {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

.diag-model-block {
  padding: 12px 16px;
  margin-bottom: 14px;
}

.diag-model-label {
  font-size: 12px;
  color: var(--color-hint);
  margin-bottom: 10px;
  text-align: center;
}

.diag-model-block .pill-row {
  gap: 22px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-title);
  padding-left: 10px;
  border-left: 3px solid var(--color-accent);
  margin-bottom: 12px;
  line-height: 1.4;
}

.diag-divider {
  border: none;
  border-top: 1px dashed var(--color-border);
  margin: 20px 0;
}

.report-placeholder {
  padding: 40px 24px;
  text-align: center;
  color: var(--color-hint);
  font-size: 13px;
}

.diag-action-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.aw-suggest {
  margin-top: 10px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface-2);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.aw-suggest .aw-suggest-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text);
}

.aw-suggest .aw-suggest-item:last-child {
  border-bottom: 0;
}

.aw-suggest .aw-suggest-item:hover {
  background: rgba(59, 130, 246, 0.06);
}

.aw-suggest .aw-suggest-sub {
  font-size: 12px;
  color: var(--color-hint);
  margin-top: 4px;
}

/* Global button rounding override for page-level inline styles */
button,
input[type="button"],
input[type="submit"],
a.case-btn,
.tag {
  border-radius: var(--radius-pill) !important;
}

button.btn-icon,
button.cm-icon,
button.op {
  border-radius: 12px !important;
}

/* ===== 退出按钮（共享 .btn-primary 声明，仅 letter-spacing 差异）===== */
.logout-btn {
  letter-spacing: 2px;
}

/* ===== ISSUE-56: 头像下拉 (SuperAdmin 进入管理后台入口) ===== */
.user-avatar-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--color-border, #e5e5e5);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text, #333);
  transition: border-color .2s, box-shadow .2s;
  flex-shrink: 0;
}
.user-avatar-btn:hover { border-color: var(--color-brand-purple, #7c6fcd); }
.user-avatar-btn[aria-expanded="true"] {
  border-color: var(--color-brand-purple, #7c6fcd);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}
.user-avatar-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: var(--color-bg);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.user-avatar-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar-caret { font-size: 10px; color: var(--color-hint, #999); }

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 9999;
  overflow: hidden;
  padding: 4px 0;
}
.user-dropdown.open { display: block; }
.user-dropdown-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 4px;
}
.user-dropdown-name { font-weight: 600; font-size: 14px; color: var(--color-title); }
.user-dropdown-meta { font-size: 12px; color: var(--color-hint); margin-top: 2px; }
.user-dropdown-item {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text);
  transition: background .15s;
}
.user-dropdown-item:hover { background: rgba(59,130,246,0.08); }
.user-dropdown-item.danger { color: #e74c3c; }
.user-dropdown-item.danger:hover { background: rgba(231,76,60,0.08); }

.sys-expiry {
  margin-right: 80px;
}

/* ===== 通知铃铛（参与 header-main flex 流，tip 的 flex:1 把它推到右侧）===== */
.notify-bell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  color: #e74c3c;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s;
  flex-shrink: 0;
  white-space: nowrap;
}
.notify-bell:hover { background: rgba(231,76,60,0.08); }
.notify-bell-icon { font-size: 16px; }
/* Round 19 反馈 #5: 无未读时铃铛灰色, 不再误导用户以为有新通知 */
.notify-bell.empty { color: #999; font-weight: 500; }
.notify-bell:not(.empty) .notify-bell-icon { animation: none; }
.notify-bell-count {
  background: #e74c3c;
  color: var(--color-bg);
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-weight: 600;
}

.notify-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-width: 90vw;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 9999;
  max-height: 420px;
  overflow-y: auto;
}
.notify-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background .15s;
}
.notify-item:hover { background: rgba(59, 130, 246, 0.08); }
.notify-item.unread { background: rgba(59, 130, 246, 0.10); }
.notify-item:last-child { border-bottom: none; }
.notify-item-title { font-size: 14px; font-weight: 600; color: var(--color-title); margin-bottom: 4px; }
.notify-item.unread .notify-item-title::before {
  content: '●';
  color: #f87171;
  margin-right: 5px;
}
.notify-item-content { font-size: 13px; color: var(--color-hint); line-height: 1.5; margin-bottom: 4px; }
.notify-item-time { font-size: 11px; color: var(--color-placeholder); }

/* ===== 页内多标签栏 ===== */
.tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px 0 12px;
  background: var(--color-surface-header);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  flex-shrink: 0;
  min-height: 40px;
}
.tab-bar::-webkit-scrollbar { height: 4px; }
.tab-bar::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 2px; }

.tab-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  color: var(--color-hint);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
  max-width: 200px;
}
.tab-item:hover { background: rgba(59,130,246,0.10); color: var(--color-text); }
.tab-item.active {
  background: var(--color-bg);
  color: var(--color-primary);
  border-color: rgba(59, 130, 246, 0.4);
  border-bottom: 2px solid var(--color-primary);
  font-weight: 600;
}
.tab-item-label { overflow: hidden; text-overflow: ellipsis; }
.tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.tab-close:hover { background: rgba(239,68,68,0.12); color: #ef4444; }
.tab-item.no-close .tab-close { display: none; }

/* ===== ISSUE-B3 (2026-08-12): competitor-analysis multi-row URL input ===== */
.ca-url-inputs { display: flex; flex-direction: column; gap: 6px; }
.ca-url-rows { display: flex; flex-direction: column; gap: 6px; }
.ca-url-row { display: flex; gap: 6px; align-items: center; }
.ca-url-input { flex: 1; padding: 6px 8px; border: 1px solid var(--color-border); border-radius: 4px; background: var(--color-surface-input); color: var(--color-text); }
.ca-url-input:focus { outline: none; border-color: var(--accent-primary); }
.ca-url-remove { padding: 4px 10px; background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.30); border-radius: 4px; cursor: pointer; color: var(--badge-red-fg); }
.ca-url-remove:hover { background: rgba(239,68,68,0.18); }
.ca-url-add { padding: 6px 12px; background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.30); border-radius: 4px; cursor: pointer; color: var(--badge-blue-fg); align-self: flex-start; }
.ca-url-add:hover:not(:disabled) { background: rgba(59,130,246,0.20); }
.ca-url-add:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== ISSUE-238 步骤 9: backdrop-filter 旧浏览器降级（@supports 守卫）===== */
@supports not (backdrop-filter: blur(1px)) {
  .card, .modal-card, .kb-warnings-modal, .user-dropdown, .notify-dropdown {
    backdrop-filter: none;
    background: rgba(15, 23, 42, 0.96);
  }
  .modal, .kb-warnings-overlay {
    backdrop-filter: none;
    background: rgba(6, 9, 18, 0.96);
  }
  .header, .sidebar, .tab-bar {
    backdrop-filter: none;
    background: rgba(10, 14, 26, 0.98);
  }
}

