/* ========================================================
   设计系统 - 基于 40 张原图精确还原
   ======================================================== */
:root {
  /* 品牌色（取自原稿） */
  --brand: #1664FF;
  --brand-hover: #4585FF;
  --brand-deep: #145AE5;
  --brand-light: #80B4FE;
  --brand-soft: #E8F0FF;
  --brand-bg: #F2F6FF;

  /* 中性色 */
  --text-1: #1D2129;
  --text-2: #4E5969;
  --text-3: #86909C;
  --text-4: #C9CDD4;
  --text-disabled: #C9CDD4;
  --border: #E5E6EB;
  --border-light: #F2F3F5;
  --fill-0: #FBFBFC;
  --fill-1: #F7F8FA;
  --fill-2: #F2F3F5;
  --fill-3: #E5E6EB;
  --bg: #FFFFFF;

  /* 状态色 */
  --success: #00B42A;
  --success-light: #E8FFEA;
  --warning: #FF7D00;
  --warning-light: #FFF7E8;
  --danger: #F53F3F;
  --danger-light: #FFECE8;

  /* 数据可视化 - 取自原稿精确色 */
  --pos: #ABD479;       /* 正向贡献绿 */
  --pos-light: #C6E198;
  --neg: #DDA6C5;       /* 负向贡献玫红 */
  --neg-light: #EBC4DA;

  /* AI 卡片高亮色 */
  --hi-red: #FBE6E6;    /* QTD 标签条粉红 */
  --hi-yellow: #FFF3D6; /* WoW 标签条暖黄 */

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(29,33,41,0.04);
  --shadow-md: 0 4px 12px rgba(29,33,41,0.08);
  --shadow-lg: 0 8px 24px rgba(29,33,41,0.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.18);
  --shadow-modal: 0 16px 48px rgba(29,33,41,0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text-1);
  background: var(--fill-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  line-height: 1.5;
}

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; outline: none; }
input, select { font: inherit; outline: none; }
input:focus, select:focus { outline: none; }

/* ========================================================
   App 框架
   ======================================================== */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
}

/* ========================================================
   顶部导航栏（48px 高，基于原图测量）
   ======================================================== */
.topbar {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 24px;
}
.topbar .menu-grid {
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  gap: 2.5px;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
}
.topbar .menu-grid:hover { background: var(--fill-1); }
.topbar .menu-grid span {
  width: 3px; height: 3px;
  background: var(--text-2);
  border-radius: 0.5px;
}
.topbar .brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-1);
}
.topbar .nav { display: flex; gap: 24px; flex: 1; }
.topbar .nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  padding: 4px 0;
  transition: color 0.15s;
  white-space: nowrap;
  font-weight: 400;
}
.topbar .nav a.active { color: var(--brand); font-weight: 600; }
.topbar .nav a:hover { color: var(--text-1); }
.topbar .right { display: flex; align-items: center; gap: 12px; }
.topbar .right .ic {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s;
}
.topbar .right .ic:hover { background: var(--fill-1); }
.topbar .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF8888, #FFA877);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 11px; font-weight: 600;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Crect fill='%23F4A88A' width='28' height='28' rx='14'/%3E%3Ccircle fill='%23E89175' cx='14' cy='11' r='4'/%3E%3Cpath fill='%23E89175' d='M6 24 Q14 17 22 24'/%3E%3Crect fill='%23000' x='10' y='9' width='3' height='1.5' rx='0.75'/%3E%3Crect fill='%23000' x='15' y='9' width='3' height='1.5' rx='0.75'/%3E%3C/svg%3E");
  background-size: cover;
}

/* ========================================================
   主区域
   ======================================================== */
.main {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ========================================================
   左侧 Copilot 抽屉
   ======================================================== */
.copilot-side {
  width: 260px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s ease, opacity 0.2s;
  overflow: hidden;
}
.copilot-side.collapsed { width: 0; opacity: 0; border-right: none; }

.copilot-header {
  padding: 14px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.copilot-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 600;
  color: var(--text-1);
}
.copilot-collapse {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  color: var(--text-3);
}
.copilot-collapse:hover { background: var(--fill-1); color: var(--text-1); }

.new-project {
  margin: 8px 12px 0;
  padding: 9px 10px;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-1);
}
.new-project:hover { background: var(--fill-1); }
.new-project svg { width: 14px; height: 14px; color: var(--text-2); flex-shrink: 0; }

.copilot-divider {
  height: 1px;
  background: var(--border-light);
  margin: 8px 16px 0;
}

