:root {
  --bg: #111816;
  --surface: #18211e;
  --text: #edf5ef;
  --muted: #9eb2a8;
  --accent: #57b894;
  --chart: linear-gradient(135deg, rgba(87,184,148,.26), rgba(214,168,83,.08));
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  transition: background .35s ease, color .35s ease;
}

button,
input {
  font: inherit;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr);
  gap: 24px;
  align-items: stretch;
  min-height: 430px;
}

.hero-copy,
.panel,
.ticker,
.template-card {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 8px;
  box-shadow: 0 24px 60px -42px rgba(0, 0, 0, .55);
}

.hero-copy {
  padding: clamp(26px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow,
.section-heading p {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(36px, 7vw, 72px);
  max-width: 680px;
}

h2 {
  font-size: clamp(24px, 3vw, 38px);
}

.lead {
  margin: 22px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-action,
.secondary-action {
  border: 0;
  border-radius: 6px;
  padding: 13px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s ease, opacity .2s ease, border-color .2s ease;
}

.primary-action {
  background: var(--accent);
  color: #101512;
  font-weight: 800;
}

.primary-action.full {
  width: 100%;
  margin-top: 4px;
}

.secondary-action {
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  color: var(--text);
  background: transparent;
}

.primary-action:active,
.secondary-action:active,
.template-card:active {
  transform: translateY(1px) scale(.99);
}

.hero-media {
  min-height: 320px;
  border-radius: 8px;
  background-image:
    linear-gradient(90deg, color-mix(in srgb, var(--bg) 88%, transparent), transparent 48%),
    url("./assets/ginger-futures-hero.webp");
  background-size: cover;
  background-position: center;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}

.ticker {
  margin: 18px 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
}

.ticker div,
.risk-row div {
  padding: 18px;
  border-right: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
}

.ticker div:last-child,
.risk-row div:last-child {
  border-right: 0;
}

.ticker span,
.risk-row span,
.result-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 7px;
}

.ticker strong,
.risk-row strong {
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 24px;
}

.rise {
  color: #62bd84;
}

.fall {
  color: #d06c58;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, .75fr) minmax(0, 1.25fr);
  gap: 24px;
}

.panel {
  padding: 24px;
}

.form-panel {
  display: grid;
  gap: 14px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

input {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  background: color-mix(in srgb, var(--bg) 72%, white 6%);
  color: var(--text);
  border-radius: 6px;
  padding: 12px 13px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
}

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

.result-card {
  min-height: 180px;
  border-radius: 8px;
  padding: 26px;
  background: var(--chart);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.result-card strong {
  font-size: clamp(44px, 9vw, 86px);
  line-height: 1;
}

.result-card p {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.meter-top,
.risk-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.meter-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.meter-track span {
  display: block;
  height: 100%;
  width: 78%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .3s ease;
}

.risk-row {
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 8px;
  overflow: hidden;
}

.risk-row div {
  width: 50%;
}

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

.drivers li {
  padding: 13px 14px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text);
  line-height: 1.55;
}

.notice {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 13px;
}

.templates-section,
.plugins-section {
  padding-top: 34px;
}

.wide {
  margin-bottom: 18px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.template-card {
  color: var(--template-text);
  background: var(--template-bg);
  cursor: pointer;
  min-height: 154px;
  padding: 16px;
  text-align: left;
  transition: transform .2s ease, border-color .2s ease;
}

.template-card[aria-pressed="true"] {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 36%, transparent);
}

.template-card strong {
  display: block;
  margin: 14px 0 8px;
  font-size: 18px;
}

.template-card p {
  margin: 0;
  color: var(--template-muted);
  line-height: 1.55;
  font-size: 13px;
}

.plugin-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.plugin-list span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
  font-size: 14px;
}

.swatch {
  width: 34px;
  height: 10px;
  border-radius: 999px;
  background: var(--template-accent);
}

@media (max-width: 900px) {
  .shell {
    width: min(100% - 24px, 640px);
    padding-top: 14px;
  }

  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-copy {
    min-height: 380px;
  }

  .hero-media {
    min-height: 220px;
  }

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

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

@media (max-width: 520px) {
  .shell {
    width: min(100% - 20px, 460px);
  }

  .hero-copy,
  .panel {
    padding: 20px;
  }

  .hero-actions {
    display: grid;
  }

  .ticker,
  .template-grid {
    grid-template-columns: 1fr;
  }

  .ticker div {
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  }

  .result-card {
    min-height: 150px;
    padding: 20px;
  }
}
