:root {
  --background: #fafaf9;
  --foreground: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --card: rgba(255, 255, 255, 0.88);
  --card-strong: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --primary: #0f172a;
  --primary-foreground: #f8fafc;
  --secondary: #f1f5f9;
  --accent: #eef2ff;
  --success: #16a34a;
  --success-bg: rgba(22, 163, 74, 0.12);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.12);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.14);
  --info: #2563eb;
  --info-bg: rgba(37, 99, 235, 0.12);
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 6px 20px rgba(15, 23, 42, 0.06);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--foreground);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.1), transparent 30%),
    linear-gradient(180deg, #f8fafc 0%, #f8fafc 220px, #fafaf9 220px, #fafaf9 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 90%);
}

body.dialog-open {
  overflow: hidden;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
}

.app-shell {
  position: relative;
  z-index: 1;
}

.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
  background: rgba(248, 250, 252, 0.78);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-foreground);
  background: linear-gradient(135deg, #020617 0%, #1d4ed8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-weight: 800;
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand-subtitle {
  font-size: 0.84rem;
  color: var(--muted);
}

.topbar-actions,
.nav-links,
.inline-actions,
.stack,
.toolbar,
.section-actions,
.hero-actions,
.stat-meta,
.filter-line,
.table-legend,
.kbd-list,
.form-inline,
.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-links {
  justify-content: flex-end;
}

.nav-links-rich {
  flex-wrap: wrap;
}

.nav-chip-group {
  font-weight: 700;
}

.nav-chip {
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--foreground);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.nav-chip:hover,
.btn:hover,
.nav-feature:hover,
.nav-panel:hover,
.stat-card:hover,
.metric-card:hover,
.small-card:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: var(--shadow-soft);
}

.page {
  padding: 28px 0 48px;
}

.hero-card,
.section-card,
.panel-card,
.page-card,
.small-card,
.dialog-panel,
.stat-card,
.metric-card,
.nav-panel,
.nav-feature,
.sub-card,
.highlight-card,
.forecast-card {
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.9)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
  color: #eff6ff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -60px;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.26), transparent 64%);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  font-weight: 600;
}

.hero-title {
  margin: 16px 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero-text {
  max-width: 900px;
  color: rgba(239, 246, 255, 0.78);
  font-size: 1rem;
}

.hero-grid,
.content-grid,
.dashboard-grid,
.summary-grid,
.nav-grid,
.stats-grid,
.form-grid,
.metrics-grid {
  display: grid;
  gap: 16px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: stretch;
  gap: 20px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card,
.metric-card,
.small-card,
.nav-panel {
  border-radius: var(--radius-lg);
  padding: 18px;
}

.stat-label,
.metric-label,
.panel-kicker,
.section-subtitle,
.muted,
.small-text,
.help-text,
.meta,
.table-hint,
.form-note {
  color: var(--muted);
}

.stat-value,
.metric-value {
  margin-top: 10px;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.metric-value.inline {
  font-size: 1rem;
  margin-top: 0;
}

.section-card,
.page-card,
.panel-card {
  border-radius: var(--radius-xl);
}

.section-head,
.panel-card-head,
.page-card-head {
  padding: 22px 24px 0;
}

.section-body,
.panel-card-body,
.page-card-body {
  padding: 22px 24px 24px;
}

.section-title,
.panel-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-subtitle {
  margin-top: 6px;
  font-size: 0.95rem;
}

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.08), transparent);
  margin: 18px 0;
}

.nav-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nav-feature,
.nav-panel {
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.nav-feature::after,
.nav-panel::after {
  content: "";
  position: absolute;
  inset: auto -24px -36px auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1), transparent 65%);
}

.nav-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.12);
  color: var(--info);
  font-weight: 700;
}

.nav-title {
  margin: 16px 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
}

.nav-desc {
  color: var(--muted);
  font-size: 0.95rem;
}

.kpi-list {
  display: grid;
  gap: 12px;
}

.kpi-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.kpi-label {
  color: rgba(239, 246, 255, 0.74);
}

.kpi-value {
  font-weight: 800;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.92rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.72);
  color: var(--foreground);
  border-color: rgba(15, 23, 42, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
  border-color: rgba(15, 23, 42, 0.08);
}

.btn-success {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.18);
}

.btn-danger {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.18);
}

.btn-muted {
  background: var(--secondary);
  color: var(--foreground);
  border-color: rgba(15, 23, 42, 0.06);
}

.btn-linklike {
  color: var(--info);
  border-color: rgba(37, 99, 235, 0.16);
  background: rgba(37, 99, 235, 0.08);
}

