/* ============================================
   产业链新闻挖掘平台 - 样式表
   设计风格：专业金融风、深色主题、简洁商务
   ============================================ */

/* === CSS Variables === */
:root {
  /* 主色调 */
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;

  /* 背景 */
  --bg-body: #0f172a;
  --bg-surface: #1e293b;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --bg-active: #1e3a5f;

  /* 文字 */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* 边框 */
  --border: #334155;
  --border-light: #1e293b;

  /* 产业链节点颜色 */
  --color-upstream: #ef4444;
  --color-midstream: #f59e0b;
  --color-downstream: #22c55e;
  --color-equipment: #8b5cf6;
  --color-service: #06b6d4;
  --color-external: #ec4899;
  --color-demand: #f97316;

  /* 涨跌色（A股惯例） */
  --color-rise: #ef4444;
  --color-fall: #22c55e;

  /* 尺寸 */
  --navbar-height: 56px;
  --stats-height: 44px;
  --status-height: 32px;
  --news-panel-width: 380px;
  --resizer-width: 4px;

  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* === Reset === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* === Navbar === */
.navbar {
  height: var(--navbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: relative;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  letter-spacing: 1px;
}

.brand-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: -8px;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chain-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chain-selector label {
  font-size: 13px;
  color: var(--text-secondary);
}

.chain-selector select {
  background: var(--bg-body);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 32px 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 140px;
}

.chain-selector select:hover {
  border-color: var(--primary);
}

.chain-selector select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* === Stats Bar === */
.stats-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.stats-top-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-light);
  font-variant-numeric: tabular-nums;
}

