/* ============================================
   工程技术方案智能生成与合规审核平台 - 统一设计系统
   设计基准：中国中铁企业VI标准 (CMYK 100,55,0,0 → #0073FF)
   ============================================ */

/* ============================================
   CSS 变量 - 设计 Token
   ============================================ */
:root {
  /* ====== 中国中铁企业VI主色系 ====== */
  /* 主色：#0073FF（CMYK 100,55,0,0，RGB 0,115,255） */
  --primary: #0073FF;
  --primary-hover: #0052CC;
  --primary-active: #003D99;
  --primary-light: rgba(0, 115, 255, 0.10);
  --primary-light-strong: rgba(0, 115, 255, 0.18);
  --primary-bg: #E6F2FF;            /* 浅蓝底 */
  --primary-grad: linear-gradient(135deg, #0073FF 0%, #0052CC 100%);
  --primary-grad-soft: linear-gradient(135deg, #4DA3FF 0%, #0073FF 100%);
  --primary-glow: rgba(0, 115, 255, 0.28);
  --primary-shadow: 0 8px 24px -6px rgba(0, 115, 255, 0.32);

  /* 蓝系色阶 */
  --blue-50:  #E6F2FF;
  --blue-100: #CCE3FF;
  --blue-200: #99C7FF;
  --blue-300: #66ABFF;
  --blue-400: #338FFF;
  --blue-500: #0073FF;  /* 主色 */
  --blue-600: #0052CC;
  --blue-700: #003D99;
  --blue-800: #002966;
  --blue-900: #001433;

  /* 背景层级（亮色模式） */
  --bg-base: #F5F7FA;       /* 全局背景：浅灰蓝 */
  --bg-page: #FFFFFF;
  --bg-sidebar: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-input: #F5F7FA;
  --bg-hover: #F0F4F8;
  --bg-active: #E6F2FF;
  --bg-overlay: rgba(15, 23, 42, 0.5);

  /* 边框（控制台语言：更冷、更细的发丝线，靠边框而非阴影分层） */
  --border: #E4E7EC;
  --border-light: #EEF1F4;
  --border-strong: #D0D5DD;
  --border-focus: #0073FF;

  /* 文字颜色 */
  --text-primary: #18191C;
  --text-secondary: #4B5563;
  --text-tertiary: #6B7280;
  --text-muted: #9CA3AF;
  --text-inverse: #FFFFFF;

  /* 深度思考 */
  --thinking-bg: #E6F2FF;
  --thinking-border: #99C7FF;
  --thinking-text: #003D99;
  --thinking-icon: #0073FF;

  /* 状态颜色 */
  --success: #16A34A;
  --success-bg: #DCFCE7;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --danger: #EF4444;
  --danger-bg: #FEE2E2;
  --info: #0073FF;
  --info-bg: #E6F2FF;

  /* 消息气泡 */
  --user-bubble: #F5F7FA;
  --assistant-bubble: #FFFFFF;

  /* 尺寸（工程控制台：240 侧栏 / 56 顶栏，密度优先） */
  --sidebar-width: 240px;
  --navbar-height: 56px;
  --input-radius: 8px;
  --card-radius: 12px;

  /* v6.0 新增: 圆角/间距/字体 Token
     v9.14（界面专业感升级）: 圆角收敛到 4/6/8/12 —— 大圆角是通用 SaaS 模板感
     的主要来源；工程控制台以直角/小圆角 + 发丝线分层。 */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  /* 字体阶（与设计稿 84/22/13/11 同构，按 Web 可读性缩放）：
     34 关键指标 / 22 页面题 / 17 区块题 / 15 正文 / 13 次要 / 11 标签 */
  --fs-kpi: 34px;
  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-15: 15px;
  --fs-17: 17px;
  --fs-22: 22px;
  --font-display: 34px;
  --font-h1: 22px;
  --font-h2: 17px;
  --font-h3: 15px;
  --font-body: 15px;
  --font-body-sm: 13px;
  --font-caption: 11px;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", "Consolas", "Courier New", monospace;

  /* 阴影（控制台语言：压平，只保留 1–2px 的浮起感，分层主要靠边框） */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 4px 12px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --shadow-xl: 0 12px 32px -8px rgba(16, 24, 40, 0.14), 0 8px 16px -6px rgba(16, 24, 40, 0.08);
  --shadow-primary: 0 4px 12px -4px rgba(0, 115, 255, 0.28);

  /* 动画 */
  --transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.2s cubic-bezier(0.2, 0, 0.2, 1),
                border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1),
                     color 0.15s cubic-bezier(0.4, 0, 0.2, 1),
                     opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-base: #0f172a;
    --bg-sidebar: #0b1120;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --bg-hover: #334155;
    --bg-active: #475569;
    --border: #334155;
    --border-light: #2B3A4F;
    --border-focus: #338FFF;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --thinking-bg: #001433;
    --thinking-border: #003D99;
    --thinking-text: #99C7FF;
    --thinking-icon: #338FFF;
    --user-bubble: #334155;
    --assistant-bubble: #1e293b;
    --primary-light: rgba(0, 115, 255, 0.12);
    --primary-glow: rgba(0, 115, 255, 0.25);
    --danger-bg: rgba(239, 68, 68, 0.16);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.5), 0 4px 10px -4px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 40px -8px rgba(0,0,0,0.6), 0 8px 16px -6px rgba(0,0,0,0.5);
  }
}

/* v8.1: 手动主题切换 — [data-theme="dark"] 强制应用暗色变量
   （优先于 prefers-color-scheme 系统跟随） */
:root[data-theme="dark"] {
  --bg-base: #0f172a;
  --bg-sidebar: #0b1120;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --bg-hover: #334155;
  --bg-active: #475569;
  --border: #334155;
  /* v9.14-fix: 暗色块里漏了 --border-light，它退回亮色 #EEF1F4，
     表格行分隔线在暗底上是一条条白线（公司/设置/审核列表均受影响）。 */
  --border-light: #2B3A4F;
  --border-focus: #338FFF;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --thinking-bg: #001433;
  --thinking-border: #003D99;
  --thinking-text: #99C7FF;
  --thinking-icon: #338FFF;
  --user-bubble: #334155;
  --assistant-bubble: #1e293b;
  --primary-light: rgba(0, 115, 255, 0.12);
  --primary-glow: rgba(0, 115, 255, 0.25);
  /* 浅红底在暗色下要降饱和，否则禁用/删除按钮是刺眼的亮粉块 */
  --danger-bg: rgba(239, 68, 68, 0.16);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.5), 0 4px 10px -4px rgba(0,0,0,0.4);
  --shadow-xl: 0 20px 40px -8px rgba(0,0,0,0.6), 0 8px 16px -6px rgba(0,0,0,0.5);
}

