.gunsmith-page { width: min(1240px, 100%); margin: 0 auto; padding: 36px 24px 64px; }
.gunsmith-hero { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 22px; padding: 0 0 26px 18px; border-left: 4px solid var(--blue); }
.gunsmith-hero h1 { margin: 8px 0 8px; font-size: clamp(36px, 5vw, 60px); line-height: 1; letter-spacing: 0; }
.gunsmith-hero p:not(.eyebrow) { margin: 0; color: var(--muted-strong); font-size: 14px; line-height: 22px; }
.coverage-card { min-width: 180px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-rest); }
.coverage-card strong, .coverage-card span, .coverage-card small { display: block; }
.coverage-card strong { color: var(--blue-dark); font-size: 28px; line-height: 34px; }
.coverage-card span { margin-top: 2px; color: var(--text); font-size: 12px; font-weight: 700; }
.coverage-card small { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 16px; }
.data-note { display: flex; gap: 12px; margin-bottom: 18px; padding: 12px 16px; border-left: 3px solid var(--orange); border-radius: var(--radius-sm); background: var(--orange-soft); color: #80501c; font-size: 12px; line-height: 20px; }
.data-note strong { flex: none; color: #8b541b; }
.gunsmith-layout { display: grid; grid-template-columns: minmax(340px, 410px) minmax(0, 1fr); align-items: start; gap: 18px; }
.control-panel, .result-panel { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-rest); }
.control-panel { padding: 20px; }
.panel-head, .range-head, .result-top, .result-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head { margin-bottom: 18px; }
.strategy-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 18px; padding: 5px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface-muted); }
.strategy-option { display: grid; gap: 2px; min-width: 0; padding: 9px 10px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--muted-strong); text-align: left; cursor: pointer; }
.strategy-option strong { font-size: 12px; line-height: 17px; }
.strategy-option small { color: var(--muted); font-size: 10px; line-height: 15px; }
.strategy-option:hover, .strategy-option.is-active { border-color: #b7cdfc; background: var(--surface); color: var(--blue-dark); box-shadow: 0 2px 7px rgba(37, 99, 235, .08); }
.strategy-option.is-active small { color: var(--blue-dark); }
.panel-head h2, .result-panel h2 { margin: 4px 0 0; color: var(--text); font-size: 20px; line-height: 28px; }
.quiet-button { padding: 5px 0; border: 0; background: transparent; color: var(--blue-dark); font-size: 12px; }
.quiet-button:hover { color: var(--danger); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-grid label, .budget-block, .stat-panel { display: grid; gap: 7px; }
.field-label { color: var(--muted); font-size: 11px; line-height: 16px; }
.field-grid select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-control); background: var(--surface-input); color: var(--text); }
.weapon-combobox { position: relative; }
.weapon-combobox input[type=search] { width: 100%; min-height: 42px; padding: 8px 40px 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-control); background: var(--surface-input); color: var(--text); font-size: 15px; }
.weapon-combobox input[type=search]::placeholder { color: var(--muted); }
.weapon-combobox input[type=search]:focus { border-color: var(--blue); outline: 3px solid color-mix(in srgb, var(--blue) 18%, transparent); }
.weapon-toggle { position: absolute; top: 5px; right: 5px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted-strong); font-size: 21px; line-height: 28px; }
.weapon-toggle:hover, .weapon-toggle:focus-visible { background: var(--surface-muted); color: var(--blue-dark); }
.weapon-options { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; left: 0; max-height: 280px; overflow-y: auto; padding: 5px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); box-shadow: 0 14px 30px rgba(19, 36, 58, .16); }
.weapon-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 38px; padding: 8px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.weapon-option:hover, .weapon-option.is-active { background: var(--blue-soft); color: var(--blue-dark); }
.weapon-option strong { font-size: 13px; font-weight: 750; }
.weapon-option small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.weapon-option-empty { padding: 12px 10px; color: var(--muted); font-size: 11px; line-height: 18px; }
.weapon-hint { display: block; min-height: 16px; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 16px; }
.budget-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.range-head output { color: var(--orange); font-size: 18px; font-weight: 800; line-height: 24px; }
.range-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; line-height: 14px; }
input[type=range] { width: 100%; accent-color: var(--blue); }
.stat-panel { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.range-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 16px; }
.stat-order { color: var(--muted); font-size: 10px; white-space: nowrap; }
.stat-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 34px 32px; align-items: center; gap: 8px; min-height: 38px; }
.stat-row.is-unmet label, .stat-row.is-unmet output { color: var(--danger); }
.stat-row label { color: var(--muted-strong); font-size: 12px; }
.stat-row output { color: var(--text); font-size: 13px; font-weight: 800; text-align: right; }
.lock-button { width: 28px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-muted); color: var(--muted); font-size: 14px; }
.lock-button.is-locked { border-color: #b7cdfc; background: var(--blue-soft); color: var(--blue-dark); }
.lock-button.is-unmet { border-color: #f0c1a2; background: var(--orange-soft); color: var(--danger); }
.primary-button { width: 100%; min-height: 46px; margin-top: 20px; padding: 10px 16px; border: 0; border-radius: var(--radius-control); background: var(--blue); color: #fff; font-size: 13px; font-weight: 800; }
.primary-button:hover { background: var(--blue-dark); }
.result-panel { min-height: 526px; padding: 22px; }
.result-placeholder { display: grid; place-items: center; min-height: 480px; padding: 30px; color: var(--muted); text-align: center; }
.placeholder-mark { color: var(--blue); font-size: 44px; line-height: 1; }
.result-placeholder h2 { margin-top: 18px; }
.result-placeholder p { max-width: 330px; margin: 8px 0 0; font-size: 12px; line-height: 20px; }
.result-top { align-items: start; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.result-top h2 { max-width: 490px; font-size: 24px; }
.result-weapon-name { margin-top: 6px !important; color: #0d1b2a !important; font-size: clamp(30px, 4vw, 42px) !important; line-height: 44px !important; }
.result-plan-label { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 18px; }
.result-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.result-meta span { padding: 4px 7px; border-radius: var(--radius-sm); background: var(--surface-muted); }
.result-meta strong { color: var(--orange); font-size: 21px; line-height: 26px; }
.verdict { flex: none; padding: 7px 10px; border: 1px solid #b9dec7; border-radius: var(--radius-sm); background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 800; }
.verdict.is-infeasible { border-color: #f0c1a2; background: var(--orange-soft); color: #9a5712; }
.code-result { margin-top: 18px; }
.code-result .code-line { margin-top: 7px; }
.encoder-note { display: grid; gap: 4px; margin-top: 18px; padding: 12px 14px; border: 1px solid #f0c1a2; border-radius: var(--radius-sm); background: var(--orange-soft); color: #80501c; font-size: 11px; line-height: 18px; }
.locked-warning { display: grid; gap: 3px; margin-top: 16px; padding: 11px 13px; border-left: 3px solid var(--danger); border-radius: var(--radius-sm); background: #fff0ee; color: #8d342c; font-size: 11px; line-height: 18px; }
.locked-warning strong { color: var(--danger); }
.encoder-note strong { color: #9a5712; }
.copy-plan-button { justify-self: start; margin-top: 4px; background: #fff; }
.accessory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.accessory-item { display: grid; gap: 2px; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-muted); }
.accessory-item span { color: var(--muted); font-size: 10px; line-height: 16px; }
.accessory-item strong { color: var(--text); font-size: 12px; line-height: 18px; }
.stats-result { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.stat-result { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-muted); }
.stat-result span, .stat-result strong { display: block; }
.stat-result span { color: var(--muted); font-size: 10px; line-height: 16px; }
.stat-result strong { margin-top: 3px; color: var(--text); font-size: 20px; line-height: 26px; }
.stat-bar { height: 4px; margin-top: 9px; overflow: hidden; border-radius: 4px; background: #dbe2ea; }
.stat-bar i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.result-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.result-section h3 { margin: 0; color: var(--text); font-size: 13px; line-height: 20px; }
.suggestions { display: grid; gap: 6px; margin-top: 9px; }
.suggestion { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--orange-soft); color: #80501c; font-size: 11px; line-height: 18px; }
.alternative-list { display: grid; gap: 8px; margin-top: 9px; }
.alternative { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.alternative summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 10px; cursor: pointer; list-style: none; }
.alternative summary::-webkit-details-marker { display: none; }
.alternative summary::after { grid-column: 1 / -1; color: var(--muted); content: '展开查看配件'; font-size: 10px; line-height: 14px; }
.alternative[open] summary::after { content: '收起配件'; }
.alternative strong { display: block; color: var(--text); font-size: 12px; line-height: 18px; }
.alternative small { color: var(--muted); font-size: 10px; line-height: 16px; }
.alternative-price { color: var(--orange); font-size: 12px; font-weight: 800; white-space: nowrap; }
.alternative-detail { padding: 0 10px 10px; border-top: 1px solid var(--border); }
.alternative-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding-top: 10px; }
.alternative-stats span { color: var(--muted); font-size: 10px; line-height: 16px; }
.alternative-stats b { color: var(--text); font-size: 11px; }
.alternative-parts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.alternative-part, .alternative-empty { padding: 4px 6px; border-radius: 4px; background: var(--surface-muted); color: var(--muted-strong); font-size: 10px; line-height: 15px; }
.alternative-part b { margin-right: 4px; color: var(--muted); font-weight: 600; }
.alternative-code { grid-column: 1 / -1; overflow: hidden; color: var(--muted); font: 10px/16px Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.result-footnote { margin-top: 18px; color: var(--muted); font-size: 10px; line-height: 16px; }
.error-box { display: grid; place-items: center; min-height: 470px; padding: 28px; color: var(--muted); text-align: center; }
.error-box strong { color: var(--text); }
@media (max-width: 860px) { .gunsmith-layout { grid-template-columns: 1fr; } .result-panel { min-height: 0; } .result-placeholder { min-height: 300px; } }
@media (max-width: 640px) { .gunsmith-page { padding: 24px 16px 48px; } .gunsmith-hero { display: block; padding-left: 12px; } .coverage-card { margin-top: 18px; } .data-note { display: block; } .data-note strong { display: block; margin-bottom: 4px; } .field-grid { grid-template-columns: 1fr; } .stat-order { display: none; } .control-panel, .result-panel { padding: 16px; } .stats-result, .accessory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .result-top { display: block; } .result-weapon-name { font-size: 34px !important; line-height: 38px !important; } .verdict { display: inline-block; margin-top: 10px; } .alternative-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .weapon-options { max-height: 240px; } }

/* gunsmith phase7: keep the working surface compact and put the decision first */
.gunsmith-page { padding-top: 24px; }
.gunsmith-hero { margin-bottom: 14px; padding-bottom: 18px; }
.gunsmith-hero h1 { font-size: clamp(34px, 4vw, 48px); }
.gunsmith-hero p:not(.eyebrow) { font-size: 13px; line-height: 20px; }
.hero-copy { min-width: 0; }
.coverage-card { min-width: 176px; padding: 11px 14px; }
.coverage-card strong { font-size: 26px; line-height: 30px; }
.coverage-card span { font-size: 11px; font-weight: 800; }
.data-note { align-items: center; gap: 10px; margin-bottom: 14px; padding: 9px 12px; border: 1px solid #f0d8b5; border-left: 3px solid var(--orange); font-size: 11px; }
.data-note-status { margin-left: auto; flex: none; padding: 3px 7px; border: 1px solid #e8c997; border-radius: 4px; color: #8b541b; font-size: 10px; line-height: 15px; }
.gunsmith-layout { grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); gap: 14px; }
.control-panel { padding: 18px; }
.config-step { position: relative; }
.config-step + .config-step { margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--border); }
.step-heading { display: flex; align-items: center; gap: 9px; min-width: 0; margin-bottom: 10px; }
.step-heading > div { min-width: 0; }
.step-heading strong, .step-heading small { display: block; }
.step-heading strong { color: var(--text); font-size: 12px; line-height: 18px; }
.step-heading small { margin-top: 1px; color: var(--muted); font-size: 10px; line-height: 15px; }
.step-index { display: grid; place-items: center; width: 25px; height: 25px; flex: none; border-radius: 6px; background: var(--blue-soft); color: var(--blue-dark); font: 800 10px/1 Consolas, monospace; }
.field-grid { grid-template-columns: minmax(0, 1.35fr) minmax(112px, .65fr); gap: 10px; }
.field-grid label { min-width: 0; }
.field-grid select { min-height: 42px; font-size: 13px; }
.weapon-combobox input[type=search] { min-height: 42px; font-size: 14px; font-weight: 650; }
.budget-block { margin-top: 0; }
.budget-block .step-heading { margin-bottom: 7px; }
.budget-block .step-heading output { margin-left: auto; color: var(--orange); font-size: 20px; font-weight: 850; line-height: 24px; }
.stat-panel .step-heading { align-items: flex-start; }
.stat-row + .stat-row { border-top: 1px solid var(--border); }
.stat-row label { font-size: 11px; }
.primary-button { min-height: 46px; margin-top: 17px; }
.result-panel { min-height: 500px; padding: 20px; }
.result-placeholder { min-height: 458px; }
.placeholder-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--blue-soft); font-size: 30px; }
.result-weapon-name { max-width: 520px; margin-top: 4px !important; font-size: clamp(30px, 4vw, 42px) !important; line-height: 44px !important; }
.result-plan-label { margin-top: 5px; font-size: 11px; }
.result-meta { margin-top: 10px; font-size: 10px; }
.result-meta strong { font-size: 22px; line-height: 27px; }
.verdict { padding: 6px 9px; font-size: 10px; }
.accessory-item { padding: 9px 10px; }
.accessory-item strong { font-size: 11px; }
.stat-result { padding: 10px; }
.stat-result strong { font-size: 19px; }
@media (max-width: 640px) {
  .gunsmith-page { padding: 18px 14px 42px; }
  .gunsmith-hero { margin-bottom: 11px; padding-left: 11px; }
  .gunsmith-hero h1 { font-size: 34px; line-height: 38px; }
  .gunsmith-hero p:not(.eyebrow) { font-size: 12px; line-height: 18px; }
  .coverage-card { display: inline-block; min-width: 0; margin-top: 13px; padding: 8px 11px; }
  .coverage-card strong { display: inline; margin-right: 5px; font-size: 21px; }
  .coverage-card span { display: inline; font-size: 10px; }
  .coverage-card small { margin-top: 2px; }
  .data-note { align-items: flex-start; flex-wrap: wrap; gap: 4px 8px; padding: 8px 10px; }
  .data-note span:not(.data-note-status) { flex: 1 1 180px; }
  .data-note-status { margin-left: 0; }
  .control-panel, .result-panel { padding: 14px; }
  .field-grid { grid-template-columns: 1fr; gap: 8px; }
  .mode-picker { display: none !important; }
  .stat-row { grid-template-columns: 68px minmax(0, 1fr) 32px 30px; gap: 6px; }
  .stat-row label { font-size: 10px; }
  .primary-button { min-height: 48px; margin-top: 15px; }
  .result-placeholder { min-height: 250px; padding: 20px; }
  .result-top { display: block; }
  .result-weapon-name { font-size: 34px !important; line-height: 38px !important; }
  .stats-result, .accessory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Keep the result panel on its own full-width row after the compact overrides above. */
@media (max-width: 860px) {
  .gunsmith-layout { grid-template-columns: minmax(0, 1fr); width: 100%; }
  .control-panel, .result-panel { min-width: 0; width: 100%; }
}