.control,
.input,
.select,
textarea,
.dialog-input,
#editor {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.9);
  color: var(--foreground);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.65);
}

.input,
.select,
.dialog-input,
textarea {
  min-height: 42px;
  padding: 0 14px;
}

textarea {
  min-height: 132px;
  padding: 12px 14px;
  resize: vertical;
}

.input:focus,
.select:focus,
textarea:focus,
.dialog-input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.2);
  outline-offset: 0;
  border-color: rgba(37, 99, 235, 0.45);
}

.field {
  display: grid;
  gap: 8px;
}

.label {
  font-weight: 700;
  font-size: 0.94rem;
}

.form-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.span-2 { grid-column: span 2; }
.span-1 { grid-column: span 1; }

.tabbar {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.tab-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.tab-btn.is-active {
  background: #ffffff;
  color: var(--foreground);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.badge,
.status-pill,
.signal-pill,
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-muted,
.status-muted,
.signal-muted,
.nav-badge {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.16);
}

.badge-success,
.status-positive,
.signal-positive {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.18);
}

.badge-danger,
.status-negative,
.signal-negative {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.18);
}

.badge-warning,
.status-warning,
.signal-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(217, 119, 6, 0.18);
}

.badge-info,
.status-primary,
.signal-primary {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.alert,
.flash {
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.8);
}

.alert-warning,
.flash-warning {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.18);
}

.alert-danger,
.flash-danger {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
}

.alert-success,
.flash-success {
  color: var(--success);
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.18);
}

.flash-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.table-shell {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.76);
}

.data-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(248, 250, 252, 0.98);
  color: #334155;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.data-table tbody td {
  padding: 14px 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  vertical-align: top;
}

.data-table tbody tr {
  transition: background 0.18s ease, transform 0.18s ease;
}

.data-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.025);
}

.table-row-positive {
  background: rgba(22, 163, 74, 0.06);
}

.table-row-primary {
  background: rgba(37, 99, 235, 0.06);
}

.table-row-negative {
  background: rgba(220, 38, 38, 0.06);
}

.table-row-muted {
  background: rgba(100, 116, 139, 0.06);
}

.table-row-blink {
  animation: pulseRow 1.25s ease-in-out infinite;
}

@keyframes pulseRow {
  0%, 100% { box-shadow: inset 0 0 0 rgba(22, 163, 74, 0); }
  50% { box-shadow: inset 0 0 0 999px rgba(22, 163, 74, 0.06); }
}

.table-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight: 700;
}

.table-name a,
.link {
  color: var(--foreground);
  text-decoration: none;
  font-weight: 700;
}