.history-label {
  padding: 14px 16px 6px;
  font-size: 12.5px;
  color: var(--text-3);
}
.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 12px;
}
.history-item {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item:hover { background: var(--fill-1); }
.history-item.active {
  background: var(--fill-1);
  color: var(--text-1);
  font-weight: 500;
}

.copilot-footer {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.copilot-footer .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF8888, #FFA877);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Crect fill='%23F4A88A' width='28' height='28' rx='14'/%3E%3Ccircle fill='%23E89175' cx='14' cy='11' r='4'/%3E%3Cpath fill='%23E89175' d='M6 24 Q14 17 22 24'/%3E%3Crect fill='%23000' x='10' y='9' width='3' height='1.5' rx='0.75'/%3E%3Crect fill='%23000' x='15' y='9' width='3' height='1.5' rx='0.75'/%3E%3C/svg%3E");
  background-size: cover;
  flex-shrink: 0;
}
.copilot-footer .name { font-size: 13px; color: var(--text-1); }

/* ========================================================
   中央内容区
   ======================================================== */
.content {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.expand-side {
  position: absolute;
  left: 16px;
  top: 16px;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: none;
  align-items: center; justify-content: center;
  background: white;
  color: var(--text-2);
  z-index: 5;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.expand-side:hover { color: var(--brand); }
.copilot-side.collapsed ~ .content .expand-side { display: flex; }

/* ========================================================
   视图切换
   ======================================================== */
.view { display: none; height: 100%; overflow: hidden; }
.view.active { display: flex; flex-direction: column; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ========================================================
   1. 首页（AI Copilot 工作台）
   ======================================================== */
.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 40px 64px;
  position: relative;
  background: white;
  overflow: hidden;
}
.home::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(22,100,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22,100,255,0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 0 28%, transparent 66%);
  pointer-events: none;
}
.home-aura {
  position: absolute;
  width: 520px;
  height: 240px;
  top: 360px;
  left: 50%;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 24% 38%, rgba(128,180,254,0.14), transparent 34%),
    radial-gradient(circle at 78% 70%, rgba(0,180,42,0.08), transparent 34%),
    radial-gradient(circle at 58% 26%, rgba(131,91,255,0.1), transparent 42%);
  filter: blur(30px);
  opacity: 0.45;
  pointer-events: none;
}
.home-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 42px;
  position: relative;
  z-index: 1;
}
.home-brand .brand-logo { width: 52px; height: 52px; }
.home-title {
  font-size: 34px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: 0;
}
.home-subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-2);
}

.context-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(229,230,235,0.78);
  border-radius: 8px;
  background: rgba(255,255,255,0.84);
  box-shadow: 0 12px 36px rgba(22,100,255,0.06);
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  margin-bottom: 0;
  backdrop-filter: blur(12px);
}
.context-strip span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
  background: rgba(247,248,250,0.72);
}
.context-strip span:first-child {
  color: var(--text-1);
  font-weight: 500;
  background: var(--brand-bg);
}
.context-strip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(0,180,42,0.12);
}

.capability-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.home-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(229,230,235,0.82);
  margin-bottom: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 10px 30px rgba(22,100,255,0.08);
  width: 232px;
  height: 86px;
}
.home-card:hover {
  background: white;
  border-color: rgba(22,100,255,0.28);
  transform: translateY(-1px);
}
.home-card.locked {
  cursor: not-allowed;
  color: var(--text-3);
  background: rgba(255,255,255,0.52);
  border-color: rgba(229,230,235,0.66);
  box-shadow: 0 8px 24px rgba(29,33,41,0.035);
  overflow: hidden;
  padding-right: 16px;
}
.home-card.locked:hover {
  background: rgba(255,255,255,0.52);
  border-color: rgba(229,230,235,0.66);
  transform: none;
}
.home-card .card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,0.95) 0 8%, transparent 32%),
    linear-gradient(145deg, #4CC9FF 0%, #1664FF 48%, #6A5CFF 100%);
  display: flex; align-items: center; justify-content: center;
  color: white;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 14px 28px rgba(22,100,255,0.22),
    inset 0 1px 0 rgba(255,255,255,0.72),
    inset 0 -10px 18px rgba(18,57,180,0.28);
}
.home-card .card-icon::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 9px;
  background:
    linear-gradient(rgba(255,255,255,0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.18) 1px, transparent 1px);
  background-size: 8px 8px;
  mask-image: radial-gradient(circle at center, #000 0 52%, transparent 74%);
  opacity: 0.72;
}
.home-card .card-icon::after {
  content: '';
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: conic-gradient(from 130deg, transparent, rgba(255,255,255,0.55), transparent 42%);
  animation: iconSweep 4.2s linear infinite;
}
.home-card .drill-icon {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 6px rgba(12,44,140,0.28));
}
.home-card .drill-icon-orbit {
  transform-origin: 14px 14px;
  animation: orbitSpin 5.6s linear infinite;
}
.home-card:hover .card-icon {
  transform: translateY(-0.5px) scale(1.01);
  box-shadow:
    0 10px 20px rgba(22,100,255,0.16),
    inset 0 1px 0 rgba(255,255,255,0.76),
    inset 0 -8px 14px rgba(18,57,180,0.18);
}
.home-card .locked-icon {
  color: #9AA5B5;
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,0.9) 0 8%, transparent 32%),
    linear-gradient(145deg, #EEF2F7 0%, #DFE6F0 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.72),
    inset 0 -8px 14px rgba(117,128,146,0.08);
}
.home-card.locked:hover .card-icon {
  transform: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.72),
    inset 0 -8px 14px rgba(117,128,146,0.08);
}
.home-card .locked-icon::before,
.home-card .locked-icon::after {
  display: none;
}
.home-card .card-text { text-align: left; }
.home-card .card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.home-card .card-desc {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 3px;
}
.home-card.locked .card-name {
  color: #6B778A;
}
.home-card.locked .card-desc {
  color: #A8B0BD;
}
.home-card.locked .card-text {
  padding-right: 0;
  min-width: 0;
}
.home-card.locked .card-name {
  max-width: calc(100% - 52px);
  white-space: nowrap;
}
.home-card.locked .card-desc {
  white-space: nowrap;
}
.lock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  height: 18px;
  margin-top: 0;
  padding: 0 6px;
  border-radius: 5px;
  background: rgba(242,243,245,0.9);
  color: #9AA5B5;
  font-size: 10.5px;
  line-height: 18px;
  border: 1px solid rgba(229,230,235,0.8);
}

