:root {
  --navy: #0b1f3a;
  --navy-2: #123b63;
  --blue: #2563a8;
  --gold: #d6a94a;
  --bg: #f3f6fa;
  --card: #ffffff;
  --text: #142033;
  --muted: #6f7d90;
  --line: #e3e9f1;
  --red: #d64545;
  --green: #1f9d55;
  --shadow: 0 16px 40px rgba(11, 31, 58, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 14px 28px;
}

.hero {
  margin: 0 -14px;
  padding: 26px 18px 22px;
  color: #fff;
  background: linear-gradient(160deg, var(--navy), var(--navy-2));
  border-radius: 0 0 24px 24px;
  box-shadow: var(--shadow);
}

.topbar,
.control-row,
.panel-head,
.summary-grid,
.price-line,
.meta-line {
  display: flex;
  align-items: center;
}

.topbar,
.control-row,
.panel-head {
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel .eyebrow {
  color: var(--blue);
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.15;
}

.contact-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.contact-line a {
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.query-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-top: 14px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.query-link:hover {
  background: rgba(255, 255, 255, 0.16);
}

h2 {
  font-size: 18px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.icon-button.loading {
  animation: spin 0.9s linear infinite;
}

.control-row {
  margin-top: 24px;
}

.select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.select-wrap span,
.timestamp {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

select {
  width: 100%;
  border: 0;
  color: #fff;
  background: transparent;
  outline: 0;
}

option {
  color: var(--text);
}

.timestamp {
  text-align: right;
}

.summary-grid {
  align-items: stretch;
  margin-top: -16px;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.summary-grid::-webkit-scrollbar {
  display: none;
}

.price-card {
  min-width: 142px;
  flex: 1;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 10px 30px rgba(11, 31, 58, 0.08);
}

.primary-card {
  border-color: rgba(214, 169, 74, 0.36);
}

.price-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.price-line {
  gap: 5px;
}

.price-line strong {
  font-size: 25px;
  line-height: 1;
  color: var(--navy);
}

.price-line span {
  color: var(--muted);
  font-size: 11px;
}

.meta-line {
  min-height: 19px;
  margin-top: 8px;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.ton-line {
  margin-top: 6px;
  color: var(--navy-2);
  font-size: 11px;
  line-height: 1.35;
}

.up {
  color: var(--red);
}

.down {
  color: var(--green);
}

.panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.panel-head {
  align-items: flex-start;
  margin-bottom: 14px;
  flex-direction: column;
}

.panel-head.compact {
  margin-bottom: 10px;
}

.segmented {
  display: flex;
  gap: 6px;
  width: 100%;
  padding: 4px;
  border-radius: 8px;
  background: #edf2f8;
}

.segment {
  flex: 1;
  min-width: 52px;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.segment.active {
  color: #fff;
  background: var(--navy-2);
}

.product-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.product-item {
  min-height: 96px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.product-name {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.product-price {
  margin: 0;
  color: var(--navy);
  font-size: 24px;
  font-weight: 800;
}

.product-change {
  margin-top: 8px;
  font-size: 12px;
}

.product-ton {
  margin-top: 6px;
  color: var(--navy-2);
  font-size: 12px;
  font-weight: 700;
}

.muted-ton {
  color: var(--muted);
  font-weight: 500;
}

.map-base {
  padding: 7px 10px;
  border-radius: 8px;
  color: #fff;
  background: var(--navy-2);
  font-size: 12px;
  font-weight: 700;
}

.map-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.map-stat {
  min-height: 58px;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.map-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.map-stat strong {
  display: block;
  margin-top: 5px;
  color: var(--navy);
  font-size: 16px;
}

.national-map {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 22%, rgba(37, 99, 168, 0.08), transparent 24%),
    linear-gradient(180deg, #f9fbfe, #eef5fb);
}

.china-map {
  width: 100%;
  min-height: 360px;
}

.province-shape {
  stroke: #ffffff;
  stroke-width: 1.2;
  transition:
    fill 0.18s ease,
    stroke 0.18s ease,
    transform 0.18s ease;
}

.map-region.has-data {
  cursor: pointer;
}

.map-region.has-data:hover .province-shape {
  stroke: var(--navy);
  stroke-width: 1.8;
}

.province-label {
  pointer-events: none;
  fill: var(--navy);
  font-size: 10px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 3px;
  text-anchor: middle;
}

.province-diff {
  pointer-events: none;
  font-size: 9px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 3px;
  text-anchor: middle;
}

.map-legend {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 11px;
  backdrop-filter: blur(6px);
}

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

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

.legend-dot.higher {
  background: var(--red);
}

.legend-dot.lower {
  background: var(--green);
}

.legend-dot.base {
  background: var(--gold);
}

.notice {
  margin-bottom: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #715413;
  background: #fff7df;
  font-size: 12px;
}

.hidden {
  display: none;
}

.chart-wrap {
  height: 190px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f9fbfe, #f2f6fb);
}

svg {
  width: 100%;
  height: 100%;
  display: block;
}

.axis-label {
  fill: var(--muted);
  font-size: 10px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 390px;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 700;
}

td {
  color: var(--text);
}

.empty {
  padding: 28px 0;
  color: var(--muted);
  text-align: center;
}

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

@media (min-width: 780px) {
  .app-shell {
    width: min(100%, 1080px);
    padding: 0 28px 34px;
  }

  .hero {
    margin: 0 -28px;
    padding: 32px 32px 30px;
  }

  .summary-grid {
    overflow: visible;
  }

  .panel-head {
    flex-direction: row;
  }

  .segmented {
    width: auto;
  }

  .segment {
    flex: initial;
  }

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

  .national-map {
    min-height: 520px;
  }

  .china-map {
    min-height: 520px;
  }

  .province-label {
    font-size: 9px;
  }

  .province-diff {
    font-size: 8px;
  }
}
