/* ===== AI Data 智能体 全局样式 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 背景层级 */
  --bg: #F1F4F7;              /* 页面底色（浅灰） */
  --bg-card: #F8F9FC;          /* 卡片内浅底色 */
  --surface: #FFFFFF;          /* 白色卡片/面板 */
  --surface2: #F7F8FA;        /* 次级面板底色 */

  /* 边框 */
  --border: rgba(0,0,0,0.06);
  --border-md: rgba(0,0,0,0.10);
  --border-strong: rgba(0,0,0,0.14);

  /* 文字 */
  --text: #1D2129;             /* 主文字 */
  --text-2: #4E5969;           /* 次级文字 */
  --text-3: #86909C;           /* 辅助文字 */
  --text-4: #C9CDD4;           /* 占位/禁用文字 */

  /* 品牌色（KYLIGENCE 蓝） */
  --blue: #2B5FED;
  --blue-dark: #1A4BD0;
  --blue-bg: #E8F0FE;
  --blue-light: #B0CCFB;

  /* 语义色 */
  --purple: #6C5CE7;
  --purple-bg: #EDEBFD;
  --green: #22B07D;
  --green-bg: #E8F8F2;
  --orange: #F7A23B;
  --orange-bg: #FEF3E5;
  --red: #EF5350;
  --red-bg: #FDECEC;
  --gray-bg: #F2F3F5;

  /* 顶部导航栏 */
  --navy: #1E293B;
  --navy-hover: #2D3A4E;

  /* 圆角 */
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 10px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.08);

  /* 布局 */
  --sidebar-w: 220px;
  --topbar-h: 48px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  font-size: 14px; color: var(--text);
  background: var(--bg); line-height: 1.6;
  height: 100vh; overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app { height: 100vh; }

/* ===== 登录页 ===== */
.login-container {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; background: linear-gradient(135deg, #E8F0FE 0%, #F1F4F7 50%, #F8F9FC 100%);
}
.login-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 48px 40px; width: 400px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 36px; }
.logo-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--blue); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600; margin-bottom: 14px;
}
.login-logo h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.3px; }
.login-logo p { color: var(--text-3); font-size: 13px; margin-top: 6px; }
.login-hint { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 18px; }

/* ===== 布局 ===== */
.app-layout { display: flex; height: 100vh; }

.sidebar {
  width: var(--sidebar-w); background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0; box-shadow: var(--shadow-sm);
}
.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px; color: var(--text);
}
.logo-icon-sm {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; flex-shrink: 0;
}
.sidebar-nav { flex: 1; padding: 10px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-2); transition: all 0.15s;
  font-size: 13.5px; margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-card); color: var(--text); }
.nav-item.active { background: var(--blue-bg); color: var(--blue); font-weight: 500; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer {
  padding: 14px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.user-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue-bg); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 11px; color: var(--text-3); }
.btn-logout {
  background: none; border: 1px solid var(--border-md);
  border-radius: var(--radius-sm); padding: 5px 10px; font-size: 12px;
  cursor: pointer; color: var(--text-3);
  transition: all 0.15s;
}
.btn-logout:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }

.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.main-content > #page-content { flex: 1; overflow-y: auto; }
.page-container { padding: 28px 32px; max-width: 1280px; }

/* ===== 页头 ===== */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h2 { font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: -0.3px; }
.page-subtitle { color: var(--text-3); font-size: 13px; display: block; margin-top: 4px; }