.input-area {
  width: 100%;
  max-width: 760px;
  position: relative;
  isolation: isolate;
  z-index: 1;
}
.input-area::before,
.input-area::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.input-area::before {
  inset: -34px -42px;
  border-radius: 44px;
  background:
    radial-gradient(ellipse at 14% 28%, rgba(125,216,255,0.18), transparent 46%),
    radial-gradient(ellipse at 82% 36%, rgba(106,92,255,0.14), transparent 48%),
    radial-gradient(ellipse at 50% 92%, rgba(0,180,42,0.1), transparent 48%);
  filter: blur(28px);
  opacity: 0.72;
  z-index: -3;
}
.input-area::after {
  inset: -1px;
  border-radius: 13px;
  padding: 1.5px;
  background: conic-gradient(
    from var(--spin-angle),
    rgba(99,205,255,0.88),
    rgba(78,116,255,0.72),
    rgba(92,199,155,0.58),
    rgba(99,205,255,0.88)
  );
  animation: inputBorderSpin 3.6s linear infinite;
  z-index: -2;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.input-area .input-box {
  width: 100%;
  min-height: 124px;
  padding: 18px 64px 18px 18px;
  border: 1px solid rgba(255,255,255,0.92);
  border-radius: 12px;
  background: #fff;
  outline: none;
  font-size: 14px;
  color: var(--text-1);
  line-height: 1.6;
  cursor: text;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 18px 54px rgba(22,100,255,0.045);
}
.input-area .input-box:focus,
.input-area .input-box:focus-visible {
  outline: none;
  background: #fff;
}
.input-area .input-box:empty::before {
  content: attr(data-placeholder);
  color: var(--text-3);
}
.input-area:focus-within::before,
.input-area:focus-within::after {
  opacity: 0.9;
}
.input-area .send-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #6A5CFF);
  color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 20px rgba(22,100,255,0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.input-area .send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(22,100,255,0.3);
}

.prompt-suggestions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}
.suggestion-chip {
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.84);
  color: var(--text-2);
  font-size: 12.5px;
  transition: all 0.18s ease;
  box-shadow: 0 8px 20px rgba(29,33,41,0.04);
}
.suggestion-chip:hover,
.suggestion-chip.active {
  color: var(--brand);
  border-color: rgba(22,100,255,0.28);
  background: var(--brand-bg);
  transform: translateY(-1px);
}

.home-hint {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-3);
  font-size: 12px;
  z-index: 1;
  pointer-events: none;
  white-space: nowrap;
  animation: hintFade 2.8s ease infinite;
}
@keyframes hintFade { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}
@keyframes iconSweep {
  to { transform: rotate(360deg); }
}
@property --spin-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes inputBorderSpin {
  to { --spin-angle: 360deg; }
}
.home-hint::after { display: none; }

/* ========================================================
   2. 工作区（LUI + GUI）
   ======================================================== */
.workspace {
  flex: 1;
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* LUI 对话栏 */
.lui-panel {
  width: 380px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  flex-shrink: 0;
  transition: width 0.25s ease;
}
.lui-panel.hidden { width: 0; border-right: none; overflow: hidden; }

.lui-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.lui-header .toggle-btn {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  color: var(--text-2);
  cursor: pointer;
}
.lui-header .toggle-btn:hover { background: var(--fill-1); color: var(--text-1); }
.lui-header .title {
  flex: 1;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text-1);
  text-align: center;
  margin-right: 24px; /* 平衡左边按钮 */
}