/* ============================================
   全局基础样式
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Noto Sans SC", "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100vh;
  max-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ============================================
   滚动条样式
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   应用整体布局
   ============================================ */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================================
   顶部导航栏
   ============================================ */
.app-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  /* v9.14: 控制台顶栏不再用半透明毛玻璃 —— 实底 + 发丝线更像工具，
     也避免滚动内容从顶栏下透出造成的「页面发灰」。 */
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  z-index: 100;
}

.navbar-toggle {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.navbar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}
.navbar-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #0073FF, #0052CC);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  box-shadow: none;
}

.navbar-link {
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius-md);
  background: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  text-decoration: none;
}
.navbar-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.navbar-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

.navbar-spacer { flex: 1; }

/* ===== 组织面包屑「集团 › 公司 (› 项目)」+ 公司切换器（v9.x） =====
   内容由 org_switcher.js 依据 /api/org/tree 填充；非超管只读（.readonly）。 */
.org-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  position: relative;
  font-size: 0.82rem;
  max-width: 360px;
}
.org-crumb {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-crumb-dim { color: var(--text-muted); max-width: 110px; }
.org-crumb-project { color: var(--text-secondary); max-width: 150px; }
.org-crumb-sep { color: var(--text-muted); flex-shrink: 0; }
.org-crumb-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  max-width: 180px;
  transition: var(--transition-fast);
}
.org-crumb-btn:hover { background: var(--bg-hover); border-color: var(--border); }
.org-crumb-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-crumb-btn.readonly { cursor: default; color: var(--text-secondary); font-weight: 500; }
.org-crumb-btn.readonly:hover { background: none; border-color: transparent; }

.org-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 200;
  padding: 4px 0;
}
.org-menu.open { display: block; }
.org-menu-label {
  padding: 7px 14px 3px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}
.org-menu-item {
  padding: 7px 14px;
  font-size: 0.82rem;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.org-menu-item:hover { background: var(--bg-hover); }
.org-menu-item.active { color: var(--primary); font-weight: 600; }
.org-menu-slug { font-size: 0.68rem; color: var(--text-muted); font-family: monospace; }

@media (max-width: 900px) {
  .org-switcher { display: none; }
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0073FF, #0052CC);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}
.user-avatar:hover { opacity: 0.9; }

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  z-index: 200;
}
.user-menu.open { display: block; }

.user-menu-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.user-menu-header .name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.user-menu-header .email {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}
.user-menu-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.user-menu-item.danger { color: var(--danger); }
.user-menu-item.danger:hover { background: rgba(239, 68, 68, 0.08); }

/* ============================================
   侧边栏
   ============================================ */
.app-sidebar {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 90;
}

.app-sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar-section {
  padding: 12px 8px 4px;
}
.sidebar-section-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 8px;
  margin-bottom: 4px;
}

.session-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  group: true;
}
.session-item:hover { background: var(--bg-hover); }
.session-item.active { background: var(--bg-active); }

.session-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.session-info { flex: 1; min-width: 0; }
.session-title {
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.session-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.session-actions {
  display: none;
  gap: 4px;
}
.session-item:hover .session-actions { display: flex; }

.session-action-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
  font-size: 14px;
}
.session-action-btn:hover { background: var(--bg-active); color: var(--text-secondary); }
.session-action-btn.danger:hover { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.sidebar-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--border);
}
.sidebar-footer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.sidebar-footer-item:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ============================================
   主内容区域
   ============================================ */
.app-main {
  /* v9.14-fix: `.app-layout` 是 flex 容器，而侧边栏是 position:fixed（不参与布局），
     于是 `.app-main` 成了唯一的在流 flex 项。写死 margin-left 却没有 flex-grow 时，
     它的宽度取内容宽度（max-content）而不是剩余空间 —— 1440px 视口下实测只有
     792px，右侧留出一大块空白（设置/统计/首页都受影响）。
     `flex:1 1 0%` 把基准宽度归零，剩余空间（容器宽 - 左外边距）全部给它。 */
  flex: 1 1 0%;
  min-width: 0;
  margin-top: var(--navbar-height);
  margin-left: var(--sidebar-width);
  height: calc(100vh - var(--navbar-height));
  max-height: calc(100vh - var(--navbar-height));
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  min-height: 0;
}
.app-main.sidebar-collapsed {
  margin-left: 0;
}

/* ============================================
   聊天区域
   ============================================ */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
}

.chat-messages {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 欢迎屏幕 */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 20px;
  padding: 40px 24px;
}

.welcome-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: white;
  box-shadow: 0 4px 20px rgba(0, 115, 255, 0.35);
}

.welcome-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.welcome-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.6;
}

.welcome-suggestions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 560px;
  margin-top: 8px;
}

.suggestion-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  background: var(--bg-card);
}
.suggestion-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.suggestion-card .card-icon { font-size: 1.1rem; margin-bottom: 6px; }
.suggestion-card .card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

/* ============================================
   消息气泡
   ============================================ */
.message-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.message-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}
.message-avatar.user {
  background: var(--primary);
  color: white;
}
.message-avatar.assistant {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.message-body { flex: 1; min-width: 0; }

.message-author {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.message-content {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message-content.user-content {
  background: var(--user-bubble);
  padding: 12px 16px;
  border-radius: var(--input-radius);
  display: inline-block;
  max-width: 85%;
}

.message-content.assistant-content {
  /* 助手回复不用气泡，直接铺开 */
}

/* 光标闪烁动画 */
.typing-cursor::after {
  content: '▋';
  animation: blink 1s step-end infinite;
  color: var(--primary);
  font-size: 0.9rem;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================================
   深度思考面板
   ============================================ */
.thinking-panel {
  background: var(--thinking-bg);
  border: 1px solid var(--thinking-border);
  border-radius: var(--card-radius);
  overflow: hidden;
  margin-bottom: 12px;
}

.thinking-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
}
.thinking-header:hover { background: rgba(34, 197, 94, 0.08); }

.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.thinking-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--thinking-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  flex-shrink: 0;
}
.thinking-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--thinking-text);
}
.thinking-status {
  font-size: 0.75rem;
  color: var(--thinking-text);
  opacity: 0.7;
}