.stat-unit {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.time-filters {
  display: flex;
  gap: 4px;
}

.time-btn {
  padding: 4px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.time-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.time-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* === Filter Group === */
.filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-group label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.filter-group select {
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.filter-group select:hover {
  border-color: var(--primary);
}

.filter-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* === Button-style Filter Group === */
.btn-filter {
  display: flex;
  gap: 2px;
}

.filter-btn {
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* === Main Content Layout === */
.main-content {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* === News Panel (Left) === */
.news-panel {
  width: var(--news-panel-width);
  min-width: 280px;
  max-width: 600px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.panel-tools {
  display: flex;
  gap: 8px;
}

.search-input {
  flex: 1;
  background: var(--bg-body);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.refresh-btn {
  width: 32px;
  height: 32px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.refresh-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.refresh-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* News List */
.news-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

.news-item {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
  border: 1px solid transparent;
}

.news-item:hover {
  background: var(--bg-hover);
}

.news-item.active {
  background: var(--bg-active);
  border-color: var(--primary);
}

.news-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.news-tag {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
}

.news-tag.upstream { background: rgba(239,68,68,0.15); color: #ef4444; }
.news-tag.midstream { background: rgba(245,158,11,0.15); color: #f59e0b; }
.news-tag.downstream { background: rgba(34,197,94,0.15); color: #22c55e; }
.news-tag.policy { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.news-tag.price { background: rgba(236,72,153,0.15); color: #ec4899; }
.news-tag.event { background: rgba(6,182,212,0.15); color: #06b6d4; }

.news-item-summary {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

/* Skeleton Loading */
.skeleton-list .skeleton-item {
  padding: 12px;
  margin-bottom: 4px;
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-body) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 8px;
}

.skeleton-line.short { width: 60%; }
.skeleton-title { height: 16px; width: 90%; }
.skeleton-text { width: 100%; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-state p {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.empty-state span {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* === Panel Resizer === */
.panel-resizer {
  width: var(--resizer-width);
  cursor: col-resize;
  background: var(--border);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

.panel-resizer:hover,
.panel-resizer.dragging {
  background: var(--primary);
}

.resizer-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 32px;
  background: var(--text-muted);
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.2s;
}

.panel-resizer:hover .resizer-handle {
  opacity: 1;
}

/* === Content Panel (Right) === */
.content-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-body);
}

/* === 分析面板（全宽纵向流式布局） === */
.analysis-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 各模块防止被压缩 */
.analysis-body > .report-section {
  flex-shrink: 0;
}

/* ① 新闻 section */
.section-news .section-body {
  padding: 10px 12px;
}

.section-news-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 4px;
}

.section-news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.section-news-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.section-news-content.collapsed {
  max-height: 4.5em;
  overflow: hidden;
  position: relative;
}

.section-news-content.collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.5em;
  background: linear-gradient(transparent, var(--bg-surface));
  pointer-events: none;
}

.section-news-toggle {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 16px;
  font-size: 12px;
  color: var(--primary-light);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.section-news-toggle:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--primary);
}

/* ② 事件冲击速览 */
.section-impact .section-header {
  background: rgba(245, 158, 11, 0.04);
}

/* ③ 产业链解读（内嵌双栏） */
.chain-interpret-body {
  display: flex;
  padding: 0 !important;
  overflow: hidden;
  height: 360px;
  min-height: 200px;
}

.chain-interpret-left {
  width: 40%;
  min-width: 200px;
  overflow-y: auto;
  padding: 8px;
  border-right: 1px solid var(--border);
}

.chain-interpret-resizer {
  width: var(--resizer-width);
  cursor: col-resize;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.2s;
}

.chain-interpret-resizer:hover,
.chain-interpret-resizer.dragging {
  background: var(--primary);
}

.chain-interpret-right {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* ④ 投资标的映射 */
.section-targets .section-header {
  background: rgba(239, 68, 68, 0.04);
}

/* ⑤ 跟踪验证 */
.section-verify .section-header {
  background: rgba(59, 130, 246, 0.04);
}

.content-tabs {
  display: flex;
  padding: 8px 16px 0;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tab-btn {
  padding: 8px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
  flex: 1;
  overflow: hidden;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
}

/* === Graph Container === */
.graph-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.graph-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
}

.graph-placeholder p {
  margin-top: 12px;
  font-size: 15px;
  color: var(--text-secondary);
}

.graph-placeholder span {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.graph-legend {
  display: flex;
  gap: 16px;
  padding: 8px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.upstream { background: var(--color-upstream); }
.legend-dot.midstream { background: var(--color-midstream); }
.legend-dot.downstream { background: var(--color-downstream); }
.legend-dot.equipment { background: var(--color-equipment); }
.legend-dot.service { background: var(--color-service); }
.legend-dot.external { background: var(--color-external); }
.legend-dot.demand { background: var(--color-demand); }

/* === AI分析报告（通用滚动容器） === */
.analysis-report {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
}

.detail-placeholder p {
  margin-top: 12px;
  font-size: 15px;
  color: var(--text-secondary);
}

.detail-placeholder span {
  font-size: 12px;
  margin-top: 4px;
}

/* === Status Bar === */
.status-bar {
  height: var(--status-height);
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 24px;
  font-size: 11px;
  color: var(--text-muted);
}

.status-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-item::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-downstream);
}

/* === 结构化分析报告面板 === */
.analysis-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.analysis-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* 事件概要行 */
.analysis-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.6;
}

.analysis-label {
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 80px;
}

/* 涨跌标签 */
.tag-rise {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.tag-fall {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.tag-neutral {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

/* 产业链解读：上/中/下游段落 */
.impact-section {
  margin-bottom: 8px;
}

.impact-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  padding-left: 8px;
  margin-bottom: 6px;
}

.impact-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0 4px 16px;
  border-left: 2px solid transparent;
}

.impact-node {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 100px;
}

.impact-logic {
  color: var(--text-secondary);
  font-size: 12px;
}

/* 公司影响 */
.company-section {
  margin-bottom: 10px;
}

.company-section-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.company-section-title.rise {
  color: #ef4444;
}

.company-section-title.fall {
  color: #22c55e;
}

.company-section-title.neutral {
  color: #64748b;
}

.company-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 8px;
}

.company-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
}

.company-tag.rise {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.company-tag.fall {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.company-tag.neutral {
  background: rgba(100, 116, 139, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

/* 待验证指标 */
.verify-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.verify-label {
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
  min-width: 70px;
  padding-top: 2px;
}

.verify-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
  margin: 2px 4px 2px 0;
}

/* 风险提示 */
.risk-row {
  margin-bottom: 10px;
}

.risk-label {
  color: var(--text-muted);
  font-size: 13px;
  display: block;
  margin-bottom: 4px;
}

.risk-row ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* 分析文本行（fallback） */
.analysis-text-row {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
}

.analysis-text-row b {
  color: var(--text-primary);
}

/* === 分析报告新布局（参考 gjhgszh.com） === */
.report-container {
  padding-top: 8px;
}

.report-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  background: rgba(59, 130, 246, 0.04);
}

.section-icon {
  font-size: 16px;
}

.section-body {
  padding: 10px 12px;
}

/* --- 事件概览 --- */
.overview-summary {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.06);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.overview-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.overview-label {
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
  min-width: 64px;
}

.overview-value {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}

.overview-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
  background: transparent;
}

.historical-ref {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(139, 92, 246, 0.06);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-equipment);
  font-size: 13px;
  line-height: 1.7;
}

.ref-label {
  color: var(--color-equipment);
  font-weight: 600;
}

.ref-text {
  color: var(--text-secondary);
}

/* --- 产业链传导分析（链式流程） --- */
.chain-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chain-node {
  padding: 8px 12px;
  border-left: 3px solid;
  background: rgba(255,255,255,0.02);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.chain-node-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.chain-layer {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 3px;
  background: rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.chain-node-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.chain-dir {
  font-size: 12px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 3px;
  flex-shrink: 0;
}

.chain-node-logic {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 8px;
  margin-top: 4px;
}

.chain-arrow {
  text-align: center;
  color: var(--text-muted);
  font-size: 18px;
  padding: 2px 0;
  line-height: 1;
}

/* --- 投资标的映射（卡片式） --- */
.company-group {
  margin-bottom: 8px;
}
.company-group:last-child {
  margin-bottom: 0;
}

.company-group-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.company-group-title.rise { color: #ef4444; }
.company-group-title.fall { color: #22c55e; }
.company-group-title.neutral { color: #94a3b8; }

.company-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.company-card {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  background: rgba(255,255,255,0.02);
}

.company-card.rise {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.04);
}

.company-card.fall {
  border-color: rgba(34, 197, 94, 0.2);
  background: rgba(34, 197, 94, 0.04);
}

.company-card.neutral {
  border-color: rgba(100, 116, 139, 0.2);
  background: rgba(100, 116, 139, 0.04);
}

.company-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.company-card-reason {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

/* --- 建议跟踪和验证清单 --- */
.verify-group {
  margin-bottom: 8px;
}

.verify-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.verify-label {
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
  min-width: 100px;
  padding-top: 2px;
}

.verify-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.risk-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.risk-item {
  margin-bottom: 10px;
}

/* === 产业链结构图（左栏） === */
.chain-structure {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.chain-structure-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.structure-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.structure-legend .legend-dot {
  width: 8px;
  height: 8px;
}

.structure-layer {
  margin-bottom: 4px;
}

.structure-layer-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--layer-color, var(--text-muted));
  margin-bottom: 8px;
  padding-left: 4px;
  letter-spacing: 1px;
}

.structure-nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.structure-node {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.structure-node:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.structure-node-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.structure-node-dir {
  font-size: 12px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 3px;
  display: inline-block;
  width: fit-content;
}

.structure-arrow {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

.structure-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-label {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.meta-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.dir-rise {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.dir-fall {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.dir-neutral {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

/* === AI分析报告（右栏） === */
.analysis-report {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

/* 投资标的内嵌到概览区 */
.targets-inline {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

/* === 新闻摘要折叠 === */
.detail-body {
  position: relative;
}

.detail-summary {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.detail-toggle {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 16px;
  font-size: 12px;
  color: var(--primary-light);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.detail-toggle:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--primary);
}

/* === 新闻列表中的产业链标签 === */
.news-item-chains {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

/* 标签容器（产业链+来源+重要度统一） */
.news-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.news-chain-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

/* 来源标签 */
.news-source-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
}
.news-source-badge.source-cls {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.news-source-badge.source-wscn {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.news-source-badge.source-other {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* 重要度标签 */
.news-importance-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
}
.news-importance-badge.importance-high {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.news-importance-badge.importance-medium {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.news-importance-badge.importance-low {
  background: rgba(100, 116, 139, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.2);
}

/* === 响应式 === */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }

  .news-panel {
    width: 100%;
    max-width: none;
    height: 40%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .panel-resizer {
    width: 100%;
    height: var(--resizer-width);
    cursor: row-resize;
  }

  .content-panel {
    height: 60%;
  }

  .brand-subtitle {
    display: none;
  }

  .graph-legend {
    gap: 8px;
    padding: 6px 12px;
  }

  .stats-bar {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 16px;
    gap: 8px;
  }
}

/* ============================================
   分享功能样式
   ============================================ */

/* 分享按钮 */
.share-btn-wrap {
  position: relative;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.share-btn:hover {
  background: var(--primary-dark);
}

/* 分享下拉菜单 */
.share-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 160px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  display: none;
  z-index: 200;
  overflow: hidden;
}

.share-dropdown.open {
  display: block;
}

.share-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}

.share-dropdown-item:hover {
  background: var(--bg-hover);
}

.share-dropdown-item:first-child {
  border-bottom: 1px solid var(--border);
}

/* 遮罩层 */
.poster-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.poster-overlay.open {
  display: flex;
}

/* 模态框 */
.poster-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}

.poster-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
}

.poster-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  font-size: 16px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.poster-close-btn:hover {
  background: #e2e8f0;
}

.poster-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.poster-loading {
  color: #94a3b8;
  font-size: 14px;
}

.poster-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.poster-preview img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.poster-modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
}

.poster-download-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.poster-download-btn:hover {
  background: var(--primary-dark);
}

.poster-hint {
  font-size: 12px;
  color: #94a3b8;
}

/* ============================================
   海报模板（隐藏，供 html2canvas 捕获）
   ============================================ */
.poster-template {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 600px;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  color: #1e293b;
  z-index: -1;
}

.poster-inner {
  padding: 28px 30px 24px;
}

/* 品牌头 */
.pt-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.pt-brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
}

.pt-brand-text {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

/* 分割线 */
.pt-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 12px 0;
}

/* 新闻信息 */
.pt-news-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.5;
  margin-bottom: 6px;
}

.pt-news-meta {
  font-size: 12px;
  color: #94a3b8;
}

/* 段落标题 */
.pt-section {
  margin-bottom: 0;
}

.pt-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}

/* 事件摘要 */
.pt-summary {
  font-size: 13px;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #3b82f6;
}

/* 元数据网格 */
.pt-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.pt-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #475569;
}

.pt-meta-label {
  color: #94a3b8;
  min-width: 56px;
}

.pt-meta-value {
  font-weight: 600;
}

.pt-meta-value.rise { color: #ef4444; }
.pt-meta-value.fall { color: #22c55e; }
.pt-meta-value.neutral { color: #64748b; }

/* 传导路径（横向链式） */
.pt-transmission {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pt-tx-node {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 10px;
  border-left: 3px solid;
  margin-bottom: 2px;
  border-radius: 0 4px 4px 0;
  background: #f8fafc;
}

.pt-tx-layer {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: #f1f5f9;
  color: #64748b;
  flex-shrink: 0;
  margin-top: 2px;
}

.pt-tx-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
}

.pt-tx-dir {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.pt-tx-dir.rise { background: rgba(239,68,68,0.12); color: #dc2626; }
.pt-tx-dir.fall { background: rgba(34,197,94,0.12); color: #16a34a; }
.pt-tx-dir.neutral { background: rgba(100,116,139,0.12); color: #64748b; }

.pt-tx-logic {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
  padding-left: 12px;
}

.pt-tx-arrow {
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  padding: 1px 0;
}

/* 投资标的 */
.pt-targets {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pt-target-group-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.pt-target-group-title.rise { color: #dc2626; }
.pt-target-group-title.fall { color: #16a34a; }
.pt-target-group-title.neutral { color: #64748b; }

.pt-target-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pt-target-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid;
}

.pt-target-tag.rise { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); color: #dc2626; }
.pt-target-tag.fall { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.2); color: #16a34a; }
.pt-target-tag.neutral { background: rgba(100,116,139,0.08); border-color: rgba(100,116,139,0.2); color: #64748b; }

/* 底部（QR码 + 免责） */
.pt-footer {
  display: flex;
  align-items: center;
  gap: 20px;
}

.pt-qr-wrap {
  flex-shrink: 0;
}

.pt-qr-wrap canvas,
.pt-qr-wrap img {
  width: 100px;
  height: 100px;
  display: block;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  padding: 4px;
}

.pt-footer-right {
  flex: 1;
}

.pt-footer-title {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 2px;
}

.pt-footer-url {
  font-size: 10px;
  color: #94a3b8;
  word-break: break-all;
  margin-bottom: 4px;
}

.pt-footer-disclaimer {
  font-size: 10px;
  color: #cbd5e1;
  line-height: 1.5;
  margin-top: 4px;
}

/* Toast 提示 */
.toast-tip {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: toast-in 0.3s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === P2: 产业链关系（按权重）叠加区块 === */
.relation-weight-block {
  margin-top: 14px;
}
.relation-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.relation-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
}
.rel-node {
  font-weight: 600;
  color: var(--text-primary);
}
.rel-arrow {
  color: var(--text-muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.rel-weight {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.rel-w-high { color: #fca5a5; background: rgba(239,68,68,0.14); }   /* 强传导 红 */
.rel-w-mid  { color: #fcd34d; background: rgba(245,158,11,0.14); }  /* 中传导 橙 */
.rel-w-low  { color: #94a3b8; background: rgba(148,163,184,0.14); } /* 弱传导 灰 */
.rel-w-none { color: #64748b; background: rgba(100,116,139,0.12); } /* 无权重 */