/* ===== 按钮 ===== */
.btn-primary {
  background: var(--blue); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 9px 18px; cursor: pointer;
  font-size: 13.5px; font-weight: 500;
  transition: all 0.15s; box-shadow: 0 1px 3px rgba(43,95,237,0.25);
}
.btn-primary:hover { background: var(--blue-dark); box-shadow: 0 2px 8px rgba(43,95,237,0.35); }
.btn-secondary {
  background: var(--surface); border: 1px solid var(--border-md);
  border-radius: var(--radius-sm); padding: 9px 18px; cursor: pointer;
  font-size: 13.5px; color: var(--text-2); transition: all 0.15s;
}
.btn-secondary:hover { background: var(--bg-card); border-color: var(--border-strong); }
.btn-sm {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 12px;
  font-size: 12px; cursor: pointer; color: var(--text-2); transition: all 0.15s;
}
.btn-sm:hover { background: var(--bg-card); color: var(--text); border-color: var(--border-md); }
.btn-sm.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-sm.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm.btn-danger:hover { background: #d32f2f; border-color: #d32f2f; }
.btn-full { width: 100%; padding: 11px; font-size: 15px; }
.btn-danger { background: var(--red); color: #fff; border: none; }
.btn-danger:hover { background: #d32f2f; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.form-group label em { color: var(--red); font-style: normal; }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }
input, select, textarea {
  width: 100%; border: 1px solid var(--border-md);
  border-radius: var(--radius-sm); padding: 9px 13px;
  font-size: 13.5px; background: var(--surface);
  color: var(--text); font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(43,95,237,0.1);
}
.error-msg {
  background: var(--red-bg); color: var(--red);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 13px; margin-bottom: 14px;
}
.search-input { width: 240px; }

/* ===== 卡片 ===== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text); }

/* ===== 仪表盘/统计数字 ===== */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-blue { background: var(--blue-bg); color: var(--blue); }
.stat-green { background: var(--green-bg); color: var(--green); }
.stat-orange { background: var(--orange-bg); color: var(--orange); }
.stat-gray { background: var(--gray-bg); color: var(--text-2); }
.stat-value { font-size: 26px; font-weight: 600; line-height: 1.2; }
.stat-label { font-size: 12.5px; color: var(--text-3); }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ===== 指标列表（仪表盘）===== */
.metric-list { display: flex; flex-direction: column; gap: 8px; }
.metric-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 0.5px solid var(--border);
}
.metric-item:last-child { border-bottom: none; }
.metric-item-left { display: flex; align-items: center; gap: 8px; }
.metric-name { font-size: 13.5px; font-weight: 500; }
.metric-code { font-size: 11px; color: var(--text-3); font-family: monospace; }

/* ===== 历史（仪表盘）===== */
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item { display: flex; gap: 10px; align-items: flex-start; }
.history-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 5px;
  flex-shrink: 0;
}
.datasource { background: var(--blue); }
.metric { background: var(--purple); }
.approval { background: var(--green); }
.system { background: var(--text-3); }
.history-action { font-size: 13px; }
.history-target { color: var(--blue); font-weight: 500; }
.history-time { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ===== 快速入口 ===== */
.quick-actions { display: flex; gap: 12px; }
.quick-btn {
  flex: 1; background: var(--surface2); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  text-align: center; cursor: pointer;
  transition: all 0.15s;
}
.quick-btn:hover { background: var(--blue-bg); border-color: var(--blue-light); }
.qb-icon { font-size: 22px; margin-bottom: 8px; color: var(--blue); }
.qb-label { font-size: 13px; color: var(--text-2); }

/* ===== 标签 ===== */
.tag {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: 11.5px; font-weight: 500;
}
.tag-blue { background: var(--blue-bg); color: var(--blue); }
.tag-purple { background: var(--purple-bg); color: var(--purple); }
.tag-orange { background: var(--orange-bg); color: var(--orange); }
.tag-gray { background: var(--gray-bg); color: var(--text-2); }
.tag-unit { background: var(--green-bg); color: var(--green); }

/* ===== 状态徽章 ===== */
.status-badge {
  padding: 2px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 500;
}
.status-draft { background: var(--gray-bg); color: var(--text-2); }
.status-reviewing, .status-pending { background: var(--orange-bg); color: var(--orange); }
.status-published, .status-approved, .status-active, .status-connected { background: var(--green-bg); color: var(--green); }
.status-rejected { background: var(--red-bg); color: var(--red); }

/* ===== 过滤栏 ===== */
.filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.filter-tabs { display: flex; gap: 4px; }
.filter-tab {
  background: none; border: 0.5px solid var(--border);
  border-radius: 6px; padding: 5px 12px;
  font-size: 13px; cursor: pointer; color: var(--text-2);
}
.filter-tab.active { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-light); }

/* ===== 数据源 ===== */
.source-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.source-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.source-card.add-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-3); min-height: 200px;
  border-style: dashed;
}
.add-card:hover { background: var(--surface2); color: var(--text-2); }
.add-icon { font-size: 28px; margin-bottom: 8px; }
.source-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.source-icon { font-size: 24px; }
.source-name { font-size: 14px; font-weight: 500; }
.source-type { font-size: 12px; color: var(--text-3); }
.source-info { flex: 1; }
.source-meta { margin-bottom: 10px; }
.meta-row {
  display: flex; justify-content: space-between;
  font-size: 12.5px; padding: 3px 0;
  border-bottom: 0.5px solid var(--border);
  color: var(--text-2);
}
.meta-row:last-child { border-bottom: none; }
.source-columns { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.col-tag { background: var(--blue-bg); color: var(--blue); padding: 1px 7px; border-radius: 3px; font-size: 11px; }
.source-actions { display: flex; gap: 6px; margin-top: 10px; }

/* ===== 指标卡片 ===== */
.metrics-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.metric-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.metric-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 8px;
}
.metric-card-title { display: flex; align-items: center; gap: 8px; }
.metric-card-title h3 { font-size: 14px; font-weight: 500; }
.metric-code-badge {
  font-family: monospace; font-size: 12px;
  background: var(--gray-bg); color: var(--text-2);
  padding: 1px 8px; border-radius: 4px;
  display: inline-block; margin-bottom: 6px;
}
.metric-desc { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.metric-formula {
  background: var(--surface2); border: 0.5px solid var(--border);
  border-radius: 6px; padding: 8px 10px; margin-bottom: 10px;
}
.formula-label { font-size: 11px; color: var(--text-3); display: block; margin-bottom: 4px; }
.metric-formula code { font-size: 12px; color: var(--purple); }
.metric-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.metric-footer {
  display: flex; gap: 16px; font-size: 12px; color: var(--text-3);
  margin-bottom: 10px;
}
.metric-actions { display: flex; gap: 6px; }
.empty-state {
  text-align: center; padding: 40px; color: var(--text-3);
  font-size: 14px;
}

/* ===== 审批 ===== */
.approval-stats { display: flex; gap: 8px; align-items: center; }
.stat-pill {
  padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 500;
}
.stat-orange { background: var(--orange-bg); color: var(--orange); }
.stat-green { background: var(--green-bg); color: var(--green); }
.approval-section { }
.section-title { font-size: 15px; font-weight: 500; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.badge-count {
  background: var(--orange-bg); color: var(--orange);
  border-radius: 20px; padding: 1px 8px; font-size: 12px;
}
.approval-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.approval-card.pending { border-left: 3px solid var(--orange); }
.approval-card.approved { border-left: 3px solid var(--green); }
.approval-card.rejected { border-left: 3px solid var(--red); }
.approval-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.approval-metric-info { display: flex; align-items: center; gap: 8px; }
.approval-metric-info h4 { font-size: 14px; font-weight: 500; }
.approval-metric-detail {
  background: var(--surface2); border-radius: 6px; padding: 10px;
  margin-bottom: 10px;
}
.approval-info {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: 12.5px; color: var(--text-2); margin-bottom: 10px;
}
.approval-comment {
  background: var(--gray-bg); border-radius: 6px; padding: 8px 12px;
  font-size: 13px; color: var(--text-2); margin-bottom: 10px;
}
.approval-comment.review { background: var(--blue-bg); color: var(--blue); font-style: italic; }
.approval-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ===== 历史时间线 ===== */
.history-timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex; gap: 14px; padding: 12px 0;
  border-bottom: 0.5px solid var(--border);
  align-items: flex-start;
}
.timeline-dot {
  width: 10px; height: 10px; border-radius: 50%;
  margin-top: 4px; flex-shrink: 0;
}
.hist-gray { background: var(--text-3); }
.hist-blue { background: var(--blue); }
.hist-purple { background: var(--purple); }
.hist-green { background: var(--green); }
.timeline-content { flex: 1; }
.timeline-header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; }
.timeline-module {
  background: var(--gray-bg); color: var(--text-2);
  padding: 1px 6px; border-radius: 3px; font-size: 11px;
}
.timeline-user { color: var(--blue); }
.timeline-target { color: var(--purple); font-weight: 500; }
.timeline-time { color: var(--text-3); font-size: 12px; margin-left: auto; }
.timeline-detail { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.history-total { font-size: 13px; color: var(--text-3); }

/* ===== 场景 ===== */
.scenarios-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.scenario-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.scenario-card.add-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-3); min-height: 200px; border-style: dashed;
}
.add-card:hover { background: var(--surface2); }
.scenario-icon { font-size: 28px; color: var(--blue); margin-bottom: 10px; display: block; }
.scenario-card h3 { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.scenario-card p { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.scenario-metrics, .scenario-keywords { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.scenario-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 12px; border-top: 0.5px solid var(--border);
  font-size: 12px; color: var(--text-3);
}

/* ===== AI 问数（KYLIGENCE 风格）===== */
.ai-query-page {
  padding: 0 !important; max-width: none !important;
  height: 100%; display: flex; flex-direction: column;
  background: var(--bg);
}

/* --- 问候区 --- */
.ai-greeting {
  padding: 28px 32px 0;
  display: flex; align-items: center; gap: 16px;
}
.ai-greeting-badge {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #FF6B9D 0%, #C44569 100%);
  color: #fff; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(255,107,157,0.3);
}
.ai-greeting-text {
  font-size: 16px; color: var(--text); font-weight: 500;
}
.ai-greeting-text span {
  color: var(--text-3); font-size: 14px; font-weight: 400;
}

/* --- Tab 导航 --- */
.ai-tabs-bar {
  display: flex; align-items: center; gap: 0;
  padding: 20px 32px 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.ai-tab {
  padding: 10px 22px; font-size: 14px; font-weight: 500;
  color: var(--text-2); cursor: pointer; border: none;
  background: none; position: relative; transition: all 0.15s;
  white-space: nowrap;
}
.ai-tab:hover { color: var(--text); }
.ai-tab.active {
  color: var(--blue); font-weight: 600;
}
.ai-tab.active::after {
  content: ''; position: absolute; bottom: -1px; left: 10px; right: 10px;
  height: 2.5px; background: var(--blue); border-radius: 2px;
}
.ai-tab-icon { margin-right: 4px; font-size: 15px; }

/* --- 内容区 --- */
.ai-content {
  flex: 1; overflow-y: auto; padding: 20px 32px;
}
.ai-subtitle {
  font-size: 13px; color: var(--text-3);
  margin-bottom: 16px; display: flex; justify-content: space-between;
  align-items: center;
}
.ai-refresh {
  font-size: 12px; color: var(--blue); cursor: pointer;
  background: none; border: none; padding: 2px 8px;
  border-radius: 4px; transition: background 0.15s;
}
.ai-refresh:hover { background: var(--blue-bg); }

/* --- 收藏列表卡片 --- */
.ai-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ai-row-list { display: flex; flex-direction: column; }
.ai-row {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  cursor: pointer; transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.ai-row:last-child { border-bottom: none; }
.ai-row:hover { background: var(--bg-card); }
.ai-row-left {
  flex: 1; min-width: 0; font-size: 14px;
  color: var(--text); display: flex; align-items: center; gap: 8px;
}
.ai-row-left .ai-row-icon { font-size: 16px; flex-shrink: 0; }
.ai-row-arrow {
  color: var(--text-3); font-size: 14px; flex-shrink: 0;
  margin: 0 4px;
}
.ai-row-right {
  flex: 1; min-width: 0; font-size: 13px; color: var(--text-2);
  text-align: left; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-row-right.muted { color: var(--text-3); }

/* --- 聊天消息（保留兼容） --- */
.ai-chat-area { flex: 1; overflow-y: auto; padding: 20px 32px; display: flex; flex-direction: column; gap: 16px; }

/* --- 底部输入区 --- */
.ai-input-footer {
  padding: 16px 32px 24px;
  background: var(--bg);
  flex-shrink: 0;
}
.ai-input-card {
  background: var(--surface); border: 1px solid var(--border-md);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 12px 16px; transition: border-color 0.2s, box-shadow 0.2s;
}
.ai-input-card:focus-within {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,95,237,0.1);
}
.ai-input-row {
  display: flex; align-items: flex-end; gap: 10px;
}
.ai-input-row textarea {
  flex: 1; resize: none; min-height: 36px; max-height: 100px;
  border: none; background: none; font-size: 14px; padding: 2px 0;
  font-family: inherit; color: var(--text);
  outline: none; box-shadow: none;
}
.ai-input-row textarea::placeholder { color: var(--text-4); }
.ai-send-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: none; background: var(--blue); color: #fff;
  font-size: 16px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.15s;
  box-shadow: 0 1px 4px rgba(43,95,237,0.3);
}
.ai-send-btn:hover { background: var(--blue-dark); box-shadow: 0 2px 8px rgba(43,95,237,0.4); }
.ai-suggestion-chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.ai-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2);
  cursor: pointer; transition: all 0.15s;
}
.ai-chip:hover { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-light); }
.ai-chip-icon { font-size: 14px; }

