:root {
  color-scheme: light;
  --ink: #14202b;
  --muted: #5f6d78;
  --line: #d8dee4;
  --canvas: #eef1f4;
  --surface: #ffffff;
  --topbar: #101820;
  --green: #087a52;
  --green-soft: #e4f3ed;
  --red: #c93737;
  --red-soft: #fbe9e9;
  --amber: #a96b00;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family:
    "Segoe UI",
    "Microsoft YaHei UI",
    "PingFang SC",
    sans-serif;
  font-variant-numeric: tabular-nums;
}

button {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  background: var(--topbar);
  color: #fff;
  border-bottom: 1px solid #26313b;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid #65717c;
  border-radius: 6px;
  color: #d8e8df;
  font-size: 13px;
  font-weight: 800;
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.topbar .eyebrow {
  color: #9babb6;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.35;
}

.market-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #394651;
  border-radius: 6px;
  color: #d3dde3;
  background: #18232c;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #84919b;
}

.market-status[data-state="open"] .status-dot {
  background: #35ca8b;
  box-shadow: 0 0 0 4px rgb(53 202 139 / 13%);
}

.market-status[data-state="closed"] .status-dot {
  background: #e0a43d;
}

.market-status[data-state="error"] .status-dot {
  background: #eb6262;
}

.market-hero {
  padding: 44px 0 36px;
  border-bottom: 1px solid var(--line);
}

.price-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.quote-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.change-badge {
  min-width: 155px;
  padding: 10px 13px;
  border-radius: 6px;
  background: #e9edf0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  text-align: right;
}

.change-badge.positive {
  background: var(--green-soft);
  color: var(--green);
}

.change-badge.negative {
  background: var(--red-soft);
  color: var(--red);
}

.price-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 18px;
  line-height: 1;
}

.currency {
  align-self: flex-start;
  margin-top: 7px;
  color: var(--muted);
  font-size: 22px;
  font-weight: 700;
}

