/* ═══════════════════════════════════════════════════════
   宣城华星 · 校园品牌内容工作台 v1.2
   Design: Navy sidebar + clean white content area
   Palette: from school badge (#1a1f5e navy, #4bb8d4 sky, #38a169 green)
   ═══════════════════════════════════════════════════════ */

:root {
  /* 冷静专业配色 v1.4.3 */
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --accent: #374151;
  --accent-light: #4b5563;
  --accent-bright: #6366f1;
  --success: #38a169;
  --warning: #dd6b20;
  --danger: #e53e3e;
  --border: #e5e7eb;
  --sidebar-bg: #1f2937;
  --sidebar-text: #e5e7eb;
  --sidebar-hover: #374151;
  --sidebar-active: #4b5563;
  --sidebar-width: 220px;
  /* 诊断中心专用 */
  --dc-success-bg: #c6f6d5;
  --dc-success-text: #22543d;
  --dc-warning-bg: #fefcbf;
  --dc-warning-text: #744210;
  --dc-danger-bg: #fed7d7;
  --dc-danger-text: #742a2a;
  --dc-neutral-bg: #edf2f7;
  --dc-neutral-text: #4a5568;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ═══ App Shell: sidebar + main ═══ */

.app-shell { display: flex; min-height: 100vh; }

/* ═══ Sidebar ═══ */

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-badge {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.15);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), box-shadow 0.3s;
}
.sidebar-badge:hover {
  transform: scale(1.08) rotate(3deg);
  box-shadow: 0 0 12px rgba(96,165,250,0.3);
}

.sidebar-badge-fallback {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a5f 0%, #2a5a8f 100%);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.15);
}

