/* =========================================================
   方案配置器
   ========================================================= */

.cfg-section {
  position: relative;
  padding-block: clamp(44px, 6vw, 76px);
}

.cfg-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    720px 440px at 88% 0%,
    rgba(242, 107, 33, 0.06),
    transparent 62%
  );
  pointer-events: none;
}

.cfg {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.cfg-top {
  position: relative;
  padding: 22px clamp(20px, 3vw, 34px) 0;
  border-bottom: 1px solid var(--line);
}

.cfg-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--bg-soft);
}

.cfg-progress i {
  display: block;
  width: 25%;
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-soft));
  transition: width 0.5s var(--ease);
}

.cfg-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.cfg-tab {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 10px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s;
}

.cfg-tab b {
  font-family: var(--font-en);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--line-strong);
  transition: color 0.25s;
}

.cfg-tab:hover {
  color: var(--ink);
}

.cfg-tab.is-active,
.cfg-tab.is-done {
  color: var(--ink);
  border-bottom-color: var(--orange);
}

.cfg-tab.is-active b,
.cfg-tab.is-done b {
  color: var(--orange);
}

.cfg-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 0;
  align-items: stretch;
}

.cfg-panels {
  padding: clamp(28px, 4vw, 46px);
  border-right: 1px solid var(--line);
}

.cfg-panel {
  display: none;
}

.cfg-panel.is-active {
  display: block;
  animation: cfgIn 0.4s var(--ease);
}

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

.cfg-step-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-en);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--orange-strong);
  text-transform: uppercase;
}

.cfg-step-label::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--orange);
}

.cfg-panel h2 {
  margin-top: 14px;
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
  letter-spacing: -0.01em;
}

.cfg-panel > p {
  margin-top: 10px;
  max-width: 620px;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--body);
}

/* Step 1 */
.cfg-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 26px;
}

.cfg-type {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 128px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s,
    background 0.25s;
}

.cfg-type:hover {
  border-color: rgba(242, 107, 33, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.cfg-type-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--navy-700);
  transition: background 0.25s, color 0.25s;
}

.cfg-type-icon svg {
  width: 20px;
  height: 20px;
}

.cfg-type strong {
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.4;
}

.cfg-type small {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted);
}

.cfg-type.is-selected {
  border-color: var(--orange);
  background: rgba(242, 107, 33, 0.035);
  box-shadow: 0 0 0 1px var(--orange), 0 18px 34px -28px rgba(242, 107, 33, 0.7);
}

.cfg-type.is-selected .cfg-type-icon {
  background: var(--orange);
  color: #fff;
}

.cfg-check {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: transparent;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.cfg-check svg {
  width: 11px;
  height: 11px;
}

.cfg-type.is-selected .cfg-check {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

/* Step 2 */
.cfg-area {
  margin-top: 30px;
  padding: 26px 26px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.cfg-area-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.cfg-area-head label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
}

.cfg-area-head output {
  font-family: var(--font-en);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
  color: var(--orange-strong);
  letter-spacing: -0.02em;
}

.cfg-area-head output small {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}

.cfg-range {
  width: 100%;
  height: 32px;
  margin-top: 18px;
  padding: 0;
  background: transparent;
  accent-color: var(--orange);
  cursor: pointer;
}

.cfg-range::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(
    to right,
    var(--orange) var(--fill, 25%),
    var(--line-strong) var(--fill, 25%)
  );
  border-radius: 99px;
}

.cfg-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7.5px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 1px var(--orange), 0 4px 10px rgba(0, 0, 0, 0.2);
}

.cfg-range::-moz-range-track {
  height: 3px;
  background: var(--line-strong);
  border-radius: 99px;
}

.cfg-range::-moz-range-progress {
  height: 3px;
  background: var(--orange);
  border-radius: 99px;
}

.cfg-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--orange);
}

.cfg-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-family: var(--font-en);
  font-size: 0.66rem;
  color: var(--muted);
}

.cfg-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.cfg-status button {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  text-align: left;
  font-size: 0.9rem;
  color: var(--body);
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}

.cfg-status button b {
  display: block;
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 3px;
}

.cfg-status button span {
  font-size: 0.72rem;
  color: var(--muted);
}

.cfg-status button:hover {
  border-color: rgba(242, 107, 33, 0.4);
}

.cfg-status button.is-selected {
  border-color: var(--orange);
  background: rgba(242, 107, 33, 0.04);
  color: var(--ink);
}

.cfg-status button.is-selected b {
  color: var(--orange-strong);
}

/* Step 3 */
.cfg-systems {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 26px;
}

.cfg-system {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.cfg-system:hover {
  border-color: rgba(242, 107, 33, 0.38);
}

.cfg-system input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cfg-system-box {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: transparent;
  flex: none;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.cfg-system-box svg {
  width: 13px;
  height: 13px;
}

.cfg-system strong {
  display: block;
  font-size: 0.88rem;
  color: var(--ink);
}

.cfg-system small {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--muted);
}

.cfg-system.is-selected {
  border-color: var(--orange);
  background: rgba(242, 107, 33, 0.035);
}

.cfg-system.is-selected .cfg-system-box {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.cfg-system-extra {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  color: var(--muted);
}

/* Step 4 */
.cfg-rec {
  margin-top: 24px;
  padding: 22px 24px;
  border: 1px solid rgba(242, 107, 33, 0.24);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(242, 107, 33, 0.055), transparent);
}

.cfg-rec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.cfg-rec-head span {
  font-family: var(--font-en);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--orange-strong);
  text-transform: uppercase;
}

