/* =========================================================
   Tau · 白色苹果风 UI
   设计语言：macOS / iOS · 浅色底 + 毛玻璃 + 柔光 + 大留白
   ========================================================= */

:root {
  /* —— 主色 —— */
  --primary: #5b5bd6;
  --primary-hover: #7878e0;
  --primary-active: #4949b8;
  --primary-soft: rgba(91, 91, 214, 0.08);
  --primary-soft-2: rgba(91, 91, 214, 0.14);
  --primary-grad: linear-gradient(135deg, #6c6cd9 0%, #5b5bd6 100%);

  /* —— 状态色（iOS 系统色）—— */
  --success: #34c759;
  --warning: #ff9f0a;
  --danger: #ff3b30;
  --info: #5ac8fa;
  --neutral: #8e8e93;

  /* —— 文字 —— */
  --text-primary: #1d1d1f;
  --text-secondary: #424245;
  --text-muted: #86868b;
  --text-disabled: #c2c2c7;

  /* —— 背景 —— */
  --bg-base: #fbfbfd;
  --bg-card: #ffffff;
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --bg-hover: rgba(0, 0, 0, 0.04);
  --bg-hover-strong: rgba(0, 0, 0, 0.06);

  /* —— 描边 —— */
  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.1);

  /* —— 阴影 —— */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(0, 0, 0, 0.05);

  /* —— 圆角 —— */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  /* —— 间距系统 —— */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* —— 动效 —— */
  --transition-fast: 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.32s cubic-bezier(0.4, 0, 0.2, 1);

  /* —— 字体 —— */
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
               'PingFang SC', 'Helvetica Neue', Helvetica, Arial,
               'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
}

/* ===== 基础重置 ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg-base);
  font-family: var(--font-sans);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#app { height: 100vh; display: flex; overflow: hidden; }

/* 自定义滚动条（WebKit）*/
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15); border-radius: 4px;
  transition: background var(--transition);
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.25); }

/* =========================================================
   侧边栏（白毛玻璃 · macOS 风）
   ========================================================= */
.tau-sidebar {
  width: 240px;
  background: var(--bg-elevated);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--border);
  color: var(--text-primary);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  transition: width var(--transition);
}

.tau-brand {
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--border);
}
.tau-brand .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tau-brand h1 {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.tau-brand .tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-soft-2);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.tau-brand p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.tau-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.tau-nav-item {
  padding: 9px 12px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-sm);
  margin: 2px 0;
  border-left: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.tau-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tau-nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(91, 91, 214, 0.28);
}
.tau-nav-item.active:hover {
  background: var(--primary-hover);
}
.tau-nav-item svg {
  width: 16px; height: 16px;
  opacity: 0.85;
  flex-shrink: 0;
}
.tau-nav-item.active svg { opacity: 1; }