.sidebar-title { display: flex; flex-direction: column; overflow: hidden; }
.brand-name { font-size: 0.82rem; font-weight: 600; color: #fff; white-space: nowrap; letter-spacing: 0.02em; }
.brand-sub { font-size: 0.68rem; color: #9ca3af; white-space: nowrap; margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 0.75rem 0; }

.nav-item {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%; padding: 0.7rem 1rem;
  border: none; background: none;
  color: var(--sidebar-text);
  cursor: pointer; text-align: left;
  transition: all 0.2s cubic-bezier(.4,0,.2,1);
  font-family: inherit;
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute; left: 0; top: 0.45rem; bottom: 0.45rem; width: 3px;
  border-radius: 0 2px 2px 0;
  background: transparent;
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  transform: scaleY(0);
}

.nav-item:hover { background: var(--sidebar-hover); }
.nav-item:active { transform: scale(0.98); }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item.active::before { background: #60a5fa; transform: scaleY(1); }

.nav-icon { font-size: 1rem; flex-shrink: 0; line-height: 1; transition: transform 0.2s; }
.nav-item:hover .nav-icon { transform: scale(1.15); }

.nav-text { display: flex; flex-direction: column; min-width: 0; }
.nav-label { font-size: 0.88rem; font-weight: 500; display: block; line-height: 1.3; }
.nav-hint { font-size: 0.68rem; color: #6b7280; display: block; margin-top: 2px; line-height: 1.2; }
.nav-item.active .nav-hint { color: #93c5fd; }

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar-version { font-size: 0.7rem; color: #475569; font-weight: 600; font-variant-numeric: tabular-nums; }
.sidebar-tagline { font-size: 0.65rem; color: #475569; }

/* ═══ Mobile Nav ═══ */

.mobile-nav {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: var(--sidebar-bg);
  padding: 0; gap: 0;
}

.mobile-tab {
  flex: 1; padding: 0.7rem 0.5rem;
  border: none; background: none;
  color: var(--sidebar-text);
  font-size: 0.82rem; font-weight: 500;
  cursor: pointer; font-family: inherit;
  position: relative; transition: color 0.15s;
}

.mobile-tab::after {
  content: ''; position: absolute;
  bottom: 0; left: 20%; right: 20%; height: 2px;
  background: transparent; transition: background 0.15s;
}
.mobile-tab:active { transform: scale(0.95); }
.mobile-tab.active { color: #fff; }
.mobile-tab.active::after { background: #60a5fa; }

/* ═══ Main Content ═══ */

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem 2.5rem;
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: panelIn 0.3s cubic-bezier(.4,0,.2,1); }

@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ Panel Headers ═══ */

.panel-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}
.panel-header h1 {
  margin: 0 0 0.3rem; font-size: 1.5rem; font-weight: 700;
  color: var(--accent); letter-spacing: -0.01em;
}
.panel-desc { margin: 0; font-size: 0.9rem; color: var(--muted); }

/* ═══ Sections ═══ */

.section { margin-bottom: 2.5rem; }
.section-header { margin-bottom: 1rem; }
.section-header h2 { margin: 0 0 0.35rem; font-size: 1.1rem; font-weight: 600; color: var(--accent); }
.section-header p { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }

/* ═══ Cards ═══ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin: 1rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.25s cubic-bezier(.4,0,.2,1), border-color 0.25s;
}
.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.card.season { border-left: 4px solid var(--accent-bright); }
.card.season.empirical { border-left-color: var(--success); }
.card.season.hypothesis { border-left-color: var(--warning); }
.card.season.off_season { border-left-color: var(--muted); }

/* ═══ Forms ═══ */

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.35rem; color: var(--text); }
.form-group input, .form-group select {
  width: 100%; padding: 0.5rem 0.75rem;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.9rem; background: #fff; transition: all 0.2s cubic-bezier(.4,0,.2,1);
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12), 0 1px 2px rgba(0,0,0,0.04);
}

/* ═══ Buttons ═══ */

.btn {
  display: inline-block; padding: 0.55rem 1.1rem;
  border: none; border-radius: 7px;
  font-size: 0.88rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s cubic-bezier(.4,0,.2,1); font-family: inherit;
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.25) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.4s;
}
.btn:active::after { opacity: 1; transition: opacity 0s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.btn:active { transform: translateY(0) scale(0.97); box-shadow: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); }
.btn-secondary { background: #f0f0f0; color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; }

.result-panel { margin-top: 1rem; }
.result-score { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; }
.result-score.pass { color: var(--success); }
.result-score.fail { color: var(--danger); }
.result-breakdown { margin: 1rem 0; }
.result-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0; font-size: 0.9rem; }
.result-row .label { width: 90px; flex-shrink: 0; }
.result-row .bar { flex: 1; height: 20px; background: #f0f0f0; border-radius: 4px; overflow: hidden; }
.result-row .bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.result-row .bar-fill.full { background: var(--success); }
.result-row .bar-fill.partial { background: var(--warning); }
.result-row .bar-fill.empty { background: #d1d5db; }
.result-row .val { width: 50px; text-align: right; color: var(--muted); font-size: 0.85rem; }

.chart-container { width: 100%; height: 220px; margin: 1rem 0; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 500; }
.badge.empirical { background: #dcfce7; color: #166534; }
.badge.hypothesis { background: #fef9c3; color: #854d0e; }
.badge.off_season { background: #f0f0f0; color: var(--muted); }

/* 推荐生成器基础辅助（canonical 版本在下方 v0.2 新增区块中）*/
.btn-small { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.loading { color: var(--muted); font-size: 0.9rem; padding: 2rem; text-align: center; }
.error { color: var(--danger); font-size: 0.9rem; padding: 1rem; }

.theme-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
.theme-list span { background: #eff6ff; color: var(--accent); padding: 4px 10px; border-radius: 4px; font-size: 0.85rem; }

/* --- v0.2 新增：推荐生成器样式 --- */

.topic-grid-container { min-height: 200px; margin-top: 1rem; }

.season-header {
  padding: 1rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  margin-bottom: 1rem;
}
.season-header h3 { margin: 0 0 0.5rem; color: var(--accent); }
.season-header p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.topic-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: visible;
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  position: relative;
  animation: cardIn 0.35s cubic-bezier(.4,0,.2,1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.topic-card--hypothesis {
  border: 1.5px dashed #f0a500 !important;
  background: #fffdf5;
}

.topic-card:hover {
  border-color: var(--accent-bright);
  box-shadow: 0 6px 20px rgba(30, 58, 95, 0.1);
  transform: translateY(-3px);
}

.topic-card-header {
  padding: 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.topic-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.topic-card-header h4 { 
  margin: 0; 
  color: var(--text); 
  line-height: 1.4; 
  flex: 1;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  /* accent from sidebar-bg palette */
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 1.6em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.topic-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

/* v0.9 标注层芯片 */
.topic-anno-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.anno-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.72rem;
  line-height: 1.3;
  white-space: nowrap;
  font-weight: 500;
  cursor: default;
  transition: box-shadow 0.15s;
}

.anno-chip:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.topic-theme {
  display: inline-block;
  background: #eff6ff;
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.topic-card-body {
  padding: 1rem;
  flex: 1;
  font-size: 0.9rem;
}
.topic-card-body p { margin: 0.5rem 0; line-height: 1.5; }
.topic-card-body strong { color: var(--text); }

.topic-card-footer {
  padding: 1rem;
  background: #fafafa;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-buttons {
  display: flex;
  gap: 0.5rem;
}

.footer-buttons .btn {
  flex: 1;
  text-align: center;
  margin: 0;
}

.footer-tags {
  display: none; /* v0.9: tags moved to header annotation row */
}

.reasoning-note {
  margin-top: 0.55rem;
  color: #6b7280;
  font-size: 0.84rem;
  line-height: 1.45;
}

/* v0.9: 旧 priority-badge / star-badge / tag-chip 已移除，改用 .anno-chip */

@media (max-width: 768px) {
  .topic-card-title-row {
    flex-direction: column;
  }

  .footer-buttons {
    flex-direction: column;
  }
}

/* M1 月度计划板 */
.planner-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.planner-header h3 {
  margin: 0 0 0.25rem;
}

.planner-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.planner-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* 导出下拉 */
.export-dropdown { position: relative; }
.export-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  min-width: 140px; z-index: 50; overflow: hidden;
}
.export-menu button {
  display: block; width: 100%; padding: 0.55rem 1rem;
  border: none; background: none; text-align: left;
  font-size: 0.86rem; cursor: pointer; font-family: inherit;
  transition: background 0.15s;
}
.export-menu button:hover { background: #f0f0f0; }

/* 锁定按钮 */
.planner-lock-btn {
  background: #f0f0f0; color: var(--muted);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}
.planner-lock-btn.is-locked {
  background: #fff7ed; color: #c2410c;
  border-color: #fed7aa;
}
.planner-lock-btn:hover { opacity: 0.85; }

.planner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.planner-slot {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  min-height: 220px;
}

.planner-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.planner-slot-header h4 {
  margin: 0;
}

.planner-slot-header span {
  color: var(--muted);
  font-size: 0.8rem;
}

.planner-slot-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 150px;
}

.plan-item {
  background: #fff;
  border: 1px solid #dbeafe;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 0.55rem 0.6rem;
  cursor: grab;
  transition: box-shadow 0.2s, transform 0.2s;
}

.plan-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.plan-item:active {
  cursor: grabbing;
  transform: scale(1.02) rotate(0.5deg);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.plan-item-title {
  font-size: 0.86rem;
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.plan-item-meta {
  font-size: 0.74rem;
  color: var(--muted);
}

.plan-item-actions {
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.plan-item-btn {
  border: 1px solid #d1d5db;
  background: #f8fafc;
  color: #334155;
  font-size: 0.7rem;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  cursor: pointer;
}

.plan-item-btn:hover {
  background: #e5e7eb;
}

.plan-item-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.plan-item-order {
  margin-left: auto;
  font-size: 0.68rem;
  color: #9ca3af;
}

.plan-empty {
  color: #9ca3af;
  font-size: 0.82rem;
  text-align: center;
  padding: 1rem 0.4rem;
  border: 1px dashed #d1d5db;
  border-radius: 6px;
  background: #fff;
}

.plan-lock {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.5rem;
}

.planner-note {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.planner-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: var(--accent);
  color: #fff;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.planner-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.btn-plan {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.btn-plan:hover {
  background: #dcfce7;
  border-color: #86efac;
}

#plannerSection {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* 模态框样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { margin: 0; }
.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
}
.btn-close:hover { color: var(--text); }

.modal-body { padding: 1.25rem; }
.modal-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}
.modal-footer .btn { margin: 0; }

/* ===== v0.3 分层推荐器 ===== */

.v03-header {
  padding: 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  text-align: center;
}

.v03-header h4 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.v03-header p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.layer-section {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border-radius: 8px;
  background: #f5f5f5;
  border-left: 4px solid #6366f1;
}

.layer-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.layer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #6366f1;
  color: white;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1rem;
}

.layer-header h4 {
  margin: 0;
  font-size: 1.05rem;
  flex: 1;
}

.layer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}

.recommendation-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
}

.recommendation-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  border-color: #d1d5db;
}

.card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  color: #1f2937;
  flex: 1;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-row .label {
  font-weight: 500;
  color: #6b7280;
  min-width: 50px;
  flex-shrink: 0;
}

.info-row .value {
  color: #374151;
  flex: 1;
}

.reason {
  color: #6b7280;
  font-style: italic;
  margin-top: 0.5rem;
  display: block;
}

.progress-bar {
  display: inline-flex;
  width: 60px;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  margin: 0 0.25rem;
}

.progress-fill {
  height: 100%;
  background: #6366f1;
  transition: width 0.3s;
}

.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  padding: 0.25rem;
}

.copy-btn:hover {
  opacity: 1;
}

.copy-btn.copied {
  opacity: 1;
  color: #10b981;
}

.guide-content {
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
}

.guide-card {
  padding: 1rem;
  background: white;
  border-radius: 6px;
  border-left: 4px solid #6366f1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.guide-card span {
  font-size: 0.9rem;
}

.guide-card p {
  margin: 0;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.3;
}

/* ═══ Memory Architecture Grid ═══ */

.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.memory-layer {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
}

.memory-layer:hover {
  border-color: var(--accent-bright);
  box-shadow: 0 2px 8px rgba(59,130,246,0.08);
  transform: translateY(-1px);
}
.memory-layer.editable {
  cursor: pointer;
}

/* 记忆层维护类型徽章 */
.mem-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.35rem;
  letter-spacing: 0.02em;
}
.mem-badge.manual {
  background: #fef3c7;
  color: #92400e;
}
.mem-badge.semi {
  background: #dbeafe;
  color: #1e40af;
}
.mem-badge.auto {
  background: #dcfce7;
  color: #166534;
}

.memory-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.memory-info {
  flex: 1;
  min-width: 0;
}

.memory-info strong {
  display: block;
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 2px;
}

.memory-info p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.memory-status {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.memory-status.active {
  background: #dcfce7;
  color: #166534;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

.memory-status.inactive {
  background: #f0f0f0;
  color: #9ca3af;
}

/* ═══ Memory Editor ═══ */

.memory-editor-wrap {
  margin-top: 1rem;
}
.memory-editor {
  padding: 1.2rem;
}
.memory-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.memory-editor-header h3 {
  font-size: 0.95rem;
  color: var(--text);
  margin: 0;
}
.memory-editor-actions {
  display: flex;
  gap: 0.5rem;
}
.memory-editor-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}
#memEditorTextarea {
  width: 100%;
  min-height: 360px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--text);
  background: #f8fafc;
  resize: vertical;
  transition: border-color 0.2s;
}
#memEditorTextarea:focus {
  outline: none;
  border-color: var(--accent-bright);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* ═══ Calendar 年度校历 ═══ */

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.cal-month {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}
.cal-month:hover {
  border-color: var(--accent-bright);
  box-shadow: 0 2px 8px rgba(30,58,95,0.08);
  transform: translateY(-1px);
}
.cal-month.cal-current {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15), 0 2px 8px rgba(30,58,95,0.08);
}
.cal-month.cal-past {
  opacity: 0.65;
}
.cal-month.cal-expanded {
  border-color: var(--accent-bright);
  background: #f8fafc;
}

.cal-month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.cal-month-num {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
}
.cal-type-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 500;
  white-space: nowrap;
}

.cal-month-status {
  font-size: 0.72rem;
  color: #6b7280;
  margin-bottom: 6px;
  line-height: 1.3;
}

.cal-month-events {
  flex: 1;
  font-size: 0.72rem;
  color: #374151;
}
.cal-evt {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}
.cal-overflow {
  color: #9ca3af;
  font-style: italic;
}

.cal-status-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.65rem;
}
.cal-status-item {
  padding: 1px 5px;
  background: #f0f0f0;
  border-radius: 4px;
  color: #475569;
}
.cal-status-item.done {
  background: #dcfce7;
  color: #166534;
}

/* Calendar detail panel */
.cal-detail-inner {
  padding: 20px 24px;
  background: #fafbfc;
  border: 1.5px solid var(--accent-bright);
}
.cal-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.cal-detail-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--accent);
}
.cal-detail-section {
  margin-bottom: 16px;
}
.cal-detail-section h4 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: #334155;
}
.cal-detail-slot {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.cal-detail-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.cal-priority {
  font-size: 0.7rem;
}
.cal-detail-slot p {
  margin: 0;
  font-size: 0.8rem;
  color: #6b7280;
}
.cal-seeds {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.cal-seed {
  font-size: 0.7rem;
  padding: 1px 7px;
  background: #eff6ff;
  border-radius: 6px;
  color: #6366f1;
}

.cal-custom-event {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 0.82rem;
}
.cal-del-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.cal-del-btn:hover {
  color: #e53e3e;
  background: #fef2f2;
}

.cal-add-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  margin-bottom: 12px;
}
.cal-input {
  font-size: 0.82rem;
  padding: 5px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
}
.cal-input:focus {
  outline: none;
  border-color: var(--accent-bright);
}
.cal-select {
  min-width: 80px;
}
.cal-muted {
  color: #9ca3af;
  font-size: 0.82rem;
  font-style: italic;
}

/* ═══ Annual Panel — Year Switcher Row ═══ */
.annual-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.annual-year-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 6px 14px;
}
.annual-year-switcher label {
  font-size: 0.82rem;
  color: #6b7280;
  font-weight: 500;
}
.annual-year-switcher select {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 2px 4px;
}
.annual-year-label {
  font-size: 0.78rem;
  color: #9ca3af;
}

/* ═══ Calendar History Overlay ═══ */
.cal-has-history .cal-month-num {
  color: #38a169;
}
.cal-hist-overlay {
  margin-top: 6px;
  border-top: 1px solid #e5e7eb;
  padding-top: 5px;
}
.cal-hist-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 8px;
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
  margin-bottom: 4px;
}
.cal-hist-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
}
.cal-hist-count {
  color: #38a169;
  font-weight: 600;
}
.cal-hist-avg {
  color: #9ca3af;
}
.cal-hist-top {
  font-size: 0.68rem;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
  max-width: 100%;
}

