﻿:root {
  --bg: #0c1016;
  --bg-elev: #151b24;
  --bg-card: #171e28;
  --bg-soft: #1d2633;
  --line: rgba(148, 175, 210, 0.14);
  --line-strong: rgba(196, 92, 38, 0.4);
  --text: #e8eef6;
  --muted: #93a0b4;
  --accent: #d06a35;
  --accent-bright: #e88955;
  --accent-dim: #9a4a1d;
  --ink: #f0d2bc;
  --orange: #e0a23a;
  --red: #e15b5b;
  --pink: #d48ab0;
  --gray: #7b8798;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --font: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 480px at 0% 0%, rgba(208, 106, 53, 0.16), transparent 55%),
    radial-gradient(800px 420px at 100% 0%, rgba(70, 100, 140, 0.14), transparent 50%),
    linear-gradient(180deg, #121821 0%, var(--bg) 45%, #090c11 100%);
  background-attachment: fixed;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 175, 210, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 175, 210, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 78%);
  z-index: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) 28px 12px;
  backdrop-filter: blur(14px);
  background: rgba(12, 16, 22, 0.88);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.brand-text {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: 0.2s ease;
  font-size: 14px;
  font-weight: 600;
}
.nav a:hover {
  color: var(--text);
  background: rgba(148, 175, 210, 0.08);
}
.nav a.active {
  color: #fff8f3;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  font-weight: 700;
  box-shadow: none;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 18px;
  flex: 0 0 auto;
}