.lui-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg {
  display: flex;
  gap: 10px;
  max-width: 100%;
}
.msg.user { flex-direction: row-reverse; }
.msg-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.msg.bot .msg-avatar {
  background: transparent;
  padding: 1px;
}
.msg.bot .msg-avatar svg { width: 24px; height: 24px; }
.msg.user .msg-avatar {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Crect fill='%23F4A88A' width='26' height='26' rx='13'/%3E%3Ccircle fill='%23E89175' cx='13' cy='10' r='4'/%3E%3Cpath fill='%23E89175' d='M5 22 Q13 16 21 22'/%3E%3Crect fill='%23000' x='9' y='8.5' width='3' height='1.5' rx='0.75'/%3E%3Crect fill='%23000' x='14' y='8.5' width='3' height='1.5' rx='0.75'/%3E%3C/svg%3E");
  background-size: cover;
}
.msg-body {
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 36px);
}
.msg.user .msg-body { display: flex; flex-direction: column; align-items: flex-end; }
.msg-name {
  font-size: 11.5px;
  color: var(--text-3);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.msg.user .msg-name { flex-direction: row-reverse; }
.msg-name .arrow {
  color: var(--text-4);
  font-size: 9px;
}
.msg-name .label { color: var(--text-2); font-weight: 500; }

.msg-content {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.58;
  color: var(--text-1);
  word-break: break-word;
}
.msg.bot .msg-content {
  background: var(--fill-1);
  color: var(--text-1);
}
.msg.user .msg-content {
  background: #DBE7FF;
  color: var(--text-1);
}

.ai-config-summary {
  margin-top: 6px;
  padding: 10px 11px;
  border: 1px solid rgba(22,100,255,0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(242,246,255,0.86), rgba(255,255,255,0.92));
}
.summary-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 7px;
  align-items: start;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
  margin-bottom: 5px;
}
.summary-label {
  color: var(--brand);
  font-weight: 600;
}
.summary-next {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(22,100,255,0.1);
  font-size: 12.5px;
  color: var(--text-1);
  font-weight: 500;
}

/* Loading 状态卡片（生成中显示） */
.loading-status-card {
  background: var(--fill-1);
  border-radius: 8px;
  padding: 12px 14px;
}
.loading-text-row {
  font-size: 13.5px;
  color: var(--text-1);
  margin-bottom: 8px;
}
.stop-gen-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--fill-2);
  color: var(--text-2);
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.stop-gen-btn:hover { background: var(--fill-3); }

/* 报告卡片（生成完毕） */
.report-card {
  margin-top: 6px;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.report-card-head {
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  background: white;
}
.report-card-head:hover { background: var(--fill-0); }
.report-card-icon {
  width: 26px; height: 26px;
  background: var(--fill-2);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  flex-shrink: 0;
}
.report-card-text { flex: 1; min-width: 0; }
.report-card-text .name { font-weight: 500; color: var(--text-1); font-size: 13px; }
.report-card-text .desc { color: var(--text-3); font-size: 11.5px; margin-top: 2px; }

.report-card-actions {
  display: flex;
  gap: 6px;
  padding: 0 10px 9px;
}
.report-card-actions .ra {
  flex: 1;
  padding: 5px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-2);
  cursor: pointer;
  background: var(--fill-1);
  border-radius: 4px;
  transition: all 0.15s;
  white-space: nowrap;
}
.report-card-actions .ra:hover { background: var(--fill-2); color: var(--brand); }
.report-card-actions .ra svg { width: 11px; height: 11px; }

.add-report-btn {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
}
.add-report-btn:hover { border-color: var(--brand); color: var(--brand); }

.lui-input {
  border-top: 1px solid var(--border-light);
  padding: 12px 16px 16px;
  flex-shrink: 0;
}
.lui-input-box {
  position: relative;
  background: var(--fill-1);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 44px 10px 12px;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, background 0.15s;
}
.lui-input-box:focus-within { 
  border-color: var(--brand); 
  background: white;
}
.lui-input-box.disabled {
  cursor: not-allowed;
}
.lui-input-box input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text-1);
}
.lui-input-box input::placeholder { color: var(--text-3); }
.lui-input-box input:disabled { cursor: not-allowed; }
.lui-input-box .send {
  position: absolute; right: 10px; bottom: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.lui-input-box .send.disabled {
  background: var(--brand-light);
  cursor: not-allowed;
}
.lui-input-box .send.stop-icon {
  background: var(--brand);
}
.lui-input-box .send.stop-icon::after {
  content: '';
  width: 10px; height: 10px;
  background: white;
  border-radius: 1px;
}

/* GUI 配置面板 */
.gui-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  position: relative;
  min-width: 0;
}

.gui-tabs {
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  height: 46px;
  flex-shrink: 0;
}
.gui-tab {
  padding: 13px 4px;
  margin-right: 30px;
  font-size: 14px;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 2px;
  font-weight: 500;
}
.gui-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}
.gui-tab.disabled {
  color: var(--text-4);
  cursor: not-allowed;
}
.gui-tab .count { 
  font-size: 13px;
  margin-left: 2px;
  color: inherit;
}
.gui-expand {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s;
}
.gui-expand:hover { color: var(--brand); }
.gui-expand svg { width: 13px; height: 13px; }

.gui-body-wrap {
  flex: 1;
  overflow-y: auto;
  position: relative;
  background: var(--fill-1);
}
.gui-body-wrap.loading-mode {
  background: white;
  overflow: hidden;
}