/* Historical post list inside detail panel */
.cal-hist-post {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 6px;
  min-height: 0;
}
.cal-hist-post-main {
  flex: 1;
  min-width: 0;
}
.cal-hist-post-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 500;
  margin-bottom: 3px;
  display: inline-block;
}
.cal-hist-post-badge.q-boom  { background: #fef9c3; color: #a16207; }
.cal-hist-post-badge.q-tool  { background: #dbeafe; color: #1e40af; }
.cal-hist-post-badge.q-topic { background: #fce7f3; color: #9d174d; }
.cal-hist-post-badge.q-low   { background: #f0f0f0; color: #475569; }
.cal-hist-post-desc {
  font-size: 0.78rem;
  color: #374151;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cal-hist-post-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.68rem;
  color: #9ca3af;
}
.cal-hist-post-score {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
  white-space: nowrap;
  padding-top: 2px;
}

/* ═══ Annual Analysis Section v1.4.2 ═══ */
.ann-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 14px;
  align-items: start;
}
.ann-card {
  border-radius: 12px;
  padding: 16px 18px;
  min-height: 220px;
}
.ann-card-full {
  grid-column: 1 / -1;
}
.ann-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}
.ann-card-sub {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-bottom: 12px;
}
.ann-sub-q {
  display: block;
  font-size: 0.72rem;
  color: #6b7280;
  font-weight: 600;
}
.ann-sub-h {
  display: block;
  font-size: 0.66rem;
  color: #9ca3af;
  margin-top: 2px;
}
/* Purpose line — always visible, low-contrast (Datawrapper editorial style) */
.ann-sub-p {
  display: block;
  font-size: 0.62rem;
  color: #9ca3af;
  font-style: italic;
  margin-top: 3px;
  padding-left: 6px;
  border-left: 2px solid #e5e7eb;
}
.ann-empty {
  padding: 32px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.9rem;
}

/* ═══ Scatter timeline ═══ */
.ann-scatter-area {
  position: relative;
  width: 100%;
  margin-bottom: 28px;
  border-bottom: 1px solid #e5e7eb;
  border-left: 1px solid #e5e7eb;
}
/* horizontal guide lines at 25/50/75% height */
.ann-scatter-guide {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px dashed #f0f0f0;
  pointer-events: none;
  z-index: 0;
}
.ann-scatter-guide span {
  position: absolute;
  left: 3px;
  top: -11px;
  font-size: 0.58rem;
  color: #d1d5db;
  background: rgba(255,255,255,0.8);
  padding: 0 2px;
  border-radius: 2px;
}
.ann-dot {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: default;
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 2;
}
.ann-dot:hover {
  transform: translate(-50%, -50%) scale(1.6);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.25);
  z-index: 20;
}
.ann-dot-big {
  z-index: 5;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.8);
}
.ann-dot-label {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.58rem;
  font-weight: 700;
  color: #374151;
  white-space: nowrap;
  pointer-events: none;
}
.ann-scatter-bench {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px dashed #9ca3af;
  z-index: 1;
  pointer-events: none;
}
.ann-scatter-bench span {
  position: absolute;
  right: 4px;
  top: -14px;
  font-size: 0.58rem;
  color: #9ca3af;
  background: rgba(255,255,255,0.85);
  padding: 0 4px;
  border-radius: 2px;
}
.ann-scatter-months {
  position: absolute;
  bottom: -18px;
  left: 0;
  right: 0;
  height: 14px;
}
.ann-scatter-mlabel {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.58rem;
  color: #9ca3af;
}
.ann-scatter-yaxis {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.ann-scatter-yaxis span {
  font-size: 0.52rem;
  color: #d1d5db;
  transform: translateX(-100%);
  padding-right: 4px;
}
.ann-scatter-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 30px;
  font-size: 0.68rem;
  color: #6b7280;
  align-items: center;
  justify-content: space-between;
}
.ann-scatter-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.ann-scatter-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.ann-scatter-note {
  margin-top: 8px;
  font-size: 0.75rem;
  color: #b45309;
  background: #fef9c3;
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
}