.table-name a:hover,
.link:hover,
.article-content a:hover,
.news-link:hover {
  color: var(--info);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.hidden {
  display: none !important;
}

.right {
  text-align: right;
}

.empty-state {
  border-radius: 18px;
  border: 1px dashed rgba(15, 23, 42, 0.14);
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.dialog-root {
  width: min(560px, calc(100% - 24px));
  border: none;
  padding: 0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
}

.dialog-root::backdrop {
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(8px);
}

.dialog-panel {
  padding: 24px;
  background: rgba(255, 255, 255, 0.96);
}

.dialog-title {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 800;
}

.dialog-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.login-shell {
  width: min(520px, calc(100% - 32px));
  margin: 0 auto;
}

.article-content {
  color: #1e293b;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  line-height: 1.25;
}

.article-content h2 {
  padding-left: 12px;
  border-left: 4px solid rgba(37, 99, 235, 0.7);
}

.article-content p,
.article-content li {
  line-height: 1.9;
}

.article-content code,
.code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.article-content pre {
  border-radius: 16px;
  padding: 14px 16px;
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
}

.side-panel {
  position: sticky;
  top: 92px;
}

.summary-grid {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.news-list {
  display: grid;
  gap: 14px;
}

.news-item {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.news-link {
  text-decoration: none;
  font-weight: 700;
}

.news-line2 {
  margin-top: 8px;
  color: var(--muted);
}

.right-nav-link {
  display: block;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  text-decoration: none;
  background: rgba(248, 250, 252, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.07);
  color: #334155;
}

.right-nav-link:hover {
  color: var(--info);
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(239, 246, 255, 0.9);
}

.highlight-card {
  border-radius: 16px;
  padding: 16px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
}

.highlight-tag {
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--info);
  border: 1px solid rgba(37, 99, 235, 0.14);
  padding: 12px;
  text-align: center;
  font-weight: 700;
}

.highlight-content {
  white-space: pre-wrap;
  color: #334155;
}

.table-responsive {
  overflow: auto;
}

.summary-table,
.east-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.summary-table th,
.summary-table td,
.east-table th,
.east-table td {
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.summary-table th,
.east-table thead th {
  background: rgba(248, 250, 252, 0.95);
  color: #334155;
  text-align: left;
}

.summary-table td,
.east-table tbody td {
  background: rgba(255, 255, 255, 0.9);
}

/* 财务指标模块保持“一期一行”的横向表格，所有表头和数据都不换行。 */
.summary-table-nowrap {
  min-width: max-content;
}

.summary-table-nowrap th,
.summary-table-nowrap td {
  white-space: nowrap;
}

.report-overview-grid {
  display: grid;
  gap: 16px;
  width: 100%;
  min-width: 0;
  /* 使用百分比切分四列，保证概览卡片总宽度与顶部详情模块一致。 */
  grid-template-columns: repeat(4, minmax(0, calc((100% - 48px) / 4)));
}

.report-overview-card,
.report-group-card {
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.report-overview-card {
  padding: 18px;
  min-width: 0;
}

.report-overview-value {
  margin-top: 10px;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.report-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.report-tab-btn {
  min-height: 40px;
}

.report-tab-panel {
  display: none;
}

.report-tab-panel.is-active {
  display: block;
}

.report-group-card + .report-group-card {
  margin-top: 18px;
}

.report-group-card {
  padding: 18px;
}

.analysis-summary {
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.06));
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: #1e293b;
  line-height: 1.8;
}

.analysis-grid,
.report-chart-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  width: 100%;
  min-width: 0;
}

.report-main {
  display: grid;
  gap: 20px;
  width: 100%;
}

/* 详细报表页的一级卡片统一占满可用宽度，和顶部 hero 模块保持一致。 */
.report-main > .section-card {
  width: 100%;
  min-width: 0;
}

.analysis-grid {
  /* 自动分析模块使用 50% / 50% 占位，避免卡片宽度忽大忽小。 */
  grid-template-columns: repeat(2, minmax(0, calc((100% - 16px) / 2)));
}

.analysis-card,
.report-chart-card {
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.analysis-card {
  padding: 18px;
  min-width: 0;
}

.analysis-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.analysis-card-text {
  margin-top: 12px;
  color: #334155;
  line-height: 1.8;
}

.report-chart-grid {
  /* 图表模块同样按百分比分成两列，占位与上方模块一致。 */
  grid-template-columns: repeat(2, minmax(0, calc((100% - 16px) / 2)));
}

.report-chart-card {
  padding: 18px;
  cursor: zoom-in;
  min-width: 0;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.report-chart-box {
  margin-top: 14px;
  min-height: 280px;
}

.report-chart-box-modal {
  min-height: 420px;
}

.report-chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-grid-line {
  stroke: rgba(148, 163, 184, 0.28);
  stroke-width: 1;
}

.chart-axis-text {
  fill: #64748b;
  font-size: 11px;
}

.chart-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(10px);
}

/* 明确覆盖组件自身的 display，确保模态框默认不会在首屏直接显示。 */
.chart-modal-backdrop[hidden] {
  display: none !important;
}

.chart-modal-panel {
  width: min(1180px, calc(100% - 24px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
  padding: 22px;
}

.report-group-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
}

.report-table-shell {
  margin-top: 14px;
  width: 100%;
}

.report-table {
  width: 100%;
  min-width: 100%;
  /* 通过固定表格布局配合 colgroup 百分比列宽，压缩单元格并避免整体被撑宽。 */
  table-layout: fixed;
}

.report-table thead th {
  white-space: nowrap;
}

.report-table th,
.report-table td {
  padding: 8px 10px;
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

/* 累计报告要求每一列都在一行内完整展示，因此切回自动列宽并禁止单元格换行。 */
.report-table-shell-nowrap {
  overflow-x: auto;
  overflow-y: hidden;
}

.report-table-nowrap {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.report-table-nowrap th,
.report-table-nowrap td {
  white-space: nowrap;
  overflow-wrap: normal;
}

.report-table .report-metric-col {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 140px;
  background: rgba(248, 250, 252, 0.98);
  font-weight: 700;
}

.report-table tbody .report-metric-col {
  background: rgba(255, 255, 255, 0.98);
}

.report-meta-list {
  align-items: flex-start;
}

.report-notes {
  margin-top: 12px;
  color: var(--muted);
}

.report-notes p {
  margin: 0;
}

.report-notes p + p {
  margin-top: 10px;
}

.footer-note {
  margin-top: 26px;
  color: var(--muted-2);
  font-size: 0.88rem;
}

.ql-toolbar.ql-snow,
.ql-container.ql-snow {
  border-color: rgba(15, 23, 42, 0.1) !important;
}

.ql-toolbar.ql-snow {
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  background: rgba(248, 250, 252, 0.95);
}

.ql-container.ql-snow {
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
}

#editor {
  min-height: 420px;
}

@media (max-width: 1180px) {
  .stats-grid,
  .nav-grid,
  .summary-grid,
  .hero-grid,
  .report-overview-grid,
  .analysis-grid,
  .report-chart-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }
}

@media (max-width: 920px) {
  .topbar {
    align-items: flex-start;
    padding: 14px 0;
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .span-8,
  .span-6,
  .span-4,
  .span-3,
  .span-2,
  .span-1 {
    grid-column: span 6;
  }

  .highlight-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 20px, 1380px);
  }

  .page {
    padding-top: 18px;
  }

  .hero-card,
  .section-body,
  .section-head,
  .panel-card-body,
  .panel-card-head,
  .page-card-body,
  .page-card-head,
  .dialog-panel {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero-card {
    padding-top: 22px;
    padding-bottom: 22px;
    border-radius: 22px;
  }

  .data-table {
    min-width: 860px;
  }

  .report-group-card {
    padding: 14px;
  }

  .report-tabs {
    width: 100%;
  }

  .report-tab-btn {
    flex: 1 1 140px;
    justify-content: center;
  }

  .chart-modal-panel {
    width: calc(100% - 12px);
    padding: 16px;
  }
}

@media (max-width: 920px) {
  /* 股票详情页在手机端统一收进屏幕宽度，避免主列、侧栏或卡片被内容撑出视口。 */
  .summary-grid,
  .summary-grid > div,
  .summary-grid > aside,
  .summary-grid .section-card,
  .summary-grid .small-card,
  .hero-grid,
  .hero-grid > div,
  .kpi-list,
  .section-head,
  .section-body,
  .article-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .hero-title,
  .hero-text,
  .article-content,
  .news-link,
  .highlight-content,
  .right-nav-link {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* 所有表格在手机端通过外层容器左右滑动查看，模块本身不再被表格撑宽。 */
  .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .table-responsive .summary-table,
  .table-responsive .east-table {
    width: max-content;
    min-width: 100%;
  }
}

@media (max-width: 640px) {
  /* 手机端按钮与工具栏改为纵向堆叠，避免头部模块在窄屏下横向溢出。 */
  .hero-actions,
  .section-actions,
  .toolbar {
    width: 100%;
  }

  .hero-actions .btn,
  .hero-actions form,
  .hero-actions form .btn {
    width: 100%;
  }

  .summary-grid .section-head .section-actions {
    align-items: stretch;
  }

  .summary-grid .section-head .section-actions > div,
  .summary-grid .section-head .section-actions > a,
  .summary-grid .section-head .section-actions > button {
    width: 100%;
    min-width: 0;
  }
}

.layout-main {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
}

.layout-profile {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.row-actions {
  gap: 8px;
}

.financial-interval-select {
  min-width: 120px;
}

.hero-card .btn-outline,
.hero-card .btn-linklike {
  background: rgba(255, 255, 255, 0.12);
  color: #eff6ff;
  border-color: rgba(255, 255, 255, 0.18);
}

.hero-card .btn-primary {
  background: #ffffff;
  color: #0f172a;
  border-color: transparent;
}

.hero-card .btn-outline:hover,
.hero-card .btn-linklike:hover,
.hero-card .btn-primary:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

@media (max-width: 1180px) {
  .layout-main,
  .layout-profile {
    grid-template-columns: 1fr;
  }
}


.form-grid-compact {
  gap: 10px;
}

.form-grid-inline {
  align-items: end;
}

.field-actions,
.field-actions-inline {
  display: flex;
  align-items: end;
}

.field-actions-inline .btn {
  width: 100%;
}

.row-actions {
  flex-wrap: nowrap;
  gap: 8px;
}

.row-actions .btn {
  flex: 0 0 auto;
}

@media (min-width: 1100px) {
  .form-grid-inline {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .form-grid-inline > .span-3 {
    grid-column: span 3;
  }

  .form-grid-inline > .span-2 {
    grid-column: span 2;
  }
}


.table-time {
  white-space: nowrap;
}

.section-actions-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.section-actions-compact .select {
  min-width: 120px;
}


.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-head-compact {
  padding-bottom: 8px;
}

.section-body-compact {
  padding-top: 0;
}

.toolbar-tight {
  gap: 8px;
}

.select-sm {
  min-width: 94px;
  height: 38px;
  padding-top: 0;
  padding-bottom: 0;
}

.form-grid-single-row .field {
  margin-bottom: 0;
}

.table-name,
.table-name a {
  display: block;
  min-width: 6em;
  line-height: 1.4;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.table-name a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.muted-note {
  color: var(--muted);
}

@media (max-width: 640px) {
  .section-card {
    border-radius: 18px;
  }

  .section-head {
    padding-top: 16px;
    padding-bottom: 12px;
  }

  .section-body {
    padding-top: 12px;
    padding-bottom: 16px;
  }

  .form-grid-single-row {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 8px;
  }

  .form-grid-single-row > .span-3 {
    grid-column: span 4;
  }

  .form-grid-single-row > .field-actions {
    grid-column: span 12;
  }

  .row-actions {
    gap: 6px;
  }

  .row-actions .btn {
    padding-left: 10px;
    padding-right: 10px;
  }

  .table-name,
  .table-name a {
    min-width: 5.6em;
    max-width: 5.6em;
  }

  .table-name a {
    -webkit-line-clamp: 2;
    line-height: 1.35;
  }

  .table-time {
    white-space: nowrap;
  }

  .toolbar-tight {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .toolbar-tight > * {
    flex: 0 0 auto;
  }

  .toolbar-tight .small-text {
    white-space: nowrap;
  }

  .toolbar-tight .btn {
    padding: 0 10px;
    white-space: nowrap;
  }

  .toolbar-tight .select-sm {
    min-width: 78px;
    width: 78px;
    padding-left: 10px;
    padding-right: 28px;
  }

  #section-stocks .data-table {
    min-width: 760px;
  }

  #section-stocks .data-table thead th,
  #section-stocks .data-table tbody td {
    padding: 12px 8px;
    font-size: 0.92rem;
  }

  #stockTableBody td:nth-child(1),
  #stockTableBody td:nth-child(3),
  #stockTableBody td:nth-child(5),
  #stockTableBody td:nth-child(6),
  #stockTableBody td:nth-child(7),
  #stockTableBody td:nth-child(8),
  #stockTableBody td:nth-child(9) {
    white-space: nowrap;
  }

  #stockTableBody td[data-k="pe"] {
    white-space: nowrap;
    line-height: 1.3;
  }

  #stockTableBody td[data-k="pe"] .small-text {
    display: block;
    margin-top: 4px;
    white-space: nowrap;
  }
}


.nowrap-text {
  white-space: nowrap;
}

.select-xs {
  min-width: 92px;
  width: 92px;
}

.stock-toolbar {
  width: 100%;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
}

.stock-toolbar .toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.stock-toolbar-buttons .btn {
  white-space: nowrap;
}

@media (min-width: 641px) {
  .section-actions {
    flex-wrap: nowrap;
  }

  .section-actions > :first-child {
    min-width: 0;
    flex: 1 1 auto;
  }

  .stock-toolbar {
    flex: 0 0 auto;
  }

  .section-actions-compact {
    flex-wrap: nowrap;
  }
}

@media (max-width: 640px) {
  .stock-toolbar {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .stock-toolbar-top,
  .stock-toolbar-buttons {
    width: 100%;
  }

  .stock-toolbar-top {
    justify-content: flex-end;
  }

  .stock-toolbar-buttons {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .stock-toolbar-buttons .btn {
    flex: 0 0 auto;
  }

  .section-actions-compact {
    gap: 8px;
  }

  .section-actions-compact .nowrap-text {
    flex: 0 0 auto;
  }
}


.section-title.nowrap-text {
  white-space: nowrap;
}


.nav-links-main {
  justify-content: flex-start;
}

.nav-links-main form {
  margin: 0;
}

@media (min-width: 921px) {
  .nav-links-main {
    flex: 1 1 auto;
    justify-content: flex-start;
    align-content: center;
  }
}

@media (max-width: 920px) {
  .topbar {
    align-items: flex-start;
    padding: 14px 0;
    flex-direction: column;
  }

  .nav-links-main {
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    align-content: flex-start;
    gap: 8px;
  }

  .brand {
    align-self: flex-start;
  }

  .brand-subtitle {
    display: none;
  }
}

@media (max-width: 640px) {
  .nav-links-main .nav-chip,
  .nav-links-main .btn {
    height: 34px;
    padding: 0 12px;
  }
}
