/* ============================================
   企业 AI 产品知识库与智能问答 MVP — 样式表
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f0f2f5;
  color: #1a202c;
  line-height: 1.6;
  min-width: 768px;
}

/* ---------- 导航栏 ---------- */
.navbar {
  background: #1a365d;
  color: #fff;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand { font-size: 16px; font-weight: 600; letter-spacing: 0.5px; }
.navbar-tabs { display: flex; gap: 4px; }
.nav-tab {
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-tab:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-tab.active { background: rgba(255,255,255,0.18); color: #fff; font-weight: 500; }

/* ---------- 主容器 ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 24px 32px 48px; }
.section-title {
  font-size: 20px;
  font-weight: 600;
  color: #1a365d;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}

/* ---------- 通用卡片 ---------- */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 24px;
  margin-bottom: 16px;
}
.card-label {
  font-size: 12px;
  font-weight: 500;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 99px;
  font-weight: 500;
}
.tag-blue   { background: #ebf5ff; color: #2b6cb0; }
.tag-green  { background: #f0fff4; color: #276749; }
.tag-purple { background: #faf5ff; color: #6b46c1; }
.tag-orange { background: #fffaf0; color: #c05621; }
.tag-red    { background: #fff5f5; color: #c53030; }
.tag-gray   { background: #edf2f7; color: #4a5568; }

/* ---------- Tab 面板 ---------- */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================
   模块 1：项目背景
   ============================================ */
.hero {
  background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
  color: #fff;
  border-radius: 8px;
  padding: 32px;
  margin-bottom: 24px;
}
.hero h2 { font-size: 22px; margin-bottom: 8px; }
.hero p { font-size: 14px; opacity: 0.85; max-width: 800px; line-height: 1.8; }
.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 20px;
}
.hero-stat-item { text-align: center; }
.hero-stat-num { font-size: 28px; font-weight: 700; }
.hero-stat-label { font-size: 12px; opacity: 0.7; margin-top: 2px; }

/* ============================================
   模块 2：智能问答
   ============================================ */
.query-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}
.input-panel { position: sticky; top: 80px; }
.input-box textarea {
  width: 100%;
  min-height: 100px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.input-box textarea:focus { border-color: #4299e1; }
.btn-primary {
  display: inline-block;
  background: #2b6cb0;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.15s;
}
.btn-primary:hover { background: #2c5282; }
.btn-primary:disabled { background: #a0aec0; cursor: not-allowed; }

.quick-list { margin-top: 16px; }
.quick-list .card-label { margin-bottom: 6px; }
.quick-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  color: #2d3748;
  cursor: pointer;
  margin-bottom: 6px;
  transition: border-color 0.15s, background 0.15s;
}
.quick-btn:hover { border-color: #4299e1; background: #ebf8ff; }

/* ---------- 回答结果区 ---------- */
.result-area { min-height: 400px; }
.result-placeholder {
  text-align: center;
  color: #a0aec0;
  padding: 80px 0;
  font-size: 14px;
}
.result-placeholder .icon { font-size: 48px; margin-bottom: 12px; display: block; }

.result-card { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.question-type-badge { margin-bottom: 12px; }

.ai-response-box {
  background: #f7fafc;
  border-left: 3px solid #2b6cb0;
  padding: 16px 20px;
  border-radius: 0 6px 6px 0;
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 16px;
}
/* 打字机光标 */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #2b6cb0;
  margin-left: 2px;
  animation: blink 0.8s infinite;
  vertical-align: text-bottom;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* 置信度条 */
.confidence-bar-wrapper { margin-bottom: 16px; }
.confidence-bar-bg {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}
.confidence-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.confidence-bar-fill.green  { background: #48bb78; }
.confidence-bar-fill.yellow { background: #ecc94b; }
.confidence-bar-fill.red    { background: #f56565; }
.confidence-text { font-size: 13px; color: #718096; margin-top: 4px; }

/* 风险提示 */
.risk-alert {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #c53030;
}
.risk-alert-title { font-weight: 600; margin-bottom: 4px; }

/* 人工介入 */
.intervention-box {
  background: #fffff0;
  border: 1px solid #fefcbf;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #975a16;
}

/* 匹配知识库 */
.kb-matches { margin-bottom: 16px; }
.kb-match-item {
  background: #f7fafc;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 13px;
}
.kb-match-title { font-weight: 600; color: #2d3748; margin-bottom: 4px; }
.kb-match-summary { color: #718096; }

/* 工单摘要 */
.ticket-summary {
  background: #f0f4f8;
  border-radius: 6px;
  padding: 16px;
  font-size: 13px;
}
.ticket-row { display: flex; margin-bottom: 6px; }
.ticket-key { width: 100px; color: #718096; flex-shrink: 0; }
.ticket-val { color: #2d3748; }

/* ============================================
   模块 3：知识库
   ============================================ */
.kb-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.kb-search {
  flex: 1;
  min-width: 200px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.kb-search:focus { border-color: #4299e1; }
.kb-filter {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  background: #fff;
  color: #4a5568;
  cursor: pointer;
  outline: none;
}

.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.kb-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 20px;
  transition: box-shadow 0.15s;
}
.kb-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.kb-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.kb-card-title { font-size: 14px; font-weight: 600; color: #1a365d; }
.kb-card-meta { font-size: 12px; color: #a0aec0; margin-top: 2px; }
.kb-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.kb-card-usage { font-size: 12px; color: #a0aec0; margin-top: 10px; }

/* ============================================
   模块 4：评估报告
   ============================================ */
.eval-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.eval-stat-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 20px;
  text-align: center;
}
.eval-stat-num { font-size: 32px; font-weight: 700; }
.eval-stat-label { font-size: 13px; color: #718096; margin-top: 4px; }

.eval-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.eval-table th {
  background: #f7fafc;
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: #4a5568;
  border-bottom: 2px solid #e2e8f0;
}
.eval-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
  vertical-align: top;
}
.eval-table tr:hover td { background: #f7fafc; }
.eval-expand-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  color: #4a5568;
  cursor: pointer;
}
.eval-expand-btn:hover { background: #edf2f7; }
.eval-detail { display: none; }
.eval-detail.open { display: block; }
.eval-detail-inner {
  background: #f7fafc;
  border-radius: 6px;
  padding: 16px;
  margin-top: 8px;
  font-size: 13px;
}
.eval-scores-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.eval-score-item { text-align: center; }
.eval-score-val { font-size: 20px; font-weight: 700; }
.eval-score-label { font-size: 11px; color: #718096; }

/* ============================================
   模块 5：PoC 验收
   ============================================ */
.poc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
.poc-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 20px;
}
.poc-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.poc-card-title { font-size: 15px; font-weight: 600; color: #1a365d; }
.poc-card-row { display: flex; margin-bottom: 6px; font-size: 13px; }
.poc-card-key { width: 80px; color: #718096; flex-shrink: 0; }
.poc-card-val { color: #2d3748; }
.poc-accuracy {
  font-size: 28px;
  font-weight: 700;
  margin: 12px 0;
}
.poc-progress-bg {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}
.poc-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: #48bb78;
  transition: width 0.6s ease;
}

/* ---------- 状态标签颜色 ---------- */
.status-进行中 { background: #ebf8ff; color: #2b6cb0; }
.status-规划中 { background: #faf5ff; color: #6b46c1; }
.status-已完成 { background: #f0fff4; color: #276749; }
.status-已取消 { background: #edf2f7; color: #718096; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .query-layout { grid-template-columns: 1fr; }
  .input-panel { position: static; }
  .eval-overview { grid-template-columns: repeat(2, 1fr); }
}