/* ═══ Theme bars (with click-to-drill) ═══ */
.ann-theme-chart {
  position: relative;
  overflow: visible;
}
.ann-theme-row {
  margin-bottom: 8px;
}
.ann-theme-clickable {
  cursor: pointer;
  padding: 4px 6px;
  margin: 0 -6px;
  border-radius: 6px;
  transition: background 0.15s;
}
.ann-theme-clickable:hover {
  background: rgba(59,130,246,0.04);
}
.ann-theme-active {
  background: rgba(59,130,246,0.08) !important;
  box-shadow: inset 0 0 0 1.5px rgba(59,130,246,0.25);
}
.ann-theme-label {
  font-size: 0.72rem;
  color: #374151;
  margin-bottom: 3px;
}
.ann-nwarn {
  font-size: 0.6rem;
  color: #d97706;
  background: #fef9c3;
  padding: 0 4px;
  border-radius: 3px;
  margin-left: 4px;
}
.ann-theme-bar-wrap {
  position: relative;
  height: 16px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: visible;
  display: flex;
  align-items: center;
  padding-right: 90px;
}
.ann-theme-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
  max-width: 100%;
}
.ann-theme-score {
  position: absolute;
  right: 0;
  font-size: 0.7rem;
  color: #6b7280;
  font-weight: 600;
  white-space: nowrap;
  width: 85px;
  text-align: left;
  padding-left: 6px;
}
.ann-theme-score small {
  font-weight: 500;
  margin-left: 2px;
}
.ann-theme-bench-mark {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: rgba(99,102,241,0.6);
  z-index: 10;
  border-radius: 1px;
}

/* Waffle CSS removed — component no longer rendered */

