/* 物迹本 v2 · 风格 C：暗黑数码装备雷达（0 外部字体，双视口零横向溢出） */
*, *::before, *::after { box-sizing: border-box; }

:root {
  color-scheme: dark;
  --bg: #0B0F14;
  --panel: #121821;
  --panel-2: #18212E;
  --panel-3: #0E141D;
  --line: #233042;
  --line-hi: #324660;
  --ink: #E6EDF3;
  --muted: #8B98A9;
  --green: #22C55E;
  --green-bg: rgba(34, 197, 94, 0.13);
  --amber: #F59E0B;
  --amber-bg: rgba(245, 158, 11, 0.15);
  --red: #EF4444;
  --red-bg: rgba(239, 68, 68, 0.16);
  --cyan: #38BDF8;
  --cyan-bg: rgba(56, 189, 248, 0.14);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.08), transparent 40%),
    radial-gradient(circle at 86% 6%, rgba(239, 68, 68, 0.06), transparent 36%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cyan { color: var(--cyan); }
.amber { color: #FDE68A; }
.red { color: #F87171; }
.muted { color: var(--muted); }

/* 顶部 HUD */
.hud-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(15, 21, 30, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 11px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hud-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px var(--green);
  flex-shrink: 0;
}
.hud-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.hud-tag {
  font-size: 11px;
  color: var(--cyan);
  background: var(--cyan-bg);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.hud-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* 按钮体系 */
.h-btn {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.h-btn:hover { border-color: var(--cyan); }
.h-btn:active { transform: translateY(1px); }
.h-btn.sm { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.h-btn.green { background: var(--green-bg); border-color: var(--green); color: #86EFAC; }
.h-btn.amber { background: var(--amber-bg); border-color: var(--amber); color: #FDE68A; }
.h-btn.cyan { background: var(--cyan-bg); border-color: var(--cyan); color: #BAE6FD; }
.h-btn.active-btn { border-color: var(--cyan); color: #BAE6FD; }
.h-btn.danger-btn { background: var(--red-bg); border-color: rgba(239, 68, 68, 0.6); color: #FCA5A5; }
.h-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* 主容器与双栏布局 */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 20px 56px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.col-main, .col-side { min-width: 0; }

.box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.box-title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.box-sub { font-size: 11.5px; color: var(--muted); }

/* 遥测大数 + SVG 雷达 */
.telemetry {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.tele-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}
.tele-card span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.tele-card strong {
  display: block;
  font-size: 22px;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.radar-split {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.radar-scope-box {
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
}
.radar-scope-svg {
  display: block;
  width: 100%;
  height: auto;
}
.radar-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.r-row { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.r-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  gap: 8px;
}
.r-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.r-name small { color: var(--muted); }
.r-val { font-weight: 700; flex-shrink: 0; }
.r-track {
  height: 7px;
  border-radius: 4px;
  background: #1C2635;
  overflow: hidden;
}
.r-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.2s ease;
}

/* 筛选条 */
.toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.chip.active {
  border-color: var(--cyan);
  background: var(--cyan-bg);
  color: #E0F2FE;
}
.sort-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sort-wrap select {
  min-height: 28px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-3);
  color: var(--ink);
  font-size: 12px;
}

/* 装备卡片 */
.gear-list { display: flex; flex-direction: column; gap: 10px; }
.gear-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-width: 0;
}
.gear-card.danger { border-left: 3px solid var(--red); }
.gear-card.warn { border-left: 3px solid var(--amber); }
.gear-card.safe { border-left: 3px solid var(--green); }
.gear-card.muted { border-left: 3px solid #64748B; opacity: 0.88; }

.gear-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.gear-head-main { min-width: 0; }
.gear-name { font-weight: 700; font-size: 14.5px; word-break: break-word; }
.gear-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.pill.red { background: var(--red-bg); color: #FCA5A5; }
.pill.amber { background: var(--amber-bg); color: #FDE68A; }
.pill.green { background: var(--green-bg); color: #86EFAC; }
.pill.muted { background: rgba(100, 116, 139, 0.22); color: #CBD5E1; }

.gear-nums {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}
.gear-nums div span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 1px; }
.gear-advice {
  font-size: 12px;
  color: #9FB0C4;
  margin-bottom: 10px;
}
.gear-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.inline-price {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.inline-price input {
  width: 96px;
  min-height: 30px;
  padding: 4px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--panel-3);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
}
.card-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* 展开抽屉：曲线 + 凭证 */
.gear-drawer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-hi);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.drawer-curve {
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.drawer-subhead {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 6px;
  gap: 8px;
}
.item-curve-svg { display: block; width: 100%; height: auto; }
.drawer-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.drawer-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* 右侧录入试算表单 */
.mini-action {
  border: 1px solid rgba(245, 158, 11, 0.5);
  background: var(--amber-bg);
  color: #FDE68A;
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.mini-action.unlocked {
  border-color: var(--cyan);
  background: var(--cyan-bg);
  color: #BAE6FD;
}
.sim-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.sim-f { min-width: 0; }
.sim-f.full { grid-column: 1 / -1; }
.sim-f label {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.sim-f input, .sim-f select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 38px;
  padding: 6px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-3);
  color: var(--ink);
  font-size: 13.5px;
}
.sim-f input:focus, .sim-f select:focus {
  outline: none;
  border-color: var(--cyan);
}
.opt-cred {
  margin-top: 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(11, 15, 20, 0.55);
}
.opt-cred summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.opt-cred[open] .sim-grid { margin-top: 10px; }

.sim-out {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}
.sim-metric span { display: block; font-size: 11px; color: var(--muted); }
.sim-metric strong { font-size: 14px; }
.sim-triage { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding-top: 4px; border-top: 1px solid rgba(255,255,255,0.05); }

/* 闲鱼挂单台 */
.liq-box textarea, .modal textarea {
  width: 100%;
  min-height: 136px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: #CBD5E1;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
}
.liq-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.liq-actions .h-btn { flex: 1; min-width: 140px; }

/* 模态框 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 80;
}
.modal-mask.open { display: flex; }
.modal {
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line-hi);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.modal-note { font-size: 12.5px; color: #CBD5E1; margin: 0 0 12px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.file-upload-btn { position: relative; overflow: hidden; }
.file-upload-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Paywall 样式 */
.free-banner {
  background: var(--green-bg);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #BBF7D0;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 12px;
}
.perks-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.perk-item {
  display: flex;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.perk-idx { color: var(--amber); font-weight: 700; font-size: 13px; padding-top: 2px; }
.perk-item strong { display: block; font-size: 13px; margin-bottom: 2px; }
.perk-item p { margin: 0; font-size: 12px; color: var(--muted); }

.xhs-steps {
  background: var(--panel-3);
  border: 1px dashed var(--line-hi);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  font-size: 12.5px;
}
.xhs-steps strong { color: #FDE68A; display: block; margin-bottom: 6px; }
.xhs-steps p { margin: 0 0 6px; color: #CBD5E1; }
.xhs-steps p:last-child { margin-bottom: 0; color: var(--muted); }

.unlock-row { display: flex; gap: 8px; }
.unlock-row input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 6px 11px;
  border-radius: 6px;
  border: 1px solid var(--line-hi);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.04em;
}
.verify-msg { font-size: 12.5px; margin-top: 8px; min-height: 18px; }
.verify-msg.ok { color: #86EFAC; }
.verify-msg.err { color: #FCA5A5; }

.unlocked-box {
  background: var(--green-bg);
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 12px;
}
.unlocked-box p { margin: 0 0 10px; font-size: 13px; color: #DCFCE7; }

/* 30 款速选与防到手刀清单 */
.models-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.model-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.model-info { min-width: 0; }
.model-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.model-sub { font-size: 11.5px; color: var(--cyan); margin-top: 3px; }
.model-tip { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.mini-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--cyan-bg);
  color: #BAE6FD;
  white-space: nowrap;
}

.checklist-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  font-size: 12.5px;
  cursor: pointer;
}
.check-row.done { opacity: 0.65; border-color: rgba(34, 197, 94, 0.35); }
.check-row input { margin-top: 3px; flex-shrink: 0; accent-color: var(--green); }

.card-preview-wrap {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}
.empty-hint {
  text-align: center;
  color: var(--muted);
  padding: 20px 10px;
  font-size: 13px;
}

.foot-bar {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding-top: 8px;
}
.foot-bar button {
  background: none;
  border: none;
  color: var(--cyan);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  padding: 0 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: var(--green);
  color: #052E16;
  padding: 9px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  display: none;
  z-index: 120;
  max-width: calc(100vw - 24px);
  text-align: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}
.toast.show { display: block; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .radar-split { grid-template-columns: 1fr; }
  .radar-scope-box { max-width: 280px; margin: 0 auto; width: 100%; }
  .drawer-fields { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hud-bar { padding: 10px 12px; }
  .hud-tag { display: none; }
  .hud-actions { width: 100%; }
  .hud-actions .h-btn { flex: 1; padding: 6px 8px; font-size: 12px; }
  .wrap { padding: 12px 12px 48px; }
  .box { padding: 13px; }
  .telemetry { grid-template-columns: 1fr; }
  .gear-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sim-grid { grid-template-columns: 1fr; }
  .unlock-row { flex-direction: column; }
  .model-row { flex-direction: column; align-items: flex-start; }
  .model-row .h-btn { width: 100%; }
}
