:root {
  --canvas: #f4f6f1;
  --canvas-strong: #eef2ea;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-tint: #f3f7f4;
  --text: #173026;
  --text-soft: #537065;
  --line: rgba(23, 48, 38, 0.1);
  --line-strong: rgba(23, 48, 38, 0.18);
  --accent: #187a57;
  --accent-strong: #0e6041;
  --accent-soft: #d9f1e6;
  --bank: #577085;
  --bank-soft: #e8eef3;
  --warn: #c7942e;
  --warn-soft: #fff6da;
  --danger: #bb5b4e;
  --danger-soft: #fde9e6;
  --shadow: 0 18px 54px rgba(30, 56, 43, 0.08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --page-width: 1440px;
  --transition: 180ms ease;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(24, 122, 87, 0.07), transparent 28%),
    linear-gradient(180deg, #f8faf6 0%, var(--canvas) 100%);
  color: var(--text);
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--accent-strong);
}

.hidden {
  display: none !important;
}

.page-shell {
  width: min(calc(100vw - 32px), var(--page-width));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px 26px;
  border-bottom: 1px solid rgba(23, 48, 38, 0.08);
}

.brand-lockup {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.brand-mark {
  width: 58px;
  height: 58px;
  flex: none;
}

.brand-copy h1,
.brand-copy .subtitle,
.brand-copy .eyebrow,
.pill,
.btn,
.chip {
  white-space: nowrap;
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(1.7rem, 2vw, 2.2rem);
  line-height: 1.1;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  font-size: 0.79rem;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.brand-copy .subtitle {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 0.98rem;
}

.topbar-actions {
  display: grid;
  gap: 14px;
  justify-items: end;
}

.status-strip,
.action-row,
.inline-filters,
.table-controls,
.drawer-actions,
.hero-meta,
.trend-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(23, 48, 38, 0.06);
  color: var(--text-soft);
  font-size: 0.86rem;
}

.pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.72;
}

.pill.is-good {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.pill.is-warn {
  background: var(--warn-soft);
  color: #996d12;
}

.pill.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn,
.chip,
.ghost-link,
.icon-btn {
  border: 0;
  cursor: pointer;
  transition:
    transform var(--transition),
    background var(--transition),
    color var(--transition),
    box-shadow var(--transition);
}

.btn {
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
}

.btn:hover,
.chip:hover,
.ghost-link:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(24, 122, 87, 0.22);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(23, 48, 38, 0.09);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.ghost-link {
  background: transparent;
  color: var(--accent-strong);
  font-weight: 700;
  padding: 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(23, 48, 38, 0.08);
  color: var(--text);
  font-size: 1.3rem;
}

.content-stack {
  display: grid;
  gap: 22px;
  padding-top: 24px;
}

.hero-panel,
.panel,
.metric-card,
.empty-state,
.alert-banner,
.drawer {
  backdrop-filter: blur(16px);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  padding: 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 247, 0.88));
  box-shadow: var(--shadow);
}

.hero-panel h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.1rem);
  line-height: 1.06;
  max-width: 14ch;
}

.hero-text {
  margin: 18px 0 0;
  max-width: 60ch;
  color: var(--text-soft);
  line-height: 1.8;
}

.hero-meta {
  margin-top: 18px;
}

.hero-meta span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(23, 48, 38, 0.06);
  color: var(--text-soft);
  font-size: 0.9rem;
}

.hero-visual-wrap {
  position: relative;
  min-height: 260px;
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(24, 122, 87, 0.08), rgba(87, 112, 133, 0.08)),
    linear-gradient(180deg, #eef5ef, #f7faf6);
  box-shadow: inset 0 0 0 1px rgba(23, 48, 38, 0.05);
}

.hero-visual {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.alert-banner {
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--warn-soft);
  color: #6d5200;
  box-shadow: var(--shadow);
}

.alert-banner.is-danger {
  background: var(--danger-soft);
  color: #8d3428;
}

.empty-state {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
  padding: 28px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.empty-copy h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1.1;
}