/* ═══ Phase 1: Quality Gate Backtest ═══ */
.ann-gate-bar {
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  margin: 8px 0;
}
.ann-gate-pass {
  background: #38a169;
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.ann-gate-block {
  background: #e53e3e;
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.ann-gate-verdict {
  font-size: 0.78rem;
  font-weight: 700;
  margin: 6px 0;
}
.ann-gate-causes {
  margin-top: 8px;
  border-top: 1px solid #f0f0f0;
  padding-top: 6px;
}
.ann-gate-cause-note {
  font-size: 0.68rem;
  color: #6b7280;
  margin-bottom: 4px;
}
.ann-gate-cause-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.70rem;
  margin: 3px 0;
  color: #475569;
}
.ann-gate-cause-label {
  min-width: 100px;
  font-size: 0.68rem;
}
.ann-gate-cause-bar {
  height: 8px;
  border-radius: 4px;
  min-width: 4px;
}
.ann-gate-cause-count {
  font-size: 0.68rem;
  color: #6b7280;
}

/* Phase 2: Failure factor chips */
.ann-fail-chip {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: #fef2f2;
  color: #e53e3e;
  font-weight: 500;
}
.ann-warn-chip {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: #fefce8;
  color: #ca8a04;
  font-weight: 500;
}
.ann-bottom-rank {
  color: #9ca3af !important;
}
.ann-bottom-score {
  color: #9ca3af !important;
}
.ann-bottom-summary {
  font-size: 0.72rem;
  color: #6b7280;
  background: #fef2f2;
  border-radius: 6px;
  padding: 5px 10px;
  margin-bottom: 8px;
}

/* ═══ Calendar delta triangle ═══ */
.cal-delta {
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
  margin-left: 2px;
}

/* ═══ Scatter year-average baseline ═══ */
.ann-scatter-bench-year {
  border-top-style: dotted;
  border-top-color: #6366f1;
}
.ann-scatter-bench-year span {
  color: #6366f1;
}

/* ═══ Gate backtest flow ═══ */
.ann-gate-flow {
  margin: 8px 0;
  font-size: 0.75rem;
  color: #374151;
  line-height: 1.7;
}
.ann-gate-flow-step {
  padding: 2px 0;
}
.ann-gate-disclaimer {
  font-size: 0.68rem;
  color: #78716c;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  padding: 6px 10px;
  margin: 8px 0;
  line-height: 1.55;
}

/* ═══ Insight KPI highlights ═══ */
.ann-kpi {
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.ann-kpi-up {
  color: #38a169;
}
.ann-kpi-down {
  color: #e53e3e;
}
.ann-kpi-flat {
  color: #9ca3af;
}
.ann-insight-subtitle {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-bottom: 10px;
  font-style: italic;
}
.ann-rx-row {
  display: block;
  padding-left: 12px;
  line-height: 1.65;
}

/* ═══ TOP 5 posts ═══ */
.ann-top-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid #f0f0f0;
  border-radius: 6px;
  transition: background 0.12s, transform 0.12s;
  cursor: pointer;
}
.ann-top-row:hover {
  background: #f8fafc;
  transform: translateX(3px);
}
.ann-top-row--bottom {
  border-left: 3px solid #fecaca;
  padding-left: 10px;
  border-radius: 0 6px 6px 0;
}
.ann-top-row--top {
  border-left: 3px solid #bbf7d0;
  padding-left: 10px;
  border-radius: 0 6px 6px 0;
}
.ann-top-row:last-child {
  border-bottom: none;
}
.ann-top-rank {
  font-size: 1rem;
  font-weight: 800;
  color: #d1d5db;
  min-width: 28px;
  padding-top: 2px;
}
.ann-top-row:first-child .ann-top-rank { color: #e53e3e; }
.ann-top-row:nth-child(2) .ann-top-rank { color: #ea580c; }
.ann-top-row:nth-child(3) .ann-top-rank { color: #d97706; }
.ann-top-body {
  flex: 1;
  min-width: 0;
}
.ann-top-desc {
  font-size: 0.82rem;
  color: #374151;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 4px;
}
.ann-top-meta {
  display: flex;
  gap: 8px;
  font-size: 0.68rem;
  color: #9ca3af;
  flex-wrap: wrap;
}
.ann-top-theme {
  padding: 0 5px;
  border-radius: 4px;
}
.ann-top-q {
  background: #fef9c3;
  color: #a16207;
  padding: 0 5px;
  border-radius: 4px;
}
.ann-top-score {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
  padding-top: 2px;
}

/* TOP 5 Factor Chips */
.ann-top-factors {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.ann-factor-chip {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: #ecfdf5;
  color: #059669;
  font-weight: 500;
}

/* ═══ Insight box ═══ */
.ann-insight {
  padding: 16px 20px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--accent-bright);
  margin: 0 !important;
}
.ann-insight-header {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}
.ann-insight-list {
  margin: 0;
  padding-left: 18px;
}
.ann-insight-list li {
  font-size: 0.82rem;
  color: #374151;
  line-height: 1.6;
  margin-bottom: 10px;
}
.ann-insight-list li:last-child {
  margin-bottom: 0;
}

/* ═══ 3-Layer Insight Tags ═══ */
.ann-insight-section {
  margin-bottom: 16px;
  padding-left: 8px;
}
.ann-insight-section:last-child {
  margin-bottom: 0;
}
.ann-insight-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
}
.ann-tag-describe {
  background: #eff6ff;
  color: #6366f1;
  border-left: 3px solid #6366f1;
}
.ann-tag-diagnose {
  background: #fef9c3;
  color: #a16207;
  border-left: 3px solid #d97706;
}
.ann-tag-prescribe {
  background: #ecfdf5;
  color: #059669;
  border-left: 3px solid #059669;
}

/* ═══ KPI Strip ═══ */
.ann-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 16px;
}
.ann-kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: box-shadow 0.2s, transform 0.15s;
}
.ann-kpi-card:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.ann-kpi-card-good { background: #f0fdf4; border-color: #bbf7d0; }
.ann-kpi-card-bad  { background: #fef2f2; border-color: #fecaca; }
.ann-kpi-card-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.ann-kpi-card-value small {
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 2px;
}
.ann-kpi-card-label {
  font-size: 0.72rem;
  color: #6b7280;
  font-weight: 600;
  margin-top: 4px;
}
.ann-kpi-card-sub {
  font-size: 0.65rem;
  color: #9ca3af;
  margin-top: 2px;
}

/* ═══ Five-dim Delta Bars ═══ */
.ann-delta-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f0;
}
.ann-delta-comp-label { font-size: 0.72rem; color: #6b7280; font-weight: 600; }
.ann-delta-scale-hint { font-size: 0.65rem; color: #9ca3af; }
.ann-delta-rows { display: flex; flex-direction: column; gap: 2px; }
.ann-delta-row {
  display: grid;
  grid-template-columns: 72px 52px 1fr 48px 60px;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  border-radius: 6px;
  transition: background 0.15s;
}
.ann-delta-row:hover { background: #f8fafc; }
.ann-delta-row-focus { background: #fef2f2; border: 1px solid #fecaca; }
.ann-delta-label { font-size: 0.72rem; color: #374151; font-weight: 600; white-space: nowrap; }
.ann-delta-value { font-size: 0.82rem; font-weight: 800; text-align: right; }
.ann-delta-value small { font-size: 0.6rem; font-weight: 600; margin-left: 1px; color: #9ca3af; }
.ann-delta-bar-area {
  position: relative;
  height: 16px;
  background: #f8fafc;
  border-radius: 8px;
  overflow: hidden;
}
.ann-delta-center-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #d1d5db;
}
.ann-delta-bar {
  position: absolute;
  height: 100%;
  border-radius: 8px;
  transition: width 0.4s ease;
  opacity: 0.75;
}
.ann-delta-bar-right { left: 50%; }
.ann-delta-bar-left { right: 50%; }
.ann-delta-pct { font-size: 0.72rem; font-weight: 700; text-align: center; }
.ann-delta-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  min-width: 60px;
}
.ann-delta-dot {
  display: inline-block;
  border-radius: 50%;
  flex-shrink: 0;
}
.ann-delta-action {
  margin-top: 10px;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 0.72rem;
  color: #374151;
  line-height: 1.5;
}
.ann-delta-action-ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.ann-delta-action-tag {
  display: inline-block;
  background: #fee2e2;
  color: #e53e3e;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 4px;
}
.ann-delta-action-rx {
  color: #6b7280;
  font-size: 0.68rem;
}

/* ═══ CSV Export link (inline with legend) ═══ */
.ann-csv-export { text-decoration: none; }

/* ═══ Calendar legend ═══ */
.cal-legend {
  font-size: 0.68rem;
  color: #6b7280;
  padding: 3px 4px;
  text-align: right;
}

/* ═══ TOP / BOTTOM score + delta ═══ */
.ann-top-score-wrap { text-align: center; min-width: 48px; }
.ann-top-delta { font-size: 0.65rem; font-weight: 700; margin-top: 1px; }

/* ═══ Checklist correlation table ═══ */
.ann-check-table { width: 100%; font-size: 0.78rem; margin-bottom: 10px; }
.ann-check-header {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 60px;
  gap: 4px;
  padding: 4px 6px;
  background: #f8fafc;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 4px;
}
.ann-check-row {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 60px;
  gap: 4px;
  padding: 5px 6px;
  border-bottom: 1px solid #f0f0f0;
  align-items: center;
}
.ann-check-row:last-child { border-bottom: none; }
.ann-check-label { font-weight: 600; color: #374151; }
.ann-check-yes { color: #166534; font-size: 0.75rem; }
.ann-check-no  { color: #6b7280; font-size: 0.75rem; }
.ann-check-lift { font-weight: 700; font-size: 0.8rem; }
.ann-check-combo-wrap { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; }
.ann-check-combo { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; }
.ann-check-combo-label { min-width: 90px; color: #6b7280; font-size: 0.72rem; }
.ann-check-combo-bar { height: 10px; border-radius: 3px; min-width: 4px; }
.ann-check-combo-avg { color: #374151; font-weight: 600; }

/* ═══ Responsive ═══ */

@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-nav { display: flex; }
  .main-content { margin-left: 0; padding: 1rem; padding-top: 3.5rem; }
  .panel-header h1 { font-size: 1.2rem; }
  .memory-grid { grid-template-columns: 1fr; }
  .planner-grid { grid-template-columns: 1fr; }
  .planner-header { flex-direction: column; }
  .footer-buttons { flex-wrap: wrap; }
  .calendar-grid { grid-template-columns: repeat(2, 1fr); }
  .ann-grid { grid-template-columns: 1fr !important; }
  .ann-kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .ann-delta-row { grid-template-columns: 60px 45px 1fr 40px 40px; font-size: 0.68rem; }
}

@media (min-width: 769px) {
  .mobile-nav { display: none !important; }
}


/* ═══ 满血版诊断中心 v1.4.3 ═══ */
.ann-diagnostic-center {
  padding: 24px 28px;
}
.dc-header { margin-bottom: 16px; }
.dc-title { font-size: 1.1rem; font-weight: 700; color: #1a1a1a; }
.dc-summary { font-size: 0.82rem; color: #6b7280; margin-top: 6px; }
.dc-section { margin-top: 20px; }
.dc-section-title { font-size: 0.88rem; font-weight: 700; color: #374151; margin-bottom: 12px; }
.dc-yoy-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dc-yoy-card { padding: 12px 16px; border-radius: 10px; text-align: center; border: 1px solid #e5e7eb; }
.dc-yoy-good { background: linear-gradient(135deg, #f0fff4 0%, #fff 100%); border-color: #9ae6b4; }
.dc-yoy-bad { background: linear-gradient(135deg, #fff5f5 0%, #fff 100%); border-color: #feb2b2; }
.dc-yoy-value { font-size: 1.4rem; font-weight: 800; color: #1a1a1a; }
.dc-yoy-label { font-size: 0.7rem; color: #6b7280; margin-top: 4px; }
.dc-yoy-delta { font-size: 0.8rem; font-weight: 700; margin-top: 2px; }
.dc-yoy-vs { font-size: 0.65rem; color: #9ca3af; margin-top: 2px; }
.dc-table { border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.dc-table-header { display: grid; grid-template-columns: 2fr 1fr 2fr 1.5fr; gap: 12px; padding: 12px 16px; background: #f7f8fa; font-size: 0.75rem; font-weight: 700; color: #374151; }
.dc-table-row { display: grid; grid-template-columns: 2fr 1fr 2fr 1.5fr; gap: 12px; padding: 14px 16px; border-top: 1px solid #e5e7eb; align-items: center; font-size: 0.8rem; }
.dc-cell-check { display: flex; align-items: flex-start; gap: 10px; }
.dc-icon { font-size: 1.2rem; }
.dc-name { font-weight: 600; color: #1a1a1a; }
.dc-desc { font-size: 0.7rem; color: #6b7280; margin-top: 2px; }
.dc-status-badge { font-size: 0.72rem; padding: 3px 10px; border-radius: 6px; font-weight: 600; }
.dc-status-good { background: var(--dc-success-bg); color: var(--dc-success-text); }
.dc-status-warn { background: var(--dc-warning-bg); color: var(--dc-warning-text); }
.dc-status-bad { background: var(--dc-danger-bg); color: var(--dc-danger-text); }
.dc-bench-lift { font-weight: 700; }
.dc-cell-action { font-size: 0.78rem; color: #4a5568; }
.dc-combo-chart { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.dc-combo-row { display: flex; align-items: center; gap: 12px; font-size: 0.8rem; }
.dc-combo-label { min-width: 70px; color: #4a5568; }
.dc-combo-bar-wrap { flex: 1; height: 20px; background: #f0f0f0; border-radius: 6px; overflow: hidden; }
.dc-combo-bar { height: 100%; border-radius: 6px; transition: width 0.5s ease; }
.dc-combo-val { min-width: 90px; font-weight: 600; color: #374151; }
.dc-disclaimer { margin-top: 20px; padding: 12px 16px; background: #fffbeb; border-left: 3px solid #f6e05e; border-radius: 8px; font-size: 0.75rem; color: #744210; line-height: 1.6; }

/* Diagnostic center responsive */
@media (max-width: 768px) {
  .dc-yoy-grid { grid-template-columns: repeat(2, 1fr); }
  .dc-table-header, .dc-table-row { grid-template-columns: 1fr 1fr; }
  .dc-cell-bench, .dc-cell-action { grid-column: 1 / -1; }
  .ann-diagnostic-center { padding: 16px; }
}

/* ▲▼ comparison basis label (Datawrapper: always show what you're comparing to) */
.ann-delta-basis {
  font-size: 0.52rem;
  font-weight: 500;
  color: inherit;
  opacity: 0.65;
  margin-left: 2px;
  letter-spacing: 0.02em;
}

/* KPI strip: yoy chip row */
.ann-kpi-yoy-row {
  margin-top: 5px;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 4px;
}
.ann-kpi-yoy {
  font-size: 0.62rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 1px 5px;
  border-radius: 3px;
}
.ann-kpi-yoy-good { color: var(--indicator-good); background: #f0fdf4; }
.ann-kpi-yoy-bad  { color: var(--indicator-bad);  background: #fef2f2; }

/* KPI bench delta inline chip */
.ann-kpi-bench-delta {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
}
.ann-kpi-bench-delta.good { color: var(--indicator-good); background: #f0fdf4; }
.ann-kpi-bench-delta.bad  { color: var(--indicator-bad);  background: #fef2f2; }

/* ② Small-sample warning banner */
.ann-sample-warn {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.5;
  margin-bottom: 10px;
  border: 1px solid;
}
.ann-sample-warn-strong {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}
.ann-sample-warn-mild {
  background: #fefce8;
  border-color: #fde68a;
  color: #854d0e;
}
.ann-sample-warn-label {
  font-weight: 700;
  margin-right: 4px;
  flex-shrink: 0;
}

/* ③ Weak prev-year n= chip on KPI yoy row */
.ann-kpi-yoy-weak {
  font-size: 0.58rem;
  font-weight: 600;
  color: #9ca3af;
  background: #f3f4f6;
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 3px;
  cursor: default;
}

/* Theme filter reset button */
.ann-theme-reset {
  display: none;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  color: #6b7280;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  transition: background 0.1s;
  margin-left: 6px;
}
.ann-theme-reset:hover { background: #e2e8f0; }

/* Indicator CSS vars (semantic) */
:root {
  --indicator-good: #38a169;
  --indicator-bad:  #e53e3e;
}

/* ── Print / Export styles (年度报告打印) ── */
@media print {
  .sidebar, .mobile-nav, nav, .tab-btn, .nav-item,
  .ann-csv-export, #annExportBtn, .ann-theme-reset,
  .ann-scatter-bench, .ann-scatter-note { display: none !important; }
  body { background: #fff; }
  .main-content { margin: 0; padding: 0; }
  .tab-panel { display: block !important; }
  .tab-panel:not(#panel-annual) { display: none !important; }
  .card, .ann-card { box-shadow: none; border: 1px solid #e5e7eb; break-inside: avoid; }
  .ann-kpi-strip { grid-template-columns: repeat(4, 1fr); }
  .ann-grid { grid-template-columns: 1fr 1fr; }
  .ann-card-full { grid-column: 1 / -1; }
  h1, .panel-title { font-size: 1.2rem; }
  canvas { max-width: 100%; }
}

/* ═══════════════════════════════════════════════════
   v1.14 — Unified KPI Cards, Draggable Cards, Resizable Sidebar
   ═══════════════════════════════════════════════════ */

/* ── Sidebar Resizer ── */
.sidebar-resizer {
  position: fixed;
  top: 0; bottom: 0;
  left: var(--sidebar-width);
  width: 6px;
  z-index: 102;
  cursor: col-resize;
  background: transparent;
  transition: background 0.2s;
}
.sidebar-resizer::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 2px; height: 48px;
  background: #6366f1;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}
.sidebar-resizer:hover,
.sidebar-resizer.is-resizing {
  background: rgba(99,102,241,0.18);
}
.sidebar-resizer:hover::after,
.sidebar-resizer.is-resizing::after {
  opacity: 1;
}

/* ── Diagnostic Block (replaces card ann-card wrapper, standalone) ── */
.ann-diagnostic-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s;
}
.ann-diagnostic-block:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.07);
}

/* ── Unified KPI Grid ── */
.kpi-unified-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 960px) {
  .kpi-unified-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .kpi-unified-grid { grid-template-columns: 1fr; }
}

.kpi-unified-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.15s;
}
.kpi-unified-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.kpi-card-good { background: #f0fdf4; border-color: #bbf7d0; }
.kpi-card-bad  { background: #fef2f2; border-color: #fecaca; }

.kpi-u-top { margin-bottom: 10px; }
.kpi-u-main {
  display: flex;
  align-items: baseline;
  gap: 3px;
  line-height: 1.1;
}
.kpi-u-value {
  font-size: 1.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.kpi-u-unit {
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
}
.kpi-u-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  margin-top: 4px;
}

/* Compare row: split by vertical grey line */
.kpi-u-compare {
  display: flex;
  align-items: stretch;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 8px;
  margin-top: auto;
  gap: 0;
  min-height: 54px;
}
.kpi-u-half {
  flex: 1;
  padding: 0 6px;
  min-width: 0;
}
.kpi-u-half:first-child { padding-left: 0; }
.kpi-u-half:last-child  { padding-right: 0; }
.kpi-u-vdivider {
  width: 1px;
  background: #e5e7eb;
  flex-shrink: 0;
  align-self: stretch;
}
.kpi-u-compare-label {
  font-size: 0.58rem;
  color: #9ca3af;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-u-compare-delta {
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.kpi-u-compare-ref {
  font-size: 0.6rem;
  color: #9ca3af;
  margin-top: 2px;
  line-height: 1.3;
}
.kpi-delta-good { color: var(--success); }
.kpi-delta-bad  { color: var(--danger); }
.kpi-delta-neutral { color: #9ca3af; }

/* Weak n= badge inside KPI compare label */
.kpi-u-weak {
  font-size: 0.55rem;
  font-weight: 700;
  color: #9ca3af;
  background: rgba(0,0,0,0.06);
  border-radius: 3px;
  padding: 0 3px;
  margin-left: 3px;
  vertical-align: middle;
  cursor: default;
}

/* Diagnostic section hint */
.dc-kpi-hint {
  font-size: 0.62rem;
  font-weight: 400;
  color: #9ca3af;
  margin-left: 6px;
}
.dc-kpi-section { padding-bottom: 4px; }

/* ── Draggable Cards ── */
[data-draggable] { position: relative; }

.ann-drag-handle {
  position: absolute;
  top: 10px; right: 10px;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: #d1d5db;
  cursor: grab;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  z-index: 10;
  user-select: none;
  line-height: 1;
}
[data-draggable]:hover .ann-drag-handle { opacity: 1; }
.ann-drag-handle:hover {
  color: #6366f1;
  background: rgba(99,102,241,0.08);
}
.ann-drag-handle:active { cursor: grabbing; }

.ann-card-dragging {
  opacity: 0.45;
  box-shadow: 0 8px 28px rgba(99,102,241,0.18) !important;
  outline: 2px dashed #6366f1;
}
.ann-card-drag-over {
  outline: 2px solid #6366f1;
  background: rgba(99,102,241,0.025);
}

/* Drop position indicator line */
.ann-drag-indicator {
  height: 3px;
  border-radius: 2px;
  background: #6366f1;
  margin: 4px 0;
  pointer-events: none;
  animation: dragIndicatorPulse 0.6s ease-in-out infinite alternate;
}
@keyframes dragIndicatorPulse {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

/* ── v1.15: Annual analysis container — uniform 16px vertical gap ── */
#annualAnalysisContainer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#annualAnalysisContainer > * {
  margin: 0 !important;
}

/* ══════════════════════════════════════════════════════════════════
   v1.14: 数据读数指南 · KPI目标差距 · 象限趋势 · 帕累托 · 主题sparkline · TOP5共性
   ══════════════════════════════════════════════════════════════════ */

/* ── 数据读数指南 ── */
.ann-data-guide {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #fafbff;
}
.ann-dg-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  background: #f3f4f6;
  user-select: none;
  transition: background 0.15s;
}
.ann-dg-toggle:hover { background: #e9eaf0; }
.ann-dg-chevron { font-size: 0.72rem; color: #9ca3af; transition: transform 0.2s; }
.ann-dg-content { padding: 14px 16px; }
.ann-dg-body { display: flex; flex-direction: column; gap: 12px; }
.ann-dg-portrait {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 14px;
}
.ann-dg-portrait-title { font-size: 0.78rem; font-weight: 700; color: #1d4ed8; margin-bottom: 8px; }
.ann-dg-portrait-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}
@media (max-width: 640px) { .ann-dg-portrait-grid { grid-template-columns: repeat(2, 1fr); } }
.ann-dg-portrait-grid > div { text-align: center; }
.ann-dg-num { display: block; font-size: 1.3rem; font-weight: 800; color: #1d4ed8; }
.ann-dg-unit { font-size: 0.68rem; color: #6b7280; }
.ann-dg-portrait-note { font-size: 0.68rem; color: #6b7280; }
.ann-dg-section { font-size: 0.79rem; color: #374151; line-height: 1.6; }
.ann-dg-section p { margin: 3px 0; }
.ann-dg-section-title { font-weight: 700; color: #111827; margin-bottom: 4px; font-size: 0.82rem; }
.ann-dg-section-warn { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 8px 12px; }
.ann-dg-section-warn .ann-dg-section-title { color: #c2410c; }
.ann-dg-section-good { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 8px 12px; }
.ann-dg-section-good .ann-dg-section-title { color: #166534; }
.ann-dg-list { margin: 4px 0 0; padding-left: 0; list-style: none; }
.ann-dg-list li { padding: 2px 0; font-size: 0.77rem; }

/* ── KPI目标差距 ── */
.ann-kpitgt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 680px) { .ann-kpitgt-grid { grid-template-columns: 1fr; } }
.ann-kpitgt-section { display: flex; flex-direction: column; gap: 6px; }
.ann-kpitgt-section-title {
  font-size: 0.8rem; font-weight: 700; color: #374151;
  margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid #e5e7eb;
}
.ann-kpitgt-section-note { font-weight: 400; font-size: 0.71rem; color: #9ca3af; margin-left: 4px; }
.ann-kpitgt-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f3f4f6;
}
.ann-kpitgt-label {
  font-size: 0.77rem; font-weight: 600; color: #374151;
  grid-column: 1; grid-row: 1;
  display: flex; align-items: center; gap: 6px;
}
.ann-kpitgt-note { font-weight: 400; font-size: 0.67rem; color: #9ca3af; }
.ann-kpitgt-track {
  position: relative; height: 6px; background: #e5e7eb; border-radius: 3px;
  grid-column: 1; grid-row: 2; overflow: visible;
}
.ann-kpitgt-bar { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.ann-kpitgt-target-line {
  position: absolute; right: 0; top: -3px; bottom: -3px;
  width: 2px; background: #f59e0b; border-radius: 1px;
}
.ann-kpitgt-vals {
  font-size: 0.72rem; display: flex; gap: 4px; align-items: center;
  grid-column: 2; grid-row: 1 / 3; white-space: nowrap;
}
.ann-kpitgt-cur { font-weight: 800; }
.ann-kpitgt-arrow { color: #9ca3af; }
.ann-kpitgt-tgt { color: #6b7280; }
.ann-kpitgt-gap { font-weight: 700; font-size: 0.68rem; }
.ann-kpitgt-footer { font-size: 0.68rem; color: #9ca3af; margin-top: 10px; text-align: right; }

/* ── 主题sparkline ── */
.ann-spark-row {
  display: inline-flex; align-items: flex-end; gap: 2px;
  margin-top: 3px; vertical-align: bottom;
}
.ann-spark-label { font-size: 0.58rem; color: #9ca3af; margin-right: 2px; line-height: 1; }
.ann-spark-dot {
  display: inline-block; width: 5px; border-radius: 2px;
  transition: height 0.3s;
}
.ann-spark-connect {
  display: inline-block; width: 3px; height: 1px; background: #e5e7eb;
  align-self: center;
}

/* ── 帕累托 ── */
.ann-pareto-summary {
  font-size: 0.75rem; color: #374151; background: #f8f9ff;
  border: 1px solid #e0e2ff; border-radius: 6px;
  padding: 6px 10px; margin-top: 8px; line-height: 1.5;
}

/* ── TOP5共性观察 ── */
.ann-top-patterns {
  margin-top: 12px; padding: 10px 12px;
  background: #f8f9ff; border: 1px solid #e0e2ff; border-radius: 8px;
}
.ann-top-patterns-label {
  font-size: 0.77rem; font-weight: 700; color: #374151; margin-bottom: 6px;
}
.ann-top-patterns-note { font-weight: 400; color: #9ca3af; font-size: 0.68rem; }
.ann-top-patterns-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── 象限趋势结论框 ── */
.ann-quad-conclusion {
  margin-top: 10px; padding: 10px 14px;
  background: #fffbeb; border: 1px solid #fbbf24; border-radius: 8px;
  font-size: 0.80rem; color: #1f2937; line-height: 1.7;
}
.ann-quad-conclusion strong { color: #b45309; }

/* ── KPI目标差距 — 确认目标标注 ── */
.ann-kpitgt-notice {
  font-size: 0.76rem; color: #374151; background: #eff6ff;
  border: 1px solid #bfdbfe; border-radius: 6px;
  padding: 7px 12px; margin-bottom: 10px; line-height: 1.5;
}
.ann-kpitgt-agreed { background: #f0fdf4; border-radius: 6px; }
.ann-kpitgt-agreed-badge {
  display: inline-block; margin-left: 5px;
  font-size: 0.62rem; font-weight: 700; color: #166534;
  background: #dcfce7; border: 1px solid #86efac;
  border-radius: 4px; padding: 1px 5px; vertical-align: middle;
}

/* ── 帕累托紧凑stats ── */
.ann-prto-wrap { display: flex; flex-direction: column; gap: 7px; padding: 4px 0; }
.ann-prto-row { display: flex; align-items: center; gap: 8px; }
.ann-prto-lbl { font-size: 0.73rem; color: #374151; white-space: nowrap; width: 110px; flex-shrink: 0; }
.ann-prto-bar-wrap { flex: 1; background: #f3f4f6; border-radius: 4px; height: 22px; position: relative; display: flex; align-items: center; overflow: hidden; }
.ann-prto-bar { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.ann-prto-pct { position: absolute; right: 6px; font-size: 0.71rem; font-weight: 700; color: #1f2937; }
.ann-prto-dim { color: #9ca3af; }
.ann-prto-note { font-size: 0.72rem; color: #6b7280; margin-top: 4px; }

/* ── print: hide data guide toggle, show content ── */
@media print {
  .ann-dg-toggle { display: none; }
  .ann-dg-content { display: block !important; }
  .ann-data-guide { border: none; background: none; }
}