/* 智能反显横幅 */
.prefill-banner {
  margin: 10px 24px 6px;
  padding: 11px 14px;
  background: linear-gradient(90deg, var(--brand-bg), rgba(232,240,255,0.56));
  border: 1px solid rgba(22,100,255,0.12);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-1);
  animation: slideDown 0.3s;
}
@keyframes slideDown {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.prefill-banner .info-icon {
  color: var(--brand);
  flex-shrink: 0;
}
.prefill-banner .close {
  margin-left: auto;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prefill-banner.hidden { display: none; }

/* ========================================================
   配置页内容
   ======================================================== */
.config-body {
  padding: 16px 24px 100px;
}

.section {
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.section-header {
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-body {
  padding: 0 20px 20px;
}
.section.collapsed .section-body { display: none; }

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}
.form-item label {
  display: block;
  font-size: 13px;
  color: var(--text-1);
  margin-bottom: 8px;
}
.form-item label::before {
  content: '*';
  color: var(--danger);
  margin-right: 4px;
}
.form-item input,
.form-item select {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  font-size: 13.5px;
  color: var(--text-1);
  transition: border-color 0.15s;
}
.form-item input { padding-right: 36px; }
.form-item select { 
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M2 4l3 3 3-3' stroke='%2386909C' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-item .input-with-icon { position: relative; }
.form-item .input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.form-item input:hover,
.form-item select:hover { border-color: var(--text-4); }
.form-item input:focus,
.form-item select:focus { border-color: var(--brand); }

/* 数据报表配置卡 */
.report-config {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 20px;
  position: relative;
}
.report-config + .report-config { margin-top: 16px; }
.report-collapse {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px; height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 3px;
}
.report-collapse:hover { background: var(--fill-1); }
.report-config.collapsed .config-content { display: none; }

.report-header-row {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}
.report-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.report-del {
  margin-left: 16px;
  font-size: 12.5px;
  color: var(--brand);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.report-del:hover { opacity: 0.85; }

.field-row { margin-bottom: 20px; }
.field-row:last-child { margin-bottom: 0; }
.field-label {
  font-size: 13px;
  color: var(--text-1);
  margin-bottom: 10px;
}
.field-label::before {
  content: '*';
  color: var(--danger);
  margin-right: 4px;
}

/* 分组维度穿梭框 */
.dimension-picker {
  display: grid;
  grid-template-columns: 1fr 36px 1fr;
  gap: 0;
  align-items: stretch;
}
.dim-box {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  min-height: 180px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dim-box-header {
  padding: 9px 12px;
  background: var(--fill-1);
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dim-box-header .count {
  margin-left: auto;
  color: var(--text-3);
  font-size: 12px;
}
.dim-list {
  flex: 1;
  padding: 4px 0;
  overflow-y: auto;
}
.dim-item {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
.dim-item:hover { background: var(--fill-0); }
.dim-checkbox {
  width: 14px; height: 14px;
  border: 1.5px solid var(--text-4);
  border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}
.dim-checkbox.checked {
  background: var(--brand);
  border-color: var(--brand);
}
.dim-checkbox.checked::after {
  content: '';
  width: 7px; height: 4px;
  border-left: 1.5px solid white;
  border-bottom: 1.5px solid white;
  transform: rotate(-45deg) translate(1px, -1px);
}
.dim-checkbox.indeterminate {
  background: var(--brand);
  border-color: var(--brand);
}
.dim-checkbox.indeterminate::after {
  content: '';
  width: 7px; height: 2px;
  background: white;
}
.dim-filter-icon {
  margin-left: auto;
  color: var(--text-3);
  cursor: pointer;
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px;
}
.dim-filter-icon:hover { background: var(--fill-1); color: var(--brand); }
.dim-handle {
  margin-right: 8px;
  color: var(--text-4);
  font-size: 14px;
  letter-spacing: -2.5px;
  cursor: grab;
  user-select: none;
}
.dim-remove {
  margin-left: auto;
  color: var(--text-3);
  cursor: pointer;
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px;
}
.dim-remove:hover { color: var(--danger); }
.dim-item.right { padding-left: 12px; }

.dim-arrows {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.dim-arrows button {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.dim-arrows button:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-bg);
}
.dim-arrows button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

/* 指标选择行 */
.metric-row {
  display: grid;
  grid-template-columns: 24px 1fr 1fr 1fr 32px;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.metric-row .drag {
  cursor: grab;
  color: var(--text-4);
  text-align: center;
  font-size: 14px;
  letter-spacing: -2.5px;
  user-select: none;
}
.metric-row select,
.metric-row input {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 12px;
  font-size: 13.5px;
  background: var(--bg);
  color: var(--text-1);
  transition: border-color 0.15s;
  width: 100%;
}
.metric-row select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M2 4l3 3 3-3' stroke='%2386909C' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.metric-row select:hover, .metric-row input:hover { border-color: var(--text-4); }
.metric-row select:focus, .metric-row input:focus { border-color: var(--brand); }
.metric-row .del-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  border-radius: 4px;
  cursor: pointer;
}
.metric-row .del-btn:hover { color: var(--danger); }

.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  font-size: 13px;
  padding: 4px 0;
  margin-top: 8px;
  cursor: pointer;
}
.add-btn:hover { opacity: 0.85; }

/* 跨满宽度的新增按钮 */
.add-block-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px;
  background: var(--fill-1);
  color: var(--brand);
  font-size: 13.5px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
  margin-top: 12px;
  border: none;
}
.add-block-btn:hover {
  background: var(--brand-bg);
}
.add-block-btn.disabled {
  color: var(--text-3);
  cursor: not-allowed;
}
.add-block-btn.disabled:hover {
  background: var(--fill-1);
}

/* 底部生成栏 - 吸底全宽 */
.gui-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  padding: 16px 240px 16px 24px;
  border-top: 1px solid var(--border-light);
  z-index: 4;
}
.generate-btn-wide {
  width: 100%;
  height: 44px;
  background: var(--brand);
  color: white;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s;
}
.generate-btn-wide:hover { background: var(--brand-hover); }
.generate-btn-wide.disabled {
  background: var(--brand-light);
  cursor: not-allowed;
}

/* ========================================================
   生成中状态 - 右侧白底插画
   ======================================================== */
.loading-state {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(232,245,255,0.9), transparent 28%),
    white;
  padding: 40px;
}
.loading-card {
  width: 240px;
  min-height: 248px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.loading-illust-large {
  width: 220px;
  height: 220px;
  display: block;
}
.loading-progress {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.loading-progress span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.28;
  animation: loadingDot 1.1s ease-in-out infinite;
}
.loading-progress span:nth-child(2) { animation-delay: 0.16s; }
.loading-progress span:nth-child(3) { animation-delay: 0.32s; }
@keyframes loadingDot {
  0%, 100% { opacity: 0.22; transform: translateY(0); }
  50% { opacity: 0.9; transform: translateY(-3px); }
}

.loading-text-block {
  text-align: center;
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.8;
}
.loading-text-block .l1 {
  font-weight: 600;
}
.loading-text-block .l2 {
  color: var(--text-2);
  font-weight: 400;
  font-size: 13px;
}

/* ========================================================
   报告 Tab 切换栏
   ======================================================== */
.report-tabs-bar {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 24px;
  background: var(--bg);
  position: relative;
  border-bottom: 1px solid var(--border-light);
}
.report-tab-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.report-tab-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  background: var(--bg);
  color: var(--text-2);
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.report-tab-pill.active {
  background: var(--brand-bg);
  color: var(--brand);
  border-color: var(--brand-light);
}
.report-tab-pill .close {
  color: var(--text-4);
  display: flex;
  align-items: center;
  cursor: pointer;
}
.report-tab-pill.active .close { color: var(--brand); }
.report-tab-pill .close:hover { color: var(--danger); }

.add-report-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  padding: 0 14px;
  border: 1px solid var(--brand);
  border-radius: 16px;
  font-size: 13px;
  color: var(--brand);
  cursor: pointer;
  background: var(--bg);
  transition: all 0.15s;
}
.add-report-tab:hover {
  background: var(--brand-bg);
}

/* ========================================================
   报告页内容
   ======================================================== */
.report-body { padding: 16px 24px 24px; }

.report-section {
  background: var(--bg);
  border-radius: 8px;
  margin-top: 12px;
  overflow: hidden;
}
.report-section:first-child { margin-top: 0; }
.rs-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg);
  user-select: none;
}
.rs-header .label-bar {
  display: inline-flex;
  align-items: center;
  flex: 1;
}
.rs-header .label-bar::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--brand);
  border-radius: 2px;
  margin-right: 10px;
  vertical-align: middle;
}
.rs-header .actions {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 400;
}
.rs-header .actions .ac {
  display: inline-flex; 
  align-items: center; 
  gap: 4px;
  cursor: pointer;
}
.rs-header .actions .ac:hover { color: var(--brand); }
.rs-header .legend {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 400;
}
.rs-header .legend .dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.rs-body { }
.rs-body.collapsed { display: none; }