/* 思考中旋转动画 */
.thinking-icon.spinning {
  animation: spin 1.2s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.thinking-chevron {
  font-size: 12px;
  color: var(--thinking-text);
  transition: transform 0.2s ease;
}
.thinking-panel.collapsed .thinking-chevron {
  transform: rotate(-90deg);
}

.thinking-body {
  padding: 0 14px 12px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 400px;
  opacity: 1;
}
.thinking-panel.collapsed .thinking-body {
  max-height: 0;
  opacity: 0;
  padding-bottom: 0;
}

.thinking-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  border-left: 2px solid var(--thinking-border);
  padding-left: 10px;
  margin-left: 4px;
}
.thinking-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--thinking-icon);
  margin-top: 7px;
  flex-shrink: 0;
  margin-left: -13px;
}
.thinking-step-text {
  font-size: 0.825rem;
  color: var(--thinking-text);
  line-height: 1.5;
  opacity: 0.9;
}

/* 思考中骨架动画 */
.thinking-loading {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
}
.thinking-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--thinking-icon);
  animation: thinking-pulse 1.4s ease-in-out infinite;
}
.thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking-pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ============================================
   输入区域
   ============================================ */
.input-area {
  padding: 16px 24px 24px;
  background: var(--bg-base);
  border-top: 1px solid var(--border);
}

.input-wrapper {
  max-width: 720px;
  margin: 0 auto;
}

.input-box {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--input-radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}
.input-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light), var(--shadow-sm);
}

.input-textarea {
  width: 100%;
  min-height: 52px;
  max-height: 200px;
  padding: 14px 16px 8px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: inherit;
  line-height: 1.6;
  resize: none;
  overflow-y: auto;
}
.input-textarea::placeholder { color: var(--text-muted); }

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 10px;
  gap: 8px;
}

.input-options {
  display: flex;
  align-items: center;
  gap: 6px;
}

.option-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}
.option-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.option-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.send-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: var(--transition-fast);
  flex-shrink: 0;
}
.send-btn:hover { background: var(--primary-hover); transform: scale(1.05); }
.send-btn:disabled {
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

.input-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ============================================
   进度条 / 加载动画
   ============================================ */
.progress-bar-wrap {
  height: 3px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #4ade80);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.progress-bar-fill.indeterminate {
  width: 60% !important;
  animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

/* ============================================
   模态框 / 对话框
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
  transition: var(--transition-fast);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================
   表单组件
   ============================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}
.form-hint { font-size: 0.775rem; color: var(--text-muted); }

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { min-height: 100px; resize: vertical; }

/* ============================================
   按钮组件
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  font-family: inherit;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary-active));
  box-shadow: 0 4px 14px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-outline {
  background: none;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: none;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ============================================
   Toast 通知
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  color: var(--text-primary);
  max-width: 340px;
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error { border-left: 3px solid var(--danger); }
.toast.toast-info { border-left: 3px solid var(--info); }
.toast.toast-warning { border-left: 3px solid var(--warning); }

.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.4; }

/* Toast 操作按钮 */
.toast-actions {
  display: flex;
  gap: 6px;
  margin-left: 8px;
  flex-shrink: 0;
}
.toast-action-btn {
  background: none;
  border: 1px solid currentColor;
  color: inherit;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.15s;
  white-space: nowrap;
  text-align: center;
}
.toast-action-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,0.12);
}

/* ============================================
   认证页面（登录/注册）
   ============================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef5ff 0%, #f0f9ff 50%, #f5faff 100%);
  padding: 24px;
  overflow: auto;
}

.auth-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #0073FF, #0052CC);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(0, 115, 255, 0.35);
}
.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-error {
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.875rem;
  margin-bottom: 16px;
  display: none;
}
.auth-error.show { display: block; }

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.auth-footer a {
  color: var(--primary);
  font-weight: 500;
}
.auth-footer a:hover { text-decoration: underline; }

/* ============================================
   方案管理工作台（保留核心功能）
   ============================================ */
.workspace-layout {
  display: flex;
  height: calc(100vh - var(--navbar-height));
  overflow: hidden;
}

.workspace-sidebar {
  width: 300px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-sidebar);
}

.workspace-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  background: var(--bg-base);
}

.section-panel {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

.tree-node {
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-fast);
}
.tree-node:hover { background: var(--bg-hover); }
.tree-node.selected { background: var(--primary-light); }

.tree-node-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
}
.tree-toggle {
  width: 16px;
  height: 16px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.tree-toggle.open { transform: rotate(90deg); }

.tree-label {
  font-size: 0.825rem;
  color: var(--text-primary);
  flex: 1;
}
.tree-label.has-content { color: var(--primary); }

/* 内容编辑器 */
.content-editor-area {
  flex: 1;
  padding: 20px;
  overflow: auto;
}

#content-editor {
  width: 100%;
  height: 100%;
  min-height: 300px;
  border: 1.5px solid var(--border);
  border-radius: var(--card-radius);
  padding: 16px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-card);
  resize: none;
  outline: none;
  line-height: 1.7;
  transition: border-color 0.15s ease;
}
#content-editor:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
    --navbar-height: 52px;
  }

  .app-sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }
  .app-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .app-main {
    margin-left: 0 !important;
  }

  .chat-messages { padding: 0 16px; }
  .input-area { padding: 12px 16px 20px; }

  .welcome-suggestions {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .auth-card {
    padding: 28px 24px;
    border-radius: var(--radius-lg);
  }

  .workspace-layout { flex-direction: column; }
  .workspace-sidebar {
    width: 100%;
    height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 480px) {
  .navbar-logo span { display: none; }
  .welcome-title { font-size: 1.4rem; }
  .modal-box { border-radius: var(--radius-md); }
}

/* ============================================
   打字效果 / 流式内容
   ============================================ */
.streaming-content { position: relative; }

.stream-placeholder {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* 代码块样式 */
.message-content pre {
  background: #1e1e2e;
  border-radius: var(--radius-md);
  padding: 16px;
  overflow-x: auto;
  margin: 12px 0;
  font-size: 0.85rem;
  line-height: 1.6;
  border: 1px solid #313244;
}

.message-content code {
  font-family: "Fira Code", "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: 0.85em;
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary);
}

.message-content pre code {
  background: none;
  padding: 0;
  color: #cdd6f4;
}

/* 分隔线 */
.message-divider {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 8px 0;
  position: relative;
}
.message-divider::before,
.message-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: var(--border);
}
.message-divider::before { left: 0; }
.message-divider::after { right: 0; }

