:root {
  --page: #f5f7fa;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #2563eb;
  --cyan: #0891b2;
  --orange: #b45309;
  --purple: #7c3aed;
  --red: #dc2626;
  --green: #15803d;
  --amber: #d97706;
  --radius: 12px;
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
  color: var(--text);
  background: var(--page);
  font-variant-numeric: tabular-nums;
  font-size: clamp(13px, 0.35vw + 12px, 16px);
}

button,
select {
  font: inherit;
}

button,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

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

.site-header {
  height: 70px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  min-width: 0;
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand > span:last-child {
  min-width: 0;
}

.brand-mark {
  min-width: 42px;
  height: 38px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--blue);
  border-radius: 10px;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fafb;
}

.tab {
  border: 0;
  border-radius: 7px;
  padding: 7px 14px;
  color: var(--muted);
  background: transparent;
}

.tab.active {
  color: var(--blue);
  background: white;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.08);
  font-weight: 650;
}

.tab:disabled {
  opacity: 0.46;
}

.page-tabs {
  flex: 0 0 auto;
}

.mobile-page-tabs {
  display: none;
}

.page-tabs .tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.page {
  padding-top: 24px;
  padding-bottom: 28px;
}

.placeholder-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 70px);
  box-sizing: border-box;
}

.coming-soon {
  display: grid;
  flex: 1;
  margin: 0;
  color: #c4cad3;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  place-items: center;
}

.placeholder-footer {
  width: 100%;
  flex: 0 0 auto;
}

.positions-web-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
  text-align: left;
}

.positions-web-notice-copy {
  min-width: 0;
}

.positions-web-notice h1 {
  margin: 0;
  font-size: clamp(22px, 1.4vw + 14px, 28px);
  font-weight: 600;
}

.positions-web-notice .subtitle {
  max-width: 570px;
  margin: 10px 0 0;
  line-height: 1.7;
}

.positions-statistics-entry {
  flex: 0 0 auto;
}

.positions-statistics-entry,
.position-add-button {
  min-height: 40px;
  padding: 0 16px;
  color: #374151;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.positions-statistics-entry:hover,
.position-add-button:hover {
  color: var(--blue);
  background: #f8fafc;
  border-color: #93c5fd;
}

.positions-statistics-entry:active,
.position-add-button:active {
  transform: translateY(1px);
}

.positions-statistics-entry:focus-visible,
.position-add-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

.positions-web-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
}

.positions-web-product {
  padding: 0;
  overflow: hidden;
  border-top: 3px solid var(--product-color);
}

.positions-web-product > div {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.positions-web-product > div i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: var(--product-color);
  border-radius: 50%;
}

.positions-web-product > div strong {
  font-size: 18px;
  font-weight: 600;
}

.positions-web-product > div span {
  color: var(--muted);
  font-size: 11px;
}

