/* ♏ 天蝎特务 V2 — 三栏透明面板 + 星空背景 */

/* ===== Canvas 星空背景 ===== */
#starCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -1;
  pointer-events: none;
}

body {
  background: #080c14;
  overflow-x: hidden;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  background: rgba(10, 16, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(58, 155, 200, 0.15);
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-back {
  color: #6889a8;
  text-decoration: none;
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
}
.header-back:hover { color: #FFD100; }
.logo-mark {
  width: 4px; height: 28px;
  background: linear-gradient(180deg, #FFD100 0%, rgba(255,209,0,0.2) 100%);
}
.logo-text {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #FFD100;
  letter-spacing: 1px;
}
.logo-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #6889a8;
  letter-spacing: 2px;
}
.beta-tag {
  font-size: 10px;
  padding: 1px 6px;
  background: rgba(58, 155, 200, 0.2);
  color: #3a9bc8;
  border: 1px solid rgba(58, 155, 200, 0.3);
  vertical-align: middle;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 1px;
}
.header-link {
  color: #8aaccc;
  text-decoration: none;
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
}
.header-link:hover { color: #FFD100; }

/* ===== Main ===== */
.main {
  min-height: calc(100vh - 52px);
  position: relative;
}

/* ===== Ship Selector (reuse existing styles from theme.css + overrides) ===== */
.ship-selector {
  padding: 20px 40px;
  min-height: calc(100vh - 120px);
}
.selector-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
}
.selector-sidebar {
  width: auto;
  flex-shrink: 0;
  background: rgba(12, 20, 32, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(58, 155, 200, 0.12);
  padding: 16px;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  max-height: 600px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sb-title {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #b8d4f0;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(58, 155, 200, 0.15);
}
.sb-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}
.sb-act-btn {
  flex: 1;
  background: rgba(58, 155, 200, 0.08);
  border: 1px solid rgba(58, 155, 200, 0.2);
  color: #a4bedb;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Noto Sans SC', sans-serif;
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}
.sb-act-btn:hover { background: rgba(58, 155, 200, 0.15); color: #FFD100; }
.selector-main { flex: 1; }
.ship-search-wrap { position: relative; margin-bottom: 12px; }
.ship-search {
  width: 100%;
  box-sizing: border-box;
  background: rgba(12, 20, 32, 0.85);
  border: 1px solid rgba(58, 155, 200, 0.2);
  color: #fff;
  padding: 10px 14px;
  font-size: 15px;
  font-family: 'Noto Sans SC', sans-serif;
  outline: none;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.ship-search:focus { border-color: #FFD100; }
.ship-search-count {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #6889a8;
  font-family: 'JetBrains Mono', monospace;
}
.ship-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
/* 新三行筛选器 */
.ship-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(58,155,200,0.08);
}
.ship-filter-row:last-of-type { border-bottom: none; }
/* 种类行激活色：青色 */
#shipClassRow .sg-btn.active, #shipClassRow .sg-btn:hover {
  background: rgba(0,164,164,0.12); border-color: #00c8c8; color: #00e0e0;
}
/* 势力行激活色：紫色 */
#shipFactionRow .sg-btn.active, #shipFactionRow .sg-btn:hover {
  background: rgba(168,85,247,0.12); border-color: #a855f7; color: #c084fc;
}
.sg-btn {
  padding: 4px 10px;
  background: rgba(58, 155, 200, 0.06);
  border: 1px solid rgba(58, 155, 200, 0.15);
  color: #a4bedb;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Noto Sans SC', sans-serif;
  clip-path: polygon(3px 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%, 0 3px);
}
.sg-btn.active, .sg-btn:hover { background: rgba(255, 209, 0, 0.1); border-color: #FFD100; color: #FFD100; }
.ship-meta-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.ship-meta-btn {
  padding: 4px 12px;
  background: rgba(58, 155, 200, 0.06);
  border: 1px solid rgba(58, 155, 200, 0.15);
  color: #a4bedb;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Noto Sans SC', sans-serif;
}
.ship-meta-btn.active { background: rgba(255, 209, 0, 0.1); border-color: #FFD100; color: #FFD100; }
.ship-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
  max-height: 520px;
  overflow-y: auto;
}
.ship-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(12, 20, 32, 0.7);
  border: 1px solid rgba(58, 155, 200, 0.12);
  cursor: pointer;
  transition: all 0.15s;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  border-left: 3px solid transparent;
}
.ship-card:hover {
  background: rgba(58, 155, 200, 0.08);
  border-color: rgba(58, 155, 200, 0.25);
}
.ship-card:nth-child(6n+1) { border-left-color: rgba(255, 209, 0, 0.4); }
.ship-card:nth-child(6n+2) { border-left-color: rgba(58, 155, 200, 0.4); }
.ship-card:nth-child(6n+3) { border-left-color: rgba(61, 232, 154, 0.4); }
.ship-card:nth-child(6n+4) { border-left-color: rgba(168, 85, 247, 0.4); }
.ship-card-icon {
  width: 48px; height: 48px;
  object-fit: contain;
  border: 1px solid rgba(58, 155, 200, 0.15);
  flex-shrink: 0;
}
.ship-card-info { flex: 1; min-width: 0; }
.ship-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  font-family: 'Noto Sans SC', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ship-card-group {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #6889a8;
}
.ship-card-slots {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #a4bedb;
}
.ship-card-meta {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 6px;
  margin-right: 5px;
  vertical-align: middle;
  line-height: 18px;
}
.ship-meta-t2 { background: rgba(58, 155, 200, 0.15); color: #3a9bc8; border: 1px solid rgba(58, 155, 200, 0.3); }
.ship-meta-t3 { background: rgba(168, 85, 247, 0.15); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.3); }
.ship-meta-navy { background: rgba(58, 155, 200, 0.1); color: #7bc8ff; border: 1px solid rgba(123, 200, 255, 0.3); font-family: 'Noto Sans SC', sans-serif; }
.ship-meta-pirate { background: rgba(255, 170, 50, 0.12); color: #ffaa32; border: 1px solid rgba(255, 170, 50, 0.3); font-family: 'Noto Sans SC', sans-serif; }
.ship-card-price {
  float: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #FFD100;
  opacity: 0.7;
}

/* ===== Fit Workspace ===== */
.fit-workspace {
  padding: 0 16px 20px;
}

/* Ship Bar */
.fit-ship-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(12, 20, 32, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(58, 155, 200, 0.12);
  margin-bottom: 12px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.fit-ship-icon {
  width: 48px; height: 48px;
  object-fit: contain;
  border: 1px solid rgba(58, 155, 200, 0.2);
}
.fit-ship-info { flex: 1; min-width: 0; }
.fit-ship-name {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #FFD100;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fit-ship-group {
  font-size: 13px;
  color: #6889a8;
  font-family: 'Noto Sans SC', sans-serif;
}
.skill-level-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.skill-lv-label {
  font-size: 13px;
  color: #6889a8;
  font-family: 'Noto Sans SC', sans-serif;
  margin-right: 4px;
}
.skill-lv-btn {
  width: 28px; height: 28px;
  background: rgba(58, 155, 200, 0.08);
  border: 1px solid rgba(58, 155, 200, 0.2);
  color: #a4bedb;
  font-size: 13px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
}
.skill-lv-btn.active { background: rgba(255, 209, 0, 0.15); border-color: #FFD100; color: #FFD100; }
.fit-actions { display: flex; gap: 6px; flex-shrink: 0; }
.fit-act-btn {
  padding: 6px 10px;
  background: rgba(58, 155, 200, 0.08);
  border: 1px solid rgba(58, 155, 200, 0.2);
  color: #a4bedb;
  font-size: 14px;
  cursor: pointer;
  clip-path: polygon(3px 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%, 0 3px);
}
.fit-act-btn:hover { background: rgba(58, 155, 200, 0.15); color: #FFD100; }
.act-save { border-color: rgba(123, 200, 255, 0.3); }
.act-back { border-color: rgba(255, 85, 119, 0.3); color: #ff5577; }

/* ===== V2 三栏布局（默认） / 四栏（浏览列打开时） ===== */
.v2-layout {
  display: grid;
  grid-template-columns: 300px 1fr 280px;
  gap: 12px;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - 180px);
  transition: grid-template-columns 0.25s ease;
}
.v2-layout.browse-open {
  grid-template-columns: 500px 280px minmax(280px, 1fr) 260px;
}

/* 通用面板 */
.v2-panel {
  background: rgba(12, 20, 32, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(58, 155, 200, 0.12);
}
.v2-panel-slots {
  height: 100%;
  overflow-y: auto;
  border-left: 3px solid rgba(255, 209, 0, 0.4);
}
.v2-panel-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
  border-right: 3px solid rgba(58, 155, 200, 0.3);
}

/* 左栏: 槽位 */
.v2-col-slots {
  min-width: 0;
}

/* 中栏: 环形仪表盘 */
.v2-col-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}
.v2-ring-wrap {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 400/420;
  min-height: 320px;
}
.ring-svg {
  width: 100%;
  height: 100%;
}

/* PG/CPU 资源条 */
.v2-resource-bar {
  width: 100%;
  max-width: 400px;
  margin-top: 8px;
  padding: 12px 16px;
  background: rgba(12, 20, 32, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(58, 155, 200, 0.1);
}
.v2-res-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.v2-res-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #6889a8;
  width: 30px;
  flex-shrink: 0;
}
.v2-res-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #a4bedb;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 90px;
  text-align: right;
}
.v2-res-val b { color: #fff; }
.v2-res-row {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #6889a8;
  margin-top: 4px;
}
.v2-res-row b { color: #fff; }
.sp-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}
.sp-bar-inner {
  height: 100%;
  transition: width 0.3s;
}
.sp-bar-pg { background: rgba(168, 85, 247, 0.7); }
.sp-bar-cpu { background: rgba(59, 130, 246, 0.7); }

/* 右栏 */
.v2-col-stats {
  min-width: 0;
}

/* ===== 数据卡片 (共享) ===== */
.sg-card {
  background: rgba(10, 16, 26, 0.5);
  border: 1px solid rgba(58, 155, 200, 0.1);
  padding: 10px 12px;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.sg-label {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #b8d4f0;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sg-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  font-size: 13px;
  font-family: 'Noto Sans SC', sans-serif;
  color: #a4bedb;
}
.sg-row span:last-child {
  font-family: 'JetBrains Mono', monospace;
  color: #fff;
  font-weight: 500;
}
.sg-row.sg-total {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(58, 155, 200, 0.1);
}
.sg-row.sg-total span:last-child {
  font-size: 16px;
  color: #FFD100;
  font-weight: 700;
}
.sg-drone-add {
  font-size: 12px;
  color: #3a9bc8;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
}
.sg-drone-add:hover { color: #FFD100; }

/* ===== 防御抗性网格 ===== */
.resist-grid {
  display: grid;
  grid-template-columns: auto 1fr 1fr 1fr 1fr;
  gap: 2px 6px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 4px;
}
.resist-hdr { color: #6889a8; text-align: center; font-size: 12px; }
.resist-lbl { color: #a4bedb; font-size: 12px; }
.resist-val { text-align: center; padding: 1px 4px; font-size: 13px; }
.resist-bar { height: 3px; margin-top: 1px; }
.dmg-pattern-sel {
  background: rgba(10, 16, 26, 0.8);
  border: 1px solid rgba(58, 155, 200, 0.2);
  color: #a4bedb;
  font-size: 12px;
  font-family: 'Noto Sans SC', sans-serif;
  padding: 1px 6px;
  cursor: pointer;
  outline: none;
}
.dmg-pattern-sel option { background: #0a1020; }

/* ===== 槽位 ===== */
.slot-section { margin-bottom: 2px; }
.slot-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #b8d4f0;
  background: rgba(58, 155, 200, 0.06);
  border-bottom: 1px solid rgba(58, 155, 200, 0.1);
}
.slot-header.slot-hi { border-left: 3px solid rgba(255, 85, 119, 0.5); }
.slot-header.slot-med { border-left: 3px solid rgba(58, 155, 200, 0.5); }
.slot-header.slot-lo { border-left: 3px solid rgba(123, 200, 80, 0.5); }
.slot-header.slot-rig { border-left: 3px solid rgba(168, 85, 247, 0.5); }
.slot-count { color: #6889a8; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.slot-sub { font-size: 12px; color: #6889a8; font-family: 'JetBrains Mono', monospace; }
.slot-sub-full { color: rgba(255, 209, 0, 0.7); }

.slot-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 16px;
  border-bottom: 1px solid rgba(58, 155, 200, 0.04);
  transition: background 0.15s;
  cursor: default;
}
.slot-item:hover { background: rgba(58, 155, 200, 0.06); }
.slot-item-icon { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.slot-item-name {
  flex: 1;
  font-size: 13px;
  color: #fff;
  font-family: 'Noto Sans SC', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot-off { opacity: 0.35; }
.slot-ovl .slot-item-name { color: #ff8844; }
.slot-toggle, .slot-remove, .slot-ovl-btn {
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.slot-toggle:hover, .slot-remove:hover, .slot-ovl-btn:hover { opacity: 1; }
.ovl-on { opacity: 1; }

.slot-empty {
  padding: 6px 16px;
  font-size: 13px;
  color: #6889a8;
  cursor: pointer;
  border-bottom: 1px solid rgba(58, 155, 200, 0.04);
  transition: background 0.15s;
  font-family: 'Noto Sans SC', sans-serif;
}
.slot-empty:hover { background: rgba(58, 155, 200, 0.08); color: #a4bedb; }
.slot-empty-icon { color: #3a9bc8; margin-right: 4px; }
.slot-empty-hi { border-left: 2px solid rgba(255, 85, 119, 0.2); }
.slot-empty-med { border-left: 2px solid rgba(58, 155, 200, 0.2); }
.slot-empty-lo { border-left: 2px solid rgba(123, 200, 80, 0.2); }
.slot-empty-rig { border-left: 2px solid rgba(168, 85, 247, 0.2); }

/* 弹药行 */
.slot-charge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 28px;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(58, 155, 200, 0.03);
  background: rgba(255, 209, 0, 0.02);
}
.slot-charge:hover { background: rgba(255, 209, 0, 0.06); }
.slot-charge-icon { width: 18px; height: 18px; object-fit: contain; }
.slot-charge-name { flex: 1; color: #b8d4f0; font-family: 'Noto Sans SC', sans-serif; }
.slot-charge-dmg { color: #6889a8; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.slot-charge-clear { cursor: pointer; color: #ff5577; opacity: 0.5; font-size: 12px; }
.slot-charge-clear:hover { opacity: 1; }
.slot-charge-empty { color: #6889a8; }
.slot-charge-hint { color: #3a9bc8; font-family: 'Noto Sans SC', sans-serif; }

/* ===== 装备浏览列（双栏并排：左分类树 + 右装备列表） ===== */
.v2-col-browse {
  min-width: 0;
}
.v2-panel-browse {
  background: rgba(7, 14, 24, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(58, 155, 200, 0.18);
  border-right: 2px solid rgba(255, 209, 0, 0.2);
  height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.browse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(58, 155, 200, 0.15);
  flex-shrink: 0;
  gap: 8px;
}
.browse-title {
  font-size: 13px;
  font-weight: 700;
  color: #FFD100;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.browse-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
}
.browse-search-inline {
  flex: 1;
  max-width: 200px;
  height: 28px;
  background: rgba(58, 155, 200, 0.06);
  border: 1px solid rgba(58, 155, 200, 0.2);
  color: #fff;
  padding: 0 10px;
  font-size: 13px;
  font-family: 'Noto Sans SC', sans-serif;
  outline: none;
}
.browse-search-inline:focus { border-color: #FFD100; }
.browse-search-inline::placeholder { color: #6889a8; }
.browse-close {
  cursor: pointer;
  color: #6889a8;
  font-size: 16px;
  width: 22px; height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.browse-close:hover { color: #ff5577; }

/* 筛选行区域 */
.browse-filters {
  flex-shrink: 0;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(58, 155, 200, 0.1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(5, 12, 22, 0.5);
}
.browse-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.browse-filter-sep {
  width: 1px;
  height: 16px;
  background: rgba(58, 155, 200, 0.2);
  margin: 0 2px;
}
.browse-cat-tag {
  font-size: 12px;
  color: #FFD100;
  font-family: 'Noto Sans SC', sans-serif;
  padding: 2px 6px;
  background: rgba(255, 209, 0, 0.1);
  border: 1px solid rgba(255, 209, 0, 0.3);
}
.browse-cat-clear {
  font-size: 12px;
  color: #6889a8;
  cursor: pointer;
  padding: 2px 6px;
  border: 1px solid rgba(58, 155, 200, 0.2);
}
.browse-cat-clear:hover { color: #ff5577; border-color: #ff5577; }

/* 双栏主体 */
.browse-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* 左侧分类树 */
.browse-cattree {
  width: 160px;
  min-width: 160px;
  border-right: 1px solid rgba(58, 155, 200, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(4, 10, 18, 0.6);
}
.cattree-search-wrap {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(58, 155, 200, 0.08);
  flex-shrink: 0;
}
.cattree-search {
  width: 100%;
  background: rgba(58, 155, 200, 0.06);
  border: 1px solid rgba(58, 155, 200, 0.15);
  color: #fff;
  padding: 5px 8px;
  font-size: 12px;
  font-family: 'Noto Sans SC', sans-serif;
  outline: none;
}
.cattree-search:focus { border-color: #FFD100; }
.cattree-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.cattree-list::-webkit-scrollbar { width: 3px; }
.cattree-list::-webkit-scrollbar-thumb { background: rgba(58,155,200,0.3); }

/* 右侧装备列表 */
.browse-modlist {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.mod-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.mod-list::-webkit-scrollbar { width: 3px; }
.mod-list::-webkit-scrollbar-thumb { background: rgba(58,155,200,0.3); }
.cat-group {
  margin-bottom: 4px;
}
.cat-group-header {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #FFD100;
  background: rgba(255, 209, 0, 0.04);
  border-left: 3px solid rgba(255, 209, 0, 0.3);
  font-family: 'Noto Sans SC', sans-serif;
}
.cat-item {
  padding: 5px 10px 5px 18px;
  font-size: 13px;
  color: #a4bedb;
  cursor: pointer;
  border-bottom: 1px solid rgba(58, 155, 200, 0.04);
  font-family: 'Noto Sans SC', sans-serif;
}
.cat-item:hover { background: rgba(58, 155, 200, 0.08); color: #fff; }
.cat-item-count { color: #6889a8; font-family: 'JetBrains Mono', monospace; font-size: 12px; margin-left: 6px; }

/* Mod list in drawer */
.mod-back-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(58, 155, 200, 0.04);
  border-bottom: 1px solid rgba(58, 155, 200, 0.1);
  margin-bottom: 6px;
}
.mod-back-btn {
  cursor: pointer;
  color: #3a9bc8;
  font-size: 13px;
  font-family: 'Noto Sans SC', sans-serif;
}
.mod-back-btn:hover { color: #FFD100; }
.mod-back-group {
  flex: 1;
  font-size: 13px;
  color: #b8d4f0;
  font-family: 'Noto Sans SC', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mod-back-clear {
  cursor: pointer;
  color: #6889a8;
  font-size: 14px;
}
.mod-back-clear:hover { color: #ff5577; }
.mod-search-wrap { margin-bottom: 6px; }
.mod-search {
  width: 100%;
  box-sizing: border-box;
  background: rgba(58, 155, 200, 0.06);
  border: 1px solid rgba(58, 155, 200, 0.15);
  color: #fff;
  padding: 8px 12px;
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
  outline: none;
}
.mod-search:focus { border-color: #FFD100; }
.mod-filter, .mod-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 2px;
}
.mod-filter-btn, .mod-meta-filter, .mod-size-filter {
  padding: 3px 8px;
  background: rgba(58, 155, 200, 0.06);
  border: 1px solid rgba(58, 155, 200, 0.12);
  color: #a4bedb;
  font-size: 12px;
  cursor: pointer;
  font-family: 'Noto Sans SC', sans-serif;
}
.mod-filter-btn.active, .mod-meta-filter.active, .mod-size-filter.active {
  background: rgba(255, 209, 0, 0.1);
  border-color: rgba(255, 209, 0, 0.4);
  color: #FFD100;
}
.mod-meta-t1 { color: rgba(184,212,240,0.7); }
.mod-meta-t1.active { background: rgba(184,212,240,0.08); border-color: rgba(184,212,240,0.3); color: #b8d4f0; }
.mod-meta-t2.active { background: rgba(58, 155, 200, 0.15); border-color: #3a9bc8; color: #3a9bc8; }
.mod-meta-faction.active { background: rgba(123, 200, 80, 0.1); border-color: rgba(123, 200, 80, 0.5); color: #7bc850; }
.mod-meta-deadspace.active { background: rgba(168, 85, 247, 0.1); border-color: rgba(168, 85, 247, 0.5); color: #a855f7; }
.mod-meta-officer.active { background: rgba(255, 170, 50, 0.1); border-color: rgba(255, 170, 50, 0.5); color: #ffaa32; }
.mod-list {
  margin-top: 6px;
  max-height: none;
  overflow-y: auto;
}
.mod-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  cursor: pointer;
  border-bottom: 1px solid rgba(58, 155, 200, 0.04);
  transition: background 0.15s;
  font-family: 'Noto Sans SC', sans-serif;
}
.mod-item:hover { background: rgba(58, 155, 200, 0.08); }
.mod-item-icon { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.mod-item-name { flex: 1; font-size: 13px; color: #fff; }
.mod-item-zh { color: #b8d4f0; }
.mod-item-slot {
  font-size: 11px;
  padding: 1px 6px;
  font-family: 'JetBrains Mono', monospace;
}
.mod-item-fit { font-size:12px; color:rgba(104,137,168,0.8); font-family:var(--font-mono,monospace); margin-left:auto; white-space:nowrap; }

.mod-item-meta { font-size: 11px; color: #6889a8; font-family: 'JetBrains Mono', monospace; }

/* ===== 弹药选择弹窗 ===== */
.charge-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.charge-modal {
  background: rgba(10, 16, 26, 0.97);
  border: 1px solid rgba(58, 155, 200, 0.25);
  width: 400px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.charge-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(58, 155, 200, 0.15);
  font-size: 15px;
  font-weight: 700;
  color: #FFD100;
  font-family: 'Noto Sans SC', sans-serif;
}
.charge-modal-hint { font-size: 12px; color: #6889a8; font-weight: 400; }
.charge-modal-close { cursor: pointer; color: #6889a8; font-size: 18px; }
.charge-modal-close:hover { color: #ff5577; }
.charge-modal-search {
  margin: 8px 12px;
  padding: 8px 12px;
  background: rgba(58, 155, 200, 0.06);
  border: 1px solid rgba(58, 155, 200, 0.15);
  color: #fff;
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
  outline: none;
}
.charge-modal-search:focus { border-color: #FFD100; }
.charge-modal-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
}
.charge-modal-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-bottom: 1px solid rgba(58, 155, 200, 0.04);
  cursor: pointer;
  transition: background 0.15s;
}
.charge-modal-item:hover { background: rgba(58, 155, 200, 0.08); }
.charge-modal-icon { width: 28px; height: 28px; object-fit: contain; }
.charge-modal-info { flex: 1; }
.charge-modal-name { font-size: 13px; color: #fff; font-family: 'Noto Sans SC', sans-serif; }
.charge-modal-dmg { font-size: 12px; color: #6889a8; font-family: 'JetBrains Mono', monospace; }
.charge-modal-single {
  width: 22px; height: 22px;
  background: rgba(58, 155, 200, 0.08);
  border: 1px solid rgba(58, 155, 200, 0.2);
  color: #a4bedb;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}
.charge-modal-single:hover { color: #FFD100; border-color: #FFD100; }

/* ===== DPS 图表 ===== */
.dps-chart-wrap { margin-top: 8px; }
.dps-chart-canvas { width: 100%; height: 200px; }
.dps-chart-tooltip {
  position: fixed;
  background: rgba(10, 16, 26, 0.95);
  border: 1px solid rgba(58, 155, 200, 0.3);
  padding: 6px 10px;
  font-size: 12px;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  pointer-events: none;
  z-index: 500;
  white-space: nowrap;
}
.tgt-params { margin-bottom: 8px; }
.tgt-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-bottom: 4px;
}
.tgt-label { font-size: 12px; color: #6889a8; font-family: 'Noto Sans SC', sans-serif; }
.tgt-preset-btn {
  padding: 2px 8px;
  background: rgba(58, 155, 200, 0.06);
  border: 1px solid rgba(58, 155, 200, 0.15);
  color: #a4bedb;
  font-size: 12px;
  cursor: pointer;
  font-family: 'Noto Sans SC', sans-serif;
}
.tgt-preset-btn:hover { border-color: #FFD100; color: #FFD100; }
.tgt-inputs { display: flex; gap: 12px; }
.tgt-input-label { font-size: 12px; color: #6889a8; font-family: 'Noto Sans SC', sans-serif; }
.tgt-input {
  width: 60px;
  background: rgba(58, 155, 200, 0.06);
  border: 1px solid rgba(58, 155, 200, 0.15);
  color: #fff;
  padding: 2px 6px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
}

/* ===== 电容详情 ===== */
.cap-detail-list {
  font-size: 12px;
  color: #6889a8;
  font-family: 'Noto Sans SC', sans-serif;
}
.cap-detail-list .sg-row { font-size: 12px; padding: 1px 0; }

/* ===== 无人机 ===== */
.drone-list { margin-top: 4px; }

/* ===== 投射 ===== */
.proj-body { font-size: 13px; color: #a4bedb; }

/* ===== DPS 伤害类型条 ===== */
#dmgProfileBar {
  display: flex;
  height: 4px;
  margin-top: 6px;
  gap: 1px;
  overflow: hidden;
}

/* ===== 船体加成面板 ===== */
.ship-bonus-panel {
  background: rgba(10, 16, 26, 0.5);
  border: 1px solid rgba(58, 155, 200, 0.1);
  padding: 10px 12px;
  margin-top: 4px;
}
.bp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.bp-title {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #b8d4f0;
}
.bp-lv-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #FFD100;
  padding: 1px 8px;
  border: 1px solid rgba(255, 209, 0, 0.3);
}
.bp-body { font-size: 13px; color: #a4bedb; font-family: 'Noto Sans SC', sans-serif; }

/* ===== 植入体/对比面板 ===== */
.implant-panel-wrap, .compare-panel-wrap {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 250;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.implant-panel, .compare-panel {
  background: rgba(10, 16, 26, 0.97);
  border: 1px solid rgba(58, 155, 200, 0.25);
  width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.implant-header, .compare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(58, 155, 200, 0.15);
  font-size: 15px;
  font-weight: 700;
  color: #FFD100;
  font-family: 'Noto Sans SC', sans-serif;
}
.implant-close {
  cursor: pointer;
  color: #6889a8;
  font-size: 18px;
}
.implant-close:hover { color: #ff5577; }
.implant-body, .compare-body { padding: 12px 16px; }
.compare-actions { display: flex; gap: 8px; align-items: center; }
.imp-clear-btn {
  padding: 4px 10px;
  background: rgba(58, 155, 200, 0.08);
  border: 1px solid rgba(58, 155, 200, 0.2);
  color: #a4bedb;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Noto Sans SC', sans-serif;
}
.imp-clear-btn:hover { color: #FFD100; border-color: #FFD100; }

/* ===== Beta Banner ===== */
.beta-banner {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #a4bedb;
  font-size: 13px;
  font-family: 'Noto Sans SC', sans-serif;
  z-index: 50;
  white-space: nowrap;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.beta-banner-icon { font-size: 16px; }
.beta-banner-close { cursor: pointer; color: #6889a8; margin-left: 8px; font-size: 16px; }
.beta-banner-close:hover { color: #ff5577; }

/* ===== Footer ===== */
.sub-footer {
  background: rgba(10, 16, 26, 0.9);
  border-top: 1px solid rgba(58, 155, 200, 0.1);
  padding: 16px 24px;
}
.sub-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sub-footer-brand {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  color: rgba(58, 155, 200, 0.4);
  letter-spacing: 2px;
}
.sub-footer-brand .dim { opacity: 0.5; }
.sub-footer-nav { display: flex; gap: 16px; }
.sub-footer-nav a {
  color: #6889a8;
  text-decoration: none;
  font-size: 13px;
  font-family: 'Noto Sans SC', sans-serif;
}
.sub-footer-nav a:hover { color: #FFD100; }
.sub-footer-nav a.current { color: #FFD100; }
.sub-footer-icp { font-size: 12px; }
.sub-footer-icp a { color: #6889a8; text-decoration: none; }

/* ===== 加载中 ===== */
.fit-loading {
  padding: 12px;
  color: #6889a8;
  font-size: 14px;
  font-family: 'Noto Sans SC', sans-serif;
  text-align: center;
}

/* ===== 无人机选择器 (fitting.js 动态创建) ===== */
.drone-selector-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drone-selector {
  background: rgba(10,16,26,0.97);
  border: 1px solid rgba(58,155,200,0.25);
  width: 400px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  clip-path: polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px);
}

/* ===== saved fits list ===== */
.saved-fit-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(58, 155, 200, 0.06);
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 13px;
  color: #a4bedb;
}
.saved-fit-item:hover { background: rgba(58, 155, 200, 0.08); }
.saved-fit-icon { width: 32px; height: 32px; object-fit: contain; }
.saved-fit-name { flex: 1; color: #fff; }
.saved-fit-ship { color: #6889a8; font-size: 12px; }
.saved-fit-del { color: #ff5577; opacity: 0.5; cursor: pointer; font-size: 14px; }
.saved-fit-del:hover { opacity: 1; }

/* ===== 自定义滚动条 ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(58, 155, 200, 0.2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(58, 155, 200, 0.4); }

/* ===== EFT 导入弹窗 (fitting.js 动态创建) ===== */
.eft-import-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.eft-import-modal {
  background: rgba(10,16,26,0.97);
  border: 1px solid rgba(58,155,200,0.25);
  width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  clip-path: polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px);
}

/* ===== 响应式 ===== */
@media (max-width: 1400px) {
  .v2-layout {
    grid-template-columns: 280px 1fr 260px;
  }
  .v2-layout.browse-open {
    grid-template-columns: 460px 260px minmax(240px, 1fr) 240px;
  }
}
@media (max-width: 1200px) {
  .v2-layout {
    grid-template-columns: 260px 1fr 240px;
    gap: 8px;
  }
  .v2-layout.browse-open {
    grid-template-columns: 280px 240px minmax(200px, 1fr) 220px;
  }
}
@media (max-width: 960px) {
  .v2-layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .v2-layout.browse-open {
    grid-template-columns: 1fr;
  }
  .v2-col-center { order: -1; }
  .v2-panel-stats {
    max-height: none;
    border-right: none;
  }
  .v2-panel-slots {
    border-left: none;
  }
  .v2-panel-browse {
    height: auto;
    max-height: 50vh;
  }
}