/* ============================================
   三栏工作台布局（新版：项目/方案树 + 章节大纲 + 内容/识别）
   ============================================ */
.workspace-page {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 三栏容器 */
.ws-splitter {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* 左栏 - 项目/方案树列表 */
.ws-panel-left {
  width: 260px;
  min-width: 200px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-sidebar);
  min-height: 0;
}

/* 中栏 - 文档结构树 */
.ws-panel-center {
  width: 300px;
  min-width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-sidebar);
  min-height: 0;
}

/* 右栏 - 内容编辑区 / 识别界面 */
.ws-panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 400px;
  min-height: 0;
  max-height: 100%;
}

/* 面板头部 */
.panel-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.panel-header .header-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}
.panel-header select,
.panel-header input {
  width: 100%;
}

/* 面板内容区 */
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* 文档结构树 */
.section-tree {
  padding: 4px 0;
  user-select: none;
}

.tree-item {
  cursor: pointer;
}
.tree-item:hover > .tree-row { background: var(--bg-hover); }
.tree-item.selected > .tree-row {
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px 5px calc(8px + var(--tree-level, 0) * 16px);
  border-left: 3px solid transparent;
  transition: var(--transition-fast);
  min-height: 30px;
}

.tree-toggle-btn {
  width: 18px;
  height: 18px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--text-muted);
  flex-shrink: 0;
  border-radius: 4px;
  transition: transform 0.15s ease;
}
.tree-toggle-btn:hover { background: var(--bg-active); }
.tree-toggle-btn.expanded { transform: rotate(90deg); }

.tree-code {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 44px;
  flex-shrink: 0;
  font-family: var(--font-mono, monospace);
}