.empty-copy p {
  color: var(--text-soft);
  line-height: 1.8;
}

.empty-side {
  display: grid;
  gap: 16px;
}

.placeholder-chart {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #f9fbf8 0%, #eef5ef 100%);
  box-shadow: inset 0 0 0 1px rgba(23, 48, 38, 0.06);
}

.placeholder-label {
  font-size: 0.82rem;
  color: var(--text-soft);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.placeholder-lines {
  margin-top: 18px;
  height: 136px;
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(24, 122, 87, 0.28), rgba(24, 122, 87, 0) 55%),
    repeating-linear-gradient(
      180deg,
      rgba(23, 48, 38, 0.04),
      rgba(23, 48, 38, 0.04) 1px,
      transparent 1px,
      transparent 28px
    ),
    linear-gradient(180deg, rgba(87, 112, 133, 0.07), rgba(87, 112, 133, 0.02));
}

.privacy-note {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.75;
}

.privacy-note.large {
  font-size: 1rem;
}

.demo-preview,
.demo-trend-panel,
.demo-breakdown-card,
.demo-stat-card,
.demo-insight-item {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(242, 247, 243, 0.92));
  box-shadow: inset 0 0 0 1px rgba(23, 48, 38, 0.06);
}

.demo-preview {
  display: grid;
  gap: 16px;
}

.demo-preview-head,
.demo-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.demo-preview-title,
.demo-disclaimer {
  color: var(--text-soft);
}

.demo-preview-title {
  font-weight: 700;
  color: var(--text);
}

.demo-preview-grid,
.demo-stat-grid,
.demo-breakdown-grid {
  display: grid;
  gap: 12px;
}

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

.demo-preview-metric,
.demo-stat-card {
  display: grid;
  gap: 8px;
}

.demo-preview-metric span,
.demo-stat-card p,
.demo-trend-copy,
.demo-preview-note,
.demo-case-summary {
  margin: 0;
  color: var(--text-soft);
}

.demo-preview-metric strong,
.demo-stat-card h3,
.demo-trend-bar strong {
  font-family: "Manrope", "Noto Sans SC", sans-serif;
}

.demo-preview-metric strong {
  font-size: 1.15rem;
}

.demo-preview-spark,
.demo-trend-bars {
  display: grid;
  gap: 10px;
}

.demo-preview-spark {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  min-height: 126px;
}

.demo-spark-bar,
.demo-trend-bar {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.demo-spark-bar span,
.demo-trend-track span {
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

.demo-spark-bar span {
  max-width: 22px;
  min-height: 16px;
}

.demo-spark-bar small,
.demo-trend-bar small {
  color: var(--text-soft);
  font-size: 0.8rem;
}

.panel-demo {
  display: grid;
  gap: 18px;
}

.demo-disclaimer {
  max-width: 30ch;
  line-height: 1.6;
  text-align: right;
}

.demo-layout {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 18px;
}

.demo-main,
.demo-side,
.demo-store-list {
  display: grid;
  gap: 14px;
}

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

.demo-stat-card h3,
.demo-trend-head h3 {
  margin: 0;
  font-size: clamp(1.5rem, 2.3vw, 2.2rem);
  line-height: 1.05;
}

.demo-stat-card span {
  color: var(--text-soft);
  line-height: 1.6;
}

.demo-stat-card.is-bank {
  background:
    linear-gradient(180deg, rgba(87, 112, 133, 0.09), rgba(87, 112, 133, 0.03)),
    #fff;
}

.demo-stat-card.is-usdt {
  background:
    linear-gradient(180deg, rgba(24, 122, 87, 0.1), rgba(24, 122, 87, 0.03)),
    #fff;
}

.demo-stat-card.is-profit {
  background:
    linear-gradient(135deg, rgba(16, 95, 64, 0.96), rgba(24, 122, 87, 0.92)),
    #0e6041;
}

.demo-stat-card.is-profit p,
.demo-stat-card.is-profit span,
.demo-stat-card.is-profit h3 {
  color: #fff;
}

.demo-trend-panel,
.demo-copy-card {
  display: grid;
  gap: 14px;
}

.demo-trend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.demo-trend-bars {
  grid-template-columns: repeat(7, minmax(72px, 1fr));
}

.demo-trend-bar {
  min-width: 0;
}

.demo-trend-track {
  width: 100%;
  height: 132px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(87, 112, 133, 0.04), rgba(87, 112, 133, 0.01)),
    #f8faf8;
}

.demo-trend-track span {
  display: block;
  max-width: 28px;
  min-height: 18px;
}

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

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

.demo-insight-item {
  padding: 14px 16px;
}

.demo-insight-item p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 18px;
}