.price-value {
  font-size: 64px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.price-value.flash-up {
  animation: flash-up 700ms ease-out;
}

.price-value.flash-down {
  animation: flash-down 700ms ease-out;
}

.price-unit {
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

@keyframes flash-up {
  0% {
    color: var(--green);
  }
  100% {
    color: var(--ink);
  }
}

@keyframes flash-down {
  0% {
    color: var(--red);
  }
  100% {
    color: var(--ink);
  }
}

.hero-meta {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(190px, 1.4fr) minmax(210px, 1.5fr) 44px;
  align-items: end;
  gap: 26px;
  margin-top: 34px;
}

.session-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 30px;
  border-top: 1px solid var(--line);
}

.session-item {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 18px 22px 0 0;
}

.session-item + .session-item {
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.session-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.session-item strong {
  font-size: 15px;
}

.session-item small {
  color: #6d7a84;
  font-size: 11px;
  font-weight: 700;
}

.meta-item {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.meta-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.meta-item strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-item small {
  margin-top: -3px;
  color: #7b8790;
  font-size: 11px;
  font-weight: 700;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #b9c2c9;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: #788690;
  background: #f7f8f9;
}

.icon-button:focus-visible {
  outline: 3px solid rgb(8 122 82 / 24%);
  outline-offset: 2px;
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button.loading svg {
  animation: spin 850ms linear infinite;
}

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

.range-section {
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

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

.section-heading h2 {
  margin: 5px 0 0;
  font-size: 22px;
}

.range-status {
  display: flex;
  align-items: baseline;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.range-status strong {
  color: var(--ink);
  font-size: 15px;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.range-labels strong {
  margin-left: 6px;
  color: var(--ink);
  font-size: 15px;
}

.range-track {
  position: relative;
  height: 12px;
  margin: 46px 0 34px;
  border-radius: 6px;
  background: #d9dee3;
}

.range-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 6px;
  background: #4d6575;
  transition: width 450ms ease;
}

.range-marker {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  transition: left 450ms ease;
}

.range-marker i {
  display: block;
  width: 18px;
  height: 18px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: #536b7a;
  box-shadow: 0 0 0 1px #8898a3;
}

.range-marker em {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.open-marker {
  top: calc(50% + 22px);
}

.open-marker em {
  top: 22px;
  bottom: auto;
  color: var(--muted);
}

.price-marker i {
  width: 22px;
  height: 22px;
  border-color: #fff;
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green), 0 3px 9px rgb(8 122 82 / 24%);
}

.range-caption {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.range-caption strong {
  margin-left: 6px;
  color: var(--ink);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 24px 0 30px;
}

.metric-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-card strong {
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-band {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.analysis-panel {
  min-width: 0;
  padding: 34px 0;
}

.risk-panel {
  padding-right: 34px;
}

.advice-panel {
  padding-left: 34px;
  border-left: 1px solid var(--line);
}

.risk-badge,
.trend-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  background: #e9edf0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.risk-badge[data-level="low"] {
  background: var(--green-soft);
  color: var(--green);
}

.risk-badge[data-level="medium"] {
  background: #fff1d8;
  color: var(--amber);
}

.risk-badge[data-level="high"] {
  background: var(--red-soft);
  color: var(--red);
}

.trend-badge[data-trend="上行"] {
  background: var(--green-soft);
  color: var(--green);
}

.trend-badge[data-trend="下行"] {
  background: var(--red-soft);
  color: var(--red);
}

.risk-scale {
  position: relative;
  height: 12px;
  margin: 34px 0 48px;
}

.risk-zones {
  display: grid;
  grid-template-columns: 25fr 50fr 25fr;
  height: 100%;
  overflow: hidden;
  border-radius: 6px;
}

.risk-zones span:nth-child(1) {
  background: #a8d8c5;
}

.risk-zones span:nth-child(2) {
  background: #e0c989;
}

.risk-zones span:nth-child(3) {
  background: #e4a8a8;
}

.risk-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: left 450ms ease;
}

.risk-marker i {
  display: block;
  width: 20px;
  height: 20px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px #71808b, 0 3px 9px rgb(20 32 43 / 22%);
}

.risk-marker em {
  position: absolute;
  left: 50%;
  bottom: 23px;
  transform: translateX(-50%);
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

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

.risk-legend div {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.risk-legend span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.risk-legend strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advice-panel h3 {
  margin: 26px 0 10px;
  font-size: 21px;
  line-height: 1.35;
}

.advice-summary {
  min-height: 76px;
  margin-bottom: 24px;
  color: #43515c;
  font-size: 14px;
  line-height: 1.75;
}

.advice-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.advice-metrics span {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.advice-metrics strong {
  color: var(--ink);
  font-size: 15px;
}

.advice-disclaimer,
.history-note {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.factors-news-band {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.factors-column {
  min-width: 0;
  padding-right: 34px;
}

.news-column {
  min-width: 0;
  padding-left: 34px;
  border-left: 1px solid var(--line);
}

.factors-list,
.news-list {
  display: grid;
}

.factor-item,
.news-item {
  padding: 15px 0;
  border-top: 1px solid #e2e7eb;
}

.factor-item:first-child,
.news-item:first-child {
  border-top: 0;
}

.factor-meta,
.news-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.factor-tag,
.news-category {
  color: #48606f;
}

.factor-level {
  color: var(--amber);
}

.factor-item h3 {
  margin: 8px 0 6px;
  font-size: 16px;
}

.factor-item p {
  margin: 0;
  color: #52606a;
  font-size: 12px;
  line-height: 1.65;
}

.news-source {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.news-item {
  display: grid;
  gap: 7px;
}

.news-headline {
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.5;
  text-decoration: none;
}

.news-headline:hover {
  color: #0b6f4d;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-item > span:last-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.news-impact {
  font-weight: 800;
}

.news-impact[data-tone="bullish"] {
  color: var(--green);
}

.news-impact[data-tone="bearish"] {
  color: var(--red);
}

.news-impact[data-tone="mixed"] {
  color: var(--amber);
}

.news-disclaimer,
.content-loading {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.content-loading {
  margin: 0;
  padding: 15px 0;
}

.history-section {
  padding: 34px 0 30px;
}

.history-asof {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.history-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 15px 16px;
  border-bottom: 1px solid #e4e8ec;
  text-align: right;
  white-space: nowrap;
}

.history-table th:first-child,
.history-table td:first-child {
  padding-left: 0;
  text-align: left;
}

.history-table th:last-child,
.history-table td:last-child {
  padding-right: 0;
}

.history-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.history-table td {
  font-size: 15px;
  font-weight: 700;
}

.history-table tbody tr:last-child td {
  border-bottom: 0;
}

.history-table tbody tr.is-highlight {
  background: #f5f8f7;
}

.history-table .period-cell {
  color: var(--ink);
  font-weight: 800;
}

.history-table .positive {
  color: var(--green);
}

.history-table .negative {
  color: var(--red);
}

.history-table .muted-cell {
  color: var(--muted);
  font-weight: 600;
}

.dashboard-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 0 0 34px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 28px, 680px);
  }

  .topbar-inner {
    min-height: 70px;
  }

  .market-hero {
    padding-top: 32px;
  }

  .price-value {
    font-size: 52px;
  }

  .hero-meta {
    grid-template-columns: 1fr 1fr 44px;
    gap: 22px 16px;
  }

  .session-strip {
    grid-template-columns: 1fr;
  }

  .session-item {
    padding: 15px 0 0;
  }

  .session-item + .session-item {
    margin-top: 15px;
    padding-top: 15px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .meta-item:nth-child(2) {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  .meta-item:nth-child(3) {
    grid-column: 1 / 3;
    grid-row: 3;
  }

  .icon-button {
    grid-column: 3;
    grid-row: 1;
  }

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

  .analysis-band {
    grid-template-columns: 1fr;
  }

  .risk-panel {
    padding-right: 0;
  }

  .advice-panel {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .factors-news-band {
    grid-template-columns: 1fr;
  }

  .factors-column {
    padding-right: 0;
  }

  .news-column {
    margin-top: 34px;
    padding-top: 34px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: calc(100% - 24px);
  }

  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 15px 0;
  }

  .market-status {
    min-height: 30px;
  }

  .price-heading {
    display: grid;
    gap: 16px;
  }

  .change-badge {
    min-width: 0;
    width: fit-content;
    text-align: left;
  }

  .price-line {
    margin-top: 14px;
  }

  .price-value {
    font-size: 46px;
  }

  .currency {
    font-size: 18px;
  }

  .hero-meta {
    grid-template-columns: 1fr 44px;
  }

  .meta-item:nth-child(1),
  .meta-item:nth-child(2),
  .meta-item:nth-child(3) {
    grid-column: 1;
  }

  .meta-item:nth-child(1) {
    grid-row: 1;
  }

  .meta-item:nth-child(2) {
    grid-row: 2;
  }

  .meta-item:nth-child(3) {
    grid-row: 3;
  }

  .icon-button {
    grid-column: 2;
    grid-row: 1;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics-grid {
    gap: 8px;
  }

  .metric-card {
    padding: 15px;
  }

  .metric-card strong {
    font-size: 17px;
  }
}