/* 入口动画 */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 旧版布局兼容 --- */
.ai-layout { display: flex; height: 100%; }
.ai-sidebar {
  width: 220px; border-right: 1px solid var(--border);
  background: var(--surface); display: flex; flex-direction: column; flex-shrink: 0;
  overflow-y: auto;
}
.ai-sidebar-header {
  padding: 14px 16px 10px; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.ai-sidebar-header h3 { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.ai-scenario-list { padding: 8px; }
.ai-scenario-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; color: var(--text-2); transition: all 0.15s;
}
.ai-scenario-item:hover { background: var(--bg-card); }
.ai-scenario-item.active { background: var(--blue-bg); color: var(--blue); font-weight: 500; }
.scenario-item-icon { font-size: 14px; }
.ai-sidebar-section { border-top: 1px solid var(--border); flex: 1; }
.available-metrics { padding: 8px; }
.avail-metric {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
  font-size: 12px; transition: all 0.15s;
}
.avail-metric:hover { background: var(--blue-bg); }
.avail-metric-name { color: var(--text); }
.avail-metric-code { color: var(--text-3); font-family: monospace; font-size: 11px; }

.ai-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.ai-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface);
}
.ai-title { font-size: 15px; font-weight: 600; }
.ai-subtitle { 
  font-size: 13px; color: var(--text-3); margin-left: 8px;
  display: inline; 
}
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.chat-msg { display: flex; gap: 12px; align-items: flex-start; }
.chat-msg.user { flex-direction: row-reverse; }
.msg-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; flex-shrink: 0;
}
.msg-bubble {
  max-width: 72%; padding: 12px 16px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.7;
}
.msg-bubble.assistant {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px 12px 12px 12px;
}
.msg-bubble.user {
  background: var(--blue); color: #fff;
  border-radius: 12px 4px 12px 12px;
}

/* 打字指示器 */
.typing { display: flex; align-items: center; gap: 5px; padding: 16px; }
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-3);
  animation: bounce 1.2s infinite;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }

.suggested-questions {
  padding: 10px 20px; display: flex; flex-wrap: wrap; gap: 8px;
  border-top: 1px solid var(--border);
}
.suggestion-btn {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 14px;
  font-size: 12.5px; cursor: pointer; color: var(--text-2);
  transition: all 0.15s;
}
.suggestion-btn:hover { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-light); }

.chat-input-area {
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--surface); display: flex; gap: 10px; align-items: flex-end;
}
.chat-input-area textarea {
  flex: 1; resize: none; min-height: 38px; max-height: 120px;
  border-radius: var(--radius-sm); font-size: 14px;
}
.btn-send {
  background: var(--blue); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 9px 18px;
  cursor: pointer; font-size: 14px; font-weight: 500;
  white-space: nowrap; box-shadow: 0 1px 4px rgba(43,95,237,0.3);
  transition: all 0.15s;
}
.btn-send:hover { background: var(--blue-dark); box-shadow: 0 2px 8px rgba(43,95,237,0.4); }

/* ===== 模型选择器 ===== */
.model-selector {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2);
}
.model-selector select {
  border: 0.5px solid var(--border); border-radius: 6px;
  padding: 4px 8px; font-size: 12px; color: var(--text);
  background: var(--surface2); cursor: pointer;
  outline: none; font-family: inherit;
}
.model-selector select:focus { border-color: var(--blue); }

/* ===== 模型标识徽章 ===== */
.model-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 500;
  margin-bottom: 8px;
}
.model-badge.ai-agent {
  background: var(--blue-bg); color: var(--blue);
}
.model-badge.analytics {
  background: var(--purple-bg); color: var(--purple);
}
.model-badge.industry {
  background: var(--green-bg); color: var(--green);
}
.model-badge .model-dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.model-badge.ai-agent .model-dot { background: var(--blue); }
.model-badge.analytics .model-dot { background: var(--purple); }
.model-badge.industry .model-dot { background: var(--green); }

/* ===== 消息内分区 ===== */
.msg-section {
  margin-top: 12px; padding-top: 12px;
  border-top: 0.5px solid var(--border);
}
.msg-section-title {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
}
.msg-section-title .section-icon {
  font-size: 14px;
}

/* 中立建议区域 */
.msg-recommendation {
  background: var(--orange-bg); border-radius: 8px;
  padding: 10px 12px; margin-top: 8px;
}
.msg-recommendation .rec-title {
  font-size: 11px; font-weight: 600; color: var(--orange);
  margin-bottom: 6px; display: flex; align-items: center; gap: 4px;
}
.msg-recommendation .rec-body {
  font-size: 12.5px; color: var(--text-2); line-height: 1.6;
}
.msg-recommendation .rec-item {
  display: flex; gap: 6px; margin-bottom: 4px;
}
.msg-recommendation .rec-item .rec-marker {
  font-size: 11px; flex-shrink: 0; margin-top: 1px;
}
.rec-marker.pro { color: var(--green); }
.rec-marker.con { color: var(--red); }

/* 行业洞察区域 */
.msg-insight {
  background: var(--blue-bg); border-radius: 8px;
  padding: 10px 12px; margin-top: 8px; border-left: 3px solid var(--blue);
}
.msg-insight .insight-title {
  font-size: 11px; font-weight: 600; color: var(--blue);
  margin-bottom: 6px; display: flex; align-items: center; gap: 4px;
}
.msg-insight .insight-body {
  font-size: 12.5px; color: var(--text-2); line-height: 1.6;
}
.msg-insight .insight-benchmark {
  display: inline-block; padding: 1px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 500; margin: 4px 4px 0 0;
  background: #fff; color: var(--blue);
}

