/* ==========================================================================
   实验工作台样式
   ========================================================================== */

body {
  background: #f4f1ea;
}

/* ---------- 顶部栏 ---------- */

.labbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 8px 20px;
  background: #11161e;
  color: #e9e3d6;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.labbar a {
  text-decoration: none;
}

.lab-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.lab-brand svg {
  width: 30px;
  height: 30px;
}

.lab-brand span {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: #b9a887;
}

.lab-title {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  min-width: 0;
}

.lab-title b {
  font-size: 13.5px;
  font-weight: 650;
  color: #f2e9d7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lab-title span {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: #8f8778;
}

.labbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  flex: 0 0 auto;
}

.lab-stat {
  text-align: right;
  line-height: 1.25;
}

.lab-stat span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #8f8778;
}

.lab-stat b {
  display: block;
  color: #e9d3a6;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.labbar .btn-ghost {
  border-color: rgba(255, 255, 255, 0.18);
  color: #e9e3d6;
}

.labbar .btn-ghost:hover {
  border-color: #d6b273;
  background: rgba(214, 178, 115, 0.12);
}

.labbar .btn-dark {
  background: #d6b273;
  color: #221a0d;
}

.labbar .btn-dark:hover {
  background: #e3c288;
}

/* ---------- 三栏骨架 ---------- */

.lab-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr) 304px;
  height: calc(100vh - 64px);
  overflow: hidden;
}

.lab-nav {
  overflow-y: auto;
  padding: 18px 14px 48px;
  border-right: 1px solid var(--line);
  background: #fbf8f1;
  scrollbar-width: thin;
}

.lab-main {
  overflow-y: auto;
  padding: 28px 34px 64px;
  scrollbar-width: thin;
}

.lab-rail {
  overflow-y: auto;
  padding: 18px 16px 48px;
  border-left: 1px solid var(--line);
  background: #fbf8f1;
  scrollbar-width: thin;
}

/* ---------- 左侧步骤导航 ---------- */

.nav-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #8d8474;
  font-size: 10.5px;
  letter-spacing: 0.14em;
}

.nav-head b {
  color: #6f5426;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.nav-progress {
  height: 3px;
  margin-bottom: 14px;
  border-radius: 2px;
  background: #e8e0d0;
  overflow: hidden;
}

.nav-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #d6b273, #b8894a);
  transition: width 0.3s ease;
}

.stage-group {
  margin-bottom: 6px;
}

.stage-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 8px 5px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: #9a8f7b;
}

.stage-label b {
  color: #6f5426;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.stage-label em {
  font-style: normal;
  color: #b3a88f;
  font-variant-numeric: tabular-nums;
}

.navstep {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #3d434b;
  font-size: 12.3px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.navstep:hover {
  background: #f2e9d8;
}

.navstep .num {
  flex: 0 0 auto;
  width: 18px;
  color: #a8977a;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.navstep .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.navstep .pts {
  flex: 0 0 auto;
  color: #b3a88f;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.navstep.done .pts {
  color: #2c7a5b;
  font-weight: 650;
}

.navstep.done .nm {
  color: #2f3a33;
}

.navstep.active {
  background: #11161e;
  color: #f5efe2;
}

.navstep.active .num {
  color: #d6b273;
}

.navstep.active .pts {
  color: #d6b273;
}

.navstep.active .nm {
  color: #f5efe2;
}

/* ---------- 主区域 ---------- */

.step-crumb {
  margin: 0;
  color: #8d8474;
  font-size: 10.5px;
  letter-spacing: 0.14em;
}

.step-title {
  margin: 8px 0 12px;
  font-family: var(--serif);
  font-size: clamp(21px, 2.3vw, 29px);
  font-weight: 700;
  line-height: 1.35;
  color: #1c2128;
}

.step-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}

.meta-pill {
  padding: 4px 11px;
  border-radius: 999px;
  background: #f0e8d8;
  color: #6f5426;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.meta-pill.ok {
  background: #e3efe8;
  color: #2c6a4f;
}

.panel {
  margin-bottom: 14px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fffdf9;
  box-shadow: 0 6px 18px rgba(15, 19, 25, 0.04);
}

.panel h4 {
  margin: 0 0 9px;
  color: #8a6531;
  font-size: 10.5px;
  letter-spacing: 0.14em;
}

.goal {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  color: #2d323a;
}

.ops {
  margin: 0;
  padding-left: 17px;
  color: #4c525b;
  font-size: 13px;
  line-height: 1.9;
}

.ops li {
  margin-bottom: 3px;
}

.ops li::marker {
  color: #b8894a;
}