.app {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 28px auto 48px;
  animation: fadeUp 0.45s ease both;
}

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 0 16px calc(40px + var(--safe-bottom));
  line-height: 1.6;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-head {
  margin-bottom: 22px;
}
.page-head h1 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}
.stack { display: grid; gap: 18px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border-top: 3px solid rgba(196, 92, 38, 0.55);
}
.card h2, .card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--ink);
}
.card .hint {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.gene-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.gene-slot {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 22px;
  text-transform: uppercase;
  outline: none;
  transition: 0.15s ease;
}
.gene-slot:focus {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.2);
}
.gene-slot.Y, .chip.Y, .pill.Y { background: rgba(46, 160, 90, 0.18); color: #8ee0a8; border-color: rgba(46, 160, 90, 0.45); }
.gene-slot.G, .chip.G, .pill.G { background: rgba(45, 150, 140, 0.18); color: #7ed4cb; border-color: rgba(45, 150, 140, 0.45); }
.gene-slot.H, .chip.H, .pill.H { background: rgba(224, 162, 58, 0.16); color: #f0c56e; border-color: rgba(224, 162, 58, 0.45); }
.gene-slot.W, .chip.W, .pill.W { background: rgba(225, 91, 91, 0.16); color: #f3a0a0; border-color: rgba(225, 91, 91, 0.45); }
.gene-slot.X, .chip.X, .pill.X { background: rgba(212, 138, 176, 0.14); color: #e8b0ce; border-color: rgba(212, 138, 176, 0.4); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.chip b {
  font-family: var(--mono);
  font-size: 13px;
}

.score-panel {
  text-align: center;
  padding: 10px 0 4px;
}
.score-value {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}
.score-value.bad { color: #fb923c; }
.score-value.mid { color: #fbbf24; }
.score-value.good { color: #8ee0a8; }
.score-value.perfect { color: #a8f0bc; }
.score-grade {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 700;
}
.score-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}
.bar {
  width: min(360px, 100%);
  height: 10px;
  margin: 18px auto 14px;
  border-radius: 999px;
  background: #0a0e14;
  overflow: hidden;
  border: 1px solid var(--line);
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent-bright));
  transition: width 0.35s ease;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.stat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
}
.stat strong {
  display: block;
  font-size: 24px;
  font-family: var(--mono);
  margin-bottom: 2px;
}
.stat span {
  color: var(--muted);
  font-size: 12px;
}

.tips {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tips li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(148, 175, 210, 0.06);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}
.tips li::before {
  content: "✓";
  color: var(--accent-bright);
  font-weight: 800;
  margin-top: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-weight: 600;
  transition: 0.18s ease;
}
.btn:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: #fff8f3;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(196, 92, 38, 0.22);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; }
.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.field {
  display: grid;
  gap: 8px;
}
.field label {
  color: var(--muted);
  font-size: 13px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.18);
}
.textarea { min-height: 120px; resize: vertical; font-family: var(--mono); }

.cross-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 480px;
  margin: 0 auto 18px;
}
.cell {
  min-height: 108px;
  border-radius: 12px;
  border: 1px dashed rgba(148, 175, 210, 0.22);
  background: rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 12px 8px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.cell.active {
  border-style: solid;
  border-color: var(--line-strong);
  background: rgba(208, 106, 53, 0.1);
  color: var(--text);
}
.cell.center {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(208, 106, 53, 0.25);
}
.mini-genes {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.cell .mini-genes {
  margin: 0;
  gap: 3px;
  padding: 0 2px;
}
.cell .pill {
  width: clamp(18px, 18%, 24px);
  height: 22px;
  min-width: 0;
  flex: 1 1 0;
  max-width: 24px;
  font-size: 11px;
  line-height: 1;
}
.pill {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  background: var(--bg);
  flex: 0 0 auto;
  line-height: 1;
  box-sizing: border-box;
}

.plant-list { display: grid; gap: 12px; }
.plant-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.plant-row.no-action { grid-template-columns: 88px 1fr; }
.plant-row .name { font-size: 13px; color: var(--muted); }
.path-seed-list { display: grid; gap: 8px; }
.path-seed-row {
  display: grid;
  grid-template-columns: 36px max-content auto;
  gap: 8px;
  align-items: center;
  justify-content: start;
  padding: 10px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.path-seed-row .gene-row {
  gap: 6px;
  justify-content: flex-start;
  flex-wrap: nowrap;
}
.path-seed-row .gene-slot {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 16px;
}
.path-seed-row .idx {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.path-seed-row .meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  text-align: left;
}
.result-box {
  margin-top: 16px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(196, 92, 38, 0.08);
  text-align: center;
}
.result-box .label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}
.target-seq {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.target-seq .mini-genes {
  margin-top: 0;
  gap: 10px;
}
.target-seq .pill {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 22px;
}
.target-seq .seq-text {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.path-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.05fr);
  gap: 18px;
  align-items: start;
}
.seed-pick-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}
.seed-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
}
.seed-pick input { accent-color: var(--accent); width: 16px; height: 16px; }
.seed-pick .meta { margin-left: auto; color: var(--muted); font-size: 12px; }
.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
}
.empty .icon {
  font-size: 42px;
  opacity: 0.35;
  margin-bottom: 8px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.toolbar .grow { flex: 1; min-width: 180px; }

.seed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.seed-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  padding: 16px;
  display: grid;
  gap: 12px;
}
.seed-card .top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}
.seed-card .title {
  font-weight: 700;
  font-size: 15px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(196, 92, 38, 0.14);
  color: var(--accent-bright);
  border: 1px solid rgba(196, 92, 38, 0.28);
}
.badge.bad { background: rgba(225, 91, 91, 0.16); color: #f3a0a0; border-color: rgba(225, 91, 91, 0.4); }
.badge.mid { background: rgba(224, 162, 58, 0.16); color: #f0c56e; border-color: rgba(224, 162, 58, 0.4); }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.tab {
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
  font-size: 13px;
  font-weight: 600;
}
.tab.active {
  color: #fff8f3;
  background: var(--accent);
  border-color: transparent;
}

.stage {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  margin-bottom: 12px;
}
.stage .tag {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(196, 92, 38, 0.16);
  color: var(--accent-bright);
}
.stage p { margin: 0; color: #d5deea; font-size: 14px; line-height: 1.65; }

.grad-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(196, 92, 38, 0.1);
  border: 1px solid var(--line-strong);
}
.grad-bar .desc { color: var(--muted); font-size: 13px; }

.rule-list {
  display: grid;
  gap: 12px;
}
.rule {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.rule h4 { margin: 0 0 6px; font-size: 15px; }
.rule p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.rule code {
  font-family: var(--mono);
  color: var(--accent-bright);
  background: rgba(196, 92, 38, 0.1);
  padding: 1px 6px;
  border-radius: 6px;
}

.path-steps {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.step {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.step .idx {
  color: var(--accent-bright);
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 6px;
}

.path-overview .overview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.timeline {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.timeline-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.timeline-card {
  min-width: 118px;
  padding: 12px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  text-align: center;
}
.timeline-tag {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.timeline-arrow {
  color: var(--accent-bright);
  font-weight: 800;
  font-size: 18px;
}

.round-list { display: grid; gap: 10px; margin-top: 8px; }
.round-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  overflow: hidden;
}
.round-item.open {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px rgba(196, 92, 38, 0.12);
}
.round-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  text-align: left;
  color: inherit;
}
.round-head:hover { background: rgba(196, 92, 38, 0.05); }
.round-head .idx {
  color: var(--accent-bright);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}
.round-side {
  display: flex;
  align-items: center;
  gap: 10px;
}
.round-side .chev {
  color: var(--muted);
  font-size: 14px;
}
.round-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.place-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 14px;
  align-items: start;
}
.place-board { max-width: none; margin: 0; }
.place-empty { min-height: 108px; opacity: 0.25; }
.place-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.2;
  flex: 0 0 auto;
}
.place-seq {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.place-seq.big { font-size: 20px; margin: 8px 0; }
.place-note {
  font-size: 10px;
  color: var(--accent-bright);
  line-height: 1.25;
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}
.cell .place-seq { display: none; }
.place-expect {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(196, 92, 38, 0.08);
  text-align: center;
}
.place-tips {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: #d5deea;
}
.place-tips > div {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
}

.need-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.need-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(224, 162, 58, 0.55);
  background: rgba(224, 162, 58, 0.08);
}
.need-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.need-head .btn { margin-left: auto; }
.stage-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}
.stage-chip {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #c5d0de;
  background: rgba(0, 0, 0, 0.22);
}
.stage-chip.ok {
  border-color: rgba(46, 160, 90, 0.55);
  color: #8ee0a8;
  background: rgba(46, 160, 90, 0.12);
}
.cell.need-seed {
  border-color: rgba(224, 162, 58, 0.65) !important;
  box-shadow: inset 0 0 0 1px rgba(224, 162, 58, 0.25);
}
.cell.need-seed .place-label { color: #f0c56e; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal {
  width: min(520px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 8px; }
.modal .actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 8px;
}
.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #1e3a5f;
  border: 1px solid rgba(30, 58, 95, 0.35);
  color: #f4f7fb;
  box-shadow: var(--shadow);
  animation: fadeUp 0.25s ease both;
}

@media (max-width: 900px) {
  .grid-2,
  .path-layout,
  .place-layout { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .plant-row,
  .plant-row.no-action { grid-template-columns: 1fr; }
  .plant-row .name { margin-bottom: 4px; }
  .nav-toggle { display: grid; place-items: center; }
  .nav {
    display: none;
    position: absolute;
    top: calc(64px + var(--safe-top));
    right: 12px;
    left: 12px;
    flex-direction: column;
    padding: 10px;
    border-radius: 14px;
    background: rgba(18, 24, 33, 0.98);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .nav a {
    width: 100%;
    justify-content: center;
    padding: 12px 14px;
    min-height: 44px;
  }
  .nav.open { display: flex; }
  .topbar { position: sticky; }
  .app { width: min(1120px, calc(100% - 20px)); margin: 18px auto 36px; }
  .card { padding: 16px; }
  .cross-board { gap: 8px; max-width: 100%; }
  .cell { min-height: 96px; padding: 10px 6px; }
  .path-seed-row {
    grid-template-columns: 28px 1fr auto;
    gap: 6px;
    padding: 10px 8px;
  }
  .btn-row { gap: 8px; }
  .btn { min-height: 42px; }
  .timeline { gap: 6px; }
  .timeline-card { min-width: 104px; }
  .round-head { padding: 12px; flex-wrap: wrap; }
  .round-side { width: 100%; justify-content: space-between; }
}

@media (max-width: 560px) {
  .topbar { padding: calc(10px + var(--safe-top)) 12px 10px; gap: 8px; }
  .brand { gap: 8px; flex: 1; min-width: 0; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-text { font-size: 16px; }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 26px; }
  .page-head p { font-size: 13px; }
  .gene-slot { width: 42px; height: 42px; font-size: 16px; border-radius: 10px; }
  .gene-row { gap: 6px; }
  .path-seed-row .gene-slot { width: 36px; height: 36px; font-size: 14px; }
  .path-seed-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .path-seed-row .idx { order: -1; }
  .path-seed-row .btn { width: 100%; }
  .score-value { font-size: 48px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .legend { gap: 6px; }
  .chip { font-size: 11px; padding: 5px 8px; }
  .target-seq .pill { width: 38px; height: 38px; font-size: 18px; }
  .target-seq .seq-text { font-size: 22px; }
  .cell { min-height: 88px; font-size: 12px; }
  .cell .pill { height: 20px; font-size: 10px; }
  .place-label { font-size: 11px; }
  .btn-row { width: 100%; }
  .btn-row .btn { flex: 1 1 auto; }
  .footer { font-size: 12px; padding-left: 12px; padding-right: 12px; }
  .toast-host { right: 10px; left: 10px; bottom: calc(12px + var(--safe-bottom)); }
  .toast { max-width: none; min-width: 0; }
  .modal { padding: 16px; border-radius: 14px; }
  .tabs { gap: 6px; }
  .tab { padding: 10px 12px; font-size: 12px; }
}



