:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #162436;
  --muted: #6d7a8a;
  --line: #dfe7ef;
  --blue: #1f4e79;
  --blue-2: #42779e;
  --teal: #2b8c88;
  --orange: #c46a4a;
  --gold: #b48732;
  --shadow: 0 14px 40px rgba(25, 48, 74, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 5% 0%, rgba(66, 119, 158, 0.12), transparent 26rem),
    radial-gradient(circle at 95% 14%, rgba(43, 140, 136, 0.09), transparent 30rem),
    var(--bg);
  color: var(--ink);
  font-family: "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

button, select { font: inherit; }

.app-header {
  background:
    linear-gradient(125deg, rgba(16, 47, 73, 0.98), rgba(28, 77, 109, 0.96) 58%, rgba(32, 91, 104, 0.93));
  color: #fff;
  padding: 34px 24px 30px;
  box-shadow: 0 16px 44px rgba(13, 36, 56, 0.18);
}

.header-inner {
  max-width: 1520px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.eyebrow, .section-kicker {
  letter-spacing: .18em;
  font-size: 11px;
  font-weight: 700;
  opacity: .72;
}

h1 { margin: 8px 0 4px; font-size: clamp(28px, 4vw, 44px); font-weight: 600; }
.app-header p { margin: 0; opacity: .72; font-size: 14px; }

.section-tabs {
  display: flex;
  gap: 8px;
  background: rgba(255,255,255,.1);
  padding: 6px;
  border-radius: 999px;
}

.section-tab {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.72);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: .2s ease;
}

.section-tab.active, .section-tab:hover { background: #fff; color: var(--blue); }

main {
  max-width: 1520px;
  margin: 0 auto;
  padding: 42px 24px 72px;
}

.section { display: none; }
.section.active { display: block; animation: rise .35s ease; }

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

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 20px;
}

.section-heading h2 { margin: 4px 0 0; font-size: 28px; font-weight: 600; }
.section-heading p { margin: 0; max-width: 680px; color: var(--muted); font-size: 13px; text-align: right; }
.section-kicker { color: var(--teal); }

.panel {
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(194, 208, 222, .56);
  border-radius: var(--radius);
  padding: 24px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.panel-head h3 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.panel-head p { margin: 0; color: var(--muted); font-size: 13px; }

.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 3px;
  background: #eef3f8;
  border-radius: 12px;
  flex-wrap: wrap;
}

.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
}

.segmented button.active {
  background: var(--blue);
  color: white;
  box-shadow: 0 4px 12px rgba(31, 78, 121, .22);
}

.segmented.compact {
  padding: 3px;
  border-radius: 10px;
}

.segmented.compact button {
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12px;
}

.chart-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.chart-controls .chart-note {
  flex: 1;
  margin: 0;
}

