/* ===== Reset & Variables ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #5b6abf;
  --primary-light: #eef0ff;
  --primary-dark: #3d4a99;
  --accent: #7c5cbf;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --transition: 0.2s ease;
  --font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== Navbar ===== */
.navbar {
  height: 60px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.5px;
}
.brand-text {
  color: white;
  font-size: 17px;
  font-weight: 600;
}
.navbar-actions { display: flex; align-items: center; gap: 12px; }
.upload-headline-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-bottom: 40px;
}
.hero-logo {
  width: 140px;
  height: auto;
  flex-shrink: 0;
  mix-blend-mode: multiply;
}
.upload-headline-row .upload-headline {
  margin-bottom: 0;
  font-size: 38px;
  line-height: 1.2;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .upload-headline-row { flex-direction: column; gap: 16px; }
  .hero-logo { width: 110px; }
  .upload-headline-row .upload-headline { font-size: 26px; white-space: normal; text-align: center; }
}
.nav-admin-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.nav-admin-btn:hover { background: rgba(255,255,255,0.08); }
.admin-label { font-size: 13px; color: rgba(255,255,255,0.7); }
.admin-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 600;
}

/* ===== Tab Bar ===== */
.tab-bar {
  display: flex;
  gap: 6px;
  max-width: 900px;
  margin: 20px auto 0;
  padding: 0 20px;
}
.tab-bar.hidden { display: none; }
.tab-item {
  padding: 10px 22px;
  border: none;
  background: var(--card);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow);
}
.tab-item:hover { color: var(--primary); background: var(--primary-light); }
.tab-item.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 12px rgba(91,106,191,0.3);
}
.tab-icon { margin-right: 4px; }

/* ===== Pages ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== Upload Page ===== */
.upload-hero {
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.upload-headline {
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.4;
  color: var(--text);
}
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.upload-zone {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: 20px;
  padding: 48px 36px;
  text-align: center;
  border: 2px dashed var(--border);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.upload-zone-icon {
  width: 80px;
  height: 80px;
  background: var(--primary-light);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--primary);
  transition: all var(--transition);
}
.upload-zone:hover .upload-zone-icon {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}
.upload-zone-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.upload-zone-desc { color: var(--text-muted); font-size: 14px; }
.upload-progress { margin-top: 20px; display: none; }
.upload-progress.visible { display: block; }
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  position: absolute;
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  animation: progressIndeterminate 1.6s ease-in-out infinite;
}
@keyframes progressIndeterminate {
  0%   { left: -30%; }
  100% { left: 100%; }
}
.progress-text { font-size: 13px; color: var(--text-muted); margin-top: 10px; line-height: 1.6; }