.metric-card {
  min-height: 210px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card-wide {
  grid-column: span 1;
  background:
    linear-gradient(180deg, rgba(24, 122, 87, 0.06), rgba(24, 122, 87, 0.02)),
    var(--surface);
}

.metric-card-bank {
  background:
    linear-gradient(180deg, rgba(87, 112, 133, 0.08), rgba(87, 112, 133, 0.02)),
    var(--surface);
}

.metric-card-usdt {
  background:
    linear-gradient(180deg, rgba(24, 122, 87, 0.1), rgba(24, 122, 87, 0.03)),
    var(--surface);
}

.metric-card-profit {
  background:
    linear-gradient(135deg, rgba(16, 95, 64, 0.96), rgba(24, 122, 87, 0.92)),
    #0e6041;
  color: #fff;
}

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

.metric-label {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.metric-card-profit .metric-label,
.metric-card-profit .metric-footnote,
.metric-card-profit .metric-profit-rate {
  color: rgba(255, 255, 255, 0.88);
}

.metric-card h3 {
  margin: 10px 0 6px;
  font-family: "Manrope", "Noto Sans SC", sans-serif;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1;
}

.metric-cny {
  margin: 0;
  font-family: "Manrope", "Noto Sans SC", sans-serif;
  font-size: 1rem;
  color: var(--text-soft);
}

.metric-card-profit .metric-cny {
  color: rgba(255, 255, 255, 0.88);
}

.metric-subcopy,
.metric-footnote,
.settlement-copy {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.market-rollup,
.rate-mini-list,
.rate-source-list,
.sync-summary,
.sync-log-list,
.drain-rail {
  display: grid;
  gap: 12px;
}

.market-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 8px 8px 0 0;
  border-radius: 999px;
  background: rgba(23, 48, 38, 0.05);
  color: var(--text-soft);
  font-size: 0.84rem;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
}

.panel-grid-bottom {
  grid-template-columns: 0.88fr 1.12fr;
}

.panel {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.panel-head h2 {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1.18;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(23, 48, 38, 0.06);
  color: var(--text-soft);
  font-weight: 700;
}

.chip.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.chart-shell {
  overflow-x: auto;
}

#trend-chart {
  width: 100%;
  min-width: 660px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(87, 112, 133, 0.02), rgba(87, 112, 133, 0)),
    linear-gradient(180deg, #fbfcfb, #f6f8f6);
  box-shadow: inset 0 0 0 1px rgba(23, 48, 38, 0.05);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 6px;
}

.legend-bank {
  background: var(--bank);
}

.legend-usdt {
  background: var(--accent);
}

.legend-delta {
  background: #99d4b8;
}

.day-detail-card,
.helper-box,
.sovereignty-card,
.sync-item,
.rate-source-card,
.store-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 244, 0.92));
  box-shadow: inset 0 0 0 1px rgba(23, 48, 38, 0.06);
}

.day-detail-card h3,
.helper-box strong {
  margin: 0;
}

.day-detail-card h3 {
  margin-top: 6px;
  font-size: 1.16rem;
}

.day-detail-card p,
.helper-box p,
.sovereignty-list,
.store-card p {
  color: var(--text-soft);
}

.drain-rail {
  margin-bottom: 16px;
}

.drain-step {
  display: grid;
  gap: 8px;
}

.drain-step-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.drain-bar {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(23, 48, 38, 0.06);
}