.tau-sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tau-sidebar-footer .user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.tau-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-grad);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(91, 91, 214, 0.25);
}
.tau-sidebar-footer .uname {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tau-sidebar-footer .urole {
  font-size: 11px;
  color: var(--text-muted);
}

/* =========================================================
   主区
   ========================================================= */
.tau-main { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }

.tau-topbar {
  height: 56px;
  background: var(--bg-elevated);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-shrink: 0;
}
.tau-topbar h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* 视图根：每个 view 的最外层 div 用此类，撑满高度并让内部 topbar+content 正确堆叠 */
.tau-view {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tau-content {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  padding: var(--space-lg);
  overflow-y: auto;
  overflow-x: hidden;
}

/* 表格容器：窄屏自动横向滚动，不再撑破布局 */
.tau-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tau-table-wrap .el-table {
  min-width: 520px;
}

/* 强制卡片与表格撑满父容器，避免固定宽度残留 */
.tau-card { width: 100%; }
.el-table { width: 100% !important; }
.el-table__inner-wrapper { width: 100% !important; }

/* =========================================================
   卡片
   ========================================================= */
.tau-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.tau-card:hover {
  box-shadow: var(--shadow-md);
}
.tau-card h3 {
  margin: 0 0 var(--space-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}

/* =========================================================
   统计卡（KPI）
   ========================================================= */
.tau-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.tau-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.tau-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--primary-grad);
  opacity: 0;
  transition: opacity var(--transition);
}
.tau-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.tau-stat:hover::before { opacity: 1; }
.tau-stat .label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.tau-stat .num {
  font-size: 30px;
  font-weight: 600;
  margin: 8px 0 4px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-feature-settings: 'tnum';
}
.tau-stat .num.brand-color { color: var(--primary); }
.tau-stat .sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* =========================================================
   图表区
   ========================================================= */
.tau-chart-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.tau-chart-box:hover {
  box-shadow: var(--shadow-md);
}
.tau-chart {
  width: 100%;
  height: 340px;
  min-height: 280px;
}

/* =========================================================
   登录页（左浅灰渐变 + 右白表单 — 对齐 CVn 简洁风格）
   ========================================================= */
view-login { display: block; width: 100%; }
.tau-login-page {
  display: flex;
  width: 100%;
  min-height: 100vh;
  background: #fff;
}

/* —— 左侧装饰区 —— */
.tau-login-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #fbfbfd 0%, #f0f0f5 100%);
  padding: 40px;
  position: relative;
  overflow: hidden;
}
.tau-login-left::before,
.tau-login-left::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.tau-login-left::before {
  width: 620px; height: 620px;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.10) 0%, transparent 70%);
  top: -220px; right: -220px;
}
.tau-login-left::after {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(94, 92, 230, 0.10) 0%, transparent 70%);
  bottom: -160px; left: -160px;
}
.tau-login-left h1 {
  font-size: 52px;
  font-weight: 600;
  margin: 0 0 14px;
  background: linear-gradient(135deg, #1d1d1f 0%, #4343a0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
  letter-spacing: -0.03em;
  text-align: center;
}
.tau-login-left p {
  color: #6b7280;
  font-size: 16px;
  font-weight: 400;
  margin: 0;
  position: relative;
  z-index: 1;
  text-align: center;
}

/* —— 右侧表单区 —— */
.tau-login-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  background: #ffffff;
}
.tau-login-box {
  width: 100%;
  max-width: 380px;
}
.tau-login-box h2 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 6px;
  text-align: left;
  color: #1d1d1f;
  letter-spacing: -0.02em;
}
.tau-login-subtitle {
  color: #6b7280;
  font-size: 14px;
  margin: 0 0 28px;
}
.tau-login-error {
  color: #dc2626;
  font-size: 13px;
  margin-bottom: 14px;
  text-align: center;
  padding: 10px 14px;
  background: #fef2f2;
  border-radius: 6px;
}
.tau-login-input {
  width: 100%;
  padding: 14px 16px;
  background: #f5f5f7;
  border: 1.5px solid transparent;
  border-radius: 10px;
  color: #1d1d1f;
  font-size: 15px;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
}
.tau-login-input:focus {
  border-color: #0071e3;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}
.tau-login-input::placeholder { color: #9ca3af; }
.tau-login-btn {
  width: 100%;
  padding: 14px;
  background: #0071e3;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  margin-top: 8px;
  font-family: inherit;
  letter-spacing: -0.01em;
}
.tau-login-btn:hover:not(:disabled) {
  background: #005bb5;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 113, 227, 0.28);
}
.tau-login-btn:active:not(:disabled) { transform: translateY(0); }
.tau-login-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* =========================================================
   表格 / 标签 / 按钮微调
   ========================================================= */
.el-table {
  font-size: 13px;
  color: var(--text-primary);
  --el-table-border-color: var(--border);
  --el-table-header-bg-color: transparent;
  --el-table-row-hover-bg-color: var(--bg-hover);
}
.el-table th.el-table__cell {
  background: transparent !important;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-strong) !important;
}
.el-table td.el-table__cell {
  border-bottom: 1px solid var(--border) !important;
}
.el-table--border, .el-table--border .el-table__cell {
  border-color: var(--border) !important;
}

.el-button {
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.el-button--primary {
  --el-button-bg-color: var(--primary);
  --el-button-border-color: var(--primary);
  --el-button-hover-bg-color: var(--primary-hover);
  --el-button-hover-border-color: var(--primary-hover);
  --el-button-active-bg-color: var(--primary-active);
  --el-button-active-border-color: var(--primary-active);
}
.el-button--large {
  height: 44px;
  font-size: 15px;
  border-radius: var(--radius-sm);
}

.el-tag {
  border-radius: 6px;
  font-weight: 500;
  border: none;
  padding: 0 8px;
}

.el-card, .el-dialog, .el-drawer {
  border-radius: var(--radius-lg) !important;
}

.el-input__wrapper,
.el-textarea__inner,
.el-select .el-input__wrapper {
  border-radius: var(--radius-sm) !important;
  box-shadow: 0 0 0 1px var(--border-strong) inset !important;
  transition: box-shadow var(--transition-fast) !important;
}
.el-input__wrapper:hover,
.el-select .el-input__wrapper:hover {
  box-shadow: 0 0 0 1px var(--text-disabled) inset !important;
}
.el-input.is-focus .el-input__wrapper,
.el-input__wrapper.is-focus,
.el-select .el-input.is-focus .el-input__wrapper {
  box-shadow: 0 0 0 2px var(--primary) inset !important;
}

.row-actions {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}

/* =========================================================
   抽屉 / 对话框
   ========================================================= */
.drawer-footer {
  padding: 10px 0 0;
  text-align: right;
}
.keyword-detail pre,
.keyword-detail {
  white-space: pre-wrap;
  word-wrap: break-word;
  background: #f5f5f7;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font-mono);
  line-height: 1.6;
  max-height: 240px;
  overflow-y: auto;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.brand-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 11px;
  font-size: 11px;
  margin-right: 4px;
  margin-bottom: 4px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.brand-pill.self {
  background: var(--primary-soft);
  color: var(--primary);
}
.brand-pill.comp {
  background: rgba(255, 59, 48, 0.08);
  color: var(--danger);
}

/* Element Plus dialog/drawer 苹果化 */
.el-dialog {
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
  box-shadow: var(--shadow-xl) !important;
}
.el-dialog__header {
  padding: 20px 24px 12px !important;
  border-bottom: 1px solid var(--border);
  margin: 0 !important;
}
.el-dialog__title {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  letter-spacing: -0.01em;
}
.el-dialog__body { padding: 20px 24px !important; }
.el-dialog__footer {
  padding: 12px 24px 20px !important;
  border-top: 1px solid var(--border);
}

.el-drawer__header {
  padding: 20px 24px !important;
  margin-bottom: 0 !important;
  border-bottom: 1px solid var(--border);
}
.el-drawer__title {
  font-size: 16px !important;
  font-weight: 600 !important;
}
.el-drawer__body { padding: 20px 24px !important; }
.el-drawer__footer {
  padding: 12px 24px 20px !important;
  border-top: 1px solid var(--border);
}

/* =========================================================
   响应式：移动端
   ========================================================= */

/* Element Plus dialog/drawer 自适应：在窄屏强制全宽 */
@media (max-width: 768px) {
  .el-overlay-dialog {
    padding: 0;
    align-items: stretch;
  }
  .el-dialog {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    min-height: 100vh;
  }
  .el-drawer.ltr, .el-drawer.rtl {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* 平板（768-1024）侧边栏图标化 */
@media (max-width: 1024px) and (min-width: 769px) {
  .tau-sidebar { width: 72px; }
  .tau-brand { padding: 18px 0 14px; text-align: center; }
  .tau-brand .row { justify-content: center; }
  .tau-brand h1 { font-size: 0; }
  .tau-brand h1::first-letter { font-size: 22px; }
  .tau-brand .tag, .tau-brand p { display: none; }
  .tau-nav-item {
    justify-content: center;
    padding: 11px 0;
  }
  .tau-nav-item span:last-child { display: none; }
  .tau-sidebar-footer { flex-direction: column; gap: 8px; padding: 12px 8px; }
  .tau-sidebar-footer .user { flex-direction: column; gap: 4px; }
  .tau-sidebar-footer .uname,
  .tau-sidebar-footer .urole { display: none; }
}

/* 手机（≤768）侧边栏隐藏，改为顶部抽屉 */
@media (max-width: 768px) {
  .tau-sidebar {
    position: fixed;
    z-index: 100;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .tau-sidebar.mobile-open { transform: translateX(0); }
  .tau-topbar {
    padding: 0 12px;
    height: 52px;
  }
  .tau-topbar h2 { font-size: 15px; }
  .tau-content { padding: 12px; }
  .tau-card { padding: 14px; border-radius: var(--radius-md); }
  .tau-stat { padding: 14px 16px; }
  .tau-stat .num { font-size: 24px; }
  .tau-chart { height: 260px; min-height: 220px; }
  .tau-login-page { flex-direction: column; }
  .tau-login-left { flex: none; padding: 32px 24px; }
  .tau-login-left h1 { font-size: 32px; }
  .tau-login-right { flex: 1; padding: 24px; }
}

/* 工具类 */
.flex-wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.flex-grow { flex: 1; min-width: 0; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }

/* ECharts 容器自身 resize */
.echarts { width: 100% !important; height: 100% !important; }

/* =========================================================
   AI 综合分析 Tab（report.js 专用）
   ========================================================= */
.tau-ai-hero {
  background: linear-gradient(135deg, rgba(91,91,214,0.06) 0%, rgba(90,200,250,0.06) 100%);
  border: 1px solid rgba(91,91,214,0.2);
  position: relative;
}
.tau-ai-hero-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.tau-ai-hero-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.tau-ai-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #5b5bd6, #5ac8fa);
  letter-spacing: 0.04em;
}
.tau-ai-summary-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  margin: 0;
  white-space: pre-wrap;
}
.tau-ai-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

/* KPI 4-cell 归因 */
.tau-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.tau-kpi-cell {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.tau-kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.tau-kpi-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.tau-kpi-trend {
  font-size: 12px;
  font-weight: 500;
}
.tau-kpi-reason {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  border-top: 1px dashed var(--border);
  padding-top: 6px;
}

/* 风险 / 优化建议 列表 */
.tau-risk-list, .tau-suggestion-list {
  display: flex; flex-direction: column; gap: 10px;
}
.tau-risk-row, .tau-suggestion-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
}
.tau-risk-tag, .tau-suggestion-tag {
  flex-shrink: 0;
  min-width: 70px;
  text-align: center;
}
.tau-risk-body, .tau-suggestion-body { min-width: 0; flex: 1; }
.tau-risk-title {
  font-weight: 600; font-size: 14px; color: var(--text-primary);
  margin-bottom: 4px;
}
.tau-risk-desc, .tau-suggestion-action {
  font-size: 13px; color: var(--text-secondary); line-height: 1.6;
}
.tau-suggestion-issue {
  font-weight: 600; font-size: 14px; color: var(--text-primary);
  margin-bottom: 4px;
}
.tau-risk-rec, .tau-suggestion-impact {
  font-size: 12px; color: var(--text-muted);
  margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed var(--border);
}
.tau-risk-rec-label { color: var(--primary); font-weight: 500; }

/* 口碑词云 */
.tau-wc-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.tau-wc-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: baseline;
}
.tau-wc-tag {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 4px 10px;
  border-radius: 14px;
  line-height: 1.4;
  font-weight: 500;
}
.tau-wc-tag em {
  font-style: normal;
  font-size: 11px;
  opacity: 0.7;
}
.tau-wc-pos {
  background: rgba(52, 199, 89, 0.12);
  color: #1d7a35;
  border: 1px solid rgba(52, 199, 89, 0.3);
}
.tau-wc-neg {
  background: rgba(255, 59, 48, 0.12);
  color: #b3271e;
  border: 1px solid rgba(255, 59, 48, 0.3);
}

/* 平台洞察（旧：行式） */
.tau-platform-list {
  display: flex; flex-direction: column; gap: 10px;
}
.tau-platform-row {
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* =========================================================
   W2 报表升级 · 新组件
   ========================================================= */

/* —— 顶部 KPI 条 —— */
.tau-kpi-bar {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.tau-kpi-card {
  position: relative;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  justify-content: center;
  min-height: 88px;
  overflow: hidden;
}
.tau-kpi-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  opacity: 0.6;
}
.tau-kpi-card.tau-kpi-hero {
  background: linear-gradient(135deg, rgba(91, 91, 214, 0.08) 0%, rgba(255,255,255,1) 60%);
  border-color: rgba(91, 91, 214, 0.25);
}
.tau-kpi-card.tau-kpi-hero::before { background: var(--primary-grad); opacity: 1; width: 4px; }
.tau-kpi-big {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.tau-kpi-mid {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.tau-kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.tau-kpi-sub em {
  font-style: normal;
  color: var(--text-secondary);
  font-weight: 500;
}

/* —— 平台拆解 · 卡片网格 —— */
.tau-platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.tau-platform-card {
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.tau-platform-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.tau-platform-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.tau-platform-card-head h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.tau-platform-samples {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 8px;
  background: var(--bg-hover);
  border-radius: 10px;
}
.tau-platform-card-body {
  display: flex; flex-direction: column;
}
.tau-metric-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px dashed transparent;
}
.tau-metric-row:not(:last-child) {
  border-bottom-color: var(--border);
}
.tau-metric-row > span:first-child {
  color: var(--text-muted);
}
.tau-metric-row > span:last-child {
  font-weight: 600;
  color: var(--text-primary);
}

/* —— 信源偏好标签 —— */
.tau-source-pref {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.tau-source-pref-title {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tau-source-pref-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.tau-source-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--primary-soft);
  color: var(--primary-active);
  border-radius: 10px;
  border: 1px solid var(--primary-soft-2);
}

/* 移动端兼容 */
@media (max-width: 1024px) {
  .tau-kpi-bar { grid-template-columns: repeat(2, 1fr); }
  .tau-kpi-card.tau-kpi-hero { grid-column: span 2; }
}
@media (max-width: 768px) {
  .tau-kpi-grid { grid-template-columns: 1fr 1fr; }
  .tau-kpi-cell { padding: 10px 12px; }
  .tau-kpi-value { font-size: 20px; }
  .tau-risk-row, .tau-suggestion-row { flex-direction: column; gap: 6px; }
  .tau-kpi-bar { grid-template-columns: 1fr; }
  .tau-kpi-card.tau-kpi-hero { grid-column: span 1; }
  .tau-platform-grid { grid-template-columns: 1fr; }
}