/* ===== Report Page ===== */
#pageReport { max-width: 900px; margin: 0 auto; padding: 28px 20px 60px; }
.report-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.report-header-left { flex: 1; min-width: 0; }
.report-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.report-header-actions .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}
.report-header-actions .btn:disabled:hover {
  transform: none;
  box-shadow: none;
}
.btn-icon { display: inline-block; margin-right: 4px; }
.report-company { font-size: 26px; font-weight: 700; margin-bottom: 10px; }
.report-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  padding: 5px 14px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
}
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-yellow { background: #fef3c7; color: #d97706; }
.badge-red { background: #fee2e2; color: #dc2626; }

/* Demo Banner */
.demo-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.demo-banner.hidden { display: none; }
.demo-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.demo-icon { font-size: 22px; flex-shrink: 0; }
.demo-text { flex: 1; }
.demo-text strong { font-size: 14px; color: #92400e; display: block; }
.demo-desc { font-size: 12px; color: #a16207; }

/* ===== Cards ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 5px;
  font-weight: 400;
  background: #fef3c7;
  color: #d97706;
}
.card-badge.active { background: #dcfce7; color: #16a34a; }
.card-subtitle { font-size: 13px; color: var(--text-muted); font-weight: 400; }

/* Info Grid */
.info-grid { display: grid; gap: 12px; }
.info-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.info-item {
  padding: 14px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
}
.info-item.full-width { grid-column: 1 / -1; }
.info-label { display: block; color: var(--text-muted); font-size: 12px; margin-bottom: 4px; }
.info-value { font-size: 15px; font-weight: 600; color: var(--text); }

/* Raw Text */
.raw-text-box {
  font-size: 13px;
  color: var(--text-secondary);
  background: #f8fafc;
  padding: 16px;
  border-radius: var(--radius-sm);
  line-height: 1.7;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Founders */
.founder-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.founder-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}

.team-summary {
  margin-top: 12px;
  padding: 12px 14px;
  background: #f0fdf4;
  border-left: 3px solid #22c55e;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.7;
  font-weight: 400;
}
.team-summary strong {
  color: #16a34a;
  font-weight: 600;
}

.team-highlights {
  margin-top: 8px;
  padding: 10px 14px;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}
.team-highlights strong { color: #92400e; font-weight: 600; flex-shrink: 0; }
.highlight-tag {
  display: inline-block;
  padding: 2px 10px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 4px;
  font-size: 12px;
  color: #92400e;
  font-weight: 500;
}

/* ===== Financing (BP 抓取 + 历史融资) ===== */
.funding-block {
  margin-bottom: 18px;
}
.funding-block:last-child { margin-bottom: 0; }
.funding-block-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.funding-row-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
}
.fund-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fund-cell-label {
  font-size: 12px;
  color: var(--text-muted);
}
.fund-cell-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.fund-use-row {
  margin-top: 10px;
  padding: 12px;
  background: white;
  border-radius: 6px;
  border-left: 3px solid var(--primary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fund-use-label {
  font-size: 12px;
  color: var(--text-muted);
}
.fund-use-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.funding-empty {
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}
.funding-empty-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* 股东信息板块 */
.shareholder-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.shareholder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid var(--primary);
}
.shareholder-idx {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 20px;
  font-weight: 500;
}
.shareholder-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.shareholder-pct {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  min-width: 60px;
  text-align: right;
}
.shareholder-capital {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 80px;
  text-align: right;
}
.shareholder-type-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.shareholder-type-tag.person {
  background: #dbeafe;
  color: #1d4ed8;
}
.shareholder-type-tag.company {
  background: #e0e7ff;
  color: #4338ca;
}
.shareholder-note {
  margin-top: 12px;
  padding: 12px 14px;
  background: #fffbeb;
  border-radius: 8px;
  border-left: 3px solid #f59e0b;
}
.shareholder-note-title {
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 6px;
}
.shareholder-note-content {
  font-size: 13px;
  color: #78350f;
  line-height: 1.7;
}
.shareholder-highlight-item {
  display: inline-block;
  margin: 3px 4px 3px 0;
  padding: 3px 8px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #92400e;
}

.shareholder-firms {
  margin: 10px 0 6px;
  padding: 10px 14px;
  background: #f0f9ff;
  border-radius: 6px;
  border-left: 3px solid #0ea5e9;
  font-size: 13px;
  line-height: 1.6;
}
.shareholder-firms-label { font-weight: 600; color: #0369a1; margin-right: 4px; }
.shareholder-firms-value { color: #1e293b; }
.funding-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hist-fund-row {
  padding: 14px 16px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}
.hist-fund-meta {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.hist-fund-date {
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'SF Mono', Consolas, monospace;
}
.hist-fund-round {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}
.hist-fund-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.hist-fund-detail {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.hist-fund-valuation { color: var(--text); }
.hist-fund-investors { flex: 1; min-width: 200px; }
.hist-fund-source {
  font-size: 12px;
  color: var(--text-muted);
}
.hist-fund-source a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.hist-fund-source a:hover { text-decoration: underline; }

/* Tavily 原始搜索结果展示 */
.tavily-raw-block {
  margin-top: 14px;
  padding: 14px;
  background: #f0f9ff;
  border-radius: 8px;
  border-left: 3px solid #0ea5e9;
}
.tavily-raw-title {
  font-size: 13px;
  font-weight: 600;
  color: #0369a1;
  margin-bottom: 10px;
}
.tavily-answer {
  padding: 10px 12px;
  background: white;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 10px;
}
.tavily-answer strong { color: #0369a1; }
.tavily-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tavily-result-item {
  padding: 10px 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e0f2fe;
}
.tavily-result-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #0369a1;
  text-decoration: none;
  margin-bottom: 4px;
}
.tavily-result-title:hover { text-decoration: underline; }
.tavily-result-snippet {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 4px;
}
.tavily-result-url {
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
  font-family: 'SF Mono', Consolas, monospace;
}

/* ===== Charts ===== */
.chart-title { font-size: 14px; font-weight: 600; margin-bottom: 14px; color: var(--text); }
.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 200px;
  padding: 0 10px;
  border-bottom: 2px solid var(--border);
}
.bar-group { display: flex; flex-direction: column; align-items: center; width: 60px; }
.bar-column {
  width: 44px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  position: relative;
  transition: height 0.5s ease;
}
.bar-value {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.bar-label { font-size: 12px; color: var(--text-secondary); margin-top: 8px; }

/* Forecast Sections (每条预测一个独立柱状图块) */
.forecast-list { display: block; }
.forecast-section {
  margin-bottom: 20px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 4px solid var(--accent);
}
.forecast-section:last-child { margin-bottom: 4px; }
.forecast-section.bp-source { border-left-color: #1565c0; background: #f0f7ff; }
.forecast-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.forecast-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
}
.forecast-tag.authority { background: #ede9fe; color: #7c3aed; }
.forecast-tag.bp { background: #dbeafe; color: #1565c0; }
.forecast-org { font-weight: 600; font-size: 14px; color: var(--text); }
.forecast-report { font-size: 12px; color: var(--text-muted); }
.forecast-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 4px;
  background: white;
  border: 1px solid var(--primary);
}
.forecast-link:hover { background: var(--primary); color: white; }
.forecast-link.disabled {
  border-color: var(--border);
  color: var(--text-muted);
  background: transparent;
  cursor: not-allowed;
}
.forecast-link.disabled:hover { background: transparent; color: var(--text-muted); }
.forecast-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.forecast-stat-label { color: var(--text-muted); margin-right: 4px; }
.forecast-stat-value { font-weight: 600; color: var(--text); }
.forecast-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 160px;
  padding: 26px 10px 0;
  background: white;
  border-radius: 6px;
  border-bottom: 2px solid var(--border);
}
.forecast-bar .bar-column { background: linear-gradient(180deg, var(--primary), var(--accent)); }
.forecast-section.bp-source .bar-column { background: linear-gradient(180deg, #1976d2, #1565c0); }
.forecast-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  background: white;
  padding: 8px 12px;
  border-radius: 4px;
  line-height: 1.6;
}

.pie-container { display: flex; align-items: center; gap: 36px; justify-content: center; padding: 10px 0; }
.pie-legend { display: flex; flex-direction: column; gap: 8px; }
.pie-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.pie-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.pie-source-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
  margin-left: 2px;
}
.pie-source-tag.bp { background: #dbeafe; color: #1565c0; }
.pie-source-tag.report { background: #ede9fe; color: #7c3aed; }
.pie-source-tag.estimate { background: #fef3c7; color: #92400e; }

/* ===== 市场份额三板块 ===== */
.share-block {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.share-block:last-child { border-bottom: none; padding-bottom: 0; }
.share-block-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.share-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 6px;
}
.share-tag.authority { background: #ede9fe; color: #7c3aed; }
.share-tag.bp { background: #dbeafe; color: #1565c0; }
.share-tag.estimate { background: #fef3c7; color: #92400e; }
.share-disclaimer {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
}
.share-card {
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 10px;
}
.share-card:last-child { margin-bottom: 0; }
.share-card.authority { background: #faf5ff; border: 1px solid #e9d5ff; }
.share-card.bp { background: #eff6ff; border: 1px solid #bfdbfe; }
.share-card.ai { background: #fffbeb; border: 1px solid #fde68a; }
.share-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.share-card-scope {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.share-card-source {
  font-size: 12px;
  color: var(--text-muted);
}
.share-card-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  padding: 2px 8px;
  border: 1px solid var(--primary);
  border-radius: 4px;
}
.share-card-link:hover { background: var(--primary); color: white; }
.share-card-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 10px;
  background: rgba(255,255,255,0.6);
  border-radius: 4px;
}
.share-data-list { margin-bottom: 8px; }
.share-data-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 13px;
}
.share-data-row:last-child { border-bottom: none; }
.share-data-row.supplement { background: #f8fafc; padding: 6px 8px; border-radius: 4px; margin-top: 4px; }
.share-data-name { font-weight: 500; color: var(--text); min-width: 100px; }
.share-data-value { font-weight: 600; color: var(--primary); min-width: 50px; }
.share-data-source { font-size: 11px; }
.share-data-logic { font-size: 11px; color: var(--text-muted); flex: 1; }
.share-supplement-title {
  font-size: 12px;
  font-weight: 500;
  color: #92400e;
  margin: 10px 0 6px;
  padding-top: 8px;
  border-top: 1px dashed #fde68a;
}
.share-ai-logic {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.7);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.share-ai-logic strong { color: #92400e; }
.share-empty {
  padding: 14px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.share-normalize-warning {
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  font-size: 12px;
  color: #92400e;
  font-weight: 500;
}
.pie-auto-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
  margin-left: 2px;
  background: #e0e7ff;
  color: #4338ca;
}

.market-note {
  margin-top: 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.market-note-section {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
}
.market-note-section.bp {
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  color: #1e40af;
}
.market-note-section.bp strong { color: #1e40af; }
.market-note-section.ai {
  background: #f8fafc;
  border-left: 3px solid #94a3b8;
  color: var(--text-secondary);
  margin-top: 4px;
}
.market-note-section.ai strong { color: #64748b; }
.data-source {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}
.data-source a { color: var(--primary); text-decoration: none; }
.data-source a:hover { text-decoration: underline; }

/* ===== Comparison Table ===== */
.comp-selectors {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.comp-selector-row {
  display: flex;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}
.comp-selector-item { flex: 1; min-width: 140px; position: relative; }
.comp-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.comp-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,106,191,0.1);
}

/* 智能下拉 */
.stock-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
}
.stock-dropdown.visible { display: block; }
.stock-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13px;
  transition: background 0.1s;
}
.stock-option:last-child { border-bottom: none; }
.stock-option:hover { background: var(--primary-light); }
.stock-opt-name {
  font-weight: 500;
  color: var(--text);
  flex: 1;
}
.stock-opt-code {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'SF Mono', Consolas, monospace;
}
.stock-opt-market {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
}
.stock-opt-market.market-a { background: #fee2e2; color: #dc2626; }
.stock-opt-market.market-hk { background: #fef3c7; color: #d97706; }
.stock-opt-market.market-us { background: #dbeafe; color: #1e40af; }
.stock-opt-source {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
  background: #f1f5f9;
  color: #64748b;
}
.stock-option-empty {
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}
.comp-refresh-btn {
  white-space: nowrap;
  flex-shrink: 0;
}
.comp-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.comp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.comp-table th {
  background: #f8fafc;
  padding: 11px 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.comp-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-secondary);
  white-space: nowrap;
}
.comp-hl { background: #eff6ff; }
.comp-hl td { color: var(--primary); font-weight: 500; }
.comp-note { font-size: 12px; color: var(--text-muted); margin-top: 10px; }
.peer-logic {
  margin-top: 12px;
  padding: 14px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== Risks ===== */
.risk-badge { font-size: 13px; font-weight: 500; }
.risk-row {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}
.risk-row:last-child { border-bottom: none; }
.risk-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.risk-dot.green { background: var(--success); }
.risk-dot.yellow { background: var(--warning); }
.risk-dot.red { background: var(--danger); }
.risk-content { flex: 1; }
.risk-title { font-size: 14px; font-weight: 500; }
.risk-desc { font-size: 13px; color: var(--text-secondary); margin-top: 3px; line-height: 1.5; }
.risk-link { font-size: 12px; color: var(--primary); text-decoration: underline; cursor: pointer; margin-top: 4px; display: inline-block; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 2px 8px rgba(91,106,191,0.3);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(91,106,191,0.4); transform: translateY(-1px); }
.btn-secondary { background: #f1f5f9; color: var(--text-secondary); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-warning { background: #fef3c7; color: #92400e; }
.btn-warning:hover { background: #fde68a; }
.btn-outline-primary { background: white; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary-light); }
.btn-outline-success { background: white; border: 1px solid var(--success); color: var(--success); }
.btn-outline-success:hover { background: #dcfce7; }

.report-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* ===== History ===== */
#pageHistory { max-width: 900px; margin: 0 auto; padding: 28px 20px 60px; }
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.history-header h2 { font-size: 20px; font-weight: 600; }
.history-hint { font-size: 13px; color: var(--text-muted); }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.hist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all var(--transition);
}
.hist-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.hist-info { flex: 1; min-width: 0; }
.hist-company { font-size: 16px; font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.hist-tag { font-size: 12px; color: var(--primary); background: var(--primary-light); padding: 2px 10px; border-radius: 4px; }
.hist-time { font-size: 12px; color: var(--text-muted); }
.hist-file { font-size: 12px; color: var(--text-muted); }
.hist-actions { display: flex; align-items: center; gap: 10px; }
.hist-risk { font-size: 12px; font-weight: 500; white-space: nowrap; }
.hist-del {
  width: 32px; height: 32px;
  border: none; background: transparent;
  cursor: pointer; border-radius: 6px;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.3;
  transition: all var(--transition);
}
.hist-del:hover { opacity: 1; background: #fee2e2; }

/* ===== Admin ===== */
#pageAdmin { max-width: 1000px; margin: 0 auto; padding: 28px 20px 60px; }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: var(--radius);
  padding: 22px;
  color: white;
  text-align: center;
}
.stat-num { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.stat-label { font-size: 12px; opacity: 0.7; }

/* Toggle */
.toggle-list { }
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-info h4 { font-size: 14px; font-weight: 500; }
.toggle-info p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.toggle-switch {
  width: 44px;
  height: 24px;
  background: #cbd5e1;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-switch.on { background: var(--primary); }
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch.on::after { left: 22px; }

.key-actions { display: flex; gap: 6px; }
.status-text { font-weight: 500; }
.test-result {
  display: none;
  margin: 0 0 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.test-result.visible { display: block; }
.test-result.success { background: #dcfce7; border: 1px solid #22c55e; color: #166534; }
.test-result.error { background: #fee2e2; border: 1px solid #ef4444; color: #991b1b; }

/* Feedback */
.fb-item { padding: 12px; background: #f8fafc; border-radius: var(--radius-sm); margin-bottom: 8px; }
.fb-item:last-child { margin-bottom: 0; }
.fb-top { display: flex; justify-content: space-between; margin-bottom: 4px; }
.fb-user { font-weight: 500; font-size: 13px; }
.fb-time { font-size: 12px; color: var(--text-muted); }
.fb-text { font-size: 13px; color: var(--text-secondary); }

/* Line Chart */
.line-svg { width: 100%; height: 200px; }

/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(4px);
}
.modal-overlay.visible { display: flex; }
.modal-box {
  background: var(--card);
  border-radius: 16px;
  padding: 28px;
  width: 420px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
}
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 16px; }
.modal-guide { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.7; }
.modal-textarea {
  width: 100%;
  height: 110px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 14px;
  resize: none;
  font-family: var(--font);
  transition: border-color var(--transition);
}
.modal-textarea:focus { outline: none; border-color: var(--primary); }
.modal-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  transition: border-color var(--transition);
}
.modal-input:focus { outline: none; border-color: var(--primary); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .info-grid.cols-2 { grid-template-columns: 1fr; }
  .upload-headline { font-size: 28px; }
  .pie-container { flex-direction: column; gap: 20px; }
  .tab-bar { overflow-x: auto; }
  .navbar { padding: 0 16px; }
  .report-company { font-size: 22px; }
}
@media (max-width: 480px) {
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .tab-item { padding: 8px 14px; font-size: 13px; }
  .fund-row { flex-direction: column; gap: 8px; }
}

/* ===== 报告页分区块渐进展示 ===== */
.report-section.hidden { display: none; }
.section-next {
  text-align: center;
  margin: 28px 0;
  padding: 18px 0;
  border-top: 1px dashed #cbd5e1;
}
.section-next.consumed {
  opacity: 0.4;
  pointer-events: none;
}
.section-btn {
  min-width: 240px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
}
.ai-summary-card-wrap {
  background: #f0f9ff;
  border-left: 4px solid #0ea5e9;
}
.ai-summary-loading {
  text-align: center;
  padding: 24px 16px;
  color: #64748b;
  font-size: 14px;
}
.ai-summary-loading::after {
  content: ' ⏳';
  display: inline-block;
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.ai-summary-content {
  font-size: 14px;
  line-height: 1.8;
  color: #1e293b;
}
.ai-summary-content h4 {
  font-size: 14px;
  font-weight: 600;
  color: #0369a1;
  margin: 12px 0 6px;
}
.ai-summary-content h4:first-child { margin-top: 0; }
.ai-summary-content p { margin: 0 0 8px; }
.ai-summary-error {
  padding: 16px;
  background: #fee2e2;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 13px;
}
.valuation-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.valuation-item {
  padding: 12px;
  background: #f8fafc;
  border-radius: 6px;
}
.valuation-label { font-size: 12px; color: #64748b; }
.valuation-value { font-size: 16px; font-weight: 600; color: #1e293b; margin-top: 4px; }
.revenue-row {
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid var(--primary);
  margin-bottom: 8px;
  font-size: 14px;
}
.revenue-empty {
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  color: #64748b;
  font-size: 13px;
}

/* ===== 报告编辑器 ===== */
#pageReportEditor { max-width: 1000px; margin: 0 auto; padding: 24px 20px 60px; }
.editor-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.editor-header h2 { flex: 1; margin: 0; font-size: 18px; }
.editor-header-actions { display: flex; align-items: center; gap: 8px; }
.editor-save-status { font-size: 12px; color: #64748b; }
.editor-save-status.saving { color: #f59e0b; }
.editor-save-status.saved { color: #22c55e; }
.editor-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.editor-meta-item label {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}
.editor-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}
.editor-input:focus { outline: none; border-color: var(--primary); }
.editor-section {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.editor-section-title {
  padding: 10px 16px;
  background: #f8fafc;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
}
.editor-toolbar button {
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  min-width: 28px;
}
.editor-toolbar button:hover { background: #f1f5f9; }
.editor-toolbar .toolbar-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}
.editor-content {
  min-height: 120px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.8;
  outline: none;
  white-space: pre-wrap;
}
.editor-content:focus { background: #fffbf0; }
.editor-content p { margin: 0 0 8px; }
.editor-content ul, .editor-content ol { padding-left: 24px; margin: 8px 0; }

/* AI 气泡菜单 */
.ai-bubble {
  position: absolute;
  z-index: 1000;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: #1e293b;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  flex-wrap: wrap;
  max-width: 480px;
}
.ai-bubble button {
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.ai-bubble button:hover { background: rgba(255,255,255,0.15); }
.ai-loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.ai-loading-box {
  background: white;
  padding: 20px 32px;
  border-radius: 12px;
  font-size: 14px;
  color: #1e293b;
}

/* ===== 上传页跑马灯 ===== */
.marquee-wrap {
  overflow: hidden;
  background: transparent;
  border: none;
  padding: 8px 0;
  margin-bottom: 18px;
  white-space: nowrap;
}
.marquee-track {
  display: inline-block;
  white-space: nowrap;
  animation: marqueeMove 28s linear infinite;
}
.marquee-text {
  display: inline-block;
  padding-right: 80px;
  font-size: 13px;
  font-weight: 500;
  color: #15803d;
}
.marquee-text::before { content: '🔥 '; }
@keyframes marqueeMove {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }

.editor-ai-badge {
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== 用户认证弹窗 ===== */
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.auth-tab:hover { color: var(--primary); }
.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form.hidden { display: none; }
.auth-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
  margin-top: -6px;
}
.btn-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
  text-decoration: underline;
  margin-top: 8px;
}
.btn-link:hover { color: var(--primary); }

/* ===== 导航栏用户菜单 ===== */
.user-menu { position: relative; }
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition);
}
.user-menu-btn:hover { background: rgba(255,255,255,0.15); }
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  z-index: 200;
  min-width: 140px;
}
.user-dropdown button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
}
.user-dropdown button:hover { background: var(--bg); }
.nav-login-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.nav-login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91,106,191,0.3);
}
