:root {
  color-scheme: dark;
  --bg: #07080d;
  --panel: rgba(18, 22, 30, 0.92);
  --panel-solid: #12161e;
  --panel-2: #1a202a;
  --text: #f7f3ef;
  --muted: #a9adb8;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #ff4655;
  --accent-2: #ff7a45;
  --good: #35ff9d;
  --warn: #ffd166;
  --danger: #ff4655;
  --radius: 8px;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(255, 70, 85, 0.16) 0 18%, transparent 18% 100%),
    radial-gradient(circle at 84% 8%, rgba(255, 70, 85, 0.28), transparent 28%),
    radial-gradient(circle at 8% 90%, rgba(255, 122, 69, 0.12), transparent 30%),
    var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.hero-copy,
.hero-card,
.panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(18, 22, 30, 0.96), rgba(13, 16, 23, 0.9));
  border-radius: var(--radius);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  padding: 28px;
}

.hero-copy::after {
  content: "VLR";
  position: absolute;
  right: -18px;
  bottom: -30px;
  color: rgba(255, 255, 255, 0.035);
  font-size: 170px;
  font-weight: 1000;
  line-height: 0.8;
}

.hero-card {
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 22px;
  border-color: rgba(255, 70, 85, 0.45);
}

.hero-card span,
.section-kicker,
.mini-export span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-card strong {
  font-size: 24px;
  line-height: 1.1;
}

.hero-card p,
.subtitle,
.panel-head p,
.hint,
.result-line,
.recommendation {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.language-switcher select {
  width: auto;
  min-width: 118px;
  padding: 8px 10px;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 12px;
  font-size: clamp(38px, 6vw, 82px);
  line-height: 0.92;
  text-transform: uppercase;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
}

h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.subtitle {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.55;
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.step-tab {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid var(--line);
  background: rgba(18, 22, 30, 0.76);
  color: var(--muted);
  border-radius: 6px;
  padding: 10px;
  text-align: left;
}

.step-tab span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  background: #0a0c12;
  color: var(--accent);
  border: 1px solid rgba(255, 70, 85, 0.4);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 1000;
}

.step-tab strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.step-tab.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(255, 70, 85, 0.28), rgba(18, 22, 30, 0.92));
  color: var(--text);
  box-shadow: inset 4px 0 0 var(--accent);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.stage {
  min-width: 0;
}

.tab-panel {
  display: none;
  min-height: 580px;
}

.tab-panel.active {
  display: block;
}

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

.panel-head.compact {
  margin-bottom: 14px;
}

.panel-head p {
  margin: 8px 0 0;
  line-height: 1.45;
}

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

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #090b10;
  color: var(--text);
  border-radius: 6px;
  padding: 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 70, 85, 0.18);
}

textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.metrics div {
  border: 1px solid rgba(255, 70, 85, 0.25);
  background: linear-gradient(180deg, #1a202a, #11151d);
  border-radius: 6px;
  padding: 14px;
  min-width: 0;
}

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

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.primary,
.panel-head button,
.ghost-button {
  border: 0;
  border-radius: 6px;
  padding: 12px 14px;
  font-weight: 1000;
}

.primary,
.panel-head button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 28px rgba(255, 70, 85, 0.28);
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.step-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.step-actions.split {
  justify-content: space-between;
}

.reaction-pad {
  display: grid;
  width: 100%;
  min-height: 330px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  color: var(--text);
  font-size: clamp(24px, 5vw, 54px);
  font-weight: 1000;
  text-align: center;
  text-transform: uppercase;
}

.reaction-pad.idle {
  background: linear-gradient(135deg, #151a23, #202632);
}

.reaction-pad.waiting {
  background: linear-gradient(135deg, #9d1f2d, #3b0d14);
}

.reaction-pad.ready {
  background: linear-gradient(135deg, #0a9f58, #12391f);
}

.reaction-pad.too-soon {
  background: linear-gradient(135deg, #c2741e, #41230c);
}

.result-line {
  min-height: 24px;
  margin-top: 14px;
  font-size: 14px;
}

.aim-arena {
  position: relative;
  height: 440px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 70, 85, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 70, 85, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(255, 70, 85, 0.16), transparent 40%),
    #0b0e15;
  background-size: 48px 48px, 48px 48px, auto, auto;
  cursor: none;
}

.arena-crosshair,
.target {
  position: absolute;
  pointer-events: none;
}

.arena-crosshair {
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.arena-crosshair::before,
.arena-crosshair::after {
  content: "";
  position: absolute;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(255, 70, 85, 0.9);
}

.arena-crosshair::before {
  left: 13px;
  top: 0;
  width: 2px;
  height: 28px;
}

.arena-crosshair::after {
  left: 0;
  top: 13px;
  width: 28px;
  height: 2px;
}

.target {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 7px rgba(255, 70, 85, 0.16), 0 0 28px rgba(255, 70, 85, 0.8);
}

.timer,
.score {
  position: absolute;
  top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 8, 13, 0.86);
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 1000;
  z-index: 2;
}

.timer {
  left: 12px;
}

.score {
  right: 12px;
}

.output {
  position: sticky;
  top: 16px;
}

.preview-wrap {
  border: 1px solid rgba(255, 70, 85, 0.3);
  background: #090b10;
  border-radius: var(--radius);
  padding: 12px;
}

.preview {
  position: relative;
  height: 310px;
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 70, 85, 0.18), rgba(13, 16, 22, 0.12)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='280' viewBox='0 0 360 280'%3E%3Crect width='360' height='280' fill='%230b0e15'/%3E%3Cpath d='M0 210h360v70H0z' fill='%231c2230'/%3E%3Cpath d='M24 98h76v112H24zM128 60h94v150h-94zM258 118h70v92h-70z' fill='%232b3442'/%3E%3Cpath d='M42 135h42M151 98h50M273 145h34' stroke='%23464f5f' stroke-width='8'/%3E%3Cpath d='M0 0h110L0 82z' fill='%23ff4655' opacity='.23'/%3E%3Ccircle cx='180' cy='136' r='13' fill='%23ff4655'/%3E%3C/svg%3E");
  background-size: cover;
}

.crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  transform: translate(-50%, -50%);
}

.crosshair .line,
.crosshair .dot,
.crosshair .outer,
.crosshair .ear,
.crosshair .whisker {
  position: absolute;
  background: var(--accent);
  box-shadow: 0 0 0 var(--outline-size, 0) rgba(0, 0, 0, 0.9), 0 0 14px color-mix(in srgb, var(--accent), transparent 50%);
}

.crosshair .dot {
  border-radius: 50%;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.status-strip.stacked {
  display: grid;
}

.status-strip span,
.import-help,
.mini-export {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-radius: 6px;
  padding: 10px;
  font-size: 13px;
}

.mini-export {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.mini-export code {
  max-height: 72px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.import-help {
  margin-top: 14px;
  line-height: 1.45;
}

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

.tune-group {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 6px;
  padding: 14px;
  min-width: 0;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.slider-field {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.slider-field span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.slider-field b {
  color: var(--text);
}

.slider-field input {
  padding: 0;
  accent-color: var(--accent);
}

.hint {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 1120px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .output {
    position: static;
  }

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

@media (max-width: 760px) {
  .app {
    width: min(100% - 20px, 620px);
    padding: 18px 0;
  }

  .hero-copy {
    min-height: 190px;
    padding: 20px;
  }

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

  .hero-copy::after {
    font-size: 110px;
  }

  .steps,
  .form-grid,
  .metrics,
  .tune-grid {
    grid-template-columns: 1fr;
  }

  .step-tab {
    min-height: 52px;
  }

  .panel-head,
  .step-actions,
  .step-actions.split {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-head button,
  .step-actions button {
    width: 100%;
  }

  .tab-panel {
    min-height: auto;
  }

  .reaction-pad {
    min-height: 240px;
  }

  .aim-arena {
    height: 320px;
  }
}
