/* Tailwind CSS CDN */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* ============================================================
   CSS 变量（设计令牌）
   ============================================================ */
:root {
  --color-primary:       #8B4513;
  --color-primary-dark:  #6B3410;
  --color-accent:        #C0392B;
  --color-navy:          #2C3E7A;
  --color-navy-deep:     #1a1a2e;
  --color-bg:            #F8F5F0;
  --color-bg-white:      #FFFFFF;
  --color-text:          #2C2C2C;
  --color-text-muted:    #666666;
  --color-border:        #E8E0D5;
  --color-success:       #27AE60;
  --color-warning:       #F39C12;
  --color-danger:        #E74C3C;
  --color-info:          #3498DB;

  --font-sans:           'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --radius-sm:           6px;
  --radius-md:           10px;
  --radius-lg:           16px;
  --shadow-sm:           0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:           0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg:           0 8px 40px rgba(0,0,0,0.14);
  --transition:          0.25s cubic-bezier(.4,0,.2,1);
}

/* ============================================================
   全局重置
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   导航栏
   ============================================================ */
.navbar {
  background: var(--color-navy-deep);
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.navbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.brand-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 1px;
}
.brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-left: 4px;
  display: none;
}
@media (min-width: 900px) { .brand-sub { display: inline; } }
.navbar-nav { display: flex; gap: 8px; }
.nav-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* ============================================================
   主体布局
   ============================================================ */
.main-layout {
  display: flex;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 24px 16px;
  gap: 20px;
}
@media (max-width: 900px) {
  .main-layout { flex-direction: column; }
}

/* ============================================================
   左侧输入面板
   ============================================================ */
.panel-left {
  width: 38%;
  flex-shrink: 0;
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
}
@media (max-width: 900px) { .panel-left { width: 100%; } }

.panel-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(135deg, #fdf8f3, #fff);
}
.panel-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 10px;
}

/* 步骤指示器 */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}
.step {
  padding: 3px 10px;
  border-radius: 20px;
  color: var(--color-text-muted);
  background: #f0ece8;
  cursor: default;
  transition: var(--transition);
}
.step.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 500;
}
.step.done {
  background: var(--color-success);
  color: #fff;
}
.step-sep { color: var(--color-border); font-size: 14px; }

/* 表单步骤 */
.form-step { padding: 20px 24px; flex: 1; }
.step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 藏品类型卡片 */
.type-cards { display: flex; gap: 8px; margin-bottom: 4px; }
.type-card {
  flex: 1;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: #fdf8f3;
  user-select: none;
}
.type-card:hover {
  border-color: var(--color-primary);
  transform: scale(1.02);
  box-shadow: var(--shadow-sm);
}
.type-card.selected {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, #fef5ee, #fff5f0);
  box-shadow: 0 0 0 3px rgba(139,69,19,0.12);
}
.type-card-icon {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 3px;
}
.type-card-name { font-size: 12px; font-weight: 600; color: var(--color-text); margin-bottom: 2px; }
.type-card-desc { font-size: 10px; color: var(--color-text-muted); }

/* 子类型单选 */
.subtype-group { }
.radio-group { display: flex; gap: 16px; }
.radio-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}
.radio-item input { accent-color: var(--color-primary); width: 14px; height: 14px; }

/* 表单组 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.full { grid-column: 1 / -1; }
.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
}
.form-label.required::after { content: ' *'; color: var(--color-danger); }
.form-input {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: #fafaf9;
  transition: var(--transition);
  outline: none;
  width: 100%;
}
.form-input:focus {
  border-color: var(--color-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(139,69,19,0.08);
}
.form-textarea { resize: vertical; min-height: 72px; }

/* AI 预填字段样式 */
.form-input.ai-prefilled {
  background: #fffbeb;
  border-color: #f5c842;
  position: relative;
}
.form-group {
  position: relative;
}
.form-input.ai-prefilled + .ai-prefill-tag,
.form-group:has(.ai-prefilled) .ai-prefill-tag {
  display: inline-block;
}