/* 数据表格 */
.data-table-wrap {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}
.data-table thead.group th {
  background: var(--fill-1);
  font-weight: 500;
  color: var(--text-2);
  font-size: 13px;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border-light);
}
.data-table thead.sub th {
  background: var(--fill-1);
  font-weight: 400;
  color: var(--text-3);
  font-size: 12.5px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table tbody td {
  padding: 14px 12px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-2);
}
.data-table tbody td.region {
  text-align: left;
  padding-left: 24px;
  font-weight: 400;
  color: var(--text-1);
}
.data-table tbody tr.total td { 
  background: #F6F9FF;
}
.data-table tbody tr.total td.region {
  font-weight: 600;
  color: var(--text-1);
}
.data-table tbody tr:hover td { background: var(--fill-0); }
.data-table tbody tr.total:hover td { background: #EEF3FF; }
.data-table .pos { color: var(--success); font-weight: 500; }
.data-table .neg { color: var(--danger); font-weight: 500; }

/* AI 摘要 */
.ai-section {
  padding: 16px 20px 20px;
}
.ai-summary-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 12px;
}
.ai-summary-banner {
  padding: 12px 16px;
  background: var(--brand-bg);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-1);
  margin-bottom: 16px;
}
.ai-summary-banner .danger { color: var(--danger); font-weight: 600; }
.ai-summary-banner .warning { color: var(--warning); font-weight: 600; }