/* 数据置信度 */
.msg-confidence {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-3); margin-top: 8px;
}
.msg-confidence .conf-bar {
  width: 48px; height: 4px; background: var(--surface2);
  border-radius: 2px; overflow: hidden;
}
.msg-confidence .conf-fill {
  height: 100%; border-radius: 2px;
}
.conf-fill.high { background: var(--green); }
.conf-fill.medium { background: var(--orange); }
.conf-fill.low { background: var(--red); }

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(2px);
}
.modal-box {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 540px; max-width: 95vw; max-height: 88vh;
  display: flex; flex-direction: column;
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.modal-lg { width: 680px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--text-3); padding: 4px 8px;
  border-radius: 6px; transition: all 0.15s;
}
.modal-close:hover { background: var(--gray-bg); color: var(--text); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ===== 上传区 ===== */
.upload-zone {
  border: 1.5px dashed var(--border-md); border-radius: 10px;
  padding: 32px; text-align: center; color: var(--text-3);
}
.upload-zone:hover { border-color: var(--blue); background: var(--blue-bg); }
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-zone p { margin-bottom: 12px; font-size: 13px; }
.preview-info { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }

/* ===== 数据表 ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
  background: var(--surface2); padding: 7px 10px; text-align: left;
  border-bottom: 0.5px solid var(--border); font-weight: 500;
}
.data-table td { padding: 6px 10px; border-bottom: 0.5px solid var(--border); }
.data-table tr:hover td { background: var(--surface2); }

/* ===== 连接测试 ===== */
.test-connecting { color: var(--orange); font-size: 13px; padding: 8px 0; }
.test-success { color: var(--green); font-size: 13px; padding: 8px 0; }
.table-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.table-item {
  padding: 8px 12px; background: var(--surface2);
  border-radius: 6px; font-size: 13px;
}

/* ===== 指标详情 ===== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item { }
.detail-item.full { grid-column: 1/-1; }
.detail-item label { font-size: 12px; color: var(--text-3); display: block; margin-bottom: 3px; }
.detail-item span { font-size: 13.5px; }
.formula-block { display: block; background: var(--surface2); padding: 8px 10px; border-radius: 6px; font-size: 12.5px; color: var(--purple); }

/* ===== 复选框 ===== */
.metrics-checkboxes { display: flex; flex-direction: column; gap: 8px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.checkbox-item input { width: auto; }

/* ===== 其他 ===== */
.meta-text { font-size: 12px; color: var(--text-3); }
code { font-family: monospace; }

/* ==========================================
   品牌 — 灵犀 Logo
   ========================================== */
.logo-img-lg {
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.logo-img-lg img {
  filter: drop-shadow(0 2px 12px rgba(26,58,92,0.3));
  transition: filter 0.3s;
}
.logo-img-sm {
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-img-sm img {
  filter: drop-shadow(0 1px 4px rgba(26,58,92,0.25));
}

/* ==========================================
   指标大厅
   ========================================== */
.hall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.hall-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  transition: box-shadow 0.2s, transform 0.15s;
  cursor: default;
}
.hall-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.hall-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.hall-card-title { display: flex; align-items: center; gap: 10px; }
.hall-card-title h3 { font-size: 14px; font-weight: 500; margin: 0; }
.hall-card-title code { font-size: 11px; color: var(--text-3); display: block; }
.hall-icon { font-size: 22px; width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.hall-icon-chart { background: var(--blue-bg); }
.hall-icon-users { background: var(--purple-bg); }
.hall-icon-star { background: var(--orange-bg); }
.hall-icon-money { background: var(--green-bg); }
.hall-card-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.hall-card:hover .hall-card-actions { opacity: 1; }
.hall-card-value {
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.hall-current { font-size: 28px; font-weight: 500; line-height: 1.2; }
.hall-unit { font-size: 13px; color: var(--text-3); }
.hall-change { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 2px; }
.hall-change.up { color: var(--green); }
.hall-change.down { color: var(--red); }
.change-arrow { font-size: 14px; }
.hall-mini-chart { height: 70px; margin-bottom: 10px; }
.mini-chart-svg { width: 100%; height: 100%; }
.hall-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-3);
}
.hall-range { font-size: 11px; }

/* 趋势详情 — 柱状图 */
.trend-bars {
  display: flex; align-items: flex-end; gap: 8px;
  height: 240px; padding: 10px 0;
}
.trend-bar-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  gap: 4px; min-width: 0;
}
.trend-bar {
  width: 100%; max-width: 48px; border-radius: 4px 4px 0 0;
  display: flex; align-items: flex-start; justify-content: center;
  color: #fff; font-size: 10px; padding-top: 4px;
  transition: height 0.3s;
}
.trend-bar-label {
  font-size: 10px; color: var(--text-3);
  white-space: nowrap;
}

/* ==========================================
   指标打分视角
   ========================================== */
/* 打分模式切换 */
.scoring-toggle {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border-radius: 8px;
  padding: 3px;
}
.scoring-toggle-btn {
  padding: 5px 14px; border-radius: 6px; font-size: 13px;
  border: none; cursor: pointer; background: none;
  color: var(--text-2); transition: all 0.15s;
}
.scoring-toggle-btn.active {
  background: var(--blue); color: #fff;
  box-shadow: 0 1px 4px rgba(24,95,165,0.25);
}
/* 排名角标 */
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.rank-badge.r1 { background: #FEF3C7; color: #B45309; }
.rank-badge.r2 { background: #E5E7EB; color: #6B7280; }
.rank-badge.r3 { background: #FED7AA; color: #C2410C; }
.rank-badge.rn { background: var(--surface2); color: var(--text-3); }

/* 总分评分卡 */
.hall-score-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 15px; font-weight: 600;
}
.hall-score-badge.high { background: var(--green-bg); color: var(--green); }
.hall-score-badge.medium { background: var(--orange-bg); color: var(--orange); }
.hall-score-badge.low { background: var(--red-bg); color: var(--red); }
.hall-score-max { font-size: 11px; font-weight: 400; opacity: 0.7; }

/* 维度得分条 */
.score-dim-bars {
  display: flex; flex-direction: column; gap: 6px;
  margin: 10px 0;
}
.score-dim-row {
  display: flex; align-items: center; gap: 8px;
}
.score-dim-label {
  font-size: 11px; color: var(--text-2);
  width: 64px; flex-shrink: 0; text-align: right;
}
.score-dim-track {
  flex: 1; height: 6px; background: var(--surface2);
  border-radius: 3px; overflow: hidden;
}
.score-dim-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.5s ease;
}
.score-dim-fill.high { background: linear-gradient(90deg, var(--green), #5B8F1A); }
.score-dim-fill.medium { background: linear-gradient(90deg, var(--orange), #C76F1A); }
.score-dim-fill.low { background: linear-gradient(90deg, var(--red), #C52A2A); }
.score-dim-val {
  font-size: 11px; font-weight: 500; color: var(--text-2);
  width: 28px; flex-shrink: 0;
}

/* 打分详情面板 */
.score-detail-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 0.5px solid var(--border);
}
.score-detail-total {
  text-align: center; min-width: 80px;
}
.score-detail-total .sdt-num {
  font-size: 36px; font-weight: 500; line-height: 1.1;
}
.score-detail-total .sdt-label {
  font-size: 11px; color: var(--text-3);
}
.score-detail-meta { font-size: 12px; color: var(--text-3); }
.score-detail-meta span { display: block; margin-bottom: 2px; }

.score-detail-dims {
  display: flex; flex-direction: column; gap: 12px;
}
.score-detail-dim {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--surface2);
  border-radius: 8px;
}
.sdd-icon {
  font-size: 20px; width: 36px; height: 36px;
  border-radius: 8px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.sdd-icon.usage { background: var(--blue-bg); }
.sdd-icon.quality { background: var(--purple-bg); }
.sdd-icon.adoption { background: var(--green-bg); }
.sdd-icon.performance { background: var(--orange-bg); }
.sdd-icon.impact { background: var(--red-bg); }
.sdd-info { flex: 1; min-width: 0; }
.sdd-name { font-size: 13px; font-weight: 500; }
.sdd-desc { font-size: 11px; color: var(--text-3); }
.sdd-bar-wrap { flex: 1; height: 8px; background: #fff; border-radius: 4px; overflow: hidden; }
.sdd-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.sdd-val { font-size: 16px; font-weight: 600; min-width: 40px; text-align: right; }

/* 指标打分排名表格 */
.score-rank-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.score-rank-table th {
  text-align: left; padding: 8px 10px; font-weight: 500;
  color: var(--text-2); font-size: 11px; text-transform: uppercase;
  border-bottom: 1px solid var(--border-md);
}
.score-rank-table td {
  padding: 10px; border-bottom: 0.5px solid var(--border);
}
.score-rank-table tr:hover td { background: var(--surface2); }
.sr-name { font-weight: 500; }
.sr-code { font-size: 11px; color: var(--text-3); font-family: monospace; }

/* 编辑打分表单 */
.score-edit-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.score-edit-label {
  width: 80px; font-size: 12px; color: var(--text-2);
  text-align: right; flex-shrink: 0;
}
.score-edit-slider-wrap { flex: 1; display: flex; align-items: center; gap: 10px; }
.score-edit-slider {
  flex: 1; -webkit-appearance: none; height: 6px;
  background: var(--surface2); border-radius: 3px; outline: none;
}
.score-edit-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--blue);
  cursor: pointer; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.score-edit-val {
  font-size: 14px; font-weight: 600; width: 32px;
  text-align: center; color: var(--blue);
}

/* ==========================================
   行列级权限管理
   ========================================== */
.perm-matrix { width: 100%; border-collapse: collapse; font-size: 12px; }
.perm-matrix th {
  background: var(--surface2); padding: 8px 10px;
  border: 0.5px solid var(--border); text-align: center;
  font-weight: 500; vertical-align: top;
}
.perm-matrix th small { font-size: 10px; color: var(--text-3); display: block; margin-top: 2px; }
.perm-matrix td {
  padding: 6px 8px; border: 0.5px solid var(--border);
  text-align: center; vertical-align: middle;
}
.perm-role-cell { text-align: left !important; min-width: 90px; }
.perm-cell { min-width: 80px; }
.perm-level { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.perm-level.has-perm { }
.perm-level.no-perm { opacity: 0.5; }
.perm-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 500;
}
.perm-read { background: var(--blue-bg); color: var(--blue); }
.perm-write { background: var(--green-bg); color: var(--green); }
.perm-none { background: var(--gray-bg); color: var(--text-3); }
.perm-col-hint {
  font-size: 10px; padding: 1px 4px; border-radius: 3px;
  background: var(--orange-bg); color: var(--orange);
}

.perm-rule-item {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: 8px; padding: 12px 16px; margin-bottom: 10px;
}
.perm-rule-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.perm-rule-header > div:first-child { display: flex; align-items: center; gap: 8px; }
.perm-rule-body {
  display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px;
}
.perm-rule-body > div { display: flex; gap: 4px; }
.perm-rule-body label { color: var(--text-3); }

/* ==========================================
   归因分析 — 炫酷可视化版
   ========================================== */
.attribution-layout { display: flex; flex-direction: column; gap: 20px; }

/* KPI 概览卡 */
.attr-kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.attr-kpi-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  position: relative; overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.attr-kpi-card:hover { transform: translateY(-2px); }
.attr-kpi-card .kpi-icon {
  font-size: 24px; margin-bottom: 6px;
}
.attr-kpi-card .kpi-label {
  font-size: 12px; color: var(--text-3); margin-bottom: 4px;
}
.attr-kpi-card .kpi-value {
  font-size: 28px; font-weight: 500; letter-spacing: -0.5px;
}
.attr-kpi-card .kpi-sub {
  font-size: 11px; color: var(--text-3); margin-top: 2px;
}
.attr-kpi-card .kpi-glow {
  position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  opacity: 0.12; pointer-events: none;
}

/* 视图切换标签（增强） */
.attr-view-tabs {
  display: flex; gap: 2px; background: var(--surface2);
  border-radius: 10px; padding: 4px;
}
.attr-view-tab {
  padding: 8px 20px; border-radius: 8px; font-size: 13px;
  font-weight: 500; border: none; cursor: pointer;
  background: none; color: var(--text-2);
  transition: all 0.2s; white-space: nowrap;
}
.attr-view-tab.active {
  background: var(--blue); color: #fff;
}

/* ===== 瀑布图 ===== */
.waterfall-container {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.waterfall-title {
  font-size: 14px; font-weight: 500; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.waterfall-chart { display: flex; flex-direction: column; gap: 8px; }
.waterfall-row {
  display: flex; align-items: center; gap: 12px;
  animation: wfSlideIn 0.5s ease both;
}
@keyframes wfSlideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
.waterfall-label {
  width: 80px; font-size: 12px; color: var(--text-2);
  text-align: right; flex-shrink: 0;
}
.waterfall-bar-wrap { flex: 1; height: 32px; position: relative; }
.waterfall-bar {
  height: 100%; border-radius: 6px; display: flex;
  align-items: center; justify-content: flex-end;
  padding-right: 10px; font-size: 12px; font-weight: 500;
  color: #fff; transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative; overflow: hidden;
}
.waterfall-bar.pos { background: var(--blue); }
.waterfall-bar.neg { background: var(--red); justify-content: flex-start; padding-left: 10px; }
.waterfall-bar.total { background: var(--purple); font-size: 14px; }
.waterfall-bar::after {
  content: ''; position: absolute; top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: wfShimmer 2.5s infinite;
}
@keyframes wfShimmer {
  0% { left: -60%; } 100% { left: 120%; }
}
.waterfall-total-row {
  border-top: 2px solid var(--border-md);
  padding-top: 8px; margin-top: 4px;
}

/* ===== 环形图 ===== */
.donut-section {
  display: flex; gap: 24px; align-items: center;
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.donut-chart-wrap { flex-shrink: 0; position: relative; }
.donut-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); text-align: center;
}
.donut-center .dc-total {
  font-size: 28px; font-weight: 500; line-height: 1.1;
}
.donut-center .dc-label {
  font-size: 11px; color: var(--text-3);
}
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.donut-legend-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px;
  transition: background 0.15s; cursor: default;
}
.donut-legend-item:hover { background: var(--surface2); }
.donut-legend-dot {
  width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0;
}
.donut-legend-info { flex: 1; min-width: 0; }
.donut-legend-name { font-size: 13px; font-weight: 500; }
.donut-legend-weight { font-size: 11px; color: var(--text-3); }
.donut-legend-val { text-align: right; }
.donut-legend-val .dlv-num { font-size: 15px; font-weight: 500; }
.donut-legend-val .dlv-change {
  font-size: 11px; font-weight: 500;
}

/* ===== 维度卡片（手风琴） ===== */
.dim-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.2s;
}
.dim-card.expanded { border-color: var(--blue); }
.dim-card-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer;
  transition: background 0.15s;
}
.dim-card-header:hover { background: var(--surface2); }
.dim-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.dim-card-info { flex: 1; min-width: 0; }
.dim-card-name { font-size: 14px; font-weight: 500; }
.dim-card-meta { font-size: 11px; color: var(--text-3); }
.dim-card-total { text-align: right; }
.dim-card-total .dct-val { font-size: 20px; font-weight: 500; }
.dim-card-total .dct-change { font-size: 11px; font-weight: 500; }
.dim-card-chevron {
  font-size: 14px; color: var(--text-3);
  transition: transform 0.3s; flex-shrink: 0;
}
.dim-card.expanded .dim-card-chevron { transform: rotate(180deg); }
.dim-card-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s ease;
}
.dim-card.expanded .dim-card-body { max-height: 600px; }
.dim-card-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  margin: 0 16px 16px;
}
.dim-card-table th {
  text-align: left; padding: 8px 10px; font-weight: 500;
  color: var(--text-2); font-size: 11px; border-bottom: 1px solid var(--border-md);
}
.dim-card-table td {
  padding: 10px; border-bottom: 0.5px solid var(--border);
}
.dim-card-table tr:hover td { background: var(--surface2); }
.dim-bar-wrap {
  height: 8px; background: var(--surface2);
  border-radius: 4px; overflow: hidden; min-width: 80px;
}
.dim-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== 因子卡片网格 ===== */
.factor-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.factor-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  position: relative; overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
}
.factor-card:hover { transform: translateY(-1px); }
.factor-card .fc-rank {
  position: absolute; top: 8px; right: 12px;
  font-size: 11px; color: var(--text-3);
}
.factor-card .fc-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.factor-card .fc-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.factor-card .fc-info { min-width: 0; }
.factor-card .fc-name { font-size: 14px; font-weight: 500; }
.factor-card .fc-weight { font-size: 11px; color: var(--text-3); }
.factor-card .fc-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 10px;
}
.factor-card .fc-stat-val { font-size: 20px; font-weight: 500; }
.factor-card .fc-stat-lbl { font-size: 11px; color: var(--text-3); }
.factor-card .fc-bar-wrap {
  height: 6px; background: var(--surface2);
  border-radius: 3px; overflow: hidden;
}
.factor-card .fc-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== 对比雷达图容器 ===== */
.radar-section {
  display: flex; gap: 24px; align-items: flex-start;
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.radar-chart-wrap { flex-shrink: 0; }
.radar-legend { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.radar-legend-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-radius: 6px; font-size: 13px;
}
.radar-legend-dot {
  width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
}

/* ===== 增强归因洞察卡 ===== */
.attribution-insight {
  background: var(--surface); border-left: 4px solid var(--blue);
  border-radius: var(--radius); padding: 20px;
  position: relative;
}
.attribution-insight .ai-pulse {
  animation: aiPulse 2s ease infinite;
}
@keyframes aiPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.insight-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.insight-icon {
  font-size: 22px; width: 40px; height: 40px;
  background: var(--blue-bg); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.insight-header h4 { font-size: 15px; font-weight: 500; }
.insight-conf-badge {
  font-size: 11px; padding: 2px 10px; border-radius: 12px;
  font-weight: 500;
}
.insight-body { font-size: 13px; color: var(--text-2); line-height: 1.9; }
.insight-body ul { margin-left: 18px; margin-top: 6px; }
.insight-body li { margin-bottom: 6px; padding: 6px 0; border-bottom: 0.5px solid var(--border); }
.insight-body li:last-child { border-bottom: none; }
.insight-body li strong { color: var(--blue); }
.insight-highlight {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 500; margin: 0 2px;
}

/* 变化指标 */
.change-indicator { font-weight: 500; }
.change-indicator.up { color: var(--green); }
.change-indicator.down { color: var(--red); }
.contrib-bar {
  height: 6px; background: var(--gray-bg);
  border-radius: 3px; overflow: hidden; min-width: 60px;
}
.contrib-fill {
  height: 100%; background: var(--blue);
  border-radius: 3px; transition: width 0.5s ease;
}


/* ==========================================
   AI 智能问数 Hero — 数据产品首页嵌入
   ========================================== */
.ai-hero-section {
  margin-bottom: 20px;
  animation: heroFadeIn 0.5s ease;
}
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-hero-card {
  background: linear-gradient(135deg, #F0F5FF 0%, #E8F0FE 30%, #F8FAFE 70%, #EDF2FC 100%);
  border: 1px solid rgba(43, 95, 237, 0.12);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: 0 2px 16px rgba(43, 95, 237, 0.05);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s, border-color 0.3s;
}
.ai-hero-card:hover {
  box-shadow: 0 4px 24px rgba(43, 95, 237, 0.1);
  border-color: rgba(43, 95, 237, 0.2);
}
/* 装饰光晕 */
.ai-hero-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43,95,237,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.ai-hero-card::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 20%;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,92,231,0.04) 0%, transparent 70%);
  pointer-events: none;
}

/* Header */
.ai-hero-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}
.ai-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px 5px 10px;
  background: linear-gradient(135deg, var(--blue), #4F7DF3);
  color: #fff;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 10px rgba(43, 95, 237, 0.25);
  flex-shrink: 0;
}
.ai-hero-badge-icon {
  font-size: 14px;
}
.ai-hero-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  animation: heroPulse 2s ease infinite;
}
@keyframes heroPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.2); }
}
.ai-hero-greeting {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
}
.ai-hero-greeting strong {
  color: var(--text);
}