.positions-web-product p {
  min-height: 48px;
  margin: 14px 18px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.position-add-button {
  margin: 0 18px 18px;
}

.mini-program-dialog {
  width: min(420px, calc(100vw - 32px));
}

.mini-program-dialog-body {
  text-align: center;
}

.mini-program-dialog-body img {
  width: min(260px, 80vw);
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
}

.mini-program-code-error {
  padding: 18px 12px;
  color: #92400e !important;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
}

.positions-page {
  min-height: calc(100vh - 70px);
}

.snapshot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 32px;
  padding: 20px 24px;
  margin-bottom: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.index-quote {
  width: max-content;
  max-width: 100%;
  justify-self: center;
}

.field-label,
.control label,
.control legend {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  margin-bottom: 7px;
}

.select {
  width: 100%;
  min-height: 40px;
  padding: 0 36px 0 12px;
  color: var(--text);
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  outline: none;
}

.select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.index-point {
  font-weight: 300;
  font-size: 14px;
  line-height: 1.35;
}

.index-value-line {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
}

.index-market-line {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 14px;
}

.index-primary {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.index-name {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.index-name-compact {
  display: none;
}

.point-unit {
  margin-left: 3px;
  color: var(--muted);
  font-size: 12px;
}

.index-change {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.25;
  white-space: nowrap;
}

.index-change > span {
  font-weight: 300;
}

.index-change.up {
  color: #dc2626;
}

.index-change.down {
  color: #15803d;
}

.index-change.flat {
  color: #6b7280;
}

.market-update-time {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.quote-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.market-status-text {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
}

.market-delay {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}

.market-delay strong {
  font-weight: 600;
}

.market-delay.delayed strong {
  color: #b45309;
}

.market-delay.stale strong {
  color: var(--red);
}

.card {
  padding: 24px;
  margin-bottom: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.roll-card {
  border-top: 3px solid var(--blue);
}

.roll-card .roll-head h2 {
  font-size: clamp(22px, 1.2vw + 13px, 27px);
}

.roll-card .roll-head .subtitle {
  font-size: 14px;
}

.roll-title-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -8px 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  font-size: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
}

.info-mark {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.roll-title-button:hover .info-mark,
.roll-title-button:focus-visible .info-mark {
  color: var(--blue);
}

.current-contracts {
  margin-bottom: 4px;
}

.compact-head {
  margin-bottom: 12px;
}

.section-divider {
  height: 1px;
  margin: 22px 0;
  background: var(--line);
}

.contracts-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.contracts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.contracts-mobile-list {
  display: none;
}

.contract-mobile-card {
  min-width: 0;
  overflow: hidden;
  padding: 13px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.contract-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.contract-mobile-head .contract-name {
  min-width: 0;
}

.contract-mobile-head .contract-name small {
  padding: 2px 5px;
  color: var(--muted);
  background: #eef0f3;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 400;
}

.annualized-inline-help,
.contract-calculation-help,
.contract-expiry-help,
.table-info-button {
  margin: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.table-expiry-help {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin: -10px -8px;
  padding: 0 8px;
  white-space: nowrap;
}

.annualized-result-line {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin: -10px -8px;
  padding: 0 8px;
  color: inherit;
  background: transparent;
  border: 0;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.contract-mobile-metrics .contract-calculation-help {
  min-width: 0;
  min-height: 62px;
  margin: 0;
  padding: 7px 3px;
  color: var(--text);
  font-size: inherit;
}

.contract-calculation-help:hover,
.contract-calculation-help:focus-visible {
  color: var(--blue);
}

.annualized-inline-help {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.table-heading-with-info {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
}

.table-info-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  margin: -8px -8px -8px -4px;
  font-size: 12px;
}

.annualized-inline-help:hover,
.table-info-button:hover {
  color: var(--blue);
}

.contract-mobile-annualized strong {
  font-size: 15px;
  font-weight: 400;
}

.contract-mobile-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
}

.contract-mobile-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0 !important;
  overflow: hidden;
  border-radius: 9px;
}

.contract-mobile-metrics > * {
  min-width: 0;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 3px;
  box-sizing: border-box;
  color: var(--text);
  background: #f8fafc;
  border: 0;
  border-left: 1px solid #eef0f3;
  font: inherit;
  text-align: center;
}

.contract-mobile-metrics > :first-child {
  border-left: 0;
}

.contract-mobile-metric span,
.contract-mobile-static-metric > span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.contract-mobile-metric strong,
.contract-mobile-static-metric > strong {
  font-size: clamp(12px, 3.3vw, 14px);
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
}

.contract-mobile-metric i {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.contract-expiry-help {
  cursor: pointer;
}

.contract-mobile-head > .expiry-warning {
  display: block;
  flex: 0 0 auto;
  width: fit-content;
  margin-left: auto;
  white-space: nowrap;
}

.contracts-table th {
  padding: 10px 12px;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 500;
  text-align: right;
}

.contracts-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.contracts-table td.interactive-data-cell {
  padding: 0;
}

.interactive-data-cell .annualized-result-line,
.interactive-data-cell .table-expiry-help {
  width: 100%;
  min-height: 58px;
  margin: 0;
  padding: 0 12px;
}

.contracts-table th:first-child,
.contracts-table td:first-child {
  text-align: left;
}

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

.contract-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.contract-name i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

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

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

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 18px;
}

.card h1,
.card h2 {
  margin: 0;
  font-size: clamp(18px, 1vw + 12px, 21px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0 0 5px;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.legend {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.legend button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  color: #374151;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
}

.legend button:hover {
  background: #f3f4f6;
}

.legend button.off {
  opacity: 0.35;
}

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

.expiry-warning {
  padding: 1px 5px;
  color: #92400e;
  background: #fffbeb;
  border-radius: 999px;
  font-size: 11px;
}

.annualized-near-expiry {
  color: #b45309;
  font-weight: 600;
}

.chart-wrap {
  position: relative;
  width: 100%;
}

.curve-wrap {
  height: 420px;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.chart {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

.chart text {
  fill: var(--muted);
  font-family: inherit;
  font-size: 12px;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.chart .grid {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart .zero {
  stroke: #9ca3af;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.chart .series {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart .hover-line {
  stroke: #9ca3af;
  stroke-width: 1;
  stroke-dasharray: 4 4;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.chart .hit-area {
  fill: transparent;
  cursor: crosshair;
}

.chart-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  z-index: 2;
}

.chart-tooltip {
  position: absolute;
  min-width: 164px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 8px 25px rgba(17, 24, 39, 0.13);
  pointer-events: none;
  z-index: 5;
  font-size: 12px;
}

.tooltip-date {
  margin-bottom: 6px;
  color: var(--muted);
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 4px;
}

.tooltip-name {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tooltip-name i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

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

.controls {
  display: flex;
  align-items: end;
  gap: 28px;
}

.control {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 168px;
}

.control legend {
  padding: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f9fafb;
}

.segmented button {
  min-width: 58px;
  height: 32px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.segmented button.active {
  color: white;
  background: var(--blue);
  font-weight: 650;
}

.roll-chart {
  overflow: hidden;
  min-height: 148px;
  margin: 12px 0 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.roll-table-head,
.roll-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.25fr) repeat(3, minmax(130px, 1fr));
  align-items: stretch;
}

.roll-table-head {
  min-height: 38px;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.roll-table-head span {
  display: grid;
  place-items: center;
}

.roll-row {
  min-height: 58px;
  background: white;
  border-bottom: 1px solid var(--line);
}

.roll-row:last-child {
  border-bottom: 0;
}

.roll-target-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
}

.roll-target-name i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
}

.roll-target-name small {
  padding: 2px 6px;
  color: #4b5563;
  background: #f3f4f6;
  border-radius: 999px;
  font-size: 10px;
}

.roll-table-value {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 4px;
  color: var(--text);
  background: white;
  border: 0;
  border-left: 1px solid #eef0f3;
  font-size: 16px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
}

.roll-cell-label {
  display: none;
}

.roll-cell-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.roll-annualized-highest {
  color: #111827;
  font-weight: 700;
}

.roll-history {
  color: var(--text);
}

.roll-calculation-button {
  font: inherit;
}

.info-button:hover,
.info-button:focus-visible {
  color: var(--blue);
}

.roll-history-card {
  margin-top: 18px;
  padding: 18px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.roll-history-title {
  display: block;
  font-size: 13px;
  font-weight: 400;
}

.roll-history-chart-wrap {
  height: 230px;
  margin-top: 12px;
}

.roll-history-reference-line-svg {
  fill: none;
  stroke-width: 1;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}

.roll-history-references {
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.roll-history-reference-head,
.roll-history-reference {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  min-width: 0;
}

.roll-history-reference-head {
  min-height: 24px;
  color: #9ca3af;
  font-size: 10px;
}

.roll-history-reference-head span,
.roll-history-reference span {
  min-width: 0;
  text-align: center;
}

.roll-history-reference {
  min-height: 32px;
  border-top: 1px solid #eef0f3;
}

.roll-history-reference i {
  width: 24px;
  height: 0;
  justify-self: center;
  border-top: 1px dashed;
}

.roll-history-reference span {
  color: #6b7280;
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
}

.roll-history-reference span:first-of-type {
  color: #111827;
  font-size: 12px;
}

.roll-history-explanation {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.65;
}

.empty-state {
  min-height: 148px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
}

.page-error {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 13px;
}

.page-error button {
  margin-left: auto;
  padding: 5px 10px;
  color: #991b1b;
  background: white;
  border: 1px solid #fca5a5;
  border-radius: 7px;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  z-index: 100;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  color: white;
  background: rgba(17, 24, 39, 0.94);
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.2);
  font-size: 13px;
  transform: translateX(-50%);
}

.toast.error {
  background: rgba(153, 27, 27, 0.95);
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 4px 2px;
  color: var(--muted);
  font-size: 11px;
}

#feedback-contact {
  flex: 0 0 auto;
  min-width: 0;
  margin-right: auto;
  color: #374151;
  white-space: nowrap;
}

.feedback-copy {
  min-width: 0;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}

#page-views {
  flex: 0 0 auto;
  white-space: nowrap;
}

#feedback-contact strong {
  color: var(--blue);
  font-size: 12px;
}

.copy-icon {
  position: relative;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-left: 2px;
}

.copy-icon::before,
.copy-icon::after {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid var(--blue);
  border-radius: 2px;
  content: "";
}

.copy-icon::before {
  top: 1px;
  left: 1px;
}

.copy-icon::after {
  right: 1px;
  bottom: 1px;
  background: white;
}

.formula-dialog {
  width: min(420px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  color: var(--text);
  background: white;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(17, 24, 39, 0.22);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
}

.formula-dialog::backdrop {
  background: rgba(17, 24, 39, 0.38);
}

.formula-dialog form {
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
}

.formula-dialog-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 9px;
  border-bottom: 1px solid #eef0f3;
}

.formula-dialog-head strong {
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.formula-dialog-head button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.formula-dialog-head button:hover {
  background: #f3f4f6;
}

.formula-dialog p {
  margin: 10px 0 0;
  color: #374151;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.65;
}

.formula-dialog-body {
  min-height: 0;
  flex: 1 1 auto;
  padding: 10px 16px;
  overflow-y: auto;
}

.formula-dialog-body > :first-child {
  margin-top: 0;
}

.formula-dialog-footer {
  flex: 0 0 auto;
  padding: 8px 16px 12px;
  background: white;
}

.formula-dialog-confirm {
  width: 100%;
  height: 40px;
  min-height: 40px;
  margin: 0;
  color: white;
  background: var(--blue);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  line-height: 40px;
}

.calculation-dialog {
  width: min(520px, calc(100vw - 32px));
}

.calculation-dialog-formula {
  font-size: 13px;
  font-weight: 400;
  padding: 10px 12px;
  background: #f3f4f6;
  border-radius: 9px;
}

.calculation-dialog-formula.plain {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  white-space: pre-line;
}

.calculation-dialog.plain-detail .formula-dialog-body {
  flex: 0 1 auto;
}

.calculation-dialog-terms {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 0 12px;
  margin: 10px 0 0;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.55;
}

.calculation-dialog-terms dt,
.calculation-dialog-terms dd {
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.calculation-dialog-terms dt {
  color: var(--muted);
}

.calculation-dialog-terms dd {
  color: var(--text);
  overflow-wrap: anywhere;
  text-align: right;
}

.calculation-dialog-terms dt:last-of-type,
.calculation-dialog-terms dd:last-of-type {
  border-bottom: 0;
}

.calculation-dialog-warning {
  margin-top: 12px !important;
  padding: 10px 12px;
  color: #92400e !important;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
}

.calculation-dialog-values {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 0 12px;
  margin: 8px 0 0;
  padding: 0 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.55;
}

.calculation-dialog-values dt {
  padding: 8px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.calculation-dialog-values dd {
  margin: 0;
  padding: 8px 0;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.calculation-dialog-values dt:last-of-type,
.calculation-dialog-values dd:last-of-type {
  border-bottom: 0;
}

.calculation-dialog-result {
  width: auto;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  flex: 0 0 auto;
  margin: 0 16px 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.55;
}

.calculation-dialog-result > :first-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.calculation-dialog-result > :last-child {
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  text-align: left;
  white-space: nowrap;
}

@media (max-width: 800px) {
  .container {
    width: min(100% - 32px, 1200px);
  }

  .site-header {
    height: 62px;
  }

  .brand small {
    display: none;
  }

  .brand strong {
    font-size: 14px;
  }

  .tabs .tab {
    padding: 6px 10px;
    font-size: 12px;
  }

  .snapshot {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .index-name-full {
    display: none;
  }

  .index-name-compact {
    display: inline;
  }

  .index-quote {
    width: 100%;
    justify-self: stretch;
  }

  .card-head {
    display: block;
  }

  .legend {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .roll-head .controls {
    margin-top: 18px;
  }

  .curve-wrap {
    height: 300px;
  }

  .position-groups {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  body {
    font-size: 14px;
    line-height: 1.45;
  }

  .container {
    width: calc(100% - 24px);
  }

  .header-inner {
    gap: 8px;
  }

  .brand-mark {
    min-width: 38px;
    height: 34px;
    border-radius: 9px;
  }

  .brand strong {
    line-height: 1.15;
  }

  .tabs {
    gap: 1px;
  }

  .tabs .tab:disabled {
    display: none;
  }

  .tabs .tab {
    padding: 6px 7px;
  }

  .desktop-page-tabs {
    display: none;
  }

  .mobile-page-tabs {
    min-height: calc(78px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    gap: 6px;
    padding:
      8px max(8px, env(safe-area-inset-right))
      calc(6px + env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
    background: rgba(255, 255, 255, 0.98);
    border: 0;
    border-top: 1px solid #dbe3ed;
    border-radius: 0;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.07);
    backdrop-filter: blur(12px);
  }

  .page-tabs .tab {
    min-height: 48px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 12px;
  }

  .mobile-page-tabs.four-page-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mobile-page-tabs.five-page-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    padding-right: max(4px, env(safe-area-inset-right));
    padding-left: max(4px, env(safe-area-inset-left));
  }

  .page {
    padding-top: clamp(10px, 3.5vw, 14px);
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }

  .positions-page {
    min-height: calc(100vh - 62px);
  }

  .positions-web-notice {
    margin-top: 4px;
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .positions-statistics-entry {
    width: 100%;
  }

  .positions-web-products {
    grid-template-columns: 1fr;
  }
  .snapshot,
  .card {
    padding: clamp(11px, 3.8vw, 16px);
    border-radius: 12px;
  }

  .snapshot {
    grid-template-columns: 1fr;
    gap: clamp(10px, 3.5vw, 14px);
    margin-bottom: clamp(12px, 4vw, 18px);
  }

  .index-market-line {
    gap: 5px 10px;
  }

  .quote-meta {
    grid-column: auto;
    gap: 6px 9px;
    font-size: clamp(12px, 3.2vw, 13px);
    line-height: 1.4;
  }

  .calculation-dialog-values dd {
    line-height: 1.55;
    overflow-wrap: normal;
    word-break: normal;
  }

  .card h1,
  .card h2 {
    font-size: clamp(17px, 4.8vw, 19px);
    line-height: 1.3;
  }

  .roll-card .roll-head h2 {
    font-size: clamp(19px, 5.5vw, 22px);
    line-height: 1.3;
  }

  .roll-card .roll-head .subtitle {
    font-size: 13px;
    line-height: 1.45;
  }

  .curve-wrap {
    height: clamp(250px, 74vw, 290px);
    margin-left: -8px;
    width: calc(100% + 8px);
  }

  .contracts-table-wrap {
    display: none;
  }

  .contracts-mobile-list {
    display: grid;
    gap: clamp(7px, 2.7vw, 10px);
  }

  .contract-mobile-card {
    padding: clamp(10px, 3.3vw, 13px);
  }

  .contract-mobile-head {
    gap: 8px;
    margin-bottom: clamp(8px, 2.8vw, 12px);
    font-size: clamp(12px, 3.5vw, 14px);
    line-height: 1.3;
  }

  .contract-mobile-metrics {
    gap: clamp(7px, 2.8vw, 10px) clamp(8px, 3vw, 14px);
  }

  .contract-mobile-metrics > div {
    min-width: 0;
  }

  .contract-mobile-static-metric > span,
  .contract-mobile-static-metric > strong {
    overflow-wrap: anywhere;
  }

  .contract-mobile-static-metric > span {
    font-size: 12px;
    line-height: 1.3;
  }

  .contract-mobile-static-metric > strong {
    font-size: clamp(13px, 3.6vw, 14px);
    line-height: 1.3;
  }

  .roll-head .controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(9px, 3vw, 12px);
    margin-top: clamp(13px, 4vw, 18px);
  }

  .control {
    min-width: 0;
  }

  .roll-chart {
    display: grid;
    gap: clamp(7px, 2.7vw, 10px);
    overflow: visible;
    margin-top: clamp(13px, 4vw, 18px);
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .roll-table-head {
    display: none;
  }

  .roll-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    min-height: 0;
    padding: clamp(10px, 3.3vw, 13px);
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .roll-row:last-child {
    border-bottom: 1px solid var(--line);
  }

  .roll-target-name {
    grid-column: 1 / -1;
    min-height: 44px;
    gap: 7px;
    padding: 0;
  }

  .roll-table-value {
    min-height: 60px;
    flex-direction: column;
    gap: 7px;
    padding: 7px 3px;
    background: #f8fafc;
    border-left: 1px solid #eef0f3;
    font-size: clamp(13px, 3.6vw, 14px);
  }

  .roll-target-name + .roll-table-value {
    border-left: 0;
    border-radius: 9px 0 0 9px;
  }

  .roll-row > .roll-table-value:last-child {
    border-radius: 0 9px 9px 0;
  }

  .roll-cell-label {
    display: block;
    color: var(--muted);
    font-size: 10px;
    line-height: 14px;
  }

  .roll-cell-value {
    gap: 3px;
    line-height: 1.3;
  }

  .roll-cell-value .info-mark {
    font-size: 11px;
  }

  .roll-history-card {
    padding: clamp(12px, 4vw, 16px);
  }

  .roll-history-chart-wrap {
    height: 200px;
  }

  footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    line-height: 1.35;
  }

  #feedback-contact,
  #page-views {
    min-width: 0;
  }

  #page-views {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 359px) {
  .container {
    width: calc(100% - 16px);
  }

  .header-inner {
    gap: 5px;
  }

  .brand-mark {
    min-width: 34px;
    height: 32px;
    padding: 0 5px;
    font-size: 10px;
  }

  .brand strong {
    font-size: 12px;
  }

  .tabs .tab {
    padding: 5px 6px;
    font-size: 11px;
  }

  .page-tabs .tab {
    padding: 0 4px;
  }

  .snapshot,
  .card {
    padding: 10px;
  }

  .index-point {
    font-size: 14px;
  }

  .contract-mobile-card {
    padding: 11px;
  }

  .contract-mobile-metrics {
    gap: 7px 8px;
  }

  .curve-wrap {
    height: clamp(235px, 75vw, 270px);
  }

  .legend {
    gap: 3px 5px;
  }

  .legend button {
    gap: 5px;
    padding: 4px 5px;
    font-size: 12px;
  }

  .segmented button {
    min-width: 0;
    padding: 0 6px;
    font-size: 12px;
  }

}

/* 模拟滚IC页面保留在功能开关后，启用时复用现有中性金融数据视觉。 */
.roll-simulation-page {
  display: grid;
  gap: 16px;
}

.simulation-intro-card,
.simulation-condition-card,
.simulation-scenario-card,
.simulation-funds-card,
.simulation-chart-card,
.simulation-return-card,
.simulation-year-card {
  padding: 22px 24px;
}

.simulation-intro-card h1,
.simulation-condition-card h2,
.simulation-scenario-card h2,
.simulation-chart-card h2,
.simulation-return-card h2,
.simulation-annual-section h2 {
  margin: 0;
}

.simulation-supported-range {
  color: #9ca3af;
  font-size: 12px;
}

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

.simulation-form-grid label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: #4b5563;
  font-size: 13px;
}

.simulation-label-with-info {
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.simulation-label-with-info > button {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #2563eb;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.simulation-label-with-info > button.hidden {
  display: none;
}

.simulation-form-grid .simulation-product-field {
  grid-column: 1 / -1;
}

.simulation-form-grid input,
.simulation-form-grid select,
.simulation-input-unit {
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  color: #111827;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
}

.simulation-form-grid input,
.simulation-form-grid select {
  padding: 0 12px;
}

.simulation-input-unit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.simulation-input-unit input {
  min-width: 0;
  flex: 1;
  border: 0;
  padding-left: 38px;
  padding-right: 38px;
  text-align: center;
}

.simulation-input-unit i {
  width: 28px;
  position: absolute;
  right: 8px;
  padding: 0;
  color: #6b7280;
  font-style: normal;
  text-align: center;
}

.simulation-form-grid input[type="date"],
.simulation-form-grid select {
  text-align: center;
  text-align-last: center;
}

.simulation-form-help,
.simulation-funds-caption,
.simulation-chart-help {
  margin: 12px 0 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.65;
}

.simulation-primary-button {
  width: 100%;
  height: 44px;
  margin-top: 16px;
  color: #fff;
  background: #2563eb;
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.simulation-primary-button:disabled {
  background: #93b4ef;
  cursor: wait;
}

.simulation-loading {
  padding: 18px 12px;
  color: #6b7280;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
}

.simulation-error {
  margin-top: 12px;
  padding: 11px 12px;
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
}

.simulation-results {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.simulation-results > *,
.margin-process-card {
  min-width: 0;
}

.simulation-results.hidden,
.simulation-svg-wrap .chart-tooltip.hidden {
  display: none;
}

.simulation-funds-card {
  border-top: 3px solid #2563eb;
}

.simulation-funds-label,
.simulation-funds-value {
  display: block;
}

.simulation-funds-label {
  color: #4b5563;
  font-size: 14px;
}

.simulation-funds-value {
  margin-top: 4px;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.2;
}

.simulation-funds-condition {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 4px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.simulation-funds-condition > span {
  color: #2563eb;
  font-size: 24px;
  font-weight: 700;
}

.simulation-funds-condition > i {
  color: #2563eb;
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
}

.simulation-summary-rows {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  margin: 14px 0 0;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.simulation-summary-rows dt,
.simulation-summary-rows dd {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid #eef0f3;
  font-size: 13px;
  line-height: 1.6;
}

.simulation-summary-rows dt {
  color: #6b7280;
}

.simulation-summary-rows dd {
  color: #111827;
  text-align: right;
}

.simulation-summary-rows dt:last-of-type,
.simulation-summary-rows dd:last-of-type {
  border-bottom: 0;
}

.simulation-scenario-row {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  align-items: center;
  padding: 0;
  color: #111827;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #eef0f3;
  border-radius: 0;
  font: inherit;
  cursor: pointer;
}

.simulation-scenario-row:last-child {
  border-bottom: 0;
}

.simulation-scenario-row > span,
.simulation-scenario-row > strong {
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
}

.simulation-scenario-row > span {
  color: #6b7280;
  text-align: left;
}

.simulation-scenario-row > span i {
  color: #2563eb;
  font-size: 11px;
  font-style: normal;
}

.simulation-scenario-row > strong {
  font-weight: 400;
  text-align: right;
}

.simulation-scenario-row:hover,
.simulation-scenario-row:focus-visible {
  background: #eff6ff;
}

.simulation-calculation-entry {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 8px 12px;
  box-sizing: border-box;
  color: #374151;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.simulation-calculation-entry > span {
  display: grid;
  gap: 2px;
}

.simulation-calculation-entry strong {
  color: #374151;
  font-size: 13px;
}

.simulation-calculation-entry small {
  color: #6b7280;
  font-size: 11px;
}

.simulation-calculation-entry b {
  color: #2563eb;
  font-size: 12px;
}

.simulation-calculation-entry:hover,
.simulation-calculation-entry:focus-visible {
  background: #eff6ff;
}

.simulation-reserved-funds {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eef0f3;
}

.simulation-reserved-funds.hidden {
  display: none;
}

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

.simulation-reserved-funds-head > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.simulation-reserved-funds-head strong {
  color: #374151;
  font-size: 13px;
}

.simulation-reserved-funds-head small {
  color: #6b7280;
  font-size: 11px;
  line-height: 1.55;
}

.simulation-reserved-funds-head > button {
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  color: #2563eb;
  background: transparent;
  border: 0;
  font-size: 13px;
  text-align: right;
  cursor: pointer;
}

.simulation-reserved-funds-controls {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 10px;
  margin-top: 10px;
  box-sizing: border-box;
}

.simulation-reserved-funds-controls > * {
  min-width: 0;
  max-width: 100%;
}

.simulation-reserved-funds-controls .simulation-input-unit i {
  width: 48px;
}

.simulation-reserved-funds-controls .simulation-input-unit input {
  padding-right: 56px;
}

#simulation-reserved-funds-submit {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  color: #fff;
  background: #2563eb;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#simulation-reserved-funds-submit:disabled {
  background: #93b4ef;
  cursor: wait;
}

#simulation-reserved-funds-error {
  margin-bottom: 0;
}

.simulation-reserved-funds-unavailable {
  margin: 12px 0 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.65;
}

.simulation-risk-warning {
  margin-top: 14px;
  padding: 12px;
  color: #7c2d12;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.7;
}

.simulation-risk-warning strong {
  display: block;
  margin-bottom: 4px;
  color: #9a3412;
  font-size: 13px;
}

.simulation-risk-warning p {
  margin: 0;
}

.simulation-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 8px;
  color: #4b5563;
  font-size: 12px;
}

.simulation-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.simulation-full-legend,
.simulation-low-legend {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.simulation-legend i {
  width: 22px;
  height: 3px;
  border-radius: 999px;
}

.simulation-legend i.full {
  background: #2563eb;
}

.simulation-legend i.low {
  background: #d97706;
}

.simulation-legend b {
  font-weight: 400;
}

.simulation-svg-wrap {
  height: 340px;
  position: relative;
}

#simulation-chart {
  width: 100%;
  height: 340px;
  display: block;
  touch-action: pan-y;
}

.simulation-svg-wrap .chart-tooltip {
  display: grid;
  gap: 3px;
  width: 230px;
  pointer-events: none;
  background: #fff;
}

.simulation-svg-wrap .chart-tooltip strong,
.simulation-svg-wrap .chart-tooltip span {
  display: block;
}

.simulation-termination {
  display: block;
  margin-top: 4px;
  padding: 0;
  color: #b45309;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.simulation-blowup-comparison {
  width: 100%;
  display: grid;
  margin-top: 12px;
  padding: 0;
  overflow: hidden;
  color: #374151;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.simulation-blowup-head,
.simulation-blowup-gap {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
}

.simulation-blowup-head strong {
  color: #374151;
  font-size: 13px;
}

.simulation-blowup-head i {
  color: #2563eb;
  font-size: 12px;
  font-style: normal;
}

.simulation-blowup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: #fff;
  border-top: 1px solid #eef0f3;
}

.simulation-blowup-grid > span {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 11px 8px;
  background: #f9fafb;
  border: 1px solid #eef0f3;
  border-radius: 8px;
  text-align: center;
}

.simulation-blowup-grid small,
.simulation-blowup-gap small {
  color: #6b7280;
  font-size: 11px;
}

.simulation-blowup-grid b {
  font-size: 15px;
  word-break: keep-all;
}

.simulation-blowup-gap {
  color: #374151;
  background: #f9fafb;
  border-top: 1px solid #eef0f3;
}

.simulation-blowup-gap b {
  font-size: 16px;
  word-break: keep-all;
}

.simulation-blowup-gap > span {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.simulation-blowup-gap > span i {
  color: #2563eb;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
}

.simulation-blowup-conclusion {
  display: block;
  padding: 10px 12px 12px;
  color: #9a3412;
  background: #fff7ed;
  border-top: 1px solid #fed7aa;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.65;
}

.simulation-return-grid,
.simulation-annual-metrics,
.simulation-roll-metrics {
  display: grid;
  gap: 10px;
}

.simulation-return-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.simulation-return-grid > div,
.simulation-summary-metric,
.simulation-metric {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 12px 10px;
  box-sizing: border-box;
  color: #111827;
  background: #f9fafb;
  border: 0;
  border-radius: 8px;
  font: inherit;
  text-align: center;
}

.simulation-return-grid span,
.simulation-summary-metric span,
.simulation-metric span {
  color: #6b7280;
  font-size: 12px;
}

.simulation-return-grid strong,
.simulation-summary-metric strong,
.simulation-metric strong {
  overflow-wrap: normal;
  word-break: keep-all;
  font-size: 14px;
}

.simulation-metric:not(.static) {
  cursor: pointer;
}

.simulation-summary-metric {
  cursor: pointer;
}

.simulation-summary-metric:hover,
.simulation-summary-metric:focus-visible,
.simulation-metric:not(.static):hover,
.simulation-metric:not(.static):focus-visible {
  background: #eff6ff;
}

.simulation-equation {
  margin: 12px 0 0;
  color: #9ca3af;
  font-size: 12px;
  text-align: center;
}

.simulation-return-conclusion {
  margin: 12px 0 0;
  padding: 11px 12px;
  color: #374151;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.65;
}

.simulation-annual-section > .card-head {
  margin: 8px 4px 14px;
}

.simulation-year-card {
  margin-bottom: 14px;
  overflow: hidden;
}

.simulation-year-summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  list-style: none;
  cursor: pointer;
}

.simulation-year-summary::-webkit-details-marker {
  display: none;
}

.simulation-year-card[open] .simulation-year-summary {
  padding-bottom: 12px;
  border-bottom: 1px solid #eef0f3;
}

.simulation-year-card h3 {
  margin: 0;
  font-size: 20px;
}

.simulation-year-body {
  display: block;
}

.simulation-year-total,
.simulation-year-cumulative {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 7px;
  padding: 0;
  color: #374151;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.simulation-year-total span {
  color: #6b7280;
  font-size: 12px;
}

.simulation-year-total strong {
  font-size: 15px;
}

.simulation-year-total i {
  min-width: 28px;
  color: #6b7280;
  font-size: 11px;
  font-style: normal;
  text-align: right;
}

.simulation-year-card[open] .simulation-year-total i {
  font-size: 0;
}

.simulation-year-card[open] .simulation-year-total i::after {
  content: "收起";
  font-size: 11px;
}

.simulation-annual-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0;
}

.simulation-annual-calculation {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -2px 0 14px;
  padding: 0 12px;
  color: #374151;
  background: #f9fafb;
  border: 0;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}

.simulation-annual-calculation span {
  font-size: 12px;
  font-weight: 600;
}

.simulation-annual-calculation b {
  color: #2563eb;
  font-size: 12px;
}

.simulation-roll-details {
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
}

.simulation-roll-details summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  list-style: none;
  background: #f9fafb;
  cursor: pointer;
}

.simulation-roll-details summary::-webkit-details-marker {
  display: none;
}

.simulation-roll-details summary span {
  display: grid;
  gap: 2px;
}

.simulation-roll-details summary strong {
  font-size: 13px;
}

.simulation-roll-details summary small,
.simulation-roll-details summary i {
  color: #6b7280;
  font-size: 11px;
  font-style: normal;
}

.simulation-roll-details[open] summary i {
  font-size: 0;
}

.simulation-roll-details[open] summary i::after {
  content: "收起";
  font-size: 11px;
}

.simulation-roll-entry {
  padding: 14px;
  border-top: 1px solid #eef0f3;
}

.simulation-roll-note {
  margin: 0;
  padding: 10px 14px;
  color: #6b7280;
  border-top: 1px solid #eef0f3;
  font-size: 11px;
  line-height: 1.55;
}

.simulation-roll-entry > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.simulation-roll-entry > header span {
  color: #6b7280;
  font-size: 12px;
}

.simulation-roll-entry > header span small {
  display: block;
  margin-top: 2px;
  color: #9ca3af;
  font-size: 11px;
}

.simulation-roll-entry > header strong {
  font-size: 14px;
}

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

.simulation-roll-metrics .simulation-metric {
  min-height: 66px;
}

.simulation-roll-metrics .simulation-metric span {
  font-size: 11px;
}

.simulation-roll-metrics .simulation-metric strong {
  font-size: 12px;
}

.simulation-roll-spread {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 7px 10px;
  color: #374151;
  background: #f9fafb;
  border: 0;
  border-radius: 7px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.simulation-roll-spread > span {
  display: grid;
  gap: 2px;
}

.simulation-roll-spread strong {
  font-size: 12px;
}

.simulation-roll-spread small {
  color: #6b7280;
  font-size: 11px;
}

.simulation-roll-spread b {
  flex: none;
  color: #2563eb;
  font-size: 12px;
  text-align: right;
}

.simulation-empty-rolls {
  margin: 0;
  padding: 18px;
  color: #9ca3af;
  font-size: 12px;
  text-align: center;
}

.simulation-year-body > footer {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 0 12px;
  color: #374151;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 13px;
}

.simulation-year-body > footer strong {
  text-align: right;
}

.simulation-year-cumulative {
  width: 100%;
  justify-content: space-between;
}

.simulation-year-cumulative span {
  font-size: 13px;
}

.simulation-methodology {
  display: grid;
  gap: 5px;
  padding: 16px 20px;
  color: #6b7280;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.65;
}

.simulation-methodology strong {
  color: #4b5563;
}

.return-positive {
  color: #dc2626 !important;
}

.return-negative {
  color: #16a34a !important;
}

.return-flat {
  color: #6b7280 !important;
}

.simulation-detail-note {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.65;
}

.simulation-detail-result {
  min-height: 52px;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  color: #111827;
  background: #f9fafb;
  font-size: 13px;
}

.simulation-detail-result span {
  color: #6b7280;
}

.simulation-detail-result strong {
  text-align: right;
}

/* 保证金测算与模拟滚IC复用卡片、表单和弹窗，只补充方向与长表格。 */
.margin-calculation-page {
  display: grid;
  gap: 16px;
}

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

.margin-direction-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  color: #4b5563;
  border: 0;
}

.margin-direction-field legend {
  min-height: 20px;
  margin-bottom: 7px;
  padding: 0;
  font-size: 13px;
}

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

.margin-direction button {
  width: 100%;
  min-width: 0;
  height: 36px;
}

.margin-wan-input input {
  padding-right: 54px;
}

.margin-wan-input i {
  width: 46px;
}

.margin-blowup-point strong {
  color: #111827;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.2;
}

.margin-clickable-rows {
  display: block;
}

.margin-clickable-rows .simulation-scenario-row {
  grid-template-columns: 150px minmax(0, 1fr);
  padding: 0 12px;
}

.margin-clickable-rows .simulation-scenario-row span {
  color: #6b7280;
  text-align: left;
}

.margin-clickable-rows .simulation-scenario-row i,
.margin-pressure-table i {
  color: #2563eb;
  font-style: normal;
  font-weight: 500;
}

.margin-clickable-rows .simulation-scenario-row strong {
  text-align: right;
}

.margin-table-wrap {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  -webkit-overflow-scrolling: touch;
}

.margin-pressure-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.margin-pressure-table th,
.margin-pressure-table td {
  height: 44px;
  box-sizing: border-box;
  padding: 8px 12px;
  border-bottom: 1px solid #eef0f3;
  color: #374151;
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
}

.margin-pressure-table th {
  color: #6b7280;
  background: #f9fafb;
  font-weight: 600;
}

.margin-pressure-table th:first-child,
.margin-pressure-table td:first-child {
  text-align: left;
}

.margin-pressure-table tbody tr {
  cursor: pointer;
}

.margin-pressure-table tbody tr:hover {
  background: #f8fafc;
}

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

.margin-pressure-table tr.terminal td {
  color: #1d4ed8;
  background: #eff6ff;
  font-weight: 650;
}

@media (max-width: 760px) {
  .simulation-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .simulation-intro-card,
  .simulation-condition-card,
  .simulation-scenario-card,
  .simulation-funds-card,
  .simulation-chart-card,
  .simulation-return-card,
  .simulation-year-card {
    padding: 18px 16px;
  }

  .simulation-svg-wrap,
  #simulation-chart {
    height: 280px;
  }

  .calculation-dialog-terms,
  .simulation-detail-result {
    grid-template-columns: 105px minmax(0, 1fr);
  }

  .margin-calculation-page .simulation-intro-card,
  .margin-calculation-page .simulation-condition-card,
  .margin-calculation-page .simulation-scenario-card,
  .margin-calculation-page .simulation-funds-card,
  .margin-calculation-page .simulation-chart-card {
    padding: 18px 16px;
  }

  .margin-pressure-table th,
  .margin-pressure-table td {
    padding-right: 5px;
    padding-left: 5px;
    font-size: 10px;
  }

  .margin-pressure-table th {
    white-space: normal;
  }
}

@media (max-width: 380px) {
  .simulation-form-grid {
    grid-template-columns: 1fr;
  }

  .simulation-reserved-funds-controls {
    grid-template-columns: 1fr;
  }

  .simulation-return-grid,
  .simulation-roll-metrics {
    gap: 6px;
  }

  .simulation-return-grid > div,
  .simulation-summary-metric,
  .simulation-metric {
    padding-left: 5px;
    padding-right: 5px;
  }

  .simulation-summary-metric strong {
    font-size: 12px;
  }

  .simulation-roll-metrics .simulation-metric span {
    min-height: 32px;
  }

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

  .simulation-scenario-row {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .margin-clickable-rows .simulation-scenario-row {
    grid-template-columns: 126px minmax(0, 1fr);
  }
}
.roll-percentile-reference { margin-top:20px; padding-top:18px; border-top:1px solid var(--line); }
.roll-percentile-reference h3 { font-size:15px; margin:0 0 12px; }
.roll-percentile-reference p { font-size:12px; color:var(--muted); line-height:1.7; }
.roll-percentile-reference a { color:var(--blue); }
.roll-percentile-grid { display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); gap:10px; }
.roll-percentile-grid > div { display:flex; flex-direction:column; gap:8px; padding:10px; border-radius:8px; background:#f8fafc; font-size:13px; text-align:center; }
.roll-percentile-grid span { color:var(--muted); font-size:12px; }
.roll-row.reminder-target { outline:2px solid #93c5fd; outline-offset:2px; border-radius:8px; }
@media(max-width:700px) { .roll-percentile-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; } }
@media(max-width:700px) {
  .margin-calculation-page,
  .margin-calculation-page .simulation-results,
  .margin-calculation-page .simulation-results > * {
    min-width: 0;
    max-width: 100%;
  }
  .margin-table-wrap {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }
  .margin-pressure-table {
    min-width: 460px;
    table-layout: fixed;
  }
  .margin-pressure-table .margin-pressure-change { width: 94px; }
  .margin-pressure-table .margin-pressure-point { width: 92px; }
  .margin-pressure-table .margin-pressure-loss { width: 82px; }
  .margin-pressure-table .margin-pressure-required { width: 78px; }
  .margin-pressure-table .margin-pressure-available { width: 114px; }
  .margin-pressure-table th,
  .margin-pressure-table td {
    padding: 8px 6px;
    font-size: 12px;
  }
  .margin-pressure-table th:first-child,
  .margin-pressure-table td:first-child {
    text-align: right;
  }
  .margin-pressure-table th { white-space:nowrap; }
}

/* 底部一级导航独立于正文和历史区间切换：图标、标签及可辨识选中态。 */
@media (max-width: 700px) {
  .mobile-page-tabs .tab {
    position: relative;
    min-width: 0;
    min-height: 64px;
    flex-direction: column;
    gap: 5px;
    padding: 7px 2px 6px;
    color: #64748b;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    font-size: 12px;
    font-weight: 550;
    line-height: 16px;
    white-space: nowrap;
    text-align: center;
  }

  .mobile-page-tabs .tab::before {
    content: "";
    display: block;
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
    background: currentColor;
    -webkit-mask: var(--page-tab-icon) center / contain no-repeat;
    mask: var(--page-tab-icon) center / contain no-repeat;
  }

  .mobile-page-tabs .tab[href="/"] {
    --page-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4v16h16M7 15l4-5 4 3 5-7M16 6h4v4'/%3E%3C/svg%3E");
  }

  .mobile-page-tabs .tab[href="/positions"] {
    --page-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='4' width='15' height='17' rx='2'/%3E%3Cpath d='M9 3v3M9 10h7M9 14h7M9 18h4M3 9h3M3 14h3'/%3E%3C/svg%3E");
  }

  .mobile-page-tabs .tab[href="/valuation"] {
    --page-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19V5M4 19h16M7 15l3-4 3 2 4-6'/%3E%3Cpath d='M16 7h3v3'/%3E%3C/svg%3E");
  }

  .mobile-page-tabs .tab[href="/risk"] {
    --page-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9a8 8 0 1 1 0 6M4 4v5h5M12 7v5l3 2'/%3E%3C/svg%3E");
  }

  .mobile-page-tabs .tab[href="/margin"] {
    --page-tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='3' width='14' height='18' rx='2'/%3E%3Cpath d='M8 7h8M8 11h1M12 11h1M16 11h0M8 15h1M12 15h1M16 15v3M8 18h1M12 18h1'/%3E%3C/svg%3E");
  }

  .mobile-page-tabs .tab::after {
    content: "";
    position: absolute;
    top: 0;
    left: calc(50% - 10px);
    width: 20px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: currentColor;
    opacity: 0;
  }

  .mobile-page-tabs .tab.active,
  .mobile-page-tabs .tab[aria-current="page"] {
    color: #2563eb;
    background: #eff6ff;
    font-weight: 700;
  }

  .mobile-page-tabs .tab.active::after,
  .mobile-page-tabs .tab[aria-current="page"]::after {
    opacity: 1;
  }

  .mobile-page-tabs .tab:active {
    background: #e2e8f0;
  }

  .mobile-page-tabs .tab:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
  }

  .toast {
    bottom: calc(92px + env(safe-area-inset-bottom));
  }
}

/* 指数估值页延续现有卡片与SVG图表语言，突出当前PE和历史分位。 */
.valuation-page { display: grid; gap: 18px; }
.valuation-controls h2,
.valuation-summary h2,
.valuation-chart-card h2,
.valuation-boundary-card h2,
.valuation-percentile-card h2 { margin: 0; }
.valuation-control-grid {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(360px, 1.3fr);
  gap: 24px;
  align-items: end;
}
.valuation-control-grid label,
.valuation-control-grid fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.valuation-control-grid .select { width: 100%; }
.valuation-years {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
}
.valuation-content { display: grid; gap: 18px; }
.valuation-loading {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.valuation-current-index-line {
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 5px 9px;
  margin-top: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eef0f3;
}
.valuation-current-index-line > span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}
.valuation-current-index-line > strong {
  color: #172033;
  font-size: 14px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.valuation-current-index-line .valuation-live-time {
  color: #64748b;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}
.valuation-current-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #eef0f3;
  border-radius: 8px;
}
.valuation-current-metric {
  min-width: 0;
  min-height: 58px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 8px 6px;
  text-align: center;
}
.valuation-current-metric + .valuation-current-metric {
  border-left: 1px solid #e5e7eb;
}
.valuation-current-metric span {
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
}
.valuation-current-metric strong {
  font-size: 14px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 19px;
}
.valuation-current-rank-value.well_below_mean { color: #2563eb; }
.valuation-current-rank-value.below_mean { color: #38bdf8; }
.valuation-current-rank-value.at_mean { color: #94a3b8; }
.valuation-current-rank-value.above_mean { color: #f59e0b; }
.valuation-current-rank-value.well_above_mean { color: #dc2626; }
.valuation-current-pe-value.well_below_mean { color: #2563eb; }
.valuation-current-pe-value.below_mean { color: #38bdf8; }
.valuation-current-pe-value.at_mean { color: #94a3b8; }
.valuation-current-pe-value.above_mean { color: #f59e0b; }
.valuation-current-pe-value.well_above_mean { color: #dc2626; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.valuation-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 22px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #eef0f3;
  border-radius: 9px;
}
.valuation-summary-grid > div {
  display: grid;
  gap: 7px;
  padding: 12px;
  background: transparent;
  text-align: center;
}
.valuation-summary-grid > div + div { border-left: 1px solid #e5e7eb; }
.valuation-summary-grid span { color: var(--muted); font-size: 12px; }
.valuation-summary-grid strong { color: #172033; font-size: 17px; }
.valuation-summary-grid strong,
.valuation-boundary-table td,
.valuation-reference-row span {
  font-variant-numeric: tabular-nums;
}
.valuation-boundary-state {
  min-height: 72px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}
.valuation-boundary-table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.valuation-boundary-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
.valuation-boundary-table th,
.valuation-boundary-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}
.valuation-boundary-table th {
  color: #64748b;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 550;
}
.valuation-boundary-table th:first-child,
.valuation-boundary-table td:first-child { text-align: left; }
.valuation-boundary-table th:nth-child(3),
.valuation-boundary-table td:nth-child(3) { white-space: nowrap; }
.valuation-boundary-table tbody tr:last-child td { border-bottom: 0; }
.valuation-boundary-table td { color: #475569; font-size: 13px; }
.valuation-boundary-table td:first-child { color: #172033; font-weight: 400; }
.valuation-boundary-table tr[data-boundary] td:first-child {
  border-left: 4px solid var(--valuation-boundary-color, #94a3b8);
}
.valuation-boundary-table tr[data-boundary="lower"],
.valuation-boundary-mobile article[data-boundary="lower"] { --valuation-boundary-color: #2563eb; }
.valuation-boundary-table tr[data-boundary="mean"],
.valuation-boundary-mobile article[data-boundary="mean"] { --valuation-boundary-color: #64748b; }
.valuation-boundary-table tr[data-boundary="upper"],
.valuation-boundary-mobile article[data-boundary="upper"] { --valuation-boundary-color: #dc2626; }
.valuation-boundary-table tr[data-band="well_below_mean"],
.valuation-boundary-mobile article[data-band="well_below_mean"] { --valuation-boundary-color: #2563eb; }
.valuation-boundary-table tr[data-band="below_mean"],
.valuation-boundary-mobile article[data-band="below_mean"] { --valuation-boundary-color: #38bdf8; }
.valuation-boundary-table tr[data-band="at_mean"],
.valuation-boundary-mobile article[data-band="at_mean"] { --valuation-boundary-color: #94a3b8; }
.valuation-boundary-table tr[data-band="above_mean"],
.valuation-boundary-mobile article[data-band="above_mean"] { --valuation-boundary-color: #f59e0b; }
.valuation-boundary-table tr[data-band="well_above_mean"],
.valuation-boundary-mobile article[data-band="well_above_mean"] { --valuation-boundary-color: #dc2626; }
.valuation-boundary-mobile { display: none; }
.valuation-chart-card {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.valuation-chart-card * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.valuation-svg-wrap { height: 340px; margin-top: 10px; }
.valuation-index-wrap { height: 230px; }
.valuation-chart {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.valuation-svg-wrap,
.valuation-tooltip {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.valuation-reference-panel h2 { margin: 0; }
.valuation-reference-thresholds { margin-top: 12px; }
.valuation-reference-table {
  width: 100%;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.valuation-reference-head,
.valuation-reference-row {
  display: grid;
  grid-template-columns: minmax(72px, .7fr) minmax(150px, 1.4fr) minmax(100px, 1fr);
  align-items: center;
  min-width: 0;
}
.valuation-band-table .valuation-reference-head,
.valuation-band-table .valuation-reference-row {
  grid-template-columns: minmax(68px, .45fr) minmax(0, 3fr);
}
.valuation-reference-head {
  min-height: 24px;
  color: #9ca3af;
  font-size: 10px;
}
.valuation-reference-head span,
.valuation-reference-row span {
  min-width: 0;
  text-align: center;
}
.valuation-reference-row {
  min-height: 34px;
  border-top: 1px solid #eef0f3;
}
.valuation-reference-row i {
  width: 24px;
  height: 0;
  justify-self: center;
  border-top: 2px dashed;
}
.valuation-reference-row i.mean { border-color: #64748b; }
.valuation-reference-row i.upper { border-color: #dc2626; }
.valuation-reference-row i.lower { border-color: #2563eb; }
.valuation-reference-row i.well-below { border-color: #2563eb; }
.valuation-reference-row i.below { border-color: #38bdf8; }
.valuation-reference-row i.above { border-color: #f59e0b; }
.valuation-reference-row i.well-above { border-color: #dc2626; }
.valuation-band-table .valuation-reference-row i { border-top-style: solid; }
.valuation-reference-row span {
  color: #6b7280;
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
}
.valuation-band-table .valuation-reference-row span:first-of-type {
  color: #111827;
  font-size: 12px;
  white-space: normal;
}
.valuation-reference-row span:first-of-type {
  color: #111827;
  font-size: 12px;
}
.valuation-chart-explanation {
  margin: 12px 0 0;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.65;
}
.valuation-percentile-inline {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.valuation-percentile-inline-head {
  min-height: 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.valuation-percentile-inline-head strong {
  color: #374151;
  font-size: 12px;
  font-weight: 600;
}
.valuation-percentile-inline-head span {
  color: #64748b;
  font-size: 10px;
  text-align: right;
}
.valuation-percentile-table th:first-child,
.valuation-percentile-table td:first-child {
  text-align: left;
}
.valuation-percentile-mobile { display: none; }
.valuation-grid { stroke: #e6ebf2; stroke-width: 1; }
.valuation-axis-label { fill: #64748b; font-size: 10px; }
.valuation-series {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.valuation-series.pe { stroke: #cbd5e1; stroke-width: 1.4; }
.valuation-series.index { stroke: #cbd5e1; stroke-width: 1.4; }
.valuation-index-segment,
.valuation-pe-segment {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.valuation-index-segment.well_below_mean,
.valuation-pe-segment.well_below_mean { stroke: #2563eb; }
.valuation-index-segment.below_mean,
.valuation-pe-segment.below_mean { stroke: #38bdf8; }
.valuation-index-segment.at_mean,
.valuation-pe-segment.at_mean { stroke: #94a3b8; }
.valuation-index-segment.above_mean,
.valuation-pe-segment.above_mean { stroke: #f59e0b; }
.valuation-index-segment.well_above_mean,
.valuation-pe-segment.well_above_mean { stroke: #dc2626; }
.valuation-live-segment {
  fill: none;
  stroke-width: 2.4;
  stroke-dasharray: 5 4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.valuation-live-segment.well_below_mean { stroke: #2563eb; }
.valuation-live-segment.below_mean { stroke: #38bdf8; }
.valuation-live-segment.at_mean { stroke: #94a3b8; }
.valuation-live-segment.above_mean { stroke: #f59e0b; }
.valuation-live-segment.well_above_mean { stroke: #dc2626; }
.valuation-reference { stroke-width: 1.2; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.valuation-reference.upper { stroke: #dc2626; }
.valuation-reference.mean { stroke: #64748b; }
.valuation-reference.lower { stroke: #2563eb; }
.valuation-reference-label { font-size: 9px; font-weight: 600; }
.valuation-reference-label.upper { fill: #b91c1c; }
.valuation-reference-label.mean { fill: #475569; }
.valuation-reference-label.lower { fill: #1d4ed8; }
.valuation-current-dot { fill: #fff; stroke: #2563eb; stroke-width: 3; }
.valuation-current-dot.well_below_mean { stroke: #2563eb; }
.valuation-current-dot.below_mean { stroke: #38bdf8; }
.valuation-current-dot.at_mean { stroke: #94a3b8; }
.valuation-current-dot.above_mean { stroke: #f59e0b; }
.valuation-current-dot.well_above_mean { stroke: #dc2626; }
.valuation-index-dot { fill: #fff; stroke: #64748b; stroke-width: 3; }
.valuation-index-dot.well_below_mean { stroke: #2563eb; }
.valuation-index-dot.below_mean { stroke: #38bdf8; }
.valuation-index-dot.at_mean { stroke: #94a3b8; }
.valuation-index-dot.above_mean { stroke: #f59e0b; }
.valuation-index-dot.well_above_mean { stroke: #dc2626; }
.valuation-current-dot.live,
.valuation-index-dot.live {
  stroke-dasharray: 2 1;
}
.valuation-current-label { font-size: 9px; font-weight: 650; }
.valuation-current-label.pe { fill: #1d4ed8; }
.valuation-current-label.index { fill: #475569; }
.valuation-hover-line { stroke: #475569; stroke-width: 1; stroke-dasharray: 3 3; }
.valuation-hover-dot {
  fill: #fff;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.valuation-hover-dot.pe,
.valuation-hover-dot.index { stroke: #475569; }
.valuation-hover-dot.well_below_mean { stroke: #2563eb; }
.valuation-hover-dot.below_mean { stroke: #38bdf8; }
.valuation-hover-dot.at_mean { stroke: #94a3b8; }
.valuation-hover-dot.above_mean { stroke: #f59e0b; }
.valuation-hover-dot.well_above_mean { stroke: #dc2626; }
.valuation-tooltip {
  position: absolute;
  display: grid;
  min-width: 205px;
  gap: 4px;
  pointer-events: none;
}
.valuation-tooltip strong { color: #0f172a; }
.valuation-tooltip span { display: block; color: #475569; }
.valuation-method-card { color: #64748b; font-size: 12px; line-height: 1.7; }
.valuation-method-card p { margin: 0; }

@media (max-width: 700px) {
  .mobile-page-tabs.five-page-tabs .tab {
    min-height: 62px;
    padding-right: 1px;
    padding-left: 1px;
    font-size: 10px;
  }
  .valuation-page { gap: 12px; }
  .valuation-control-grid { grid-template-columns: 1fr; gap: 15px; }
  .valuation-current-index-line {
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 5px 8px;
  }
  .valuation-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .valuation-summary-grid > div { padding: 10px 4px; }
  .valuation-summary-grid span {
    min-height: 28px;
    display: grid;
    place-items: center;
    font-size: 10px;
    line-height: 1.35;
  }
  .valuation-summary-grid strong { font-size: 15px; }
  .valuation-boundary-table-wrap { display: none; }
  .valuation-boundary-mobile {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
  }
  .valuation-percentile-mobile {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
  }
  .valuation-percentile-mobile article {
    padding: 8px 7px;
    background: #fff;
  }
  .valuation-percentile-mobile article + article {
    border-top: 1px solid #eef0f3;
  }
  .valuation-boundary-mobile article {
    display: block;
    padding: 11px 10px 10px;
    border-left: 4px solid var(--valuation-boundary-color, #94a3b8);
    background: #fff;
  }
  .valuation-boundary-mobile article + article {
    border-top: 1px solid #eef0f3;
  }
  .valuation-boundary-mobile .valuation-boundary-name {
    display: block;
    padding: 0 2px 9px;
    color: #172033;
    font-size: 13px;
    font-weight: 400;
    text-align: left;
    white-space: nowrap;
  }
  .valuation-boundary-mobile-table {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    background: #f8fafc;
    border-radius: 7px;
  }
  .valuation-boundary-mobile-table > div {
    min-width: 0;
    min-height: 50px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 4px;
    padding: 6px 2px;
    text-align: center;
  }
  .valuation-boundary-mobile-table > div + div {
    border-left: 1px solid #e5e7eb;
  }
  .valuation-boundary-mobile-table span:first-child {
    color: #64748b;
    font-size: 9px;
    line-height: 1.3;
  }
  .valuation-boundary-mobile-table span:last-child {
    max-width: 100%;
    overflow: hidden;
    color: #172033;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .valuation-reference-head,
  .valuation-reference-row {
    grid-template-columns: minmax(56px, .6fr) minmax(120px, 1.45fr) minmax(88px, 1fr);
  }
  .valuation-band-table .valuation-reference-head,
  .valuation-band-table .valuation-reference-row {
    grid-template-columns: minmax(42px, .4fr) minmax(0, 2.6fr);
  }
  .valuation-svg-wrap { height: 300px; margin-right: -5px; margin-left: -5px; }
  .valuation-index-wrap { height: 210px; }
}
.valuation-boundary-example {
  margin: 10px 2px 0;
  color: #6b7280;
  font-size: 10px;
  line-height: 1.65;
}

@media (max-width: 360px) {
  .valuation-years { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .valuation-years button { min-height: 44px; }
  .valuation-current-index-line { gap: 5px; }
}

/* 五页统一页脚，给异步反馈和三击统计预留空间，避免内容加载导致布局跳动。 */
.site-footer {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 14px;
  width: 100%;
  margin-top: 18px;
  padding: 8px 2px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.65;
}

.site-footer .site-footer-disclaimer {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.site-footer-tools {
  display: contents;
}

.site-footer #feedback-contact {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  color: #475569;
  white-space: normal;
  max-width: calc(100% - 58px);
  margin-right: 58px;
}

.site-footer .feedback-copy {
  max-width: 100%;
  min-height: 44px;
  flex-wrap: wrap;
  column-gap: 4px;
  row-gap: 0;
  font: inherit;
  text-align: left;
}

.site-footer .feedback-copy strong {
  color: var(--blue);
  font-size: inherit;
  font-weight: 600;
  white-space: nowrap;
}

.site-footer .feedback-copy:focus-visible,
.site-footer .statistics-secret-trigger:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

.site-footer-statistics {
  display: contents;
}

.site-footer #page-views {
  font: inherit;
  white-space: nowrap;
}

.site-footer #page-views[hidden],
.site-footer .statistics-secret-trigger[hidden] {
  display: none;
}

.site-footer .statistics-secret-trigger {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 52px;
  min-height: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 仅由手机触控媒体查询启用；原生顶层dialog兼容持仓表单中的情境指引。 */
.ic-guide {
  position: fixed;
  margin: 0;
  padding: 0;
  max-width: none;
  max-height: none;
  border: 0;
  background: transparent;
  color: #111827;
  overflow: hidden;
}
.ic-guide:not([open]), .ic-guide [hidden] { display: none; }
.ic-guide::backdrop { background: rgba(15, 23, 42, .58); }
.ic-guide-spotlight {
  position: absolute;
  box-sizing: border-box;
  border: 3px solid #60a5fa;
  border-radius: 12px;
  box-shadow: 0 0 0 5px rgba(96, 165, 250, .22);
  pointer-events: none;
}
.ic-guide-card {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: max(84px, calc(72px + env(safe-area-inset-bottom)));
  display: flex;
  flex-direction: column;
  max-height: calc(100% - 176px);
  max-width: 430px;
  margin: 0 auto;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 44px rgba(15, 23, 42, .24);
  box-sizing: border-box;
}
.ic-guide-copy { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.ic-guide-meta {
  display: flex;
  justify-content: space-between;
  flex: none;
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
}
.ic-guide-title { margin: 8px 0 0; font-size: 17px; font-weight: 650; line-height: 1.35; }
.ic-guide-content { margin: 7px 0 0; color: #4b5563; font-size: 13px; line-height: 1.6; }
.ic-guide-hint, .ic-guide-demo-label { margin: 10px 0 0; color: #64748b; font-size: 11px; line-height: 1.4; }
.ic-guide-demo { margin-top: 12px; padding: 8px; background: #f8fafc; border: 1px solid #dbeafe; border-radius: 8px; }
.ic-guide-demo-label { margin: 0 0 6px; }
.ic-guide-demo-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px; font-size: 11px; }
.ic-guide-demo-row.selected { background: #eff6ff; color: #2563eb; }
.ic-guide-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; flex: none; }
.ic-guide-actions button { min-height: 44px; padding: 8px 20px; border: 0; border-radius: 10px; font: inherit; font-size: 14px; cursor: pointer; }
.ic-guide-next { color: #fff; background: #2563eb; font-weight: 600; }
.ic-guide-skip { color: #64748b; background: #f1f5f9; }
.ic-guide-actions button:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
.ic-guide-spacer { height: 65vh; pointer-events: none; }
@media (max-height: 500px) {
  .ic-guide-card { bottom: 16px; max-height: calc(100% - 104px); }
}