/* ---------- 表单 ---------- */

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

.fld {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.fld.wide {
  grid-column: 1 / -1;
}

.fld > label,
.fld > .fld-label {
  color: #4b515a;
  font-size: 12.3px;
  font-weight: 650;
}

.fld input[type="text"],
.fld input[type="number"],
.fld select,
.fld textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: #fffdf9;
  font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fld textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.7;
}

.fld input:focus,
.fld select:focus,
.fld textarea:focus {
  outline: none;
  border-color: #c9a97a;
  box-shadow: 0 0 0 3px rgba(214, 178, 115, 0.18);
}

.fld .hint {
  color: #98907f;
  font-size: 11px;
  line-height: 1.6;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-row input[type="range"] {
  flex: 1;
  accent-color: #b8894a;
}

.range-out {
  min-width: 54px;
  color: #6f5426;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: #fffdf9;
  color: #4b515a;
  font-size: 12.3px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.check input {
  margin: 0;
  accent-color: #b8894a;
}

.check.on {
  border-color: #c9a97a;
  background: #f7edd9;
  color: #6f5426;
}

/* ---------- 操作按钮 ---------- */

.step-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.step-actions .spacer {
  flex: 1;
}

/* ---------- 评分反馈 ---------- */

.result {
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid #d5e4da;
  border-radius: 14px;
  background: #f3f8f4;
}

.result.warn {
  border-color: #ecd9b8;
  background: #fdf7ea;
}

.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.result-score {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
  color: #2c6a4f;
}

.result.warn .result-score {
  color: #a9761f;
}

.result-total {
  color: #7d8a80;
  font-size: 12px;
}

.result-title {
  margin-left: auto;
  color: #2c6a4f;
  font-size: 12px;
  font-weight: 650;
}

.result.warn .result-title {
  color: #a9761f;
}

.result-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 20px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: #4c525b;
}

.result-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.result-list .dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2c7a5b;
}

.result-list .dot.mid {
  background: #c99a3f;
}

.result-list .dot.low {
  background: #b25a5a;
}

.result-list .ideal {
  margin-left: auto;
  color: #8d8474;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-note {
  margin: 12px 0 0;
  color: #6f7a72;
  font-size: 11.5px;
  line-height: 1.7;
}

/* ---------- AI 建议 ---------- */

.ai-note {
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px dashed #d9c9a8;
  border-radius: 10px;
  background: #fbf6ea;
  color: #6d6250;
  font-size: 12.3px;
}

.ai-note summary {
  color: #8a6531;
  font-weight: 650;
  cursor: pointer;
}

.ai-note p {
  margin: 8px 0 0;
  line-height: 1.75;
}

/* ---------- 右栏 ---------- */

.rail-card {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf9;
}

.rail-card h4 {
  margin: 0 0 10px;
  color: #8a6531;
  font-size: 10.5px;
  letter-spacing: 0.14em;
}

#radar {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  margin: 0 auto;
}

.radar-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 10px;
  margin-top: 10px;
  color: #6a7079;
  font-size: 11px;
}

.radar-legend span {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.radar-legend b {
  color: #2b3037;
  font-variant-numeric: tabular-nums;
}

.sim-empty {
  color: #98907f;
  font-size: 11.5px;
  line-height: 1.7;
}

.sim-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed #eee6d7;
  color: #6a7079;
  font-size: 11.5px;
}

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

.sim-row b {
  color: #2b3037;
  font-variant-numeric: tabular-nums;
}

.sim-rate {
  margin: 4px 0 10px;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1;
  color: #a44242;
}

.sim-rate.good {
  color: #2c7a5b;
}

.sim-rate span {
  font-family: var(--sans);
  font-size: 11px;
  color: #8d8474;
}

.hint-card p {
  margin: 0;
  color: #6a7079;
  font-size: 11.5px;
  line-height: 1.8;
}

/* ---------- 响应式 ---------- */

@media (max-width: 1180px) {
  .lab-shell {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .lab-rail {
    display: none;
  }
}

@media (max-width: 860px) {
  .labbar {
    position: static;
    gap: 12px;
  }

  .lab-title b {
    white-space: normal;
  }

  .lab-stat:nth-child(2) {
    display: none;
  }

  .lab-shell {
    display: block;
    height: auto;
    overflow: visible;
  }

  .lab-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    max-height: 30vh;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .lab-main {
    padding: 20px 16px 48px;
  }

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

  .result-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .lab-stat {
    display: none;
  }

  .labbar {
    flex-wrap: wrap;
    padding: 9px 12px;
  }

  .labbar-right {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}