/* 快捷问题 Chips */
.ai-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.ai-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 15px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(43, 95, 237, 0.12);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(4px);
}
.ai-hero-chip:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(43, 95, 237, 0.2);
}
.ai-hero-chip-icon {
  font-size: 14px;
}

/* 消息区域 */
.ai-hero-convo {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  max-height: 320px;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  padding-right: 4px;
}
.ai-hero-convo::-webkit-scrollbar {
  width: 4px;
}
.ai-hero-convo::-webkit-scrollbar-thumb {
  background: rgba(43,95,237,0.15);
  border-radius: 2px;
}

.ai-hero-msg {
  display: flex;
  gap: 10px;
  animation: heroMsgIn 0.3s ease;
}
@keyframes heroMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ai-hero-msg.user-msg {
  justify-content: flex-end;
}
.ai-hero-msg.user-msg .ai-hero-msg-body {
  background: var(--blue);
  color: #fff;
  border-radius: 16px 4px 16px 16px;
  max-width: 70%;
}
.ai-hero-msg.ai-msg .ai-hero-msg-body {
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 4px 16px 16px 16px;
  max-width: 85%;
}
.ai-hero-msg-body {
  padding: 10px 16px;
  font-size: 13.5px;
  line-height: 1.65;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.ai-hero-msg-body table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
  margin: 6px 0;
}
.ai-hero-msg-body table td,
.ai-hero-msg-body table th {
  padding: 4px 8px;
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
  text-align: left;
}
.ai-hero-msg-body table th {
  color: var(--text-3);
  font-weight: 500;
  font-size: 11px;
}

