:root {
  color-scheme: dark;
  --ink: #edf4f8;
  --muted: #9baebc;
  --line: #2a3946;
  --blue: #74e8cd;
  --surface: #121c25;
  --control: #172631;
  --bright: #abf8e5;
  --alert: #ffb0a5;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: #0a1118;
}
body { background: radial-gradient(ellipse at 50% -12%, #182a38 0, transparent 42rem), #0a1118; }
::selection { color: #081718; background: var(--bright); }
:focus-visible { outline-color: #a4f8e6; }
.top { background: #0d161fea; border-color: #273643; }
.top-inner { min-height: 68px; }
.brand { letter-spacing: .015em; }
.mark { border: 1px solid #77e6ce85; border-radius: 8px; background: #132c30; color: #a8f6e2; }
.top nav a { color: #b7c8d4; }
.top nav a:hover { color: var(--bright); }

.hero {
  min-height: 184px;
  padding: 28px 34px;
  margin: 24px 0 12px;
  border-radius: 14px;
  border-color: #365662;
  background: linear-gradient(107deg, #162a35 4%, #14232f 50%, #142330 100%);
}
.hero::before {
  inset: 0 0 0 36%;
  background:
    linear-gradient(90deg, #152733, transparent 46%),
    repeating-linear-gradient(0deg, transparent 0 23px, #8dd9d213 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, #8dd9d213 23px 24px);
}
.hero::after {
  right: 144px;
  top: -72px;
  width: 310px;
  height: 310px;
  border-color: #92e8d93d;
  box-shadow: 0 0 0 23px #89ead210, 0 0 0 55px #89ead209, inset 0 0 0 40px #89ead208;
}
.eyebrow { color: #8ee9d4; font-weight: 700; }
.eyebrow span { background: #77ebd0; box-shadow: 0 0 10px #77ebd04d; }
h1 { font-size: clamp(2rem, 4.4vw, 3.25rem); letter-spacing: -.035em; }
.hero-copy > p:last-child { color: #b6c8d4; }
.hero-rules { gap: 5px; min-width: 175px; border-radius: 10px; border-color: #5bb9a45c; background: #0b141edc; color: #adbdc8; }
.hero-rules strong { color: var(--bright); }
.hero-rules strong span { color: #9db6bc; }
.notice { background: #101e28; border-color: #263944; color: #b1c8d6; padding: 9px 13px; margin-bottom: 14px; }
.notice strong { color: #dbe6eb; }

.layout { gap: 14px; }
.panel { background: var(--surface); border-color: #2a3b49; border-radius: 12px; box-shadow: 0 10px 32px #0003; }
.panel-head { margin-bottom: 14px; }
.fit-total { border: 1px solid #315a55; color: #a1eed9; background: #132b2b; }
.fit-total.bad { border-color: #86564d; color: var(--alert); background: #37241f; }
.outline, .add { background: var(--control); border-color: #3a5262; color: #cce0e9; }
.outline:hover, .add:hover { background: #233b47; border-color: #5d9d9c; color: #eafffb; text-decoration: none; }
.quiet { color: #aec3d0; }
.quiet:hover { background: #23333f; }
.primary { border-color: #87edda; background: #8cebd6; color: #09211f; }
.primary:hover { border-color: #c3fff0; background: #b0f7e6; }
.primary:disabled { color: #09211f; }
.bench-nav, .code-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.bench-nav button { padding: 6px 9px; }
.workbench { padding: 12px; background: #0f1922; border: 1px solid #263a48; border-radius: 10px; scroll-margin-top: 14px; }
.workbench-drop, .gun-summary { border-color: #3a5667; background: linear-gradient(125deg,#192a35,#152330); color: #daedf0; }
.workbench-drop { min-height: 84px; }
.workbench-drop:hover { background: #223b46; }
.gun-summary { padding: 8px; }
.bench-gun .item-art, .item-art { background-color: #23323b; }
.item-art.has-image { background-color: #2a3b43; background-image: none; }
.item-art:not(.has-image) img { opacity: 0; }
.gun-summary .bench-controls { gap: 6px; }
.part-slot, .equip-slot { background: #172731; color: #eff6f8; border-color: #3d5868; }
.part-slot:hover, .equip-slot:hover { background: #223944; }
.equip-slot.equipped { background: #1a303b; border-color: #4a8384; }
.slot-label, .slot-extra { color: #9ab5c1; }
.slot-plus { color: #8adfcb; }
.fitting-grid { background: #0e1922; border-color: #293f4c; }
.figure { border-color: #76664f; }
.operator-rack {
  display: grid;
  grid-template-columns: minmax(118px,.72fr) repeat(2,minmax(0,1fr));
  grid-template-areas: "figure armor armor" "figure weapons weapons" "carry carry quick";
  gap: 7px;
  padding: 8px;
  border: 1px solid #304351;
  border-radius: 9px;
  background: #0e1821;
}
.operator-rack .figure { min-height: 270px; border-style: solid; }
.operator-rack .figure-portrait { bottom: 15%; height: 75%; }
.rack-armor { grid-area: armor; }
.rack-weapons { grid-area: weapons; }
.rack-carry { grid-area: carry; }
.rack-quick { grid-area: quick; }
.rack-section { min-width: 0; padding: 7px; border: 1px solid #2f414f; border-radius: 6px; background: #13212b; }
.rack-label { margin-bottom: 5px; font-size: .875rem; font-weight: 700; color: #aec4d0; }
.rack-slots { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.rack-weapons .rack-slots { grid-template-columns: repeat(5,minmax(0,1fr)); }
.operator-rack .equip-slot {
  grid-area: auto;
  position: relative;
  display: grid;
  grid-template-columns: minmax(32px,.75fr) minmax(0,1fr);
  grid-template-rows: auto 1fr;
  align-content: start;
  align-items: center;
  gap: 3px 5px;
  min-height: 59px;
  padding: 5px 6px 6px;
  border-radius: 4px;
  border: 1px solid #3a5060;
  background: repeating-linear-gradient(135deg,#1c2a35 0 6px,#1a2832 6px 12px);
}
.operator-rack .equip-slot:hover { border-color: #6ab7a8; }
.operator-rack .equip-slot.equipped { border-color: #53796f; background: #1c333d; }
.operator-rack .equip-slot.drag-over { border-color: #affbe8; background: #24483f; }
.operator-rack .equip-slot .item-art { display: block; width: 100%; max-width: 93px; }
.operator-rack .equip-slot .slot-label { grid-column: 1/-1; }
.operator-rack .equip-slot .slot-plus { justify-self: center; }
.operator-rack .equip-slot .slot-copy strong { font-size: .8125rem; }
.rack-weapons .equip-slot { grid-column: span 2; min-height: 75px; }
.rack-weapons .equip-slot[data-slot=sidearm] { grid-column: span 1; }
.rack-weapons .equip-slot[data-slot=sidearm],.rack-quick .equip-slot { grid-template-columns: minmax(0,1fr); }
.rack-weapons .equip-slot[data-slot=sidearm] .item-art,.rack-quick .equip-slot .item-art { width: min(100%,45px); }
.rack-quick .equip-slot { grid-template-rows: auto auto 1fr; }
.operator-rack + .fit-hint { margin: 9px 0 12px; }
.is-dragging .equip-slot,.is-dragging .part-slot { border-color: #76bcb0; }
.equip-slot.drag-over,.part-box.drag-over,.workbench-drop.drag-over,.gun-summary.drag-over {
  outline-color: #adffec;
  background: #24483f;
}

.search { background: #0f1921; border-color: #344756; color: #a3bdc9; }
.search input::placeholder { color: #9bafbc; }
select, .field input, .field textarea, .selected input {
  color: var(--ink);
  background: #0f1921;
  border-color: #3a5060;
}
.subfilters, .library-info { color: #a4b8c4; }
.tabs { scrollbar-width: thin; gap: 5px; }
.tabs button { border: 1px solid #2d414e; background: #182731; color: #b2c7d2; padding-inline: 9px; }
.tabs button:hover { border-color: #4d817f; }
.tabs button[aria-pressed=true] { background: #233f41; border-color: #548c83; color: #b7f6e6; }
.item { background: #16242e; border-color: #2a3c49; padding: 10px; }
.item:hover { background: #1b2d37; border-color: #43626a; }
.meta, .tag, .price-basis { color: #a1b6c4; }
.value-edit { background: #20373b; color: #9ce8d7; }
.targeting { background: #223c3d; color: #c6f5e9; }
.add { border-color: #426977; }

.budget { background: linear-gradient(130deg, #152e31, #15252f 90%); border-color: #31565b; }
.total, .remaining { color: #a9c3ca; }
.total strong { color: #d8fff4; }
.status { color: #9eead3; }
.status.bad, .violations { color: var(--alert); }
.track { background: #2c474e; }
.track div { background: #7cf0d3; }
.track div.bad { background: #ff9d8d; }
.selected { border-color: #273a46; }
dialog { background: #15232e; border-color: #3d5867; box-shadow: 0 24px 90px #0008; }
dialog::backdrop { background: #040a11ba; }
.field textarea { width: 100%; min-height: 88px; padding: 9px; border: 1px solid #3a5060; border-radius: 7px; resize: vertical; font: inherit; }
.code-build { display: grid; gap: 12px; }
.code-build p { margin: 0; }
.code-guide { margin: 12px 0; line-height: 1.55; }
.code-guide a { display: inline-block; margin-top: 5px; }
.code-feedback { min-height: 1.4em; margin-top: 8px; color: var(--alert); font-size: .875rem; }
.code-availability { margin-top: 12px; }
.code-availability summary { color: #b4cbd0; cursor: pointer; font-size: .875rem; }
.code-result-list { display: grid; gap: 7px; max-height: min(56vh,530px); overflow: auto; padding: 2px; }
.code-result {
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 8px;
  border: 1px solid #344b57;
  border-radius: 6px;
  background: #182a35;
}
.code-result code { color: #9be9d5; overflow-wrap:anywhere; }
.code-result .outline { padding: 5px 8px; }
.code-parts { margin: 0; padding-left: 22px; color: #b0c4ce; max-height: 28vh; overflow:auto; }
#toast { background: #1e383c; border: 1px solid #447a76; color: #edfffa; }

.ad-space {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 20px;
  border: 1px dashed #5d5c48;
  border-radius: 11px;
  background: linear-gradient(110deg,#222724,#151f27 60%);
}
.ad-space h2 { font-size: 1.125rem; color: #f3deb4; }
.ad-space p { margin: 5px 0 0; color: #adbfc8; font-size: .875rem; }
.ad-space .outline { background: #2c312b; border-color: #74664d; color: #f4dfba; }
.ad-space .outline:hover { background: #3a3e31; }
.creator { align-items: center; padding: 19px 0 24px; }
.creator nav { display: flex; flex-wrap: wrap; gap: 8px; }
.creator nav a { padding: 7px 11px; border: 1px solid #344f5c; border-radius: 7px; color: #c1dbde; }
.creator nav a:hover { border-color: #7cdfcd; }
@media (max-width: 760px) {
  .hero { min-height: 0; padding: 21px; }
  .hero::after { right: -30px; }
  .creator { flex-direction: row; }
}
@media (max-width: 460px) {
  .hero { margin-top: 14px; }
  .hero-rules { gap: 8px; }
  .panel { padding: 13px; }
  .panel-head { margin-bottom: 10px; }
  .workbench { padding: 9px; }
  .ad-space { padding: 13px; }
  .operator-rack {
    grid-template-columns: minmax(82px,1fr) repeat(2,minmax(0,1fr));
    grid-template-areas:"figure armor armor" "figure carry carry" "weapons weapons weapons" "quick quick quick";
  }
  .operator-rack .figure { min-height: 176px; }
  .operator-rack .figure-portrait { bottom: 23%; height: 65%; }
  .operator-rack .equip-slot { grid-template-columns: minmax(0,1fr); min-height: 55px; }
  .operator-rack .equip-slot .item-art { width: min(100%,53px); }
}
