/* ================================================================
   新版 UI — 欢迎卡片 + 功能网格 + 定价 + 弹窗 + 国家抽屉
   ================================================================ */

/* ── 欢迎卡片 ── */
/* ── 欢迎区 v2：大头像 + 对话气泡 + 留白 ── */
.ai-chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 14px 8px;
  text-align: center;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.ai-chat-welcome-card {
  background: var(--card, #FFF);
  border-radius: 20px;
  padding: 18px 16px 14px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05), 0 0 0 1px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

/* ── 情境横幅 ── */
.ai-context-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--primary-lighter, #F0FDFA);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary, #0D9488);
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.15s;
}
.ai-context-banner.is-hidden { display: none !important; }
.ai-context-banner:hover { background: color-mix(in srgb, var(--primary) 10%, #fff 90%); }
.ai-context-banner-icon { font-size: 18px; flex-shrink: 0; line-height: 1; }
.ai-context-banner-text { flex: 1; text-align: left; }

/* ── 大头像 ── */
.ai-welcome-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.ai-welcome-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary, #0D9488), #14B8A6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.18);
}
.ai-welcome-avatar .fa-robot {
  font-size: 26px;
  line-height: 1;
}
.ai-welcome-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary, #1E293B);
  margin: 0;
  line-height: 1.35;
  text-align: center;
  letter-spacing: -0.01em;
}
.ai-welcome-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary, #94A3B8);
  margin: 2px 0 12px;
  line-height: 1.45;
}
.ai-welcome-tag { display: none; }

/* ── 开场问题气泡（对话优先） ── */
.ai-starter-bubbles {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
  align-items: flex-start;
  width: 100%;
}
.ai-starter-bubble {
  background: var(--bg-secondary, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 16px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #1E293B);
  text-align: left;
  cursor: pointer;
  line-height: 1.4;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  font-family: inherit;
  border-bottom-left-radius: 4px;
}
.ai-starter-bubble:hover,
.ai-starter-bubble:active {
  border-color: var(--primary, #0D9488);
  background: var(--primary-lighter, #F0FDFA);
  transform: translateX(2px);
}

/* ── 决策滑动卡片 ── */
.ai-decision-shortcuts {
  margin-bottom: 12px;
}
.ai-decision-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.ai-decision-title {
  font-size: 13px;
  font-weight: 700;
  color: #1c2430;
}
.ai-decision-sub {
  font-size: 11px;
  color: #6c7685;
}

/* ── 水平滑动卡片轨道 ── */
.ai-decision-card-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 4px;
  scrollbar-width: none;
}
.ai-decision-card-track::-webkit-scrollbar { display: none; }

.ai-decision-card {
  flex: 0 0 132px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 11px;
  border-radius: 14px;
  border: 1px solid var(--border, #E2E8F0);
  background: var(--card, #FFF);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  font-family: inherit;
  min-width: 0;
}
.ai-decision-card:hover,
.ai-decision-card:active {
  border-color: var(--primary, #0D9488);
  background: var(--primary-lighter, #F0FDFA);
  transform: translateY(-1px);
}
.ai-decision-card-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--primary-lighter, #F0FDFA);
  color: var(--primary, #0D9488);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  line-height: 1;
}
.ai-decision-card-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary, #1E293B);
  line-height: 1.25;
}
.ai-decision-card-hint {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary, #94A3B8);
  line-height: 1.25;
}
.ai-decision-card:hover .ai-decision-card-label { color: var(--primary, #0D9488); }

.ai-solution-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ai-solution-meta-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #364fc7;
}

.ai-solution-meta-chip--risk-high {
  background: #fff5f5;
  color: #c92a2a;
}

.ai-solution-meta-chip--risk-medium {
  background: #fff9db;
  color: #e67700;
}

.ai-solution-template-locked {
  font-size: 12px;
  color: #868e96;
  margin: 4px 0 0;
}

.ai-feature-section-head {
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: #6c7685;
}
.ai-feature-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.ai-feature-scroll {
  width: 100%;
  max-height: min(44dvh, 300px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}
.ai-feature-scroll::-webkit-scrollbar { width: 4px; }
.ai-feature-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.35); border-radius: 4px; }
.ai-feature-hero-row { display: none; }

/* ── 2×3 功能网格（优化间距+图标比例） ── */
.ai-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  transition: opacity 0.2s ease;
}
.ai-feature-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px 9px;
  background: var(--bg-secondary, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  min-height: 60px;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}
.ai-feature-icon {
  font-size: 20px;
  color: var(--primary, #0D9488);
  line-height: 1;
}
.ai-feature-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  width: 100%;
}
.ai-feature-btn .ai-feature-label {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-primary, #1E293B);
  text-align: center;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ai-feature-lock {
  font-size: 9px;
  color: var(--text-tertiary, #94A3B8);
  display: flex;
  align-items: center;
  gap: 2px;
}
.ai-feature-sub {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (hover: hover) and (pointer: fine) {
  .ai-feature-btn:hover .ai-feature-sub,
  .ai-feature-btn:focus-visible .ai-feature-sub {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    width: max-content;
    max-width: 160px;
    height: auto;
    margin: 0;
    padding: 4px 8px;
    clip: auto;
    overflow: visible;
    white-space: normal;
    font-size: 10px;
    line-height: 1.3;
    color: #fff;
    background: rgba(15, 23, 42, 0.92);
    border-radius: 6px;
    z-index: 2;
    pointer-events: none;
  }
}
.ai-feature-btn:hover {
  border-color: var(--primary, #0D9488);
  background: var(--primary-lighter, #F0FDFA);
}
.ai-feature-btn:active {
  transform: scale(0.97);
}
.ai-feature-btn--pro:hover {
  border-color: var(--primary, #0D9488);
}
.ai-feature-btn--hero {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border) 65%);
  background: var(--primary-lighter, #F0FDFA);
}
.ai-feature-topic-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  background: #64748B;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 0 12px 0 10px;
  line-height: 1.4;
}
.ai-feature-rec-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  background: var(--primary, #0D9488);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 0 12px 0 10px;
  line-height: 1.4;
}
.ai-feature-btn-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  background: var(--primary, #0D9488);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 0 12px 0 10px;
  line-height: 1.4;
}

/* ── Toast ── */
.ai-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  font-size: 13px;
  padding: 8px 20px;
  border-radius: 20px;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.ai-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
  .ai-chat-empty {
    padding: 12px 10px 6px;
  }
  .ai-chat-welcome-card {
    padding: 14px 12px 12px;
    border-radius: 16px;
  }
  .ai-welcome-title {
    font-size: 17px;
  }
  .ai-welcome-subtitle {
    font-size: 12px;
    line-height: 1.45;
  }
  .ai-feature-scroll {
    max-height: min(38dvh, 240px);
  }
  .ai-feature-grid {
    gap: 8px;
  }
  .ai-feature-btn {
    padding: 8px 4px 7px;
    min-height: 54px;
    border-radius: 12px;
  }
  .ai-feature-icon {
    font-size: 18px;
  }
  .ai-feature-btn .ai-feature-label {
    font-size: 11px;
  }
  .ai-decision-card {
    min-width: 108px;
    padding: 10px 8px;
  }
  .ai-decision-card-label {
    font-size: 12px;
  }
  .ai-decision-card-hint {
    font-size: 10px;
  }
}

/* ================================================================