.ai-hero-msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #4F7DF3);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  box-shadow: 0 1px 6px rgba(43, 95, 237, 0.2);
}

.ai-hero-msg-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.ai-hero-action-btn {
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid rgba(43,95,237,0.15);
  background: rgba(255,255,255,0.6);
  color: var(--blue);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s;
  backdrop-filter: blur(4px);
}
.ai-hero-action-btn:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* 输入区 */
.ai-hero-input-row {
  position: relative;
  z-index: 1;
}
.ai-hero-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 16px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(43, 95, 237, 0.15);
  border-radius: 14px;
  transition: all 0.25s;
  box-shadow: 0 1px 6px rgba(0,0,0,0.03);
  backdrop-filter: blur(8px);
}
.ai-hero-input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(43, 95, 237, 0.1), 0 2px 12px rgba(0,0,0,0.06);
  background: #fff;
}
.ai-hero-input-prefix {
  font-size: 15px;
  color: var(--blue);
  flex-shrink: 0;
  opacity: 0.6;
}
.ai-hero-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  padding: 6px 0;
  outline: none;
  box-shadow: none;
}
.ai-hero-input::placeholder {
  color: var(--text-4);
  font-size: 13px;
}
.ai-hero-send-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--blue), #4F7DF3);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(43, 95, 237, 0.2);
}
.ai-hero-send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(43, 95, 237, 0.35);
}

/* 打字动画 */
.ai-hero-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 0 4px;
}
.ai-hero-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0.4;
  animation: heroTyping 1.2s infinite;
}
.ai-hero-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-hero-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes heroTyping {
  0%, 60%, 100% { opacity: 0.2; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-4px); }
}

/* 模型/置信度徽章在 Hero 中的适配 */
.ai-hero-msg-body .model-badge {
  font-size: 10px;
  padding: 2px 8px;
  margin-bottom: 6px;
}
.ai-hero-msg-body .msg-recommendation {
  background: rgba(247, 162, 59, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 8px;
  font-size: 12px;
}
.ai-hero-msg-body .msg-insight {
  background: rgba(43, 95, 237, 0.06);
  border-left: 2px solid var(--blue);
  border-radius: 0 6px 6px 0;
  padding: 8px 10px;
  margin-top: 8px;
  font-size: 12px;
}
.ai-hero-msg-body .msg-confidence {
  font-size: 10px;
  margin-top: 6px;
}

@media (max-width: 768px) {
  .ai-hero-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .ai-hero-chips {
    gap: 6px;
  }
  .ai-hero-chip {
    padding: 5px 12px;
    font-size: 12px;
  }
  .ai-hero-msg-body {
    max-width: 90% !important;
  }
}

/* ==========================================
   数据产品模块 — Chart.js 增强版
   ========================================== */

/* --- 仪表盘列表 --- */
.dashboards-list { display: flex; flex-direction: column; gap: 14px; }
.dashboard-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: box-shadow 0.2s, transform 0.15s;
}
.dashboard-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.dashboard-preview {
  background: var(--surface2); padding: 14px 16px;
  border-bottom: 0.5px solid var(--border);
  min-height: 48px;
}
.dash-preview-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.dash-preview-chip {
  display: inline-flex; align-items: center; gap: 3px;
}
.dash-preview-grid { display: grid; gap: 4px; }
.dash-preview-panel {
  min-height: 20px; transition: transform 0.15s;
}
.dash-preview-panel:hover { transform: scale(1.02); }
.dashboard-card-info { padding: 14px 16px; }
.dashboard-card-info h3 { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.dashboard-card-info p { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.dashboard-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-3);
}

/* --- 仪表盘全屏模态 --- */
.dash-modal-full { width: 95vw !important; max-width: 1300px !important; }
.dash-view-body {
  max-height: 70vh; overflow-y: auto;
  padding: 16px 20px !important;
}
.dash-live-grid {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 14px; grid-auto-rows: minmax(80px, auto);
  align-items: start;
}

/* --- 实时面板基础 --- */
.dash-live-panel {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: 10px; overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  display: flex; flex-direction: column;
}
.dash-live-panel:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  border-color: var(--blue-light);
}

/* --- 面板工具栏 --- */
.dash-panel-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: 0.5px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}
.dash-panel-title {
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-panel-tools { display: flex; gap: 4px; }
.dash-panel-action {
  width: 28px; height: 28px; border-radius: 6px;
  border: none; background: none; cursor: pointer;
  font-size: 14px; display: flex; align-items: center;
  justify-content: center; color: var(--text-3);
  transition: all 0.15s;
}
.dash-panel-action:hover {
  background: var(--surface); color: var(--blue);
}
.dash-panel-collapse-btn {
  width: 24px; height: 24px; border-radius: 5px;
  border: none; background: none; cursor: pointer;
  font-size: 10px; display: flex; align-items: center;
  justify-content: center; color: var(--text-3);
  transition: all 0.15s; flex-shrink: 0;
}
.dash-panel-collapse-btn:hover {
  background: var(--blue-bg); color: var(--blue);
}
.panel-collapsed .panel-content {
  display: none;
}

/* --- 统计数值面板 --- */
.dash-stat-panel {
  padding: 16px !important;
  justify-content: center;
}
.dash-stat-panel .dash-panel-toolbar {
  background: none; border-bottom: none; padding: 0 0 8px 0;
}
.dash-stat-big { font-size: 32px; font-weight: 500; line-height: 1.2; }
.dash-stat-big small { font-size: 14px; color: var(--text-3); font-weight: 400; }
.dash-stat-change { font-size: 13px; font-weight: 500; margin-top: 4px; }
.dash-stat-change.up { color: var(--green); }
.dash-stat-change.down { color: var(--red); }

/* --- 表格面板 --- */
.dash-table-panel .dash-panel-toolbar { }
.dash-table-panel table { margin: 0; }

/* --- 图表面板（Chart.js）--- */
.dash-chart-panel-enhanced { }
.dash-chart-canvas-wrap {
  flex: 1; min-height: 180px; padding: 8px 14px 14px;
  position: relative; display: flex; align-items: center;
  justify-content: center;
}
.dash-chart-canvas-wrap canvas {
  width: 100% !important; height: 100% !important;
}

/* --- AI 智能解读侧边栏 --- */
.dash-ai-sidebar {
  background: linear-gradient(135deg, #F8FAFE 0%, #F0F5FF 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; position: sticky; top: 20px;
}
.dash-ai-header {
  padding: 16px 18px; font-size: 15px; font-weight: 600;
  color: var(--blue); display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid rgba(43,95,237,0.1);
  background: linear-gradient(135deg, rgba(43,95,237,0.04), transparent);
}
.dash-ai-body { padding: 16px 18px; }
.dash-ai-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 13px; color: var(--text-2); line-height: 1.6;
}
.dash-ai-item:last-child { border-bottom: 0; }
.dash-ai-bullet { font-size: 16px; flex-shrink: 0; line-height: 1.4; margin-top: 1px; }
.dash-ai-footer {
  padding: 12px 18px; border-top: 1px solid rgba(0,0,0,0.06);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text-3);
  background: rgba(0,0,0,0.01);
}