.drain-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.cost-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.cost-list.compact {
  margin-top: 12px;
}

.cost-list li,
.sync-item,
.rate-source-card,
.store-card {
  display: grid;
  gap: 8px;
}

.cost-row,
.rate-row,
.sync-row,
.store-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.value-strong {
  font-family: "Manrope", "Noto Sans SC", sans-serif;
  font-weight: 800;
}

.table-controls {
  justify-content: flex-end;
}

select,
input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(23, 48, 38, 0.12);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(23, 48, 38, 0.08);
  text-align: left;
  font-size: 0.93rem;
  vertical-align: top;
}

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

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: rgba(24, 122, 87, 0.04);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.status-badge.ok {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-badge.warn {
  background: var(--warn-soft);
  color: #936300;
}

.status-badge.error {
  background: var(--danger-soft);
  color: var(--danger);
}

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

.sovereignty-card {
  display: grid;
  gap: 16px;
}

.sovereignty-visual {
  width: 100%;
  min-height: 240px;
  object-fit: cover;
  border-radius: 18px;
  background: linear-gradient(180deg, #eff5f1, #f8fbf8);
}

.sovereignty-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
}

.footer {
  padding: 28px 10px 0;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.drawer-shell {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 28, 22, 0.36);
}

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(720px, 100vw);
  height: 100vh;
  padding: 22px;
  background: linear-gradient(180deg, rgba(249, 251, 248, 0.98), rgba(241, 246, 242, 0.98));
  box-shadow: -20px 0 48px rgba(17, 37, 29, 0.14);
  display: grid;
  grid-template-rows: auto 1fr;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(23, 48, 38, 0.08);
}

.drawer-head h2 {
  margin: 0;
}

.drawer-body {
  overflow-y: auto;
  padding-top: 18px;
}

.drawer-section {
  display: grid;
  gap: 16px;
}

.stack-form {
  display: grid;
  gap: 18px;
}

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

label {
  display: grid;
  gap: 8px;
}

label span {
  font-weight: 700;
}

label small {
  color: var(--text-soft);
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .metric-grid,
  .panel-grid,
  .empty-state,
  .hero-panel,
  .demo-layout {
    grid-template-columns: 1fr;
  }

  .metric-card-wide {
    grid-column: auto;
  }

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

@media (max-width: 860px) {
  .page-shell {
    width: min(calc(100vw - 20px), var(--page-width));
    padding-top: 14px;
  }

  .topbar {
    padding: 10px 10px 22px;
  }

  .topbar,
  .brand-lockup,
  .topbar-actions {
    align-items: stretch;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    justify-items: start;
  }

  .hero-panel,
  .panel,
  .metric-card,
  .empty-state,
  .demo-preview,
  .demo-trend-panel,
  .demo-breakdown-card,
  .demo-stat-card {
    padding: 18px;
  }

  .metric-grid {
    gap: 14px;
  }

  .metric-card-profit {
    order: -1;
  }

  .form-group-grid {
    grid-template-columns: 1fr;
  }

  .demo-trend-head {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .brand-copy h1,
  .brand-copy .subtitle,
  .brand-copy .eyebrow,
  .pill,
  .btn,
  .chip,
  .ghost-link {
    white-space: normal;
  }

  .hero-panel h2,
  .empty-copy h2 {
    max-width: none;
  }

  .table-wrap {
    display: none;
  }

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

  .table-controls {
    justify-content: stretch;
    flex-direction: column;
  }

  .demo-preview-grid,
  .demo-stat-grid,
  .demo-breakdown-grid {
    grid-template-columns: 1fr;
  }

  .demo-disclaimer {
    text-align: left;
  }

  .demo-preview-spark,
  .demo-trend-bars {
    overflow-x: auto;
  }

  .topbar .action-row,
  .drawer-actions,
  .empty-copy .action-row {
    width: 100%;
  }

  .topbar .action-row .btn,
  .drawer-actions .btn,
  .empty-copy .action-row .btn {
    flex: 1 1 0;
  }
}