.summary-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}
.summary-table th {
  text-align: left;
  padding: 12px;
  background: var(--fill-1);
  color: var(--text-2);
  font-weight: 500;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}
.summary-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-2);
}
.summary-table .metric-name { font-weight: 500; color: var(--text-1); }
.metric-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 500;
  margin-right: 8px;
}
.metric-pill.danger { background: var(--danger-light); color: var(--danger); }
.metric-pill.warning { background: var(--warning-light); color: var(--warning); }
.metric-pill.success { background: var(--success-light); color: var(--success); }

/* 多指标可折叠 */
.metric-group {
  border-top: 1px solid var(--border-light);
}
.metric-group:first-child { border-top: none; }
.metric-group-header {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-1);
  cursor: pointer;
  user-select: none;
}
.metric-group-header:hover { background: var(--fill-0); }
.metric-group-header .arrow {
  width: 12px; height: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: transform 0.2s;
}
.metric-group.collapsed .arrow { transform: rotate(-90deg); }
.metric-group-content { padding: 0 20px 20px; }
.metric-group.collapsed .metric-group-content { display: none; }
.metric-group-header .badge {
  display: inline-block;
  padding: 1px 8px;
  background: var(--fill-2);
  color: var(--text-3);
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 400;
}

/* 旋风图 */
.tornado-block {
  margin-top: 12px;
}
.tornado-title-bar {
  text-align: center;
  font-size: 13px;
  color: var(--text-1);
  font-weight: 500;
  padding: 8px 16px;
  background: var(--hi-red);
  border-radius: 4px;
  margin-bottom: 12px;
}
.tornado-title-bar.warning { background: var(--hi-yellow); }

.tornado {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 12px 0;
}
.tornado-half .side-label {
  text-align: left;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 12px;
  padding-left: 60px;
}
.tornado-row {
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  height: 22px;
}
.tornado-row .label { color: var(--text-2); text-align: right; padding-right: 8px; }
.tornado-bar-wrap {
  position: relative;
  height: 14px;
  background: transparent;
  overflow: visible;
}
.tornado-bar-wrap::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: var(--border);
  z-index: 1;
}
.tornado-bar {
  position: absolute;
  height: 100%;
  border-radius: 1px;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  top: 0;
}
.tornado-bar.left {
  right: 50%;
  background: var(--neg);
}
.tornado-bar.right {
  left: 50%;
  background: var(--pos);
}
.tornado-bar:hover {
  filter: brightness(0.92);
}
.tornado-bar:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  background: var(--text-1);
  color: white;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
}
.tornado-axis {
  display: grid;
  grid-template-columns: 50px 1fr;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 8px;
}
.tornado-axis .ticks {
  display: flex;
  justify-content: space-between;
}

/* 问题清单证据卡 */
.evidence-section {
  padding: 0 20px 20px;
}
.evidence-col-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}
.ev-col-label {
  font-size: 13px;
  color: var(--text-1);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 4px;
  text-align: center;
}
.ev-col-label.qtd { background: var(--hi-red); }
.ev-col-label.wow { background: var(--hi-yellow); }
.evidence-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ev-card {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s;
}
.ev-card:hover {
  border-color: var(--brand-light);
  background: var(--fill-0);
}
.ev-head {
  display: flex; 
  align-items: center; 
  gap: 8px;
  margin-bottom: 4px;
}
.ev-arrow {
  width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: transform 0.2s;
}
.ev-card.expanded .ev-arrow { transform: rotate(90deg); }
.ev-region {
  font-weight: 700;
  color: var(--text-1);
  font-size: 14px;
}
.ev-channel {
  display: inline-block;
  padding: 2px 10px;
  background: var(--fill-1);
  border-radius: 3px;
  font-size: 12px;
  color: var(--text-2);
}
.ev-card .ev-summary {
  font-size: 12px;
  color: var(--text-3);
  margin: 6px 0 8px;
  line-height: 1.7;
  padding-left: 22px;
}
.ev-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  padding-left: 22px;
  margin-bottom: 4px;
}
.ev-tag {
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 12px;
}
.ev-tag.success { background: var(--success-light); color: var(--success); }
.ev-tag.danger { background: var(--danger-light); color: var(--danger); }
.ev-tag.warning { background: var(--warning-light); color: var(--warning); }
.ev-tag.info { background: var(--brand-bg); color: var(--brand); }
.ev-detail {
  margin-top: 10px;
  padding: 10px 16px;
  background: var(--fill-0);
  border-radius: 4px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text-2);
  display: none;
}
.ev-card.expanded .ev-detail { display: block; animation: fadeIn 0.2s; }