/* --- 创建仪表盘 — 图表类型网格 --- */
.chart-type-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-top: 6px;
}
.chart-type-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 14px 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px; cursor: pointer;
  transition: all 0.2s; position: relative;
  background: var(--surface);
}
.chart-type-card:hover {
  border-color: var(--blue-light);
  background: var(--blue-bg);
}
.chart-type-card.selected {
  border-color: var(--blue);
  background: var(--blue-bg);
  box-shadow: 0 0 0 2px rgba(24,95,165,0.15);
}
.chart-type-card input { position: absolute; top: 8px; right: 8px; accent-color: var(--blue); cursor: pointer; }
.ctc-icon { font-size: 28px; }
.ctc-label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.chart-type-card.selected .ctc-label { color: var(--blue); }

/* --- 样式编辑器 --- */
.chart-style-grid {
  display: flex; flex-direction: column; gap: 20px;
}
.chart-style-section {
  padding-bottom: 16px;
  border-bottom: 0.5px solid var(--border);
}
.chart-style-section:last-child { border-bottom: none; padding-bottom: 0; }
.chart-style-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-2); margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.chart-style-row {
  display: flex; align-items: center; gap: 12px;
}
.chart-style-row select {
  width: auto; padding: 5px 10px; font-size: 12px;
}

/* --- 调色板选择器 --- */
.palette-selector {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.palette-swatch {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 10px 8px;
  border: 1.5px solid var(--border);
  border-radius: 10px; cursor: pointer;
  transition: all 0.2s; font-size: 11px; color: var(--text-2);
}
.palette-swatch:hover { border-color: var(--blue-light); }
.palette-swatch.active {
  border-color: var(--blue);
  background: var(--blue-bg);
  color: var(--blue);
  font-weight: 500;
}
.palette-dots {
  display: flex; gap: 3px;
}
.palette-dots span {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,0.08);
}

/* --- 开关切换 --- */
.toggle-switch {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 13px; color: var(--text-2);
}
.toggle-switch input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--blue);
  cursor: pointer; flex-shrink: 0;
}

/* --- 范围滑块 --- */
input[type="range"] {
  -webkit-appearance: none; height: 6px;
  background: var(--surface2); border-radius: 3px;
  outline: none; border: none; padding: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: var(--blue);
  cursor: pointer; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* --- 布局编辑器 --- */
.layout-panel-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 8px;
  background: var(--surface2); border-radius: 8px;
  border: 0.5px solid var(--border);
  flex-wrap: wrap;
}
.layout-panel-idx {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue-bg); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.layout-panel-info {
  flex: 1; min-width: 120px;
  display: flex; flex-direction: column; gap: 2px;
}
.layout-panel-info strong { font-size: 13px; }
.layout-panel-info small { font-size: 11px; color: var(--text-3); }
.layout-panel-pos {
  display: flex; gap: 6px; align-items: center;
}
.layout-panel-pos label {
  font-size: 10px; color: var(--text-3);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.layout-panel-pos input {
  text-align: center; font-size: 12px; padding: 3px;
}

/* --- 旧版迷你图表（保留向后兼容）--- */
.dash-mini-bars {
  display: flex; align-items: flex-end; gap: 8px;
  height: 140px; padding-top: 8px;
}
.dash-bar-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 2px; justify-content: flex-end;
}
.dash-bar-val { font-size: 10px; color: var(--text-3); }
.dash-bar {
  width: 100%; max-width: 40px; background: var(--blue);
  border-radius: 3px 3px 0 0; transition: height 0.3s;
}
.dash-bar-lbl { font-size: 10px; color: var(--text-3); margin-top: 4px; }
.dash-table-panel { }
.dash-panel-types { display: flex; flex-wrap: wrap; gap: 8px; }

/* 目标管理 */
.goals-overview { display: flex; flex-direction: column; gap: 16px; }
.goals-stats { display: flex; gap: 12px; }
.goal-stat-card {
  flex: 1; background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: center;
}
.goal-stat-card.warning { border-left: 3px solid var(--orange); }
.goal-stat-card.success { border-left: 3px solid var(--green); }
.goal-stat-val { font-size: 28px; font-weight: 500; }
.goal-stat-lbl { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.goal-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.goal-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.goal-card-header > div:first-child { display: flex; align-items: center; gap: 8px; }
.goal-card-body { }
.goal-metric-info {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: 12px; color: var(--text-2); margin-bottom: 12px;
}
.goal-progress-section { }
.goal-progress-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; margin-bottom: 6px;
}
.goal-progress-bar {
  height: 10px; background: var(--gray-bg);
  border-radius: 5px; overflow: hidden;
}
.goal-progress-fill {
  height: 100%; border-radius: 5px;
  transition: width 0.5s ease;
}

/* ==========================================
   响应式 & 细节
   ========================================== */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .source-grid { grid-template-columns: 1fr; }
  .hall-grid { grid-template-columns: 1fr; }
  .hall-current { font-size: 24px; }
  .dash-live-grid { grid-template-columns: repeat(4, 1fr) !important; }
  .dash-modal-full { width: 98vw !important; }
  .dash-stat-big { font-size: 24px; }
  .dash-chart-canvas-wrap { min-height: 140px; }
  .chart-type-grid { grid-template-columns: repeat(2, 1fr); }
  .palette-selector { grid-template-columns: repeat(2, 1fr); }
  .layout-panel-row { flex-direction: column; align-items: flex-start; }
  .layout-panel-pos { flex-wrap: wrap; }
  .help-drawer { width: 100vw !important; }
  .help-toc { display: none; }
  /* AI 解读侧边栏 — 移动端堆叠 */
  .dash-ai-sidebar { position: static; }
  div[style*="grid-template-columns:1fr 340px"] { grid-template-columns: 1fr !important; }
}

/* ==========================================
   顶部导航栏（KYLIGENCE 深色企业风格）
   ========================================== */
.main-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: var(--navy);
  min-height: 48px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.topbar-breadcrumb {
  font-size: 14px; font-weight: 500;
  color: rgba(255,255,255,0.9);
  display: flex; align-items: center; gap: 8px;
}
.topbar-actions {
  display: flex; align-items: center; gap: 10px;
}
.btn-help {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  font-family: 'Inter', system-ui, sans-serif;
}
.btn-help:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

/* ==========================================
   帮助文档抽屉
   ========================================== */
.help-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.help-overlay.show {
  opacity: 1; pointer-events: auto;
}
.help-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 520px; max-width: 90vw;
  background: var(--surface);
  z-index: 1001;
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
}
.help-drawer.show {
  transform: translateX(0);
}
.help-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}
.help-drawer-header h2 {
  font-size: 18px; font-weight: 600; margin: 0;
}
.help-close {
  width: 32px; height: 32px;
  border-radius: 6px;
  border: none;
  background: var(--surface2);
  color: var(--text-2);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.help-close:hover {
  background: var(--red-bg); color: var(--red);
}
.help-drawer-body {
  display: flex; flex: 1; overflow: hidden;
}
.help-toc {
  width: 140px; flex-shrink: 0;
  border-right: 0.5px solid var(--border);
  padding: 12px 0;
  overflow-y: auto;
  background: var(--surface2);
}
.help-toc-item {
  display: block; padding: 8px 16px;
  font-size: 13px; color: var(--text-2);
  text-decoration: none; cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}
.help-toc-item:hover {
  color: var(--text-1); background: rgba(0,0,0,0.03);
}
.help-toc-item.active {
  color: var(--blue); font-weight: 500;
  border-left-color: var(--blue);
  background: var(--blue-bg);
}
.help-content {
  flex: 1; overflow-y: auto;
  padding: 20px 24px;
}
.help-section { display: none; }
.help-section.active { display: block; }
.help-section h3 {
  font-size: 18px; font-weight: 600;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.help-section h4 {
  font-size: 14px; font-weight: 600;
  color: var(--text-1); margin: 20px 0 8px;
}
.help-section h4:first-of-type { margin-top: 0; }
.help-section p { font-size: 13px; color: var(--text-2); line-height: 1.8; margin-bottom: 10px; }
.help-section ul, .help-section ol {
  font-size: 13px; color: var(--text-2); line-height: 1.8;
  padding-left: 20px; margin-bottom: 12px;
}
.help-section li { margin-bottom: 4px; }
.help-section code {
  font-size: 12px; background: var(--surface2);
  padding: 1px 6px; border-radius: 3px;
  font-family: 'SF Mono', 'Menlo', monospace;
}
.help-section em { color: var(--text-1); font-style: normal; background: var(--yellow-bg); padding: 1px 4px; border-radius: 2px; }

/* 能力卡片 */
.help-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin: 12px 0;
}
.help-cap-card {
  background: var(--surface2); border: 0.5px solid var(--border);
  border-radius: 8px; padding: 12px;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12px; color: var(--text-2); line-height: 1.6;
}
.help-cap-card strong { color: var(--text-1); display: block; margin-bottom: 2px; }
.hcc-icon { font-size: 20px; flex-shrink: 0; opacity: 0.8; width: 28px; text-align: center; }

/* 帮助表格 */
.help-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; margin: 12px 0 16px;
}
.help-table th {
  background: var(--surface2); padding: 8px 12px;
  border: 0.5px solid var(--border); text-align: left;
  font-weight: 500; font-size: 12px; color: var(--text-3);
}
.help-table td {
  padding: 8px 12px;
  border: 0.5px solid var(--border);
  color: var(--text-2); line-height: 1.6;
}