.cfg-rec-head strong {
  font-size: 1.05rem;
  color: var(--ink);
}

.cfg-rec > p {
  margin-top: 9px;
  font-size: 0.84rem;
  line-height: 1.8;
  color: var(--body);
}

.cfg-rec-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.cfg-rec-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.cfg-rec-item strong {
  display: block;
  font-size: 0.8rem;
  color: var(--ink);
}

.cfg-rec-item span {
  display: block;
  margin-top: 4px;
  font-size: 0.7rem;
  line-height: 1.6;
  color: var(--muted);
}

.cfg-form {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.cfg-form .form-grid {
  margin-top: 0;
}

.cfg-form .field label {
  font-size: 0.76rem;
}

.cfg-form .field input {
  padding: 10px 12px;
  font-size: 0.84rem;
}

.cfg-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.cfg-form-note {
  font-size: 0.7rem;
  line-height: 1.6;
  color: var(--muted);
}

.cfg-success {
  display: none;
  margin-top: 20px;
  padding: 18px 20px;
  border-left: 3px solid var(--cyan);
  background: rgba(143, 185, 167, 0.08);
  font-size: 0.84rem;
  line-height: 1.8;
  color: var(--navy-700);
}

.cfg-success.is-visible {
  display: block;
}

.cfg-success strong {
  color: var(--ink);
}

.cfg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.cfg-hint {
  font-size: 0.72rem;
  color: var(--muted);
}

.cfg-footer-btns {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.cfg-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  border: 0;
  background: none;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
}

.cfg-back:hover {
  color: var(--ink);
}

.cfg-next[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

/* Sidebar */
.cfg-side {
  position: relative;
  padding: clamp(24px, 3vw, 34px);
  background:
    radial-gradient(420px 300px at 100% 0%, rgba(242, 107, 33, 0.12), transparent 62%),
    #16110d;
  color: #fff;
}

.cfg-side-card {
  position: sticky;
  top: 100px;
}

.cfg-side-kicker {
  font-family: var(--font-en);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: rgba(242, 107, 33, 0.8);
  text-transform: uppercase;
}

.cfg-side h3 {
  margin-top: 10px;
  font-size: 1.2rem;
}

.cfg-side dl {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
}

.cfg-side dl > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cfg-side dt {
  font-size: 0.72rem;
  color: rgba(232, 223, 213, 0.46);
}

.cfg-side dd {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-align: right;
}

.cfg-side-systems {
  margin-top: 20px;
}

.cfg-side-systems > span {
  display: block;
  font-size: 0.72rem;
  color: rgba(232, 223, 213, 0.46);
}

.cfg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
  min-height: 25px;
}

.cfg-chips span {
  padding: 3px 8px;
  border: 1px solid rgba(242, 107, 33, 0.25);
  border-radius: 2px;
  background: rgba(242, 107, 33, 0.09);
  font-size: 0.66rem;
  color: rgba(255, 210, 180, 0.9);
}

.cfg-side-ref {
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  font-family: var(--font-en);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  color: rgba(232, 223, 213, 0.46);
}

.cfg-side-ref strong {
  display: block;
  margin-top: 5px;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  color: #fff;
}

.cfg-side-call {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.76rem;
  color: rgba(232, 223, 213, 0.6);
}

.cfg-side-call strong {
  display: block;
  font-family: var(--font-en);
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  color: #fff;
}

.cfg-side-call svg {
  width: 18px;
  height: 18px;
  color: var(--orange);
  flex: none;
}

.cfg-side-note {
  margin-top: 18px;
  font-size: 0.66rem;
  line-height: 1.7;
  color: rgba(232, 223, 213, 0.36);
}

/* Responsive */
@media (max-width: 1024px) {
  .cfg-body {
    grid-template-columns: 1fr;
  }
  .cfg-panels {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .cfg-side {
    padding: 26px;
  }
  .cfg-side-card {
    position: static;
  }
  .cfg-side dl {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px;
  }
  .cfg-side dl > div {
    display: block;
    padding-bottom: 0;
    border-bottom: 0;
  }
  .cfg-side dd {
    margin-top: 4px;
    text-align: left;
  }
  .cfg-side-ref {
    display: inline-block;
    min-width: 220px;
  }
}

@media (max-width: 820px) {
  .cfg-types {
    grid-template-columns: repeat(2, 1fr);
  }
  .cfg-rec-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .cfg-tabs {
    gap: 0;
  }
  .cfg-tab {
    justify-content: center;
    padding: 10px 4px 12px;
    font-size: 0.7rem;
  }
  .cfg-tab b {
    display: none;
  }
  .cfg-panels {
    padding: 24px 18px;
  }
  .cfg-types {
    grid-template-columns: 1fr;
  }
  .cfg-type {
    min-height: 104px;
  }
  .cfg-systems {
    grid-template-columns: 1fr;
  }
  .cfg-status {
    grid-template-columns: 1fr;
  }
  .cfg-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .cfg-footer-btns {
    width: 100%;
    margin-left: 0;
    flex-direction: column-reverse;
  }
  .cfg-footer-btns .btn {
    width: 100%;
  }
  .cfg-area {
    padding: 20px 18px;
  }
  .cfg-area-head output {
    font-size: 1.35rem;
  }
  .cfg-side dl {
    grid-template-columns: 1fr;
  }
  .cfg-form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .cfg-form-actions .btn {
    width: 100%;
  }
}