/* ========================================================
   弹窗 - 国家分类配置
   ======================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(29,33,41,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s;
}
.modal-overlay.show { display: flex; }
.modal {
  background: white;
  border-radius: 12px;
  width: 580px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  animation: modalIn 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
  overflow: hidden;
}
@keyframes modalIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.modal-back {
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-1);
  margin-right: 8px;
  border-radius: 4px;
}
.modal-back:hover { background: var(--fill-1); }
.modal-back.hidden { visibility: hidden; }
.modal-title-text {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-right: 32px;
}
.modal-close {
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-1);
  border-radius: 4px;
}
.modal-close:hover { background: var(--fill-1); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.scheme-card {
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  background: var(--bg);
  transition: border-color 0.2s;
}
.scheme-card.selected {
  border-color: var(--brand);
}

.scheme-head {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.scheme-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.scheme-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.scheme-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  font-size: 13px;
  cursor: pointer;
}
.scheme-action svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.scheme-action:hover { opacity: 0.8; }
.scheme-action.selected-mark {
  color: var(--brand);
  font-weight: 500;
}

.sub-group-card {
  background: var(--fill-1);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--text-1);
}
.sub-group-card .arrow-down {
  color: var(--text-3);
  cursor: pointer;
}

.add-scheme {
  width: 100%;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  color: var(--brand);
  font-size: 13.5px;
  cursor: pointer;
  background: white;
  transition: all 0.15s;
}
.add-scheme:hover {
  background: var(--brand-bg);
  border-color: var(--brand);
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.modal-footer .hint {
  flex: 1;
  text-align: left;
  font-size: 12.5px;
  color: var(--text-3);
}
.btn {
  padding: 0 18px;
  height: 36px;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-default { background: var(--fill-1); color: var(--text-1); }
.btn-default:hover { background: var(--fill-2); }

/* 国家分类编辑视图（3_6 风格） */
.edit-group-card {
  margin-bottom: 16px;
}
.edit-group-head {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.edit-group-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.edit-group-del {
  margin-left: 16px;
  font-size: 13px;
  color: var(--brand);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.edit-sub-card {
  background: var(--fill-1);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
}
.edit-sub-head {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.edit-sub-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-1);
}
.edit-sub-del {
  margin-left: 14px;
  font-size: 12.5px;
  color: var(--brand);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.edit-sub-collapse {
  margin-left: auto;
  color: var(--text-3);
  cursor: pointer;
}

.edit-field-label {
  font-size: 12.5px;
  color: var(--text-1);
  margin-bottom: 8px;
}
.edit-field-label::before {
  content: '*';
  color: var(--danger);
  margin-right: 4px;
}

.country-input {
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 10px;
  min-height: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  cursor: text;
  position: relative;
  padding-right: 32px;
}
.country-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--fill-1);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 12.5px;
  color: var(--text-1);
}
.country-tag .remove {
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
}
.country-tag .remove:hover { color: var(--danger); }
.country-input::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--text-3);
  border-bottom: 1.5px solid var(--text-3);
  transform: translateY(-75%) rotate(45deg);
}

.add-sub-row {
  display: flex;
  gap: 16px;
  margin-top: 10px;
}
.add-sub-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  font-size: 13px;
  cursor: pointer;
}
.add-sub-link:hover { opacity: 0.85; }

.add-group-link {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  font-size: 13.5px;
  cursor: pointer;
  padding: 8px 0;
}

/* ========================================================
   滚动条
   ======================================================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D9DCE0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ========================================================
   演示徽章 & 提示
   ======================================================== */
.demo-badge {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 200;
  background: rgba(255,255,255,0.9);
  color: var(--text-2);
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(29,33,41,0.08);
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(12px);
}
.demo-badge:hover {
  color: var(--text-1);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(29,33,41,0.12);
}
.demo-badge .dot {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,180,42,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(0,180,42,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,180,42,0); }
}

.demo-tip {
  position: fixed;
  bottom: 70px;
  right: 18px;
  z-index: 200;
  background: white;
  color: var(--text-1);
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 13px;
  width: 320px;
  box-shadow: var(--shadow-xl);
  border-left: 3px solid var(--brand);
  display: none;
  animation: tipIn 0.3s;
}
.demo-tip.show { display: block; }
@keyframes tipIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.demo-tip .tip-title { 
  font-weight: 600; 
  margin-bottom: 8px; 
  color: var(--brand); 
  font-size: 13.5px;
}
.demo-tip .tip-text { 
  color: var(--text-2); 
  line-height: 1.85;
  font-size: 12.5px;
}
.demo-tip .tip-close {
  position: absolute;
  top: 10px;
  right: 12px;
  cursor: pointer;
  color: var(--text-4);
}