/* FAQ */
.help-faq-item {
  border-bottom: 0.5px solid var(--border);
  padding: 14px 0;
}
.help-faq-item:last-child { border-bottom: none; }
.faq-q {
  font-size: 14px; font-weight: 500; color: var(--text-1);
  margin-bottom: 6px;
}
.faq-a {
  font-size: 13px; color: var(--text-2); line-height: 1.8;
}

/* ==========================================
   指标管理模块
   ========================================== */

/* 统计小卡片 */
.stat-cards-row { flex-wrap: wrap; }
.stat-mini-card {
  flex: 1; min-width: 120px;
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  text-align: center;
}
.stat-mini-card.online { border-left: 3px solid var(--green); }
.stat-mini-card.offline { border-left: 3px solid var(--red); }
.stat-mini-card.dirs { border-left: 3px solid var(--blue); }
.stat-mini-card.granted { border-left: 3px solid var(--purple); }
.smc-val { font-size: 24px; font-weight: 500; }
.smc-lbl { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* 生命周期表格 */
.lc-metric-name { font-size: 13px; font-weight: 500; }
.lc-metric-code { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.lc-dir-tag {
  display: inline-block; padding: 2px 8px;
  font-size: 11px; border-radius: 4px;
  background: var(--surface2); color: var(--text-2);
}
.lc-time { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.lc-changelog { font-size: 12px; color: var(--text-2); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-actions { display: flex; gap: 4px; }

/* 按钮小号 */
.btn-xs {
  padding: 3px 10px; font-size: 11px;
  border-radius: 4px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
  cursor: pointer; white-space: nowrap;
  transition: all 0.15s;
}
.btn-xs:hover { border-color: var(--blue); color: var(--blue); }
.btn-xs.btn-warn { color: var(--orange); border-color: var(--orange-bg); }
.btn-xs.btn-warn:hover { background: var(--orange-bg); }
.btn-xs.btn-success { color: var(--green); border-color: var(--green-bg); }
.btn-xs.btn-success:hover { background: var(--green-bg); }
.btn-xs.btn-ghost { border-color: transparent; background: transparent; }
.btn-xs.btn-ghost:hover { background: var(--surface2); }
.btn-xs.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-xs.btn-danger:hover { background: #d32f2f; border-color: #d32f2f; }

/* 详情网格 */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.detail-item { display: flex; flex-direction: column; gap: 2px; }
.detail-item label { font-size: 11px; color: var(--text-3); text-transform: uppercase; }
.detail-item span { font-size: 13px; color: var(--text-1); }
.detail-item code { font-size: 12px; background: var(--surface2); padding: 2px 6px; border-radius: 3px; font-family: monospace; }

/* 目录树 */
.dir-tree { padding: 8px 0; }
.dir-node { }
.dir-node-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; cursor: pointer;
  border-radius: 6px; transition: background 0.15s;
}
.dir-node-header:hover { background: var(--surface2); }
.dir-arrow { font-size: 14px; color: var(--text-3); width: 16px; text-align: center; flex-shrink: 0; }
.dir-icon { font-size: 18px; flex-shrink: 0; }
.dir-name { font-size: 14px; font-weight: 500; color: var(--text-1); }
.dir-badge {
  font-size: 11px; padding: 1px 8px; border-radius: 10px;
  background: var(--blue-bg); color: var(--blue);
  white-space: nowrap;
}
.dir-actions {
  margin-left: auto; display: flex; gap: 4px;
  opacity: 0; transition: opacity 0.15s;
}
.dir-node-header:hover .dir-actions { opacity: 1; }
.dir-children { }
.dir-metrics {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 4px 16px 8px 56px;
}
.dir-metric-tag {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 4px;
  background: var(--surface2); font-size: 12px;
}
.dm-name { color: var(--text-1); }
.dm-status { font-size: 10px; padding: 1px 5px; border-radius: 3px; }
.dm-status.on { background: var(--green-bg); color: var(--green); }
.dm-status.off { background: var(--red-bg); color: var(--red); }

/* 赋权矩阵 */
.grant-cell { text-align: center; vertical-align: middle; padding: 10px !important; }
.grant-level { margin-bottom: 2px; }
.grant-mask { font-size: 10px; color: var(--text-3); margin-top: 4px; }
.grant-metric-name { text-align: left; }
.grant-metric-name code { font-size: 10px; color: var(--text-3); }
.role-tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 500;
}
.role-tag.admin { background: var(--purple-bg); color: var(--purple); }
.role-tag.analyst { background: var(--blue-bg); color: var(--blue); }

/* ===== 用户管理模块 ===== */
.ua-tabs {
  display: flex; gap: 0; margin-bottom: 20px;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  width: fit-content;
}
.ua-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-2); transition: all 0.2s;
  border-right: 1px solid var(--border);
}
.ua-tab:last-child { border-right: none; }
.ua-tab:hover { background: var(--surface2); color: var(--text); }
.ua-tab.active { background: var(--blue); color: #fff; }
.ua-tab.active .badge-count { background: rgba(255,255,255,0.25); color: #fff; }
.ua-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.ua-search { flex: 1; max-width: 360px; }
.ua-table-wrap { overflow-x: auto; }
.ua-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ua-table th {
  text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 600;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
}
.ua-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ua-table tr:hover td { background: var(--surface2); }
.ua-row-disabled td { opacity: 0.5; }
.ua-user-cell { display: flex; align-items: center; gap: 12px; }
.ua-avatar {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 14px; flex-shrink: 0;
}
.ua-uname { font-weight: 500; color: var(--text); font-size: 14px; }
.ua-umeta { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.ua-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ua-actions { display: flex; gap: 6px; }
.ua-role-tag { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.ua-role-admin { background: var(--purple-bg); color: var(--purple); }
.ua-role-analyst { background: var(--blue-bg); color: var(--blue); }
.ua-role-viewer { background: var(--green-bg); color: var(--green); }
.ua-role-developer { background: var(--orange-bg); color: var(--orange); }

/* 用户组卡片网格 */
.ua-group-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px;
  padding: 4px;
}
.ua-group-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; transition: box-shadow 0.2s;
}
.ua-group-card:hover { box-shadow: var(--shadow-md); }
.ua-group-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 10px; }
.ua-group-icon { font-size: 32px; line-height: 1; flex-shrink: 0; }
.ua-group-name { font-size: 15px; font-weight: 600; color: var(--text); }
.ua-group-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.ua-group-desc { font-size: 13px; color: var(--text-2); line-height: 1.5; margin-bottom: 14px; }
.ua-group-members { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ua-member-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px 3px 3px; border-radius: 20px;
  background: var(--surface2); font-size: 12px; color: var(--text-2);
}
.ua-chip-avatar {
  width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px; font-weight: 600;
}
.ua-chip-extra {
  background: var(--blue-bg); color: var(--blue); font-weight: 500;
}
.ua-group-actions { display: flex; gap: 8px; }

/* 成员管理 Modal */
.ua-member-section { margin-bottom: 20px; }
.ua-section-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; text-transform: uppercase; }
.ua-member-list { display: flex; flex-direction: column; gap: 6px; }
.ua-member-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 1px solid var(--border);
}
.ua-member-info { display: flex; align-items: center; gap: 10px; }

/* 表单布局 */
.ua-form {}
.ua-form-row { display: flex; gap: 16px; }
.ua-checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.ua-checkbox {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 13px; cursor: pointer; transition: all 0.15s;
}
.ua-checkbox:hover { border-color: var(--blue-light); background: var(--blue-bg); }
.ua-checkbox input[type="checkbox"] { accent-color: var(--blue); }
.btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border-md); background: #fff; color: var(--text-2);
  cursor: pointer; transition: all 0.15s;
}
.btn-outline:hover { background: var(--surface2); border-color: var(--text-3); }
.text-muted { color: var(--text-3); font-size: 12px; }