.province-controls {
  align-items: center;
  flex-wrap: wrap;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.chart-note {
  color: var(--muted);
  font-size: 12px;
  background: #f7fafc;
  border-left: 3px solid #b7cedf;
  padding: 8px 11px;
  margin: 8px 0 12px;
}

.chart { width: 100%; }
.chart-lg { height: 430px; }
#gdp-province-chart { height: 620px; }
.chart-md { height: 320px; }
.chart-orbit { height: 560px; }
.chart-sankey { height: 760px; }
.chart-map { height: 560px; }

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

.news-item {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  text-decoration: none;
  color: inherit;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.news-item:hover {
  border-color: #9eb9cb;
  background: white;
  transform: translateY(-1px);
}

.news-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
  line-height: 1.45;
}

.news-meta {
  color: var(--muted);
  font-size: 11px;
}

.news-summary {
  color: #526273;
  font-size: 12px;
  line-height: 1.6;
}

.news-empty {
  padding: 42px 18px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 12px;
}

.news-more {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #b8ccda;
  border-radius: 10px;
  background: white;
  color: var(--blue);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.news-more:hover {
  border-color: #89aec5;
  background: var(--surface-2);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mini-card, .subchart-card {
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px 6px;
}

.mini-card h4, .subchart-card h4 {
  margin: 0 4px 4px;
  font-size: 14px;
  font-weight: 600;
}

.mini-card .chart { height: 300px; }

.consumption-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar-hint { color: #8794a3; font-size: 12px; }

.multi-select { position: relative; }

.multi-trigger {
  border: 1px solid #cfdbe6;
  background: white;
  border-radius: 10px;
  padding: 8px 34px 8px 12px;
  cursor: pointer;
  color: var(--ink);
  min-width: 190px;
  text-align: left;
}

.multi-trigger::after {
  content: "⌄";
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-52%);
}

.multi-menu {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  max-height: 320px;
  overflow: auto;
  background: white;
  border: 1px solid #d7e1ea;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 18px 38px rgba(26, 50, 74, .16);
}

.multi-select.open .multi-menu { display: grid; gap: 2px; }

.multi-option {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
}

.multi-option:hover { background: #f2f6f9; }
.multi-option input { accent-color: var(--blue); }

.orbit-selectors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

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

.orbit-selectors select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 12px;
  border: 1px solid #cfdbe6;
  border-radius: 10px;
  background: white;
  color: var(--ink);
}

.industry-heading { align-items: center; }
.industry-picker {
  min-width: 280px;
  color: var(--muted);
  font-size: 12px;
}

.industry-picker select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  border: 1px solid #c8d7e4;
  border-radius: 11px;
  background: white;
  color: var(--ink);
  font-size: 15px;
}

.orbit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.expansion-panel {
  border-top: 4px solid var(--teal);
}

.wordcloud {
  min-height: 420px;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 10px 17px;
  padding: 28px;
  background: linear-gradient(135deg, #f8fbfd, #edf4f7);
  border-radius: 14px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.word {
  cursor: default;
  line-height: 1;
  transition: transform .18s ease, color .18s ease;
}

.word:hover { transform: scale(1.08); color: var(--orange); }

.assistant-panel { padding: 0; overflow: hidden; }
.assistant-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 650px;
}

.question-list {
  padding: 24px 18px;
  color: white;
  background:
    linear-gradient(155deg, rgba(21, 56, 84, .98), rgba(37, 97, 112, .96));
}

.assistant-brand {
  font-size: 18px;
  font-weight: 600;
  margin: 0 6px 24px;
}

.question {
  display: block;
  width: 100%;
  margin: 9px 0;
  padding: 14px 15px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.8);
  text-align: left;
  cursor: pointer;
  line-height: 1.45;
}

.question:hover, .question.active {
  background: white;
  color: var(--blue);
  border-color: white;
}

.assistant-disclaimer {
  margin: 28px 6px 0;
  color: rgba(255,255,255,.5);
  font-size: 11px;
  line-height: 1.6;
}

.answer-pane {
  padding: 30px 34px 38px;
  background: #fff;
}

.answer-question {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 22px;
}

.answer-lead {
  padding: 14px 16px;
  border-left: 4px solid var(--teal);
  background: #f3f8f9;
  color: #415161;
  border-radius: 0 10px 10px 0;
  margin-bottom: 22px;
}

.answer-block {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.answer-block h4 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--blue);
}

.answer-block p { margin: 0 0 8px; color: #4f5e6d; }
.answer-block ul { margin: 8px 0 0; padding-left: 20px; color: #4f5e6d; }
.answer-block li { margin: 5px 0; }

.answer-kpis {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.answer-kpi {
  padding: 8px 11px;
  border-radius: 9px;
  background: #eef4f8;
  color: var(--blue);
  font-size: 12px;
}

footer {
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 24px 36px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1050px) {
  .mini-grid, .consumption-grid { grid-template-columns: repeat(2, 1fr); }
  .orbit-grid { grid-template-columns: 1fr; }
  .assistant-layout { grid-template-columns: 1fr; }
  .header-inner, .section-heading, .panel-head { flex-direction: column; align-items: flex-start; }
  .chart-controls { flex-direction: column; align-items: stretch; }
  .chart-controls .segmented { align-self: flex-start; }
  .section-heading p { text-align: left; }
  .industry-picker { width: 100%; }
}

@media (max-width: 680px) {
  .app-header { padding: 26px 16px; }
  main { padding: 28px 14px 54px; }
  .panel { padding: 16px; border-radius: 14px; }
  .mini-grid, .consumption-grid, .orbit-selectors { grid-template-columns: 1fr; }
  .chart-lg, .chart-md, .chart-orbit, .chart-sankey, .chart-map { height: 350px; }
  .chart-sankey { height: 520px; }
  #gdp-province-chart { height: 480px; }
  .assistant-layout { min-height: 0; }
  .answer-pane { padding: 22px 18px 28px; }
}