/* 复选框 */
.checkbox-group { display: flex; flex-direction: column; gap: 10px; }
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
  position: relative;
}
.checkbox-item input { display: none; }
.checkbox-mark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  flex-shrink: 0;
  transition: var(--transition);
  position: relative;
}
.checkbox-item input:checked ~ .checkbox-mark {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.checkbox-item input:checked ~ .checkbox-mark::after {
  content: '✓';
  color: #fff;
  font-size: 11px;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

/* 步骤导航 */
.step-nav { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* 按钮 */
.btn {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  transition: var(--transition);
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
}
.btn-ghost:hover { background: #f5f0eb; color: var(--color-text); }
.btn-generate {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff;
  padding: 11px 28px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(139,69,19,0.3);
}
.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139,69,19,0.4);
}
.btn-generate:disabled {
  opacity: 0.6;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}
.btn-generate-icon { font-size: 12px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ============================================================
   右侧预览面板
   ============================================================ */
.panel-right {
  flex: 1;
  background: var(--color-bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 600px;
  position: relative;
}

/* 空状态 */
.preview-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}
.empty-icon {
  font-size: 64px;
  font-weight: 200;
  color: var(--color-border);
  margin-bottom: 20px;
  letter-spacing: -4px;
}
.empty-title { font-size: 18px; font-weight: 500; color: var(--color-text-muted); margin-bottom: 8px; }
.empty-desc { font-size: 13px; color: #aaa; }

/* 生成中状态 */
.preview-generating { padding: 24px; }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.progress-title { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.pulse-dot {
  width: 10px; height: 10px;
  background: var(--color-primary);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
}
.progress-percent { font-size: 13px; color: var(--color-text-muted); }
.progress-bar-wrap { margin-bottom: 20px; }
.progress-bar-track {
  height: 6px;
  background: #f0ece8;
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 3px;
  width: 0%;
  transition: width 0.5s ease;
}

/* 实时分析日志区（生成中） */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.live-diag-section {
  margin-top: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fdfaf6;
  overflow: hidden;
}
.live-diag-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f5f0eb;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
}
.live-diag-header:hover { background: #ede8e3; }
.live-diag-icon { font-size: 14px; }
.live-diag-title { flex: 1; color: var(--color-text); }
.live-diag-sub {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 500;
}
/* 折叠/展开按钮 */
.live-diag-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: var(--color-text-muted);
  border-radius: 4px;
  flex-shrink: 0;
  transition: background 0.15s;
}
.live-diag-collapse-btn:hover { background: rgba(0,0,0,0.06); }
.live-diag-collapse-icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}
.live-diag-collapse-icon.collapsed { transform: rotate(180deg); }
.live-diag-collapse-icon.expanded  { transform: rotate(0deg); }
.live-diag-log {
  max-height: 320px;
  overflow-y: auto;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  transition: max-height 0.25s ease, padding 0.25s ease;
}
.live-diag-log::-webkit-scrollbar { width: 4px; }
.live-diag-log::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* Agent 折叠块 */
.live-diag-agent-block {
  animation: fadeInUp 0.25s ease;
  border-bottom: 1px solid #f0ece7;
}
.live-diag-agent-block:last-child { border-bottom: none; }

.live-diag-agent-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  background: #f5f0ea;
  user-select: none;
  transition: background 0.15s;
}
.live-diag-agent-header:hover { background: #ede7df; }

.live-diag-arrow {
  font-size: 10px;
  color: var(--color-primary);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.live-diag-agent-block.open .live-diag-arrow {
  transform: rotate(90deg);
}
.live-diag-agent-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-primary);
  flex: 1;
}
.live-diag-agent-count {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Agent 内容体（折叠/展开） */
.live-diag-agent-body {
  display: none;
  flex-direction: column;
  padding: 4px 0;
  background: #fdfaf6;
}
.live-diag-agent-block.open .live-diag-agent-body {
  display: flex;
}

/* 诊断步骤折叠块（实时分析过程） */
.live-diag-step-block {
  border-top: 1px dashed #e8e2d9;
  margin: 0;
  animation: fadeInUp 0.2s ease;
}
.live-diag-step-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 16px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 500;
  color: #5b3fa6;
  background: #f9f6ff;
  transition: background 0.15s;
}
.live-diag-step-header:hover { background: #f1ecff; }
.live-diag-step-arrow {
  font-size: 10px;
  color: #9d7fe0;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.live-diag-step-title {
  flex: 1;
  font-size: 12px;
}
.live-diag-step-body {
  padding: 8px 12px 8px 16px;
  background: #fdfcff;
  font-size: 12px;
  overflow-x: auto;
}
.live-diag-step-body .diag-table {
  font-size: 11px;
  margin-top: 0;
}
.live-diag-step-body .diag-table th {
  font-size: 11px;
  padding: 4px 7px;
}
.live-diag-step-body .diag-table td {
  padding: 3px 7px;
  font-size: 11px;
}
.live-diag-step-body .diag-chunk-title {
  margin: 6px 0 4px;
  font-size: 11px;
  font-weight: 500;
  color: #7b5ea7;
}
.live-diag-step-body .diag-chunk-mod {
  font-size: 11px;
  font-weight: 500;
  margin: 6px 0 2px;
  color: #5b3fa6;
}
.live-diag-step-body .diag-url-text {
  font-size: 10px;
  color: #7b8fa8;
  word-break: break-all;
}

/* 模块行 */
.live-diag-module-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 32px;
  font-size: 12.5px;
  color: var(--color-text);
  animation: fadeInUp 0.2s ease;
  border-radius: 0;
}
.live-diag-module-row:hover { background: #f5f2ed; }

.live-diag-check { color: var(--color-success); font-size: 12px; flex-shrink: 0; }
.live-diag-mod-name { flex: 1; font-weight: 500; }
.live-diag-words { font-size: 11px; color: #aaa; margin-left: auto; flex-shrink: 0; }

.live-diag-confidence {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 8px;
  flex-shrink: 0;
}
.live-diag-confidence.verified   { background: #e8f5e9; color: var(--color-success); }
.live-diag-confidence.referenced { background: #e3f2fd; color: var(--color-info); }
.live-diag-confidence.uncertain  { background: #fff3cd; color: var(--color-warning); }

.live-diag-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 500;
  flex-shrink: 0;
}
.live-diag-badge.kb    { background: #e8f5e9; color: var(--color-success); }
.live-diag-badge.model { background: #e3f2fd; color: var(--color-info); }

/* 完成状态工具栏 */
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(135deg, #fdf8f3, #fff);
  position: sticky;
  top: 0;
  z-index: 10;
}
.preview-stats { font-size: 12px; color: var(--color-text-muted); }
.toolbar-actions { display: flex; gap: 8px; }

/* 可信度说明 */
.confidence-legend {
  padding: 5px 14px;
  font-size: 11px;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  background: #fafaf9;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.badge.verified { background: #e8f5e9; color: var(--color-success); }
.badge.referenced { background: #e3f2fd; color: var(--color-info); }
.badge.uncertain { background: #fff3cd; color: var(--color-warning); }

/* 模块列表 */
.module-list { padding: 8px 14px; overflow-y: auto; flex: 1; }
.module-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  overflow: hidden;
  animation: fadeInUp 0.4s ease;
  transition: box-shadow var(--transition);
}
.module-card:hover { box-shadow: var(--shadow-sm); }
.module-card.uncertain {
  border-color: #ffeeba;
  background: #fffdf5;
  opacity: 0.8;
}
.module-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  cursor: pointer;
  background: #fdf8f3;
  user-select: none;
  transition: background var(--transition);
}
.module-card-header:hover { background: #f5ede2; }
.module-card.uncertain .module-card-header { background: #fffaed; }
.module-card-left { display: flex; align-items: center; gap: 8px; }
.module-card-name { font-size: 13px; font-weight: 600; color: var(--color-primary); }
.module-card-right { display: flex; align-items: center; gap: 8px; }
.word-badge {
  font-size: 11px;
  color: var(--color-text-muted);
  background: #f0ece8;
  padding: 2px 7px;
  border-radius: 10px;
}
.collapse-icon { font-size: 12px; color: var(--color-text-muted); transition: transform var(--transition); }
.module-card.open .collapse-icon { transform: rotate(180deg); }
.module-card-body {
  display: none;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
  white-space: pre-wrap;
}
.module-card.open .module-card-body { display: block; }
.module-unverified-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--color-warning);
  background: #fff3cd;
  padding: 3px 10px;
  border-radius: 10px;
}
.qa-issue-tag {
  display: inline-block;
  margin-top: 4px;
  margin-right: 4px;
  font-size: 11px;
  color: var(--color-danger);
  background: #fde8e8;
  padding: 2px 8px;
  border-radius: 10px;
}

/* uncertain 汇总 */
.uncertain-summary {
  margin: 0 20px 16px;
  padding: 14px 16px;
  background: #fffdf5;
  border: 1px solid #ffeeba;
  border-radius: var(--radius-md);
}
.uncertain-title { font-size: 13px; font-weight: 600; color: var(--color-warning); margin-bottom: 8px; }
.uncertain-item { font-size: 13px; color: var(--color-text-muted); padding: 4px 0; }

/* 审核问题汇总 */
.qa-summary {
  margin: 0 20px 20px;
  padding: 14px 16px;
  background: #fef8f5;
  border: 1px solid #f5cba7;
  border-radius: var(--radius-md);
}
.qa-title { font-size: 13px; font-weight: 600; color: var(--color-primary); margin-bottom: 8px; }
.qa-item { font-size: 12px; color: var(--color-text-muted); padding: 3px 0; }

/* ============================================================
   历史记录抽屉
   ============================================================ */
.drawer { position: fixed; inset: 0; z-index: 200; }
.drawer-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.drawer-panel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 320px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-navy-deep);
  color: #fff;
}
.drawer-header h3 { font-size: 15px; font-weight: 600; }
.drawer-close { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 16px; cursor: pointer; }
.drawer-close:hover { color: #fff; }
.history-list { flex: 1; overflow-y: auto; padding: 12px; }
.history-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--color-border);
  margin-bottom: 8px;
  transition: var(--transition);
}
.history-item:hover { background: #fdf8f3; border-color: var(--color-primary); }
.history-name { font-size: 13px; font-weight: 500; }
.history-meta { font-size: 11px; color: var(--color-text-muted); margin-top: 3px; }


/* ============================================================
   诊断面板
   ============================================================ */
.diag-section {
  margin: 0 20px 20px;
}

/* 折叠触发按钮 */
.diag-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: #f3f0ff;
  border: 1.5px solid #c9b9f5;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #5b3fa6;
  text-align: left;
  transition: var(--transition);
  outline: none;
  font-family: var(--font-sans);
}
.diag-toggle:hover { background: #ebe6ff; border-color: #9c7ce0; }
.diag-toggle.diag-toggle-open {
  background: #ebe6ff;
  border-color: #9c7ce0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.diag-toggle-icon { font-size: 10px; transition: transform var(--transition); }
.diag-toggle-open .diag-toggle-icon { transform: none; }
.diag-toggle-label { flex: 1; }
.diag-toggle-sub {
  font-size: 11px;
  font-weight: 400;
  color: #8b72c8;
  background: rgba(155,124,224,0.13);
  padding: 1px 8px;
  border-radius: 10px;
}

/* 内容区 */
.diag-body {
  border: 1.5px solid #c9b9f5;
  border-top: none;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  background: #fdfcff;
  padding: 12px 16px;
  max-height: 600px;
  overflow-y: auto;
}
.diag-loading { text-align: center; color: #8b72c8; padding: 16px; font-size: 13px; }
.diag-error { color: var(--color-danger); font-size: 13px; padding: 8px 0; }

/* 元信息 */
.diag-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

/* 总览卡片 */
.diag-summary-card {
  background: #fff;
  border: 1px solid #e0d8f5;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.diag-summary-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.diag-stat-label {
  width: 72px;
  flex-shrink: 0;
  font-weight: 500;
  color: var(--color-text-muted);
}
.diag-stat-val { color: var(--color-text); }
.diag-error-text { color: var(--color-warning); }

/* 徽章 */
.diag-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 4px;
}
.diag-badge.kb { background: #e8f5e9; color: #27ae60; }
.diag-badge.model { background: #fff3cd; color: #856404; }
.diag-badge.web { background: #e3f2fd; color: #1565c0; }
.diag-badge.warn { background: #fff3cd; color: #856404; }

/* 每步折叠 */
.diag-step {
  border: 1px solid #e8e0f5;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}
.diag-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f7f4ff;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
  font-size: 12px;
  font-weight: 500;
  color: #5b3fa6;
}
.diag-step-header:hover { background: #eee8ff; }
.diag-step-arrow {
  font-size: 10px;
  transition: transform var(--transition);
  flex-shrink: 0;
}
.diag-step.diag-step-open .diag-step-arrow { transform: rotate(90deg); }
.diag-step-title { flex: 1; }
.diag-step-body {
  display: none;
  padding: 10px 12px;
  background: #fff;
}
.diag-step.diag-step-open .diag-step-body { display: block; }

/* 表格 */
.diag-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 4px;
}
.diag-table th {
  background: #f7f4ff;
  color: #5b3fa6;
  font-weight: 600;
  padding: 5px 8px;
  text-align: left;
  border-bottom: 1px solid #e0d8f5;
  white-space: nowrap;
}
.diag-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #f0ecff;
  color: var(--color-text);
  vertical-align: top;
}
.diag-table-sm td, .diag-table-sm th { padding: 4px 7px; }
.diag-table tr:last-child td { border-bottom: none; }
.diag-row-miss td { color: #8b7240; background: #fffaf0; }
.diag-row-fail td { color: var(--color-danger); background: #fff5f5; }

.diag-mono { font-family: monospace; font-size: 11px; color: #666; }
.diag-score { font-weight: 600; color: #5b3fa6; white-space: nowrap; }
.diag-query { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.diag-text-muted { color: var(--color-text-muted); }
.diag-empty { font-size: 12px; color: var(--color-text-muted); padding: 6px 0; }
.diag-chunk-title {
  font-size: 11px;
  font-weight: 600;
  color: #5b3fa6;
  margin: 10px 0 4px;
}
.diag-chunk-mod {
  font-size: 12px;
  font-weight: 500;
  margin: 8px 0 2px;
  color: var(--color-primary);
}
.diag-issue-tag {
  display: inline-block;
  font-size: 11px;
  color: var(--color-danger);
  background: #fde8e8;
  padding: 1px 7px;
  border-radius: 8px;
  margin-right: 4px;
  margin-bottom: 2px;
}
.diag-link {
  color: #1565c0;
  text-decoration: none;
  font-size: 11px;
}
.diag-link:hover { text-decoration: underline; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-navy-deep);
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================================
   辅助
   ============================================================ */
.hidden { display: none !important; }

/* ============================================================
   新单步表单样式
   ============================================================ */

/* 面板副标题 */
.panel-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* 名称输入行（带识别指示点） */
.name-group { padding: 20px 24px 0; }
.name-input-wrap { position: relative; }
.name-input { font-size: 15px; padding: 10px 12px; }

/* AI 识别状态提示 */
.detect-hint {
  font-size: 12px;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}
.detect-hint-loading {
  color: #a07820;
  background: #fffae6;
  border: 1px solid #f0d87a;
  animation: detect-pulse 1s ease-in-out infinite;
}
.detect-hint-done {
  color: #2d7a50;
  background: #f0faf5;
  border: 1px solid #7ecfa0;
}
.detect-hint-error {
  color: #a03020;
  background: #fff2f0;
  border: 1px solid #ffb0a0;
}
@keyframes detect-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}




/* 类型卡片紧凑版 */
.type-cards.compact .type-card { padding: 6px 4px; }
.type-cards.compact .type-card-icon { font-size: 14px; margin-bottom: 2px; }
.type-cards.compact .type-card-name { font-size: 11px; }
.type-cards.compact .type-card-desc { font-size: 9px; }

/* 表单整体（单步模式） */
#artifact-form {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
}

#artifact-form .form-group.full.name-group {
  padding: 20px 24px 0;
}

#artifact-form .form-group.full:not(.name-group) {
  padding: 12px 24px 0;
}

/* ─── 二级子类选择区（文物/书画通用） ─── */
.subtype-section {
  margin: 6px 24px 0;
  padding: 8px 12px;
  background: #fafafa;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.subtype-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.subtype-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.subtype-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 48px;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  transition: var(--transition);
  user-select: none;
}
.subtype-card:hover {
  border-color: var(--color-primary);
  background: #fef5ee;
}
.subtype-card.selected {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, #fef5ee, #fff5f0);
  box-shadow: 0 0 0 2px rgba(139,69,19,0.15);
}
.subtype-icon {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 3px;
}
.subtype-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text);
}
.subtype-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ─── 文物专属字段区 ─── */
.artifact-specific-fields {
  margin-top: 12px;
}
.form-divider {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-align: center;
  border-top: 1px dashed var(--color-border);
  padding-top: 8px;
  margin-bottom: 10px;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
}

/* ── 选填信息区（固定高度 + 内部滚动） ── */
.optional-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 标题行：左侧文字 + 右侧自动生成按钮 */
.optional-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px 9px 14px;
  background: #faf7f4;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.optional-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.optional-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

/* 自动生成按钮区（在标题栏内） */
.assess-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.assess-hint {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.4;
  white-space: nowrap;
}

/* 滚动内容体 */
.optional-body {
  padding: 12px 14px 14px;
  background: #fff;
  max-height: 340px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
/* 自定义滚动条 */
.optional-body::-webkit-scrollbar { width: 5px; }
.optional-body::-webkit-scrollbar-track { background: transparent; }
.optional-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
.optional-body::-webkit-scrollbar-thumb:hover { background: #c0a888; }
/* 检索完成态 */
.assess-done {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #f0faf4;
  border: 1px solid #b7e5c8;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.assess-done-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #34c759;
  color: #fff;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.assess-done-text {
  font-size: 12px; font-weight: 500; color: #1a7a3c; flex: 1;
}
.assess-done-redo {
  font-size: 11px; color: var(--color-text-muted);
  background: none; border: none; cursor: pointer;
  padding: 2px 6px; border-radius: 4px;
  font-family: var(--font-sans); transition: var(--transition);
}
.assess-done-redo:hover { background: #ddf0e6; color: #1a7a3c; }

/* 选填字段网格 - 整齐两列 */
.optional-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  align-items: start;
}
.optional-fields .form-group.full { grid-column: 1 / -1; }
.optional-fields .form-input {
  padding: 6px 10px;
  font-size: 12px;
}
.optional-fields .form-label {
  font-size: 11px;
  margin-bottom: 2px;
}
.optional-fields .form-textarea {
  min-height: 54px;
  resize: vertical;
}

/* 特殊属性区 */
.optional-attrs { margin-top: 12px; }
.attrs-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.checkbox-group.compact { gap: 8px; }
.checkbox-group.compact .checkbox-item { font-size: 12px; }

/* ── 选填未填写确认弹窗 ── */
.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeInBg 0.15s ease;
}
@keyframes fadeInBg {
  from { opacity: 0; } to { opacity: 1; }
}
.confirm-modal {
  background: #fff;
  border-radius: var(--radius-lg, 12px);
  padding: 28px 28px 22px;
  width: 340px;
  max-width: 90vw;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  animation: popIn 0.18s ease;
  text-align: center;
}
@keyframes popIn {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.confirm-modal-icon {
  font-size: 28px;
  margin-bottom: 10px;
}
.confirm-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
}
.confirm-modal-body {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}
.confirm-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.confirm-btn-cancel {
  flex: 1;
  padding: 9px 0;
  border: 1.5px solid var(--color-border);
  background: #f5f0ea;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: var(--transition);
}
.confirm-btn-cancel:hover { background: #ece4d8; }
.confirm-btn-ok {
  flex: 1;
  padding: 9px 0;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: var(--transition);
}
.confirm-btn-ok:hover { background: #6b3510; }

/* 生成按钮行 */
.generate-row {
  padding: 12px 24px 20px;
  display: flex;
  justify-content: stretch;
}
.generate-row .btn-generate {
  width: 100%;
  justify-content: center;
}

/* bounce动画（下载按钮激活） */
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.bounce { animation: bounce 0.4s ease; }

/* ============================================================
   模块卡片 — 来源标注区
   ============================================================ */
.module-source-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px 10px;
  border-top: 1px dashed var(--color-border);
  background: #fafaf8;
}
.source-label {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-right: 2px;
}
.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.source-chip.kb {
  background: #e8f4ec;
  color: #2e7d52;
  border: 1px solid #b7dfc5;
}
.source-chip.kb:hover { background: #d0ecd9; }
.source-chip.web {
  background: #e8f0fc;
  color: #1a5eb8;
  border: 1px solid #b4ceee;
}
.source-chip.web:hover { background: #d4e4f8; }
.source-chip.model {
  background: #f4f0fc;
  color: #6b4fa8;
  border: 1px solid #d0c2ee;
}
.source-chip.model:hover { background: #e8e0f8; }
.source-chip-icon { font-size: 12px; }
.source-ref-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0,0,0,0.08);
}

/* ============================================================
   一致性检测报告卡片（与正文模块明显区分）
   ============================================================ */
.consistency-card {
  border-radius: var(--radius-md);
  margin: 12px 0 6px;
  overflow: hidden;
  animation: fadeInUp 0.4s ease;
  border: 2px dashed #d0c2ee;
  background: #f7f4fd;
  position: relative;
}
.consistency-card::before {
  content: 'QA';
  position: absolute;
  top: 8px;
  right: 48px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #9b7ecf;
  opacity: 0.5;
}
.consistency-card.has-conflicts {
  border-color: #e8a87c;
  background: #fdf6f0;
}
.consistency-card.has-conflicts::before {
  color: #c0703a;
}
.consistency-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  cursor: pointer;
  background: #ede8f8;
  user-select: none;
  border-bottom: 1px solid #d0c2ee;
  transition: background var(--transition);
}
.consistency-card.has-conflicts .consistency-header {
  background: #faebd7;
  border-bottom-color: #e8c8a0;
}
.consistency-header:hover { filter: brightness(0.97); }
.consistency-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.consistency-icon { font-size: 16px; line-height: 1; }
.consistency-title {
  font-size: 13px;
  font-weight: 700;
  color: #5c3d9e;
  letter-spacing: 0.3px;
}
.consistency-card.has-conflicts .consistency-title { color: #a0522d; }
.consistency-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.consistency-status {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
}
.consistency-status.pass {
  background: #d4edda;
  color: #276b3b;
  border: 1px solid #b7dfc5;
}
.consistency-status.conflict {
  background: #fde8d8;
  color: #b85a1a;
  border: 1px solid #e8c0a0;
}
.consistency-body {
  padding: 12px 16px !important;
  background: transparent !important;
  border-top: none !important;
  white-space: normal !important;
  line-height: 1.7 !important;
}
.consistency-intro {
  font-size: 12px;
  color: #7a6690;
  margin-bottom: 10px;
  line-height: 1.6;
}
.consistency-card.has-conflicts .consistency-intro { color: #8c6040; }
.consistency-item {
  font-size: 13px;
  font-weight: 600;
  color: #b85a1a;
  margin: 10px 0 2px;
  padding: 4px 0;
  border-left: 3px solid #e8a87c;
  padding-left: 10px;
}
.consistency-desc {
  font-size: 12px;
  color: #7a6680;
  padding-left: 20px;
  margin-bottom: 4px;
}
.consistency-card.no-conflicts .consistency-body {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #276b3b;
  font-size: 13px;
  font-weight: 500;
}


.sources-section {
  margin: 0 20px 24px;
  padding: 16px;
  background: #f0f4f8;
  border: 1px solid #c8d8e8;
  border-top: 3px solid #5580aa;
  border-radius: var(--radius-md);
}
.sources-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #2c4a6e;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sources-list { display: flex; flex-direction: column; gap: 6px; }
.source-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--color-border);
  transition: var(--transition);
}
.source-entry:hover { border-color: #8B4513; background: #fdf9f6; }
.source-entry.source-entry-kb { border-left: 3px solid #2e7d52; }
.source-entry.source-entry-web { border-left: 3px solid #1a5eb8; }
.source-entry.source-entry-model { border-left: 3px solid #6b4fa8; }
.source-entry-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  margin-top: 1px;
}
.source-entry-body { flex: 1; min-width: 0; }
.source-entry-module {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}
.source-entry-desc {
  font-size: 12px;
  color: var(--color-text);
  line-height: 1.6;
}
.source-entry-link {
  font-size: 11px;
  color: var(--color-info);
  word-break: break-all;
  text-decoration: underline;
  cursor: pointer;
}
.source-entry-link:hover { color: var(--color-primary); }
.source-entry-action {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: #fff;
  cursor: pointer;
  color: var(--color-primary);
  transition: var(--transition);
  white-space: nowrap;
}
.source-entry-action:hover { background: var(--color-primary); color: #fff; }

/* 高亮关联模块卡片 */
.module-card.source-highlight {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ============================================================
   KB 切片详情弹窗
   ============================================================ */
.chunk-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.chunk-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.chunk-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}
.chunk-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}
.chunk-modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f0ebe4;
  color: var(--color-text);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.chunk-modal-close:hover { background: var(--color-primary); color: #fff; }
.chunk-modal-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  padding: 8px 20px;
  background: #fafaf8;
  border-bottom: 1px solid var(--color-border);
}
.chunk-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.chunk-item {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #f9f6f2;
  border-radius: var(--radius-sm);
  border-left: 3px solid #2e7d52;
}
.chunk-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.chunk-id-tag {
  font-size: 10px;
  font-family: monospace;
  color: var(--color-text-muted);
  background: #e8e0d5;
  padding: 1px 6px;
  border-radius: 4px;
}
.chunk-score-tag {
  font-size: 10px;
  color: #2e7d52;
  background: #e8f4ec;
  padding: 1px 6px;
  border-radius: 4px;
}
.chunk-content {
  font-size: 13px;
  line-height: 1.8;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ============================================================
   检索评估按钮行 & 评估卡片
   ============================================================ */

/* 按钮行 */
.assess-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 24px 0;
}
.assess-hint {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* 自动生成选填信息按钮（主操作，实心醒目） */
.btn-assess {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: not-allowed;
  white-space: nowrap;
  transition: var(--transition);
  font-family: var(--font-sans);
  letter-spacing: 0.2px;
  box-shadow: 0 2px 6px rgba(139,69,19,0.20);
  flex-shrink: 0;
}
.btn-assess:not(:disabled) {
  cursor: pointer;
}
.btn-assess:not(:disabled):hover {
  background: #6b3510;
  box-shadow: 0 3px 10px rgba(139,69,19,0.35);
  transform: translateY(-1px);
}
.btn-assess:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(139,69,19,0.2);
}
.btn-assess:disabled {
  opacity: 0.45;
  background: #c8a882;
  box-shadow: none;
}
.btn-assess-icon {
  font-size: 13px;
}


/* ── 字段来源徽章（自动填入后显示在字段下方） ── */
.field-source-badge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
  line-height: 1;
}
.fsb-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.fsb-kb {
  background: #e3f0ff;
  color: #1a5ab8;
}
.fsb-web {
  background: #e6f7ef;
  color: #1a7a3c;
}
.fsb-model {
  background: #f0eaff;
  color: #5a35a0;
}
.fsb-agree {
  font-size: 10px;
  color: #1a7a3c;
  font-weight: 500;
}
.fsb-conflict {
  font-size: 10px;
  color: #c62828;
  font-weight: 600;
}
.fsb-tip {
  font-size: 10px;
  color: #a05000;
  font-weight: 400;
}

/* label 右侧来源标签（行内） */
.field-source-badge.source-kb,
.field-source-badge.source-web,
.field-source-badge.source-model {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
  line-height: 1.6;
}
.field-source-badge.source-kb {
  background: #e3f0ff;
  color: #1a5ab8;
  border: 1px solid #b3d1f5;
}
.field-source-badge.source-web {
  background: #e6f7ef;
  color: #1a7a3c;
  border: 1px solid #90d4ad;
}
.field-source-badge.source-model {
  background: #f0eaff;
  color: #5a35a0;
  border: 1px solid #c5a8f0;
}



/* 输入框 AI 预填样式 */
.ai-prefilled {
  background: #f0faf4 !important;
  border-color: #52a76f !important;
}