.tree-title {
  font-size: 0.825rem;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.tree-word-input {
  width: 56px;
  height: 22px;
  padding: 0 3px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.64rem;
  text-align: right;
  flex-shrink: 0;
}
.tree-word-input:focus {
  border-color: var(--primary);
  outline: none;
}
.tree-word-unit {
  font-size: 0.64rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.tree-badge {
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  flex-shrink: 0;
  margin-left: 4px;
  text-align: center;
}

/* 章节无内容时的空状态 */
.tree-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* 树子节点容器 */
.tree-children {
  overflow: hidden;
}
.tree-children.collapsed { display: none; }
.tree-empty .empty-icon { font-size: 2rem; margin-bottom: 8px; opacity: 0.5; }

/* 项目方案树样式 */
.project-group {
  margin-bottom: 2px;
}
.project-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  cursor: pointer;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.project-group-header:hover { background: var(--bg-hover); }
.project-group-header .pg-toggle {
  width: 16px; height: 16px; font-size: 9px; color: var(--text-muted);
  transition: transform 0.15s ease;
}
.project-group-header .pg-toggle.expanded { transform: rotate(90deg); }
.project-group-header .pg-name {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.project-group-header .pg-count {
  font-size: 0.65rem; color: var(--text-muted); flex-shrink: 0;
}
.project-group-header .pg-owner {
  font-size: 0.65rem; color: var(--text-muted); font-weight: 400; margin-left: 6px;
}
.project-group-children { overflow: hidden; }
.project-group-children.collapsed { display: none; }

.scheme-tree-item {
  display: flex;
  align-items: center;
  padding: 6px 12px 6px 28px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  gap: 6px;
}
.scheme-tree-item:hover { background: var(--bg-hover); }
.scheme-tree-item.active { background: var(--primary-light); border-left: 3px solid var(--primary); }
.scheme-tree-item .sti-icon {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--bg-input); display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); flex-shrink: 0; font-size: 0.7rem;
}
.scheme-tree-item .sti-info { flex: 1; min-width: 0; }
.scheme-tree-item .sti-name {
  font-size: 0.78rem; font-weight: 600; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.scheme-tree-item .sti-meta {
  font-size: 0.65rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.scheme-tree-item .sti-recognize-btn {
  font-size: 0.65rem; padding: 2px 6px; border: 1px solid var(--border);
  border-radius: 4px; background: var(--bg-card); color: var(--text-muted);
  cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.scheme-tree-item .sti-recognize-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* 识别界面样式 */
.recognition-view {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.recognition-view.active { display: flex; }

.recognition-header {
  padding: 10px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.recognition-header .rh-title {
  font-size: 0.85rem; font-weight: 600; color: var(--text-primary);
  flex: 1;
}
.recognition-header .rh-badge {
  font-size: 0.65rem; padding: 2px 8px; border-radius: var(--radius-md);
  background: var(--primary-light); color: var(--primary); text-align: center;
}

.recognition-controls {
  padding: 8px 14px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.recognition-files {
  padding: 8px 14px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  max-height: 180px;
  overflow-y: auto;
}

.rec-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 0.78rem;
}
.rec-file-item .rfi-icon { flex-shrink: 0; font-size: 1rem; }
.rec-file-item .rfi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.rec-file-item .rfi-status { font-size: 0.68rem; padding: 2px 6px; border-radius: var(--radius-sm); flex-shrink: 0; text-align: center; }

.recognition-result-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.recognition-result-editor {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-top: none;
  background: var(--bg-card);
}
.recognition-result-editor .ql-editor {
  min-height: 200px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.recognition-toolbar {
  padding: 6px 14px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--card-radius) var(--card-radius) 0 0;
}

/* 内容视图（与识别视图切换） */
.content-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.content-view.hidden { display: none; }

/* 工具栏 */
.ws-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  background: var(--bg-card);
}

.ws-toolbar .toolbar-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-right: 8px;
  white-space: nowrap;
}

.ws-toolbar .toolbar-spacer { flex: 1; }

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 5px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  font-family: inherit;
  font-weight: 500;
}
.toolbar-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.toolbar-btn .btn-icon { font-size: 1rem; }

.toolbar-btn.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.toolbar-btn.primary:hover { background: var(--primary-hover); }

.toolbar-btn.purple {
  background: #0d9488;
  color: white;
  border-color: #0d9488;
}
.toolbar-btn.purple:hover { background: #0f766e; }

.toolbar-btn.green {
  background: var(--success);
  color: white;
  border-color: var(--success);
}
.toolbar-btn.green:hover { background: #16a34a; }

.toolbar-btn.warning {
  background: var(--warning);
  color: white;
  border-color: var(--warning);
}
.toolbar-btn.warning:hover { background: #d97706; }

.toolbar-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 对抗训练配置面板 */
.adversarial-config {
  display: none;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #f0fdfa;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.adversarial-config.open { display: flex; }

@media (prefers-color-scheme: dark) {
  .adversarial-config { background: #0f1e1c; }
}
/* v8.1: 手动主题切换 — 组件级暗色同步 data-theme */
:root[data-theme="dark"] .adversarial-config { background: #0f1e1c; }

.adversarial-config label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.adversarial-config input[type="number"] {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.875rem;
  text-align: center;
}

/* 内容编辑器容器 */
.editor-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  position: relative;
  min-height: 0;
  max-height: 100%;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
}

.editor-header .section-breadcrumb {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

#content-editor-work {
  flex: 1;
  width: 100%;
  border: none;
  min-height: 0;
  padding: 16px 18px;
  font-size: 0.9rem;
  font-family: "SimSun", "宋体", "Noto Serif CJK SC", serif;
  color: var(--text-primary);
  background: var(--bg-card);
  resize: none;
  outline: none;
  line-height: 1.8;
  overflow-y: auto;
}

/* 设计参数区 */
.design-params {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
}

.design-params .param-item { display: flex; flex-direction: column; gap: 3px; }
.design-params .param-item label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}
.design-params .param-item input,
.design-params .param-item textarea {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
}
.design-params .param-item input:focus,
.design-params .param-item textarea:focus {
  border-color: var(--primary);
}

.design-params .param-full { grid-column: 1 / -1; }

/* 文件拖拽上传区 */
.drop-zone {
  margin: 10px 12px;
  padding: 20px 12px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.drop-zone .dz-icon { font-size: 2rem; margin-bottom: 6px; }
.drop-zone .dz-text { font-size: 0.8rem; color: var(--text-secondary); }
.drop-zone .dz-hint { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* 文件列表 */
.file-list-section { padding: 8px 12px; }
.file-list-section .fl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.file-list-section .fl-header span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
}
.file-item .fi-icon { flex-shrink: 0; font-size: 1.1rem; }
.file-item .fi-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}
.file-item .fi-status {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.fi-status.pending { background: var(--bg-input); color: var(--text-muted); }
.fi-status.processing { background: var(--primary-light); color: var(--primary); }
.fi-status.done { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.fi-status.error { background: rgba(239, 68, 68, 0.08); color: var(--danger); }

.file-item .fi-remove {
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.file-item .fi-remove:hover { background: var(--bg-hover); color: var(--danger); }

/* 分析结果显示区 */
.analysis-section {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}
.analysis-section .as-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.analysis-content {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  min-height: 60px;
}

.analysis-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.analysis-empty .ae-icon { font-size: 1.5rem; margin-bottom: 6px; opacity: 0.5; }

/* 间隔线（拖拽调整面板宽度） */
.resize-handle {
  width: 4px;
  cursor: col-resize;
  background: transparent;
  transition: background 0.2s;
  flex-shrink: 0;
}
.resize-handle:hover, .resize-handle.active {
  background: var(--primary);
}

/* 移动端 - 三栏切换为Tab */
.ws-mobile-tabs {
  display: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.ws-mobile-tab {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: inherit;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
}
.ws-mobile-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* 三栏响应式 */
@media (max-width: 1200px) {
  .ws-panel-left { width: 220px; }
  .ws-panel-center { width: 260px; }
}

@media (max-width: 1024px) {
  .ws-panel-center { display: none; }
  .ws-panel-center.mobile-show {
    display: flex;
    position: absolute;
    left: 220px;
    top: 0;
    bottom: 0;
    z-index: 200;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    width: 280px;
  }
  .ws-panel-right { min-width: 100%; }
}

@media (max-width: 768px) {
  .ws-panel-left { display: none; }
  .ws-panel-left.mobile-show {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 200;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    width: 280px;
  }
  .ws-panel-center { display: none; }
  .ws-panel-right { min-width: 100%; }
  .ws-mobile-tabs { display: flex; }
  .ws-toolbar { gap: 4px; padding: 8px 10px; }
  .toolbar-btn { padding: 6px 10px; font-size: 0.75rem; }
  .design-params { grid-template-columns: 1fr; }
}

/* 生成中进度提示 */
.generation-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  gap: 12px;
}
.generation-overlay.hidden { display: none; }

.generation-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.generation-overlay .gen-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ============================================
   Quill 富文本编辑器样式
   ============================================ */
.ql-editor-container {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--card-radius) var(--card-radius);
  min-height: 0;
}

.ql-editor-container .ql-editor {
  min-height: 300px;
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-primary);
  font-family: SimSun, 宋体, serif;
}

.ql-editor-container .ql-editor:focus {
  border-color: var(--border-focus);
}

/* Quill 工具栏 */
#quill-toolbar {
  border: 1px solid var(--border);
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  background: var(--bg-sidebar);
}

#quill-toolbar .ql-picker-label {
  color: var(--text-primary);
}

#quill-toolbar .ql-stroke {
  stroke: var(--text-secondary);
}

#quill-toolbar .ql-fill {
  fill: var(--text-secondary);
}

#quill-toolbar button:hover .ql-stroke {
  stroke: var(--primary);
}

/* Quill 编辑器中的图片 */
.ql-editor img {
  max-width: 100%;
  height: auto;
  margin: 8px 0;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}

/* Quill 编辑器中的表格 */
.ql-editor table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  /* 防止列宽崩溃、文字竖排：使用 fixed 布局，超出内容自动换行 */
  table-layout: auto;
  word-break: break-all;
  overflow-wrap: break-word;
}

.ql-editor table td,
.ql-editor table th {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
  font-size: 0.8rem;
  vertical-align: middle;
  /* 关键：允许换行、禁止强制单列极窄 */
  white-space: normal;
  word-break: break-all;
  overflow-wrap: break-word;
  min-width: 40px;
  max-width: 400px;
  line-height: 1.6;
}

/* 表头样式：标准 <th> + Quill 丢弃 th 后首行 <td> 兜底 */
.ql-editor table th,
.ql-editor table tr:first-child td {
  background: var(--bg-sidebar);
  font-weight: 600;
  color: var(--text-primary);
}

/* 表内表头强标签确保粗体 */
.ql-editor table tr:first-child td strong,
.ql-editor table tr:first-child td b {
  font-weight: 700;
}

/* ============================================
   Quill 富文本段落/标题/列表 — 与 Word 导出保持一致
   ============================================ */

/* 段落：每段之间有间距，文字自然换行 */
.ql-editor p {
  margin: 0 0 0.4em 0;
  line-height: 1.9;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;     /* 保留换行符，与 Word 段落一致 */
}

/* 空段落（仅 <br> 的段落）保持合理高度，不塌陷 */
.ql-editor p:empty,
.ql-editor p > br:only-child {
  min-height: 1.2em;
}

/* 标题层级对应 Word 样式 */
.ql-editor h1 { font-size: 1.4rem; font-weight: 700; margin: 1em 0 0.4em; line-height: 1.4; }
.ql-editor h2 { font-size: 1.2rem; font-weight: 700; margin: 0.9em 0 0.35em; line-height: 1.4; }
.ql-editor h3 { font-size: 1.05rem; font-weight: 700; margin: 0.8em 0 0.3em; line-height: 1.4; }
.ql-editor h4 { font-size: 0.95rem; font-weight: 600; margin: 0.7em 0 0.25em; line-height: 1.4; }
.ql-editor h5, .ql-editor h6 { font-size: 0.9rem; font-weight: 600; margin: 0.6em 0 0.2em; line-height: 1.4; }

/* 有序/无序列表 */
.ql-editor ol, .ql-editor ul {
  padding-left: 1.5em;
  margin: 0.3em 0 0.6em;
}
.ql-editor li {
  line-height: 1.8;
  margin-bottom: 0.2em;
  word-break: break-word;
}

/* 强制所有文本元素自动换行，防止溢出 */
.ql-editor * {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
  .ql-editor-container .ql-editor {
    color: var(--text-primary);
  }
  .ql-editor table td,
  .ql-editor table th {
    border-color: var(--border);
  }
  .ql-editor table th,
  .ql-editor table tr:first-child td {
    background: var(--bg-hover);
  }
}

/* 识别结果编辑器（小尺寸） */
.analysis-quill-editor {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
}

.analysis-quill-editor .ql-editor {
  min-height: 60px;
  max-height: 100%;
  overflow-y: auto;
  font-size: 0.78rem;
  line-height: 1.7;
  font-family: SimSun, 宋体, serif;
  color: var(--text-primary);
}

/* Quill 容器占满 flex 剩余空间，内部滚动 */
.analysis-quill-editor .ql-container {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.analysis-quill-editor .ql-container .ql-editor {
  min-height: 60px;
}

/* 深色模式 Quill 覆盖 */
.ql-snow .ql-editor pre.ql-syntax {
  background: #f4f4f5;
  color: #1a1a1a;
  overflow: visible;
}

@media (prefers-color-scheme: dark) {
  .ql-snow .ql-editor pre.ql-syntax {
    background: #2a2a2a;
    color: #ececec;
  }
}
/* v8.1: 手动主题切换 */
:root[data-theme="dark"] .ql-snow .ql-editor pre.ql-syntax {
  background: #2a2a2a;
  color: #ececec;
}

/* Quill 编辑器容器水平撑满 */
.editor-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* ============================================
   Lucide 图标系统
   ============================================ */
.icon-inline {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -2px;
  overflow: hidden;
}
/* 当 icon-inline 内没有 SVG（lucide 未渲染）时，折叠占位，使文字自动居中 */
.icon-inline:not(:has(> svg)) {
  width: 0;
  height: 0;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}
.icon-inline:empty {
  width: 0;
  height: 0;
  min-width: 0;
  flex-shrink: 1;
}
.icon-inline svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.navbar-link .icon-inline svg {
  width: 15px;
  height: 15px;
}
.sidebar-footer-item .icon-inline svg,
.user-menu-item .icon-inline svg {
  width: 16px;
  height: 16px;
}
.stat-icon .icon-inline svg {
  width: 22px;
  height: 22px;
}
.session-icon .icon-inline svg {
  width: 14px;
  height: 14px;
}
.feature-card .icon-inline svg {
  width: 24px;
  height: 24px;
}
.card-icon .icon-inline svg {
  width: 26px;
  height: 26px;
}

/* ============================================
   Tab 导航组件
   ============================================ */
.tab-nav {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn{
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.tab-btn .icon-inline svg {
  width: 15px;
  height: 15px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: tabFadeIn 0.25s ease; }

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   统计卡片区
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.stat-card .sc-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card .sc-icon.blue { background: linear-gradient(135deg, #E6F0FF, #C8E0FF); color: var(--primary); }
.stat-card .sc-icon.green { background: linear-gradient(135deg, #f0fdf4, #dcfce7); color: #10b981; }
.stat-card .sc-icon.orange { background: linear-gradient(135deg, #fff7ed, #ffedd5); color: #FF8C00; }
.stat-card .sc-icon.purple { background: linear-gradient(135deg, #f5f3ff, #ede9fe); color: #8b5cf6; }
.stat-card .sc-icon .icon-inline svg { width: 22px; height: 22px; }

/* v9.9: `.stat-value` / `.stat-label` 此前**从未定义**（settings.html 用了 13 处），
   于是「本月总 Token」这类数值卡：数字按默认字号渲染、标签也按默认字号，
   且 `.stat-card` 是 flex **横排**（为「图标 + 文字块」设计）—— 数字与标签
   被并排挤在一行。补定义，并提供纵向排布的 `.stat-card.stacked`。
   原先各处用内联 `style="font-size:1.4rem;font-weight:700;"` 硬撑，一并去掉。 */
.stat-card.stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}
/* 次级卡（管理面板里的"总记录数/最早记录"等）：数值本身是日期串，用正文号 */
.stat-card.stacked .stat-value.is-text {
  font-size: 0.9rem;
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  .stat-card .sc-icon.blue { background: rgba(0, 115, 255, 0.15); }
  .stat-card .sc-icon.green { background: rgba(16, 185, 129, 0.15); }
  .stat-card .sc-icon.orange { background: rgba(255, 140, 0, 0.15); }
  .stat-card .sc-icon.purple { background: rgba(139, 92, 246, 0.15); }
}
/* v8.1: 手动主题切换 */
:root[data-theme="dark"] .stat-card .sc-icon.blue { background: rgba(0, 115, 255, 0.15); }
:root[data-theme="dark"] .stat-card .sc-icon.green { background: rgba(16, 185, 129, 0.15); }
:root[data-theme="dark"] .stat-card .sc-icon.orange { background: rgba(255, 140, 0, 0.15); }
:root[data-theme="dark"] .stat-card .sc-icon.purple { background: rgba(139, 92, 246, 0.15); }

.stat-card .sc-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.stat-card .sc-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================
   方案卡片网格
   ============================================ */
.scheme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.scheme-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  cursor: default;
}
.scheme-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--primary-light);
  border-color: var(--primary);
}
.scheme-card-bar {
  height: 4px;
  border-radius: 0;
}
.scheme-card-bar.status-processing { background: linear-gradient(90deg, #4DA3FF, #0073FF); }
.scheme-card-bar.status-completed { background: linear-gradient(90deg, #10b981, #06b6d4); }
.scheme-card-bar.status-draft { background: linear-gradient(90deg, #f59e0b, #FF8C00); }

.scheme-card-body {
  padding: 18px 20px;
}
.scheme-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.scheme-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 10px;
}
.scheme-status {
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}
.scheme-status.status-processing { background: var(--primary-light); color: var(--primary); }
.scheme-status.status-completed { background: #d1fae5; color: #065f46; }
.scheme-status.status-draft { background: #fef3c7; color: #92400e; }

@media (prefers-color-scheme: dark) {
  .scheme-status.status-processing { background: rgba(0, 115, 255, 0.2); }
  .scheme-status.status-completed { background: rgba(34, 197, 94, 0.2); }
  .scheme-status.status-draft { background: rgba(249, 115, 22, 0.2); }
}
/* v8.1: 手动主题切换 */
:root[data-theme="dark"] .scheme-status.status-processing { background: rgba(0, 115, 255, 0.2); }
:root[data-theme="dark"] .scheme-status.status-completed { background: rgba(34, 197, 94, 0.2); }
:root[data-theme="dark"] .scheme-status.status-draft { background: rgba(249, 115, 22, 0.2); }

.scheme-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.scheme-card-score{
  display: flex;
  align-items: center; justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}
.score-ring {
  width: 44px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
}
.score-ring svg {
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
}
.score-ring-bg { fill: none; stroke: var(--bg-input); stroke-width: 4; }
.score-ring-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}
.score-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
}
.score-ring-text small { font-size: 0.6rem; font-weight: 400; color: var(--text-muted); }

.score-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.score-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.score-bar-label { width: 52px; flex-shrink: 0; }
.score-bar-track {
  flex: 1;
  height: 5px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.score-bar-value { width: 28px; text-align: right; flex-shrink: 0; color: var(--text-muted); }

.scheme-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.scheme-card-actions .btn {
  flex: 1;
  justify-content: center;
  font-size: 0.78rem;
  padding: 6px 10px;
}

/* ============================================
   训练记录卡片
   ============================================ */
.record-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.record-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 14px 18px;
  transition: var(--transition-fast);
  cursor: pointer;
}
.record-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}
.record-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.record-section {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-iteration {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-muted);
  flex-shrink: 0;
}
.record-score {
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 52px;
  text-align: right;
}
.record-score.high { color: var(--success); }
.record-score.medium { color: var(--warning); }
.record-score.low { color: var(--danger); }

.record-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.record-detail {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.record-card.expanded .record-detail { display: block; }
.record-card.expanded { cursor: default; }

.record-dimensions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.record-dim-item {
  text-align: center;
}
.record-dim-value {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.record-dim-value.high { color: var(--success); }
.record-dim-value.medium { color: var(--warning); }
.record-dim-value.low { color: var(--danger); }
.record-dim-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ============================================
   筛选/搜索栏
   ============================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-bar select,
.filter-bar input {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.filter-bar select:focus,
.filter-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.filter-bar input[type="search"] { min-width: 200px; }
.filter-bar select { min-width: 140px; }

/* ============================================
   设置页 Tab 样式
   ============================================ */
.settings-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.settings-tab-btn{
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}
.settings-tab-btn:hover { color: var(--text-secondary); }
.settings-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.settings-tab-panel { display: none; }
.settings-tab-panel.active { display: block; animation: tabFadeIn 0.25s ease; }

/* ============================================
   导出中心样式
   ============================================ */
.export-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.export-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  transition: var(--transition-fast);
}
.export-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--primary-light);
}
.export-item-info {
  flex: 1;
  min-width: 0;
}
.export-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.export-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.export-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ============================================
   文本工具类
   ============================================ */
/* v9.9: `.text-muted` 此前**从未定义**（settings.html 里用了 26 处）——
   那些"说明文字"一直按正文色、正文号渲染，是设置页视觉噪声的主因之一。
   本项目里它只被 settings.html 使用，补定义的影响面仅限该页。 */
.text-muted { color: var(--text-muted); }

/* ============================================
   全宽页面覆盖（隐藏侧边栏的页面）
   ============================================ */
.page-fullwidth .app-layout { display: block; }
.page-fullwidth .app-sidebar { display: none !important; }
.page-fullwidth .app-main {
  margin-left: 0 !important;
}

/* ============================================
   空状态优化
   ============================================ */
.empty-state-premium {
  text-align: center;
  padding: 60px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.empty-state-premium .es-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.empty-state-premium .es-icon .icon-inline svg {
  width: 26px;
  height: 26px;
}
.empty-state-premium .es-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.empty-state-premium .es-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ============================================
   Toast 图标优化（移除 Emoji）
   ============================================ */
.toast-icon-outer {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.toast-icon-outer.success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.toast-icon-outer.error { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.toast-icon-outer.info { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.toast-icon-outer.warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.toast-icon-outer svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

/* ============================================
   响应式补丁
   ============================================ */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .scheme-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .record-dimensions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .scheme-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar input[type="search"] { min-width: auto; }
  .scheme-card-actions { opacity: 1; }
}

/* ============================================
   高端增强 - 骨架屏 / 动画 / 工具类
   ============================================ */

/* 骨架屏 shimmer */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-hover) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
.skel-line { height: 14px; margin-bottom: 8px; }
.skel-block { height: 80px; border-radius: var(--card-radius); }

/* 入场动画 */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.anim-in { animation: fadeInUp 0.4s var(--ease-out) both; }
.anim-scale { animation: scaleIn 0.3s var(--ease-out) both; }
.anim-delay-1 { animation-delay: 0.05s; }
.anim-delay-2 { animation-delay: 0.1s; }
.anim-delay-3 { animation-delay: 0.15s; }
.anim-delay-4 { animation-delay: 0.2s; }
.anim-delay-5 { animation-delay: 0.25s; }
.anim-delay-6 { animation-delay: 0.3s; }

/* 数字等宽 */
.tabular { font-variant-numeric: tabular-nums; font-family: 'Inter', sans-serif; }

/* 高端卡片悬浮 */
.scheme-card:hover, .stat-card:hover, .feature-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--primary-light);
}

/* 输入框聚焦增强 */
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

/* 渐变文字 */
.grad-text {
  background: linear-gradient(135deg, #0073FF, #0052CC);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 自定义 select 箭头 */
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ============================================
   v2.1 全局视觉增强 — 高端仪表盘配套
   ============================================ */

/* 页面载入渐入动画 */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.app-main > * {
  animation: pageFadeIn 0.4s var(--ease-out);
}

/* 导航栏 Logo 增强调 */
.navbar-logo {
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.navbar-logo .logo-icon {
  box-shadow: 0 4px 14px rgba(0, 115, 255, 0.30);
}

/* 导航栏链接活跃态增强 */
.navbar-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 115, 255, 0.12);
}

/* 全局卡片悬浮增强（覆盖旧规则） */
.scheme-card:hover, .stat-card:hover {
  border-color: var(--primary);
}

/* 渐变装饰背景 */
.gradient-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(0,115,255,0.03) 0%, transparent 50%, rgba(0,115,255,0.02) 100%);
  pointer-events: none;
  z-index: 0;
}

/* 隐藏滚动条但保持滚动 */
.scrollbar-hide {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* 交错动画延迟 */
.anim-delay-1 { animation-delay: 0.05s; }
.anim-delay-2 { animation-delay: 0.10s; }
.anim-delay-3 { animation-delay: 0.15s; }
.anim-delay-4 { animation-delay: 0.20s; }
.anim-delay-5 { animation-delay: 0.25s; }
.anim-delay-6 { animation-delay: 0.30s; }

/* 玻璃态卡片 */
.glass-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ============================================
   v9.14 工程控制台语言（界面专业感升级）
   ------------------------------------------------------------
   设计稿的四条判断：emoji 当图标 / 通用 SaaS 模板感 / 信息密度过低 /
   状态不可见。本节提供替代语言的**共用原子**，各页面只组合、不重复定义：
     · 发丝线分层（border）替代大圆角 + 重阴影
     · 唯一的强调色 --primary；状态色只出现在徽章/状态点上
     · 标签 11px 大写间距，数字一律 tabular-nums
   注意：色板不变（用户要求保留现有主题色）。
   ============================================ */

/* 数字：等宽对齐，评分/计数不跳动 */
.num, .rp-score-value, .kpi-value, .stat-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---- 状态徽章：唯一允许使用状态色的地方 ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  font-size: var(--fs-11);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge.no-dot::before { display: none; }
.badge--ok      { color: #15803D; background: #F0FDF4; border-color: #BBF7D0; }
.badge--warn    { color: #B45309; background: #FFFBEB; border-color: #FDE68A; }
.badge--bad     { color: #B91C1C; background: #FEF2F2; border-color: #FECACA; }
.badge--info    { color: var(--primary); background: var(--primary-light); border-color: var(--blue-100); }
.badge--neutral { color: var(--text-secondary); background: var(--bg-input); border-color: var(--border); }

/* 暗色下徽章改用半透明底色，避免整块浅色在深色卡片上过亮 */
:root[data-theme="dark"] .badge--ok      { color: #4ADE80; background: rgba(22, 163, 74, 0.16); border-color: rgba(22, 163, 74, 0.35); }
:root[data-theme="dark"] .badge--warn    { color: #FBBF24; background: rgba(245, 158, 11, 0.16); border-color: rgba(245, 158, 11, 0.35); }
:root[data-theme="dark"] .badge--bad     { color: #F87171; background: rgba(220, 38, 38, 0.16); border-color: rgba(220, 38, 38, 0.35); }
:root[data-theme="dark"] .badge--info    { color: #60A5FA; background: rgba(0, 115, 255, 0.18); border-color: rgba(0, 115, 255, 0.38); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge--ok   { color: #4ADE80; background: rgba(22, 163, 74, 0.16); border-color: rgba(22, 163, 74, 0.35); }
  :root:not([data-theme="light"]) .badge--warn { color: #FBBF24; background: rgba(245, 158, 11, 0.16); border-color: rgba(245, 158, 11, 0.35); }
  :root:not([data-theme="light"]) .badge--bad  { color: #F87171; background: rgba(220, 38, 38, 0.16); border-color: rgba(220, 38, 38, 0.35); }
  :root:not([data-theme="light"]) .badge--info { color: #60A5FA; background: rgba(0, 115, 255, 0.18); border-color: rgba(0, 115, 255, 0.38); }
}

/* ---- 分段控件（视图切换 / 筛选） ---- */
.seg {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  gap: 2px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.seg-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 4px;
  font-size: var(--fs-12);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}
.seg-item:hover { color: var(--text-primary); }
.seg-item.active {
  background: var(--bg-card);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ---- 指标块：数值在上、标签在下（无大卡片） ---- */
.kpi-row {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.kpi {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--border);
}
.kpi:last-child { border-right: 0; }
.kpi-value {
  font-size: var(--fs-17);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}
.kpi-label {
  margin-top: 2px;
  font-size: var(--fs-11);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ---- 细进度条 ---- */
.bar {
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.4s var(--ease-out);
}
.bar--ok > i { background: var(--success); }
.bar--warn > i { background: var(--warning); }
.bar--bad > i { background: var(--danger); }

/* ---- 左侧主导航（统一入口：侧栏） ---- */
.side-nav {
  padding: 10px 8px 6px;
  border-bottom: 1px solid var(--border);
}
.side-nav-label {
  padding: 4px 10px 6px;
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.side-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
}
.side-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.side-nav-item .icon-inline svg { width: 16px; height: 16px; stroke-width: 1.8; }
.side-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.side-nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 1px;
  background: var(--primary);
}
.side-nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: var(--fs-11);
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

/* ---- 侧栏「最近方案」：次要信息，压低视觉权重 ---- */
.side-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 4px;
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ---- 页面级控制台头（列表页共用） ---- */
.console-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.console-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-22);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.25;
}
.console-sub {
  margin-top: 4px;
  font-size: var(--fs-13);
  color: var(--text-secondary);
}

/* ---- 筛选条（列表页共用） ---- */
.filter-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-wrap: wrap;
}
.filter-strip .field {
  height: 30px;
  min-width: 140px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: var(--fs-12);
  font-family: inherit;
  outline: none;
}
.filter-strip .field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.filter-strip .field::placeholder { color: var(--text-muted); }

/* ---- 密集表格 ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-13);
}
.data-table th {
  height: 34px;
  padding: 0 12px;
  text-align: left;
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr.is-selected { background: var(--primary-light); }
.data-table .cell-main {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--text-primary);
}
.data-table .cell-sub {
  margin-top: 2px;
  font-size: var(--fs-11);
  color: var(--text-muted);
}
