:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #172126;
  --muted: #69777e;
  --line: #dfe5e8;
  --green: #167c65;
  --green-soft: #dcefe9;
  --red: #c94d45;
  --red-soft: #f7e5e2;
  --amber: #b67a22;
  --amber-soft: #f5ead8;
  --blue: #356b8b;
  --shadow: 0 8px 28px rgba(23, 33, 38, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(23, 33, 38, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(23, 33, 38, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button {
  color: inherit;
  font: inherit;
}

.app-shell {
  width: min(100%, 680px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(244, 246, 248, 0.94);
  border-inline: 1px solid rgba(223, 229, 232, 0.7);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 14px;
}

.topbar h1 {
  margin: 3px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 28px;
  font-weight: 700;
}

.date-label,
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.status-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

main {
  padding: 0 16px 100px;
}

.market-brief {
  padding: 20px;
  overflow: hidden;
  border-radius: 8px;
  background: #193036;
  color: #f7faf9;
  box-shadow: var(--shadow);
}

.brief-heading,
.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.market-brief .eyebrow {
  color: #a8c4bf;
}

.brief-heading h2 {
  max-width: 360px;
  margin: 7px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 23px;
  line-height: 1.35;
}

.market-score {
  display: grid;
  flex: 0 0 70px;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
}

.market-score strong {
  margin-top: 7px;
  font-size: 25px;
  line-height: 1;
}

.market-score span {
  align-self: start;
  color: #b9ccc9;
  font-size: 9px;
}

.brief-copy {
  min-height: 44px;
  margin: 18px 0;
  color: #c9d8d5;
  font-size: 13px;
  line-height: 1.7;
}

.source-note {
  margin: -8px 0 16px;
  color: #a8c4bf;
  font-size: 10px;
  line-height: 1.5;
}

.breadth-track {
  display: flex;
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
}

.breadth-up {
  background: #dd716a;
}

.breadth-flat {
  background: #8ba09d;
}

.breadth-down {
  background: #41b69a;
}

.breadth-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: #b9ccc9;
  font-size: 10px;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
}

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

.dot.flat {
  background: #91a0a5;
}

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

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 12px 0 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-strip > div {
  min-width: 0;
  padding: 14px 12px;
}

.metric-strip > div + div {
  border-left: 1px solid var(--line);
}

.metric-strip span,
.metric-strip small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-strip strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 20px;
}

.metric-strip .warning {
  color: var(--amber);
}

.section-block {
  margin-top: 28px;
}

.section-title {
  align-items: end;
  margin-bottom: 13px;
}

.section-title h2 {
  margin: 5px 0 0;
  font-size: 18px;
}

.text-button {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
}

.strategy-list,
.contract-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.trend-summary {
  margin-bottom: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

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

.trend-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.trend-card header {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 62px;
  gap: 10px;
  align-items: center;
}

.trend-card strong {
  display: block;
  font-size: 13px;
}

.trend-card span {
  color: var(--muted);
  font-size: 10px;
}

.trend-score {
  justify-self: end;
  padding: 5px 7px;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.trend-grid div {
  min-width: 0;
  padding: 9px 7px;
  background: var(--surface);
}

.trend-grid span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-grid strong {
  margin-top: 4px;
  font-size: 11px;
}

.category-tabs {
  display: flex;
  gap: 8px;
  margin: -2px -16px 12px;
  padding: 0 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tabs button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
}

.category-tabs button.active {
  border-color: rgba(22, 124, 101, 0.35);
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
}

.strategy-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.2fr) minmax(90px, 1fr) 76px;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 12px 14px;
}

.strategy-row + .strategy-row,
.contract-row + .contract-row {
  border-top: 1px solid var(--line);
}

.strategy-name strong,
.contract-name strong {
  display: block;
  font-size: 13px;
}

.strategy-name span,
.contract-name span {
  color: var(--muted);
  font-size: 10px;
}

.mini-track,
.factor-track {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #edf1f2;
}

.mini-track i,
.factor-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.impact-tag {
  justify-self: end;
  min-width: 58px;
  padding: 5px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-style: normal;
  text-align: center;
}

.impact-tag.positive {
  background: var(--green-soft);
  color: var(--green);
}

.impact-tag.neutral {
  background: var(--amber-soft);
  color: var(--amber);
}

.impact-tag.negative {
  background: var(--red-soft);
  color: var(--red);
}

.legend {
  color: var(--muted);
  font-size: 10px;
}

.legend .dot {
  margin-left: 7px;
}

.sector-chart {
  display: grid;
  gap: 14px;
  padding: 17px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.sector-row {
  display: grid;
  grid-template-columns: 54px 1fr 50px;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}

.sector-axis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  height: 9px;
  background: linear-gradient(90deg, #dcefe9 0 49.5%, #dfe5e8 49.5% 50.5%, #f7e5e2 50.5%);
}

.sector-bar-negative,
.sector-bar-positive {
  height: 9px;
}

.sector-bar-negative {
  justify-self: end;
  background: var(--green);
}

.sector-bar-positive {
  background: var(--red);
}

.sector-value {
  text-align: right;
}

.sector-value.positive,
.contract-change.positive {
  color: var(--red);
}

.sector-value.negative,
.contract-change.negative {
  color: var(--green);
}

.contract-row {
  display: grid;
  grid-template-columns: minmax(116px, 1fr) 72px 78px 18px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 67px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.empty-state {
  min-height: 82px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.contract-price,
.contract-change {
  text-align: right;
}

.contract-price strong,
.contract-change strong {
  display: block;
  font-size: 13px;
}

.contract-price span,
.contract-change span {
  color: var(--muted);
  font-size: 9px;
}

.chevron {
  color: #9aa6aa;
  font-size: 18px;
}

.score-badge {
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.factor-list {
  display: grid;
  gap: 13px;
  padding: 17px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.product-summary {
  margin-bottom: 12px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.prediction-intro {
  margin: 0 0 12px;
  padding: 13px 14px;
  border-left: 3px solid var(--green);
  background: #f0f6f4;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

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

.prediction-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.prediction-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.prediction-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.prediction-card header span {
  color: var(--muted);
  font-size: 10px;
}

.prediction-card header > strong {
  font-size: 17px;
}

.prediction-model {
  margin: 8px 0 0;
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
}

.prediction-unavailable {
  border-style: dashed;
  background: #fafbfb;
}

.prediction-unavailable > p {
  margin: 13px 0 8px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.65;
}

.sample-note,
.contribution-empty {
  color: var(--muted);
  font-size: 10px;
}

.prediction-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 13px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.prediction-metrics div {
  min-width: 0;
  padding: 10px 8px;
  background: var(--surface);
}

.prediction-metrics span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.prediction-metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.4;
}

.contribution-group {
  margin-top: 12px;
}

.contribution-group > strong {
  font-size: 11px;
}

.contribution-row {
  display: grid;
  grid-template-columns: 68px 58px 1fr;
  gap: 8px;
  align-items: start;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.contribution-row b {
  text-align: right;
}

.contribution-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.prediction-warning {
  margin: 12px 0 0;
  color: #a16416;
  font-size: 10px;
  line-height: 1.6;
}

.fund-chart {
  margin: 12px 0;
  padding: 10px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdfc 0%, #f4f8f7 100%);
}

.fund-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.fund-chart-head strong {
  color: var(--text);
  font-size: 13px;
}

.fund-chart-head span {
  color: var(--muted);
  font-size: 11px;
}

.fund-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.fund-chart text {
  fill: #7b8985;
  font-size: 9px;
}

.fund-chart .zero-line {
  stroke: #cfdcd8;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.fund-comparison-chart {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  padding: 14px;
  border: 1px solid rgba(22, 124, 101, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(circle at 12% 0%, rgba(22, 124, 101, 0.10), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f4f8f7 100%);
  box-shadow: var(--shadow);
}

.fund-comparison-chart svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
  overflow: visible;
}

.fund-comparison-chart text {
  fill: #6d7c78;
  font-size: 10px;
}

.comparison-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 11px;
}

.comparison-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.comparison-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.comparison-grid {
  stroke: #e3ece9;
  stroke-width: 1;
}

.comparison-line {
  fill: none;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.comparison-dot {
  stroke-width: 2;
}

.fund-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fund-area {
  opacity: 0.12;
}

.fund-line.positive,
.fund-dot.positive {
  stroke: #167c65;
  fill: #167c65;
}

.fund-area.positive {
  fill: #167c65;
}

.fund-line.negative,
.fund-dot.negative {
  stroke: #b23a48;
  fill: #b23a48;
}

.fund-area.negative {
  fill: #b23a48;
}

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

.product-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.product-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.product-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.product-card .role {
  color: var(--muted);
  font-size: 10px;
}

.product-card .date {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.product-estimate {
  display: grid;
  grid-template-columns: 0.8fr 1.25fr 1fr;
  gap: 1px;
  margin-top: 13px;
  overflow: hidden;
  border: 1px solid #cfe0db;
  border-radius: 7px;
  background: #cfe0db;
}

.product-estimate div {
  min-width: 0;
  padding: 11px 8px;
  background: #f0f6f4;
}

.product-estimate span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.product-estimate strong {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.35;
}

.estimate-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.product-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 13px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.product-metrics div {
  min-width: 0;
  padding: 10px 8px;
  background: var(--surface);
}

.product-metrics span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-metrics strong {
  display: block;
  margin-top: 5px;
  font-size: 12px;
}

.product-comment {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.7;
}

.factor-row {
  display: grid;
  grid-template-columns: 70px 1fr 28px;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}

.factor-row strong {
  text-align: right;
}

.method-note {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.bottom-nav {
  position: fixed;
  z-index: 10;
  bottom: 0;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 680px);
  min-height: 70px;
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateX(-50%);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.bottom-nav button {
  display: grid;
  place-content: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.bottom-nav button.active {
  color: var(--green);
  font-weight: 700;
}

.nav-icon {
  font-size: 19px;
  line-height: 1;
}

dialog {
  width: min(calc(100% - 28px), 520px);
  max-height: 80vh;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(23, 33, 38, 0.24);
}

dialog::backdrop {
  background: rgba(15, 24, 28, 0.52);
  backdrop-filter: blur(3px);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  font-size: 22px;
}

.dialog-body {
  padding: 26px 22px 24px;
}

.dialog-body h2 {
  margin: 5px 0 2px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 25px;
}

.dialog-body .large-change {
  margin: 20px 0 4px;
  font-size: 34px;
  font-weight: 750;
}

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 20px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.dialog-grid div {
  padding: 13px 10px;
  background: var(--surface);
}

.dialog-grid span,
.insight-box span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.dialog-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
}

.insight-box {
  margin-top: 12px;
  padding: 15px;
  border-left: 3px solid var(--green);
  background: #f0f6f4;
}

.insight-box p {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.7;
}

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

.kline-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.kline-head strong {
  font-size: 13px;
}

.kline-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.kline-tabs button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.kline-tabs button.active {
  border-color: rgba(22, 124, 101, 0.35);
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}

.kline-status {
  min-height: 20px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.kline-canvas {
  width: 100%;
  height: 390px;
  border-radius: 6px;
  background: #ffffff;
}

.technical-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.technical-grid div {
  padding: 9px 7px;
  background: var(--surface);
}

.technical-grid span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.technical-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}

@media (max-width: 520px) {
  .prediction-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .contribution-row {
    grid-template-columns: 58px 52px 1fr;
  }

  .product-estimate {
    grid-template-columns: 1fr;
  }

  .kline-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .kline-tabs {
    justify-content: flex-start;
  }

  .kline-canvas {
    height: 340px;
  }
}

@media (min-width: 720px) {
  .app-shell {
    margin-block: 20px;
    min-height: calc(100vh - 40px);
    border-radius: 10px;
    box-shadow: var(--shadow);
  }

  .bottom-nav {
    bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0 0 10px 10px;
  }
}

@media (max-width: 380px) {
  .brief-heading h2 {
    font-size: 20px;
  }

  .strategy-row {
    grid-template-columns: minmax(96px, 1fr) 70px 60px;
    gap: 8px;
    padding-inline: 11px;
  }

  .metric-strip > div {
    padding-inline: 8px;
  }
}
