:root {
  color-scheme: dark;

  /* ============================================================
   * v2 星舰指挥台 设计令牌 (--hud-* 命名空间)
   * 视觉规范来源: v2root.md 附录F.2
   * 主色: 蓝色 #007aff (替代 v1 的绯红 #ff435b)
   * ============================================================ */

  /* 背景梯度 */
  --hud-deep-1: #0a0d18;
  --hud-deep-2: #0c1022;
  --hud-panel-bg: rgba(15, 20, 40, 0.6);
  --hud-nav-bg: rgba(10, 13, 24, 0.75);
  --hud-input-bg: rgba(0, 0, 0, 0.3);

  /* 主色（蓝色系）*/
  --hud-accent: #007aff;
  --hud-brand-a03: rgba(0, 122, 255, 0.03);
  --hud-brand-a06: rgba(0, 122, 255, 0.06);
  --hud-brand-a08: rgba(0, 122, 255, 0.08);
  --hud-brand-a10: rgba(0, 122, 255, 0.10);
  --hud-brand-a12: rgba(0, 122, 255, 0.12);
  --hud-brand-a14: rgba(0, 122, 255, 0.14);
  --hud-brand-a15: rgba(0, 122, 255, 0.15);
  --hud-brand-a20: rgba(0, 122, 255, 0.20);
  --hud-brand-a25: rgba(0, 122, 255, 0.25);
  --hud-brand-a30: rgba(0, 122, 255, 0.30);
  --hud-brand-a35: rgba(0, 122, 255, 0.35);
  --hud-brand-a40: rgba(0, 122, 255, 0.40);

  /* 语义色 */
  --hud-gold: #ff9500;
  --hud-gold-a12: rgba(255, 149, 0, 0.12);
  --hud-gold-a15: rgba(255, 149, 0, 0.15);
  --hud-gold-a25: rgba(255, 149, 0, 0.25);
  --hud-gold-a45: rgba(255, 149, 0, 0.45);
  --hud-error: #ff3b30;
  --hud-error-a12: rgba(255, 59, 48, 0.12);
  --hud-error-a15: rgba(255, 59, 48, 0.15);
  --hud-error-a20: rgba(255, 59, 48, 0.20);
  --hud-success: #34c759;
  --hud-success-a12: rgba(52, 199, 89, 0.12);
  --hud-success-a15: rgba(52, 199, 89, 0.15);
  --hud-success-a20: rgba(52, 199, 89, 0.20);

  /* 文字层级（从亮到暗）*/
  --text-primary: #e8ecf4;
  --text-secondary: #a0a8b8;
  --text-tertiary: #6b7280;
  --text-muted: #4a5060;

  /* 圆角 */
  --radius-card: 8px;
  --radius-sm: 4px;
  --radius-pill: 999px;

  /* 面板间距 */
  --panel-padding: 20px 24px;
  --panel-padding-compact: 12px 16px;
  --panel-padding-spacious: 32px;
  --gap-section: 24px;
  --gap-panel: 16px;
  --gap-tight: 8px;

  /* 字体 */
  --font-display: 'Orbitron', sans-serif;
  --font-ui: 'DM Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-cjk: 'DM Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', 'Source Han Sans CN', 'Noto Sans CJK SC', sans-serif;

  /* ============================================================
   * 向后兼容别名: 将 v1 旧变量映射到 v2 新变量
   * 确保现有 CSS 不破坏，渐进迁移
   * ============================================================ */
  --bg: var(--hud-deep-1);
  --grid-line: var(--hud-brand-a03);
  --panel: var(--hud-panel-bg);
  --panel-bg: var(--hud-panel-bg);
  --shadow-panel: 0 18px 48px rgba(0, 0, 0, 0.28);
  --panel-2: rgba(15, 20, 40, 0.8);
  --panel-border: var(--hud-brand-a12);
  --line: var(--hud-brand-a10);
  --line-red: var(--hud-brand-a30);
  --accent: var(--hud-accent);
  --accent-glow: var(--hud-brand-a40);
  --accent-hover: var(--hud-brand-a15);
  --red: var(--hud-error);
  --red-2: #c42b25;
  --cyan: #5ac8fa;
  --gold: var(--hud-gold);
  --text: var(--text-primary);
  --soft: var(--text-secondary);
  --muted: var(--text-tertiary);
  --ok: var(--hud-success);
}

/* 曙光玩家交易所：独立于游戏市场订单，所有价格都标记为玩家意向或本站参考。 */
.exchange-shell{display:grid;gap:16px;max-width:1500px;margin:0 auto 40px}.exchange-hero{display:flex;align-items:center;justify-content:space-between;gap:16px}.exchange-hero-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.exchange-verified-character{color:#5ee7ad;border:1px solid rgba(53,220,152,.4);background:rgba(53,220,152,.08);padding:9px 13px;border-radius:999px;font-weight:700}.exchange-safety-note{display:flex;gap:14px;align-items:flex-start;padding:16px 18px;border:1px solid rgba(53,168,255,.3);background:linear-gradient(120deg,rgba(19,48,83,.7),rgba(12,18,35,.72));border-radius:14px}.exchange-safety-note strong{flex:0 0 auto;color:#8cd4ff}.exchange-safety-note span{color:var(--text-secondary);line-height:1.7}.exchange-filter-bar{display:grid;grid-template-columns:minmax(240px,1fr) 150px 150px auto auto;gap:10px;align-items:end;padding:14px;border:1px solid var(--line);background:var(--panel);border-radius:14px}.exchange-filter-bar label,.exchange-form-grid label,.exchange-form-wide,.exchange-item-edit-row label{display:grid;gap:6px}.exchange-filter-bar label>span,.exchange-form-grid label>span,.exchange-form-wide>span,.exchange-item-edit-row label>span{font-size:12px;color:var(--text-tertiary)}.exchange-filter-bar input,.exchange-filter-bar select,.exchange-form-grid input,.exchange-form-grid select,.exchange-form-wide textarea,.exchange-item-edit-row input,.exchange-contact-card textarea{width:100%;border:1px solid var(--line);background:rgba(5,11,22,.72);color:var(--text-primary);border-radius:9px;padding:10px 12px;box-sizing:border-box}.exchange-compose{scroll-margin-top:90px}.exchange-form-grid{display:grid;grid-template-columns:150px 1fr 1fr 1fr;gap:12px}.exchange-form-wide{margin-top:12px}.exchange-item-editor-head{display:flex;align-items:center;gap:12px;margin:18px 0 10px}.exchange-item-editor-head strong{font-size:17px}.exchange-item-editor-head span{color:var(--text-tertiary);font-size:12px;flex:1}.exchange-item-editor{display:grid;gap:8px}.exchange-item-edit-row{display:grid;grid-template-columns:minmax(260px,1fr) 170px 190px 38px;gap:10px;align-items:end;padding:10px;border:1px solid var(--line);background:rgba(6,13,27,.55);border-radius:12px}.exchange-item-name{position:relative}.exchange-type-suggest{position:absolute;z-index:20;top:64px;left:0;right:0;display:grid;max-height:250px;overflow:auto;padding:6px;background:#091225;border:1px solid #28517e;border-radius:10px;box-shadow:0 18px 44px rgba(0,0,0,.45)}.exchange-type-suggest[hidden]{display:none}.exchange-type-suggest button{display:flex;justify-content:space-between;gap:12px;padding:9px;border:0;background:transparent;color:#eaf4ff;text-align:left;border-radius:6px}.exchange-type-suggest button:hover{background:rgba(37,168,255,.16)}.exchange-type-suggest small{color:#7890ad}.exchange-remove-item{height:40px;border:1px solid rgba(255,71,111,.4);background:rgba(255,71,111,.08);color:#ff7391;border-radius:9px;font-size:22px}.exchange-submit-row{display:flex;justify-content:flex-end;align-items:center;gap:12px;margin-top:14px}.exchange-submit-row p{margin:0;color:#ffb65c;flex:1}.exchange-list-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin-top:8px}.exchange-list-head>div{display:flex;align-items:baseline;gap:10px}.exchange-list-head strong{font-size:22px}.exchange-list-head span,.exchange-list-head p{font-size:12px;color:var(--text-tertiary);margin:0}.exchange-post-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.exchange-post-card{display:grid;gap:13px;padding:18px;border:1px solid rgba(56,168,255,.25);background:linear-gradient(145deg,rgba(8,17,34,.96),rgba(11,13,27,.94));border-radius:16px;box-shadow:0 14px 36px rgba(0,0,0,.15)}.exchange-post-card.is-buy{border-color:rgba(53,220,152,.28)}.exchange-post-card.is-closed{opacity:.68}.exchange-post-card>header{display:flex;justify-content:space-between;gap:12px}.exchange-post-card h2{font-size:20px;margin:8px 0 0}.exchange-post-card time{font-size:12px;color:var(--text-tertiary);white-space:nowrap}.exchange-side-badge,.exchange-status-badge{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800;margin-right:6px}.exchange-side-badge{background:rgba(56,168,255,.15);color:#65c5ff}.is-buy .exchange-side-badge{background:rgba(53,220,152,.14);color:#63e8b0}.exchange-status-badge{background:rgba(255,255,255,.06);color:var(--text-tertiary)}.exchange-post-meta{display:grid;grid-template-columns:1fr 1fr;gap:8px}.exchange-post-meta>span,.exchange-owner{display:grid;gap:3px;padding:9px 10px;border:1px solid var(--line);background:rgba(255,255,255,.025);border-radius:9px;color:var(--text-secondary);text-decoration:none}.exchange-post-meta small,.exchange-owner span{font-size:10px;color:var(--text-tertiary);text-transform:uppercase}.exchange-owner strong{color:#70d8ff}.exchange-delivery{margin:0;padding:10px 12px;background:rgba(240,183,74,.06);border-left:3px solid #f0b74a;color:var(--text-secondary);line-height:1.6}.exchange-post-items{display:grid;gap:9px}.exchange-post-item{padding:12px;border:1px solid var(--line);background:rgba(2,8,18,.45);border-radius:12px}.exchange-post-item-main{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}.exchange-post-item-main>div{display:grid;gap:3px}.exchange-post-item-main>div:last-child{text-align:right}.exchange-post-item-main strong{font-size:16px;color:#f1f7ff}.exchange-post-item-main span,.exchange-post-item-main small{font-size:11px;color:var(--text-tertiary)}.exchange-post-item-main b{color:#ffd27a}.exchange-reference-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-top:10px}.exchange-reference-grid span{display:grid;gap:3px;padding:7px;background:rgba(37,168,255,.045);border-radius:7px}.exchange-reference-grid small{font-size:9px;color:var(--text-tertiary)}.exchange-reference-grid b{font-size:11px;color:var(--text-secondary);overflow-wrap:anywhere}.exchange-reference-note{font-size:10px;color:var(--text-tertiary);margin:8px 0 0}.exchange-evidence-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.exchange-evidence-actions button{border:1px solid rgba(56,168,255,.24);background:transparent;color:#83cfff;border-radius:999px;padding:5px 8px;font-size:10px}.exchange-item-insight{margin-top:8px;padding:8px 10px;border-radius:8px;background:rgba(37,168,255,.08);color:var(--text-secondary);font-size:11px;line-height:1.55}.exchange-post-card>footer{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}.exchange-close-post{color:#ff8aa2;border-color:rgba(255,71,111,.35)}.exchange-empty{grid-column:1/-1;display:grid;place-items:center;gap:8px;min-height:220px;border:1px dashed var(--line);border-radius:14px;color:var(--text-tertiary)}.exchange-empty strong{font-size:19px;color:var(--text-secondary)}.exchange-pagination{display:flex;justify-content:center;align-items:center;gap:12px}.exchange-pagination button{border:1px solid var(--line);background:var(--panel);color:var(--text-secondary);border-radius:8px;padding:8px 14px}.exchange-pagination button:disabled{opacity:.35}.exchange-pagination span{font:600 12px var(--font-mono);color:var(--text-tertiary)}.exchange-contact-dialog{width:min(560px,calc(100vw - 24px));padding:0;border:1px solid rgba(56,168,255,.35);border-radius:16px;background:#091225;color:#edf6ff;box-shadow:0 30px 90px rgba(0,0,0,.65)}.exchange-contact-dialog::backdrop{background:rgba(0,4,12,.75);backdrop-filter:blur(4px)}.exchange-contact-card{display:grid;gap:12px;padding:22px;position:relative}.exchange-contact-card h2,.exchange-contact-card p{margin:0}.exchange-contact-card small{color:#879ab5;line-height:1.6}.exchange-contact-card>div{display:flex;justify-content:flex-end;gap:8px}.exchange-dialog-close{position:absolute;right:12px;top:12px;width:34px;height:34px;border:1px solid var(--line);border-radius:50%;background:transparent;color:#dfeeff;font-size:20px}

.exchange-moderation-note{display:flex;gap:10px;align-items:flex-start;margin-top:14px;padding:10px 12px;border:1px solid rgba(53,168,255,.22);border-radius:9px;background:rgba(37,168,255,.055);color:var(--text-tertiary);font-size:11px;line-height:1.6}.exchange-moderation-note strong{flex:0 0 auto;color:#80cffc}
.exchange-location-hint{color:var(--hud-gold);font-size:12px;line-height:1.5}

@media(max-width:1050px){.exchange-filter-bar{grid-template-columns:1fr 1fr 1fr}.exchange-filter-bar label:first-child{grid-column:1/-1}.exchange-form-grid{grid-template-columns:1fr 1fr}.exchange-post-list{grid-template-columns:1fr}.exchange-reference-grid{grid-template-columns:1fr 1fr}}
@media(max-width:680px){.exchange-hero,.exchange-safety-note,.exchange-list-head{align-items:flex-start;flex-direction:column}.exchange-filter-bar,.exchange-form-grid{grid-template-columns:1fr}.exchange-filter-bar label:first-child{grid-column:auto}.exchange-item-editor-head{align-items:flex-start;flex-wrap:wrap}.exchange-item-editor-head span{flex-basis:100%}.exchange-item-edit-row{grid-template-columns:1fr 1fr 38px}.exchange-item-name{grid-column:1/-1}.exchange-post-meta{grid-template-columns:1fr}.exchange-reference-grid{grid-template-columns:1fr 1fr}.exchange-post-card{padding:13px}.exchange-post-card>header{flex-direction:column}.exchange-post-item-main{flex-direction:column}.exchange-post-item-main>div:last-child{text-align:left}.exchange-post-card>footer .action-button{flex:1 1 auto;text-align:center}}

:root[data-theme="light"] {
  color-scheme: light;
  --hud-deep-1: #f6f8fc;
  --hud-deep-2: #eef3fb;
  --hud-panel-bg: rgba(255, 255, 255, 0.82);
  --hud-nav-bg: rgba(255, 255, 255, 0.88);
  --hud-input-bg: rgba(247, 250, 255, 0.92);
  --hud-brand-a03: rgba(0, 88, 190, 0.05);
  --hud-brand-a06: rgba(0, 88, 190, 0.08);
  --hud-brand-a08: rgba(0, 88, 190, 0.10);
  --hud-brand-a10: rgba(0, 88, 190, 0.12);
  --hud-brand-a12: rgba(0, 88, 190, 0.14);
  --hud-brand-a14: rgba(0, 88, 190, 0.16);
  --hud-brand-a15: rgba(0, 88, 190, 0.18);
  --hud-brand-a20: rgba(0, 88, 190, 0.22);
  --hud-brand-a25: rgba(0, 88, 190, 0.28);
  --hud-brand-a30: rgba(0, 88, 190, 0.34);
  --hud-brand-a35: rgba(0, 88, 190, 0.40);
  --hud-brand-a40: rgba(0, 88, 190, 0.46);
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-tertiary: #667085;
  --text-muted: #8a93a3;
  --panel-2: rgba(255, 255, 255, 0.9);
  --shadow-panel: 0 18px 46px rgba(15, 23, 42, 0.10);
  --accent-glow: rgba(0, 122, 255, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%, var(--hud-brand-a06), transparent 45%),
    radial-gradient(ellipse 70% 50% at 85% 85%, var(--hud-brand-a03), transparent 45%),
    var(--hud-deep-1);
  background-attachment: fixed;
  letter-spacing: 0;
}

:root[data-theme="light"] body {
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(0, 122, 255, 0.10), transparent 42%),
    radial-gradient(ellipse 70% 50% at 90% 90%, rgba(255, 149, 0, 0.08), transparent 45%),
    var(--hud-deep-1);
}

/* 隐约网格线，营造星图坐标感 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* ============================================================
 * v2 情报扩展：星图态势 / 深渊实验室
 * ============================================================ */
.intel-page {
  display: flex;
  flex-direction: column;
  gap: var(--gap-section);
  padding: 8px 32px 32px;
}

.intel-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 12px;
  border: 1px solid var(--hud-brand-a15);
  border-radius: var(--radius-card);
  background:
    linear-gradient(135deg, var(--hud-brand-a12), rgba(255,255,255,.02)),
    rgba(10, 13, 24, .72);
}

.intel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.intel-subtitle {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.intel-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.intel-grid {
  display: grid;
  gap: var(--gap-panel);
}

.intel-grid-2 {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
}

.intel-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.intel-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.intel-panel-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.intel-updated,
.intel-source-link,
.intel-footnote {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  text-decoration: none;
}

.influence-map-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 520px;
  border: 1px solid var(--hud-brand-a10);
  border-radius: var(--radius-card);
  background:
    radial-gradient(circle at 50% 48%, rgba(0, 122, 255, .14), transparent 38%),
    radial-gradient(circle at 28% 62%, rgba(255, 149, 0, .10), transparent 28%),
    rgba(0,0,0,.64);
  overflow: hidden;
}

.influence-map-frame img {
  width: 100%;
  max-height: 720px;
  object-fit: contain;
  display: block;
}

.starmap-layer-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -2px 0 12px;
}

.starmap-layer-button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--text-secondary);
  border: 1px solid var(--hud-brand-a12);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  cursor: pointer;
}

.starmap-layer-button:hover,
.starmap-layer-button.is-active {
  color: var(--text-primary);
  border-color: var(--hud-brand-a35);
  background: var(--hud-brand-a12);
}

.starmap-new-map-cta {
  position: relative;
  overflow: visible;
  box-shadow: 0 0 0 0 rgba(0, 212, 170, .55), 0 0 24px rgba(0, 212, 170, .28);
  animation: starmapNewMapPulse 1.45s ease-in-out infinite;
}

.starmap-new-map-cta::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(0, 212, 170, .5);
  border-radius: inherit;
  opacity: .75;
  animation: starmapNewMapRing 1.45s ease-in-out infinite;
  pointer-events: none;
}

.starmap-radar-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.starmap-pulse {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 999px;
  background: var(--hud-brand);
  box-shadow: 0 0 0 0 rgba(0, 122, 255, .46), 0 0 24px rgba(0, 122, 255, .36);
  cursor: default;
  pointer-events: auto;
  animation: starmapPulse 1.8s infinite;
}

.starmap-pulse::before,
.starmap-pulse::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1px solid currentColor;
  border-radius: inherit;
  opacity: .48;
}

.starmap-pulse::after {
  inset: -17px;
  opacity: .22;
}

.starmap-pulse i {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 1;
}

.starmap-pulse span {
  position: absolute;
  left: 22px;
  top: 50%;
  z-index: 3;
  display: none;
  width: max-content;
  max-width: 240px;
  transform: translateY(-50%);
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  background: rgba(7, 10, 18, .92);
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
  text-align: left;
}

.starmap-pulse:hover span {
  display: block;
}

.starmap-pulse strong,
.starmap-pulse small {
  display: block;
}

.starmap-pulse strong {
  color: #fff;
  font-size: 12px;
}

.starmap-pulse small {
  margin-top: 3px;
  color: rgba(255,255,255,.72);
  font-size: 10px;
  line-height: 1.35;
}

.starmap-pulse.is-incursion {
  color: #ff9f0a;
  background: #ff9f0a;
  box-shadow: 0 0 0 0 rgba(255, 159, 10, .48), 0 0 28px rgba(255, 159, 10, .38);
}

.starmap-pulse.is-sovereignty {
  color: #ff375f;
  background: #ff375f;
  box-shadow: 0 0 0 0 rgba(255, 55, 95, .44), 0 0 28px rgba(255, 55, 95, .34);
}

.starmap-pulse.is-km {
  color: #32d74b;
  background: #32d74b;
  box-shadow: 0 0 0 0 rgba(50, 215, 75, .40), 0 0 24px rgba(50, 215, 75, .32);
}

.starmap-pulse.is-jumps {
  color: #64d2ff;
  background: #64d2ff;
  box-shadow: 0 0 0 0 rgba(100, 210, 255, .40), 0 0 24px rgba(100, 210, 255, .32);
}

.starmap-pulse.is-low {
  width: 13px;
  height: 13px;
  opacity: .82;
}

.starmap-pulse.is-high {
  width: 22px;
  height: 22px;
  animation-duration: 1.25s;
}

.starmap-radar-note,
.starmap-radar-empty {
  position: absolute;
  left: 12px;
  bottom: 10px;
  max-width: min(620px, calc(100% - 24px));
  color: rgba(255,255,255,.62);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  pointer-events: none;
}

.starmap-radar-empty {
  top: 50%;
  bottom: auto;
  left: 50%;
  transform: translate(-50%, -50%);
}

.starmap-metrics-strip {
  margin-top: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.starmap-news-card {
  min-height: 620px;
}

.starmap-news-panel {
  max-height: 700px;
  overflow: auto;
  padding-right: 4px;
}

@keyframes starmapPulse {
  0% {
    box-shadow: 0 0 0 0 currentColor, 0 0 22px currentColor;
  }
  72% {
    box-shadow: 0 0 0 20px rgba(255,255,255,0), 0 0 30px currentColor;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255,255,255,0), 0 0 22px currentColor;
  }
}

@keyframes starmapNewMapPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.22); }
}

@keyframes starmapNewMapRing {
  0% { transform: scale(.96); opacity: .8; }
  100% { transform: scale(1.22); opacity: 0; }
}

.starmap-lab-page {
  padding: 8px 24px 28px;
}

.starmap-lab-hero {
  min-height: 0;
  padding: 8px 12px;
  margin-bottom: 0;
}

.starmap-lab-hero .intel-title {
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1;
}

.starmap-lab-hero .intel-subtitle {
  max-width: 980px;
}

.starmap-lab-shell {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 16px;
  min-height: calc(100vh - 170px);
}

.starmap-lab-sidebar,
.starmap-lab-stage {
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  background: var(--panel-bg);
  box-shadow: var(--shadow-panel);
}

.starmap-lab-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 760px;
  padding: 14px;
}

.starmap-lab-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--text-primary);
  border: 1px solid var(--hud-brand-a18);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.04);
  outline: none;
}

.starmap-lab-results {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  max-height: 210px;
  overflow: auto;
}

.starmap-lab-results button,
.starmap-lab-event-list button {
  width: 100%;
  padding: 8px 10px;
  color: var(--text-primary);
  border: 1px solid var(--hud-brand-a10);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.035);
  text-align: left;
  cursor: pointer;
}

.starmap-lab-results b,
.starmap-lab-results small,
.starmap-lab-event-list b,
.starmap-lab-event-list small {
  display: block;
}

.starmap-lab-results small,
.starmap-lab-event-list small {
  margin-top: 2px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.starmap-lab-layers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.starmap-lab-layers button,
.starmap-lab-toolbar button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--text-secondary);
  border: 1px solid var(--hud-brand-a12);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  cursor: pointer;
}

.starmap-lab-layers button.is-active,
.starmap-lab-toolbar button:hover {
  color: var(--text-primary);
  border-color: var(--hud-brand-a35);
  background: var(--hud-brand-a12);
}

.starmap-lab-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.starmap-lab-stats div {
  padding: 10px;
  border: 1px solid var(--hud-brand-a10);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.025);
}

.starmap-lab-stats span,
.starmap-lab-detail span {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
}

.starmap-lab-stats b {
  display: block;
  margin-top: 4px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 18px;
}

.starmap-lab-owner-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--hud-brand-a10);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.025);
}

.starmap-lab-owner-list > span {
  color: var(--text-tertiary);
  font-size: 11px;
}

.starmap-lab-owner-list button {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 6px;
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
  cursor: pointer;
}

.starmap-lab-owner-list button:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--owner-color) 55%, transparent);
  background: color-mix(in srgb, var(--owner-color) 14%, transparent);
}

.starmap-lab-owner-list i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--owner-color);
  box-shadow: 0 0 14px var(--owner-color);
}

.starmap-lab-owner-list b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 12px;
}

.starmap-lab-owner-list em {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 11px;
}

.starmap-lab-detail {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
}

.starmap-lab-detail h2 {
  margin: 0;
  font-size: 24px;
}

.starmap-lab-detail .mono {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.starmap-lab-detail dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.starmap-lab-detail dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--hud-brand-a08);
}

.starmap-lab-detail dt {
  color: var(--text-tertiary);
}

.starmap-lab-detail dd {
  margin: 0;
  color: var(--text-primary);
  text-align: right;
}

.starmap-lab-event-list {
  display: grid;
  gap: 6px;
}

.starmap-lab-stage {
  position: relative;
  min-height: 760px;
  overflow: hidden;
}

.starmap-lab-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.starmap-lab-stage canvas:active {
  cursor: grabbing;
}

.starmap-real-page {
  padding: 6px 18px 22px;
}

.starmap-real-hero {
  align-items: center;
  padding: 8px 12px;
}

.starmap-real-hero .intel-title {
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1;
}

.starmap-real-hero .intel-subtitle {
  max-width: 760px;
  font-size: 13px;
}

.starmap-real-page .starmap-lab-shell {
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - 124px);
}

.starmap-real-page .starmap-lab-sidebar,
.starmap-real-page .starmap-lab-stage {
  min-height: 690px;
}

.starmap-real-page .starmap-lab-sidebar {
  position: absolute;
  z-index: 4;
  left: 14px;
  top: 14px;
  width: min(330px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  overflow: auto;
  transform: translateX(calc(-100% + 52px));
  transition: transform .18s ease, opacity .18s ease, background .18s ease;
  opacity: .46;
}

.starmap-real-page .starmap-lab-sidebar:hover,
.starmap-real-page .starmap-lab-sidebar:focus-within {
  transform: translateX(0);
  opacity: 1;
}

.starmap-real-focus-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 12px 0;
}

.starmap-real-focus-actions button {
  justify-content: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--hud-brand-a18);
  border-radius: var(--radius-sm);
  background: rgba(4, 12, 24, .62);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  cursor: pointer;
}

.starmap-real-focus-actions button.is-active,
.starmap-real-focus-actions button:hover {
  border-color: var(--accent);
  background: rgba(0, 119, 255, .18);
  color: var(--accent);
}

.starmap-real-search-float {
  position: absolute;
  z-index: 6;
  top: 54px;
  right: 10px;
  width: 220px;
  display: grid;
  gap: 6px;
  pointer-events: none;
  transition: width .18s ease;
}

.starmap-real-search-float:has(input:focus),
.starmap-real-search-float:has(.starmap-real-search-results:not(:empty)) {
  width: 280px;
}

.starmap-real-search-float input {
  pointer-events: auto;
  width: 100%;
  min-height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid rgba(0, 122, 255, .28);
  border-radius: 999px;
  background: rgba(4, 9, 18, .72);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  outline: none;
  box-shadow: 0 8px 28px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(14px);
  transition: all .18s ease;
}

.starmap-real-search-float::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 10px;
  width: 14px;
  height: 14px;
  pointer-events: none;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5z'/%3E%3C/svg%3E") no-repeat center;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5z'/%3E%3C/svg%3E") no-repeat center;
  opacity: .55;
}

.starmap-real-search-float input:focus {
  border-color: rgba(0, 122, 255, .58);
  background: rgba(4, 9, 18, .88);
  box-shadow: 0 12px 38px rgba(0,0,0,.42), 0 0 0 3px rgba(0, 122, 255, .1);
}

.starmap-real-search-results {
  pointer-events: auto;
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgba(0, 122, 255, .22);
  border-radius: var(--radius-card);
  background: rgba(4, 9, 18, .9);
  box-shadow: 0 14px 38px rgba(0,0,0,.36);
  backdrop-filter: blur(14px);
}

.starmap-real-search-results:empty {
  display: none;
}

.starmap-real-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}

.starmap-real-tags i {
  display: inline-flex;
  padding: 4px 7px;
  border: 1px solid var(--hud-brand-a18);
  border-radius: var(--radius-sm);
  color: var(--soft);
  font-style: normal;
  font-size: 11px;
}

.starmap-real-neighbours {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.starmap-real-neighbours b {
  color: var(--text);
  font-size: 12px;
}

.starmap-real-neighbours button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.035);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.starmap-real-neighbours small {
  color: var(--muted);
  white-space: nowrap;
}

.starmap-real-map-detail {
  position: absolute;
  z-index: 3;
  right: 14px;
  top: 70px;
  width: min(360px, calc(100% - 28px));
  max-height: calc(100% - 96px);
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(0, 119, 255, .28);
  border-radius: var(--radius-card);
  background: rgba(4, 9, 18, .82);
  box-shadow: 0 18px 48px rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
  display: none;
}

.starmap-fusion-page .starmap-lab-shell {
  min-height: calc(100vh - 126px);
}

.starmap-fusion-intel {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  width: min(390px, calc(100% - 28px));
  max-height: min(420px, calc(100% - 118px));
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(0, 119, 255, .24);
  border-radius: var(--radius-card);
  background: rgba(4, 9, 18, .78);
  box-shadow: 0 18px 48px rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
}

.starmap-detail-open .starmap-fusion-intel {
  opacity: .22;
  pointer-events: none;
}

.starmap-fusion-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.starmap-fusion-head span,
.starmap-fusion-head em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.starmap-fusion-head strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 18px;
}

.starmap-fusion-bottom {
  margin-top: 14px;
}

.fitting-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: none;
  margin: 0 auto;
  padding: 12px;
  min-height: calc(100vh - 78px);
}

.fitting-hero {
  display: none;
}

.fitting-hero h1 {
  margin: 4px 0 8px;
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: 0;
}

.fitting-hero p {
  max-width: 760px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

.fitting-data-badge {
  min-width: 170px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.72);
  border-radius: 8px;
  padding: 14px;
}

.fitting-data-badge span,
.fitting-data-badge small {
  display: block;
  color: var(--text-tertiary);
  font-size: 12px;
}

.fitting-data-badge b {
  display: block;
  font-family: var(--font-mono);
  font-size: 24px;
  margin: 3px 0;
  color: var(--accent);
}

.fitting-workbench {
  display: grid;
  grid-template-columns: 280px minmax(760px, 1fr) 330px;
  gap: 10px;
  align-items: stretch;
  height: calc(100vh - 112px);
  min-height: 720px;
  overflow: hidden;
}

.fitting-sidebar,
.fitting-main,
.fitting-eft-panel,
.fitting-slot-panel,
.fitting-ship-card {
  border: 1px solid var(--line);
  background: rgba(7, 11, 18, 0.72);
  border-radius: 8px;
}

.fitting-sidebar,
.fitting-eft-panel {
  padding: 12px;
  position: static;
  min-height: 0;
  overflow: auto;
}

.fitting-search-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.fitting-search-block label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.fitting-search-block label small {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 500;
}

.fitting-search-block input,
.fitting-eft-panel textarea {
  width: 100%;
  background: rgba(4, 8, 14, 0.82);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}

.fitting-eft-panel textarea {
  min-height: 260px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
}

.fitting-result-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
}

.fitting-category-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  max-height: 168px;
  overflow: auto;
  padding: 2px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 6px;
  background: rgba(2, 6, 12, 0.28);
}

.fitting-category-list button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 12, 0.44);
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.fitting-category-list button.active,
.fitting-category-list button:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(20, 184, 166, 0.14);
}

.fitting-category-list span {
  color: var(--text-tertiary);
  margin-left: 3px;
}

.fitting-result,
.fitting-slot-row {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.58);
  color: var(--text);
  border-radius: 7px;
  padding: 9px 10px;
  text-align: left;
}

.fitting-result {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.fitting-result img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 12, 0.8);
}

.fitting-result:hover {
  border-color: var(--accent);
  background: rgba(20, 184, 166, 0.12);
}

.fitting-result-note {
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.45;
  padding: 4px 2px;
}

.fitting-result b,
.fitting-slot-row b {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fitting-result small,
.fitting-slot-row small,
.fitting-empty,
.fitting-note {
  color: var(--text-tertiary);
  font-size: 12px;
}

.fitting-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.fitting-main {
  padding: 12px;
  min-width: 0;
  overflow: auto;
}

.fitting-game-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  min-height: 620px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 44%, rgba(87, 122, 130, 0.18), rgba(4, 8, 14, 0.08) 40%, transparent 58%),
    rgba(7, 11, 18, 0.72);
  overflow: hidden;
}

.fitting-game-stage:before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 0 55%, rgba(0, 119, 255, 0.08) 56% 57%, transparent 58%);
  opacity: 0.7;
  pointer-events: none;
}

.fitting-fit-wheel {
  position: relative;
  width: min(670px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(117, 171, 191, 0.28) 0 22%, rgba(24, 55, 57, 0.96) 23% 48%, rgba(3, 22, 25, 0.96) 49% 65%, transparent 66%),
    conic-gradient(from 210deg, rgba(38, 51, 61, 0.92), rgba(7, 30, 32, 0.9), rgba(45, 64, 72, 0.88), rgba(7, 30, 32, 0.9), rgba(38, 51, 61, 0.92));
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.9),
    inset 0 0 70px rgba(10, 16, 20, 0.9),
    0 24px 56px rgba(0, 0, 0, 0.46);
}

.fitting-ring-outer,
.fitting-ring-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.fitting-ring-outer {
  z-index: 2;
  filter: drop-shadow(0 0 7px rgba(0, 0, 0, 0.9));
}

.fitting-ring-outer circle {
  fill: none;
  stroke: #050607;
  stroke-width: 16;
}

.fitting-ring-outer rect {
  fill: #050607;
}

.fitting-ring-inner {
  z-index: 1;
}

.fitting-ring-inner circle {
  fill: none;
  stroke: rgba(0, 0, 0, 0.72);
  stroke-width: 46;
}

.fitting-fit-wheel:after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 78px;
  height: 58px;
  transform: translateX(-50%);
  background: rgba(8, 24, 27, 0.98);
  border-left: 7px solid rgba(151, 164, 171, 0.72);
  border-right: 7px solid rgba(151, 164, 171, 0.72);
  clip-path: polygon(0 0, 100% 0, 72% 100%, 28% 100%);
  z-index: 1;
}

.fitting-ship-render {
  position: absolute;
  inset: 26%;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  color: var(--text-tertiary);
  font: 800 16px var(--font-mono);
  background:
    radial-gradient(circle at 50% 37%, rgba(180, 218, 230, 0.36), rgba(14, 47, 48, 0.88) 45%, rgba(1, 13, 15, 0.96) 72%),
    #061012;
}

.fitting-ship-render img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.9;
  filter: brightness(1.16) contrast(1.08) drop-shadow(0 18px 22px rgba(0, 0, 0, 0.72));
}

.fitting-wheel-slot {
  --rot: 0deg;
  position: absolute;
  inset: 0;
  z-index: 5;
  transform: rotate(var(--rot));
  pointer-events: none;
}

.fitting-slot-face {
  position: absolute;
  left: 50%;
  top: 3.5%;
  width: 7%;
  height: 9%;
  min-width: 42px;
  min-height: 50px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  border: 1px solid rgba(176, 187, 193, 0.72);
  background:
    linear-gradient(180deg, rgba(36, 47, 54, 0.86), rgba(6, 10, 14, 0.94)),
    rgba(6, 10, 14, 0.94);
  clip-path: polygon(16% 0, 84% 0, 100% 82%, 50% 100%, 0 82%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.58);
  cursor: pointer;
  pointer-events: auto;
  appearance: none;
  padding: 0;
}

.fitting-slot-face:disabled {
  pointer-events: none;
}

.fitting-slot-face:hover,
.fitting-wheel-slot.is-active .fitting-slot-face,
.fitting-wheel-slot.is-selected .fitting-slot-face {
  border-color: var(--accent);
  box-shadow:
    0 0 0 2px rgba(0, 119, 255, 0.22),
    0 10px 22px rgba(0, 0, 0, 0.56);
}

.fitting-wheel-slot.is-selected .fitting-slot-face {
  box-shadow:
    0 0 0 2px rgba(56, 189, 248, 0.5),
    0 0 20px rgba(56, 189, 248, 0.22),
    0 10px 22px rgba(0, 0, 0, 0.56);
}

.fitting-wheel-slot[data-state="Active"] .fitting-slot-face {
  border-color: rgba(138, 224, 74, 0.82);
}

.fitting-wheel-slot[data-state="Online"] .fitting-slot-face {
  border-color: rgba(180, 190, 196, 0.82);
}

.fitting-wheel-slot[data-state="Passive"] .fitting-slot-face {
  opacity: 0.34;
  border-color: rgba(176, 187, 193, 0.4);
}

.fitting-slot-face img {
  width: 68%;
  height: 68%;
  object-fit: contain;
  transform: rotate(calc(-1 * var(--rot)));
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.82));
}

.fitting-slot-face img,
.fitting-wheel-empty,
.fitting-module-state,
.fitting-ammo-dot {
  pointer-events: none;
}

.fitting-wheel-slot.is-empty .fitting-slot-face {
  background:
    linear-gradient(180deg, rgba(32, 40, 46, 0.45), rgba(3, 8, 13, 0.72)),
    rgba(6, 10, 14, 0.72);
  opacity: 0.62;
}

.fitting-module-state {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 30%;
  height: 4px;
  border-radius: 999px;
  transform: translateX(-50%) rotate(calc(-1 * var(--rot)));
  background: rgba(160, 168, 172, 0.78);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.16);
}

.fitting-wheel-slot[data-state="Active"] .fitting-module-state {
  background: #8ae04a;
  box-shadow: 0 0 7px rgba(138, 224, 74, 0.62);
}

.fitting-wheel-slot[data-state="Online"] .fitting-module-state {
  background: #c8d1d6;
}

.fitting-wheel-slot[data-state="Passive"] .fitting-module-state {
  background: #666;
  box-shadow: none;
}

.fitting-wheel-slot.is-unavailable .fitting-slot-face {
  opacity: 0.16;
  cursor: default;
  border-color: rgba(176, 187, 193, 0.42);
}

.fitting-wheel-empty {
  display: block;
  width: 34%;
  height: 10%;
  border-radius: 999px;
  background: rgba(167, 178, 185, 0.28);
  transform: rotate(calc(-1 * var(--rot)));
}

.fitting-wheel-state {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #c33229;
  border: 2px solid rgba(0, 0, 0, 0.76);
  transform: translateX(-50%) rotate(calc(-1 * var(--rot)));
  cursor: pointer;
  pointer-events: auto;
  transition: transform 120ms ease, filter 120ms ease;
}

.fitting-wheel-remove:hover {
  filter: brightness(1.25);
  transform: translateX(-50%) rotate(calc(-1 * var(--rot))) scale(1.12);
}

.fitting-wheel-state:before,
.fitting-wheel-state:after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 7px;
  height: 2px;
  background: rgba(0, 0, 0, 0.8);
}

.fitting-wheel-state:before {
  transform: rotate(45deg);
}

.fitting-wheel-state:after {
  transform: rotate(-45deg);
}

.fitting-ammo-dot {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 119, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 7px rgba(0, 119, 255, 0.72);
  transform: rotate(calc(-1 * var(--rot)));
}

.fitting-stage-meta {
  position: absolute;
  right: 22px;
  top: 22px;
  z-index: 3;
  width: min(240px, 36%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  pointer-events: none;
}

.fitting-stage-meta h2 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: 0;
}

.fitting-stage-actions {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
}

.fitting-slot-inspector {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 3;
  width: min(280px, 42%);
  padding: 10px 12px;
  border: 1px solid rgba(0, 119, 255, 0.26);
  border-radius: 7px;
  background: rgba(3, 9, 18, 0.72);
  backdrop-filter: blur(10px);
}

.fitting-slot-inspector span,
.fitting-slot-inspector small {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.45;
}

.fitting-slot-inspector b {
  display: block;
  margin: 3px 0;
  color: var(--text);
  font-size: 15px;
}

.fitting-charge-picker {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.fitting-charge-picker label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.fitting-charge-picker > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  max-height: 102px;
  overflow: auto;
}

.fitting-charge-picker button {
  min-width: 0;
  height: 30px;
  border: 1px solid rgba(0, 119, 255, 0.32);
  border-radius: 0;
  background: rgba(15, 23, 42, 0.8);
  color: #dbeafe;
  cursor: pointer;
}

.fitting-charge-picker button:hover {
  border-color: #38bdf8;
  background: rgba(14, 116, 144, 0.42);
}

.fitting-charge-picker img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.fitting-charge-picker button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.fitting-state-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.fitting-state-controls button {
  min-height: 24px;
  border: 1px solid #4a4a4a;
  border-radius: 0;
  background: #191919;
  color: #c7c7c7;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.fitting-state-controls button.active,
.fitting-state-controls button:hover {
  border-color: #8ae04a;
  color: #fff;
  background: #294027;
}

.fitting-hold-strip {
  position: absolute;
  left: 22px;
  bottom: 4px;
  z-index: 4;
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.fitting-hold-button {
  display: grid;
  grid-template-columns: auto;
  gap: 2px;
  min-width: 112px;
  min-height: 42px;
  border: 1px solid #344149;
  border-radius: 0;
  background: #111;
  color: #cfcfcf;
  padding: 5px 8px;
  text-align: left;
  cursor: pointer;
}

.fitting-hold-button span {
  color: #aaa;
  font-size: 12px;
  font-weight: 800;
}

.fitting-hold-button b {
  color: #e0e0e0;
  font: 800 13px var(--font-mono);
}

.fitting-hold-button.active,
.fitting-hold-button:hover {
  border-color: #686868;
  background: #202020;
}

.fitting-hold-panel {
  display: none;
  position: absolute;
  left: 22px;
  bottom: 54px;
  z-index: 8;
  width: min(450px, 62%);
  max-height: 250px;
  overflow: auto;
  border: 1px solid #333;
  background: #111;
  color: #c5c5c5;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.56);
}

.fitting-hold-panel.active {
  display: block;
}

.fitting-hold-head {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px;
  background: #1d1d1d;
  font-size: 13px;
  z-index: 1;
}

.fitting-hold-head span {
  color: #aaa;
  font-family: var(--font-mono);
}

.fitting-hold-empty {
  padding: 12px;
  color: #888;
  font-size: 13px;
}

.fitting-hold-row,
.fitting-drone-row {
  display: grid;
  grid-template-columns: 44px 34px minmax(0, 1fr) 24px;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 4px 7px;
}

.fitting-drone-row {
  min-height: 70px;
}

.fitting-hold-row:hover,
.fitting-drone-row:hover {
  background: #321d1d;
}

.fitting-hold-row img,
.fitting-drone-row img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background: #0b0b0b;
}

.fitting-drone-row img {
  width: 48px;
  height: 48px;
}

.fitting-hold-qty {
  color: #aaa;
  text-align: right;
  font: 800 13px var(--font-mono);
}

.fitting-hold-row b,
.fitting-drone-row b {
  display: block;
  overflow: hidden;
  color: #ddd;
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.fitting-drone-row small {
  display: block;
  color: #8e8e8e;
  font-size: 11px;
}

.fitting-hold-row > button,
.fitting-drone-row > button {
  border: 0;
  background: transparent;
  color: #999;
  font-size: 18px;
  cursor: pointer;
}

.fitting-hold-row > button:hover,
.fitting-drone-row > button:hover {
  color: #fff;
}

.fitting-drone-select {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 5px;
}

.fitting-drone-select button {
  min-width: 18px;
  height: 18px;
  border: 1px solid #52281c;
  background: #321d1d;
  color: #fff;
  padding: 0 4px;
  font-size: 10px;
  cursor: pointer;
}

.fitting-drone-select button.active,
.fitting-drone-select button:hover {
  border-color: #a54b32;
  background: #7a3925;
}

.fitting-ship-card {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 520px);
  gap: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

.fitting-ship-card h2 {
  margin: 3px 0 6px;
  font-size: 22px;
  letter-spacing: 0;
  line-height: 1.25;
  word-break: keep-all;
  overflow-wrap: normal;
}

.fitting-ship-card p {
  margin: 0;
  color: var(--text-secondary);
}

.fitting-skill-select,
.fitting-name-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.fitting-skill-select small {
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.45;
}

.fitting-esi-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.fitting-esi-link:hover {
  text-decoration: underline;
}

.fitting-skill-select select,
.fitting-name-field input {
  border: 1px solid var(--line);
  background: rgba(4, 8, 14, 0.82);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
}

.fitting-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 8px;
}

.fitting-stat-grid div {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 12, 0.54);
  border-radius: 7px;
  padding: 9px;
  min-height: 60px;
}

.fitting-stat-grid span {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
  margin-bottom: 5px;
}

.fitting-stat-grid b {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text);
}

.fitting-resource-bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.fitting-resource-bars div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 52px;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 12, 0.42);
  border-radius: 7px;
  padding: 8px;
}

.fitting-resource-bars span {
  color: var(--text-tertiary);
  font-size: 11px;
}

.fitting-resource-bars b {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
}

.fitting-resource-bars meter {
  width: 100%;
}

.fitting-resource-bars meter.is-over + b {
  color: #fecaca;
}

.fitting-warning-panel {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 12, 0.48);
  border-radius: 7px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.fitting-warning-panel b,
.fitting-warning-panel span,
.fitting-warning-panel small {
  display: block;
}

.fitting-warning-panel b {
  color: var(--text);
  font-size: 13px;
  margin-bottom: 4px;
}

.fitting-warning-panel span,
.fitting-warning-panel small {
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.45;
}

.fitting-warning-panel.is-ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(22, 101, 52, 0.12);
}

.fitting-warning-panel.is-warning {
  border-color: rgba(251, 191, 36, 0.42);
  background: rgba(120, 53, 15, 0.16);
}

.fitting-warning-panel.is-warning span {
  color: #fde68a;
}

.fitting-sim-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.fitting-sim-panel {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 12, 0.46);
  border-radius: 7px;
  padding: 10px;
  min-height: 112px;
}

.fitting-sim-panel h3 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 13px;
  letter-spacing: 0;
}

.fitting-sim-panel h3 span {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}

.fitting-sim-panel b {
  display: block;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.35;
}

.fitting-sim-panel small {
  display: block;
  margin-top: 6px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.45;
}

.fitting-slots-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fitting-slot-panel {
  padding: 12px;
}

.fitting-slot-panel h3 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 16px;
  letter-spacing: 0;
}

.fitting-slot-panel h3 span {
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  font-size: 12px;
}

.fitting-slot-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fitting-slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
}

.fitting-slot-row:hover {
  border-color: rgba(0, 119, 255, 0.34);
  background: rgba(0, 119, 255, 0.1);
}

.fitting-slot-row.is-empty {
  border-style: dashed;
  color: var(--text-tertiary);
  background: rgba(15, 23, 42, 0.22);
}

.fitting-slot-row button {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.22);
  color: #fecaca;
  border-radius: 6px;
  cursor: pointer;
}

.fitting-note {
  margin-top: 12px;
  line-height: 1.55;
}

.fitting-fit-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.fitting-bay-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 12px 0;
}

.fitting-bay-summary div {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 12, 0.44);
  border-radius: 7px;
  padding: 8px 10px;
}

.fitting-bay-summary span {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
}

.fitting-bay-summary b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
}

.fitting-history {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}

.fitting-history h3 {
  margin: 0 0 8px;
  font-size: 15px;
  letter-spacing: 0;
}

.fitting-history-row {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.44);
  color: var(--text);
  border-radius: 7px;
  padding: 8px 10px;
  margin-bottom: 6px;
  text-align: left;
  cursor: pointer;
}

.fitting-history-row b,
.fitting-history-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fitting-history-row span {
  color: var(--text-tertiary);
  font-size: 12px;
  margin-top: 2px;
}

/* EVEShip.fit-style fitting surface */
.page-fitting {
  overflow: hidden;
  background: #101010;
}

.page-fitting .hud-grid-overlay,
.page-fitting .site-footer,
.page-fitting .fitting-hero {
  display: none;
}

.page-fitting .app-shell {
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.fitting-shell {
  padding: 0;
  min-height: calc(100vh - 70px);
  background: #0f0f0f;
}

.fitting-topbar {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 40;
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 18px;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  transform: translateX(-50%);
  border: 1px solid rgba(110, 125, 134, 0.52);
  background: rgba(18, 20, 22, 0.82);
  color: #d8dde0;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

.fitting-topbar a,
.fitting-topbar span {
  color: #d8dde0;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}

.fitting-topbar a:hover {
  color: #fff;
}

.fitting-topbar-brand {
  color: #8fd7ff !important;
}

.fitting-mobile-switch {
  display: none;
}

.fitting-workbench {
  grid-template-columns: minmax(300px, 24vw) minmax(430px, 1fr) minmax(360px, 26vw);
  gap: 0;
  margin-top: 0;
  height: calc(100vh - 70px);
  min-height: calc(100vh - 70px);
  background:
    radial-gradient(circle at 70% 46%, rgba(255,255,255,.04), transparent 42%),
    #101010;
  overscroll-behavior: none;
}

.fitting-sidebar,
.fitting-main,
.fitting-status-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.fitting-sidebar {
  display: flex;
  flex-direction: column;
  padding: 22px 12px 10px;
  overflow: hidden;
  background: rgba(18, 18, 18, .96);
}

.fitting-left-tabs {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 8px;
}

.fitting-left-tabs button {
  flex: 1 1 0;
  min-width: 0;
  height: 32px;
  padding-inline: 7px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.fitting-left-panel {
  display: none;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.fitting-left-panel.active {
  display: flex;
  flex-direction: column;
}

.fitting-left-panel input {
  width: 100%;
  height: 38px;
  border: 2px solid #909090;
  border-radius: 0;
  background: #1b1b1b;
  color: #d0d0d0;
  padding: 0 10px;
  font: 600 16px var(--font-ui);
}

.fitting-panel-total {
  display: flex;
  justify-content: space-between;
  padding: 6px 4px;
  color: #aaa;
  font-size: 12px;
}

.fitting-filter-icons {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 54px;
  color: #d7d7d7;
  font-size: 28px;
}

.fitting-slot-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 10px;
}

.fitting-hardware-kind {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 6px;
}

.fitting-hardware-kind button {
  min-height: 32px;
  border: 1px solid #4e4e4e;
  border-radius: 0;
  background: #1b1b1b;
  color: #c8c8c8;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.fitting-hardware-kind button.active,
.fitting-hardware-kind button:hover {
  border-color: #2786dd;
  background: #17314a;
  color: #fff;
}

.fitting-slot-filters button {
  min-height: 30px;
  border: 1px solid #4e4e4e;
  border-radius: 0;
  background: #1b1b1b;
  color: #c8c8c8;
  padding: 4px 6px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.fitting-slot-filters button.active,
.fitting-slot-filters button:hover {
  border-color: #8e8e8e;
  background: #315070;
  color: #fff;
}

.fitting-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 7px;
}

.fitting-filter-row button {
  min-height: 25px;
  border: 1px solid #3f3f3f;
  border-radius: 0;
  background: #171717;
  color: #b9b9b9;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.fitting-filter-row button.active,
.fitting-filter-row button:hover {
  border-color: #2786dd;
  background: #17314a;
  color: #fff;
}

.fitting-category-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #202020;
  gap: 0;
}

.fitting-category-list button {
  min-height: 35px;
  border: 0;
  border-radius: 0;
  background: #202020;
  color: #c9c9c9;
  padding: 3px 10px 3px 22px;
  font-size: 20px;
  line-height: 1.2;
  position: relative;
}

.fitting-category-list button:before {
  content: "›";
  position: absolute;
  left: 6px;
  top: 2px;
  color: #ddd;
}

.fitting-category-list button.active,
.fitting-category-list button:hover {
  border: 0;
  background: #555;
  color: #f0f0f0;
}

.fitting-category-list span {
  color: #999;
  font-size: 13px;
}

.fitting-category-list .fitting-tree-header,
.fitting-category-list .fitting-tree-leaf {
  border: 0;
  border-radius: 0;
  width: 100%;
  position: relative;
}

.fitting-category-list .fitting-tree-header:before,
.fitting-category-list .fitting-tree-leaf:before {
  content: none;
}

.fitting-tree-group {
  background: #202020;
}

.fitting-tree-depth-1 > .fitting-tree-header {
  padding-left: 16px !important;
}

.fitting-tree-depth-2 > .fitting-tree-header {
  padding-left: 28px !important;
  font-size: 14px !important;
}

.fitting-category-list button.fitting-tree-leaf.fitting-tree-depth-3 {
  padding-left: 38px;
}

.fitting-category-list button.fitting-tree-header {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  justify-content: normal;
  align-items: center;
  min-height: 30px;
  padding: 2px 8px 2px 4px;
  background: #202020;
  color: #cfcfcf;
  text-align: left;
  font: 700 16px/1.2 var(--font-ui);
  cursor: pointer;
}

.fitting-tree-header:hover,
.fitting-tree-group.is-open > .fitting-tree-header {
  background: #555;
  color: #f0f0f0;
}

.fitting-tree-arrow {
  color: #ddd;
  font-size: 14px;
}

.fitting-tree-header b {
  overflow: hidden;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.fitting-tree-header small {
  color: #aaa;
  font-size: 14px;
}

.fitting-tree-children {
  margin: 0;
}

.fitting-category-list button.fitting-tree-leaf {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  justify-content: normal;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 3px 8px 3px 22px;
  background: #181818;
  color: #d0d0d0;
  text-align: left;
  cursor: pointer;
}

.fitting-tree-leaf:nth-child(even) {
  background: #1e1e1e;
}

.fitting-tree-leaf:hover {
  background: #4e4e4e;
}

.fitting-tree-leaf img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  background: #101010;
}

.fitting-tree-leaf b,
.fitting-tree-leaf small {
  display: block;
  overflow: hidden;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.fitting-tree-leaf > span {
  min-width: 0;
}

.fitting-tree-leaf b {
  color: #ddd;
  font-size: 15px;
}

.fitting-tree-leaf small {
  color: #929292;
  font-size: 11px;
}

.fitting-tree-more {
  padding: 5px 8px 5px 22px;
  color: #929292;
  background: #161616;
  font-size: 12px;
}

.fitting-result-list {
  display: none;
  flex: 0 0 auto;
  max-height: none;
  margin-top: 8px;
  overflow: auto;
  gap: 0;
  background: #161616;
}

.fitting-result {
  min-height: 44px;
  grid-template-columns: 34px minmax(0, 1fr);
  border: 0;
  border-radius: 0;
  background: #1f1f1f;
  color: #d2d2d2;
  padding: 5px 8px;
}

.fitting-result:nth-child(odd) {
  background: #181818;
}

.fitting-result:hover {
  border: 0;
  background: #4e4e4e;
}

.fitting-result img {
  border: 0;
  background: #0c0c0c;
}

.fitting-result b {
  font-size: 15px;
  color: #ddd;
}

.fitting-result small {
  color: #aaa;
  font-size: 12px;
}

.fitting-left-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 8px;
}

.fitting-left-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--hud-brand-a15, rgba(255, 255, 255, 0.10));
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.fitting-left-actions button:hover {
  color: var(--text-primary);
  background: var(--hud-brand-a08, rgba(255, 255, 255, 0.05));
  border-color: var(--hud-brand-a25, rgba(255, 255, 255, 0.18));
}

.fitting-left-actions-secondary {
  padding-top: 5px;
}

.fitting-left-actions-secondary button {
  font-weight: 500;
}

:root[data-theme="light"] .fitting-left-actions button {
  border-color: rgba(0, 0, 0, 0.12);
  color: #4b5563;
}
:root[data-theme="light"] .fitting-left-actions button:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #111827;
}

.fitting-import-panel,
.fitting-history-panel,
.fitting-public-panel {
  flex: 0 0 auto;
  margin-top: 8px;
  border-top: 1px solid #333;
  padding-top: 8px;
}

.fitting-utility-drawer {
  max-height: 34px;
  overflow: hidden;
}

.fitting-utility-drawer[open] {
  max-height: 220px;
  overflow: auto;
}

.fitting-utility-drawer summary {
  display: block;
  min-height: 26px;
  padding: 6px 8px;
  border: 1px solid #3e3e3e;
  background: #1c1c1c;
  color: #d2d2d2;
  cursor: pointer;
  font: 800 12px/1 var(--font-ui);
}

.fitting-utility-drawer summary::before {
  content: "▸";
  display: inline-block;
  width: 16px;
  color: #aaa;
}

.fitting-utility-drawer[open] summary::before {
  content: "▾";
}

.fitting-import-panel textarea {
  width: 100%;
  min-height: 86px;
  max-height: 130px;
  resize: vertical;
  border: 1px solid #444;
  background: #151515;
  color: #d2d2d2;
  padding: 8px;
  font: 12px/1.45 var(--font-mono);
}

.fitting-import-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 5px;
}

.fitting-import-actions button {
  border: 1px solid #555;
  background: #222;
  color: #d2d2d2;
  height: 28px;
  cursor: pointer;
  font: 700 11px/1 var(--font-ui);
}

.fitting-history-list {
  max-height: 118px;
  overflow: auto;
}

.fitting-privacy-note {
  margin: 8px 0 0;
  color: rgba(178, 190, 210, .82);
  font-size: 11px;
  line-height: 1.55;
}

.fitting-public-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: #d2d2d2;
  font-size: 12px;
  font-weight: 800;
}

.fitting-public-library-panel {
  gap: 8px;
  overflow: hidden;
}

.fitting-public-library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(47, 214, 130, .24);
  background: rgba(47, 214, 130, .06);
}

.fitting-public-library-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.fitting-public-library-head strong { color: var(--text-primary); font-size: 13px; }
.fitting-public-library-head small { color: var(--text-tertiary); font-size: 10px; line-height: 1.4; }
.fitting-public-library-head button {
  flex: 0 0 auto;
  min-height: 28px;
  border: 1px solid #2f6f9f;
  background: #162434;
  color: #d2d2d2;
  cursor: pointer;
}

.fitting-public-library-panel .fitting-public-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding-right: 2px;
}

.fitting-public-head button,
.fitting-public-publish {
  border: 1px solid #2f6f9f;
  background: #162434;
  color: #d2d2d2;
  height: 28px;
  padding: 0 10px;
  cursor: pointer;
  font: 700 12px/1 var(--font-ui);
}

.fitting-public-publish {
  width: 100%;
  margin-bottom: 6px;
}

.fitting-public-list {
  max-height: 170px;
  overflow: auto;
}

.fitting-public-row {
  width: 100%;
  margin: 0 0 5px;
  padding: 7px 8px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: #d2d2d2;
  text-align: left;
}

.fitting-public-row:hover {
  border-color: #2f6f9f;
  background: #202b34;
}

.fitting-public-row b,
.fitting-public-row span,
.fitting-public-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fitting-public-load {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.fitting-public-owner {
  display: inline;
  color: #78c9ff;
  text-decoration: none;
}

.fitting-public-owner:hover {
  color: #b5e4ff;
  text-decoration: underline;
}

.fitting-curated-intro {
  display: grid;
  gap: 4px;
  margin-bottom: 9px;
  padding: 11px;
  border: 1px solid rgba(47, 214, 130, .3);
  border-radius: 9px;
  background: rgba(47, 214, 130, .07);
}

.fitting-curated-intro b { color: #50e69a; font-size: 12px; }
.fitting-curated-intro span,
.fitting-curated-intro small { color: var(--text-tertiary); font-size: 10px; line-height: 1.45; }
.fitting-public-row.is-curated { border-color: rgba(47, 214, 130, .28); background: rgba(47, 214, 130, .045); }
.fitting-public-row.is-curated:hover { border-color: rgba(47, 214, 130, .65); background: rgba(47, 214, 130, .09); }
.fitting-public-row b em { display: inline-flex; margin-left: 6px; padding: 2px 5px; border-radius: 999px; background: rgba(47, 214, 130, .14); color: #50e69a; font: 800 9px var(--font-mono); font-style: normal; }
.fitting-public-row .fitting-public-description { white-space: normal; line-height: 1.45; }

.fitting-public-row b {
  font-size: 12px;
}

.fitting-public-row span,
.fitting-public-row small {
  color: #aaa;
  font-size: 11px;
  margin-top: 2px;
}

.fitting-main {
  position: relative;
  padding: 0;
  overflow: hidden;
  min-width: 0;
}

.fitting-game-stage {
  height: 100%;
  min-height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: radial-gradient(circle at 58% 46%, rgba(255,255,255,.03), transparent 36%), #101010;
}

.fitting-game-stage:before {
  display: none;
}

.fitting-fit-wheel {
  width: min(680px, 86vh, 100%);
  max-width: none;
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
}

.fitting-stage-meta {
  left: 28px;
  right: auto;
  top: 28px;
  width: 320px;
}

.fitting-stage-meta .kicker {
  color: #d4d4d4;
  font-size: 22px;
  text-transform: none;
  letter-spacing: 0;
}

.fitting-stage-meta h2 {
  font-size: 22px;
  color: #cfcfcf;
}

.fitting-slot-inspector {
  left: 28px;
  bottom: 96px;
  width: min(360px, 46%);
  max-height: 270px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: rgba(18,18,18,.82);
}

.fitting-hold-strip {
  left: 28px;
  bottom: 22px;
}

.fitting-hold-panel {
  left: 28px;
  bottom: 78px;
}

.fitting-logic-hidden,
.fitting-utility-hidden {
  display: none !important;
}

.fitting-status-panel {
  padding: 12px 14px;
  overflow: auto;
  background: #101010;
  color: #cfcfcf;
}

.fitting-character-select {
  width: 100%;
  height: 30px;
  margin-bottom: 8px;
  border: 2px solid #2786dd;
  outline: 2px solid rgba(39,134,221,.35);
  background: #222;
  color: #ddd;
  font: 700 14px var(--font-ui);
}

.fitting-estimate-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 8px;
  padding: 8px 9px;
  border: 1px solid #333;
  background: #181818;
}

.fitting-estimate-panel span,
.fitting-estimate-panel small {
  display: block;
  color: #aaa;
  font-size: 11px;
  line-height: 1.35;
}

.fitting-estimate-panel b {
  display: block;
  margin: 2px 0;
  overflow: hidden;
  color: #e6e6e6;
  font: 800 16px/1.2 var(--font-mono);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.fitting-estimate-panel button {
  min-width: 58px;
  min-height: 30px;
  border: 1px solid #2786dd;
  background: #17314a;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.fitting-estimate-panel button:disabled {
  opacity: 0.45;
  cursor: default;
}

.fit-status-section {
  margin: 0 0 7px;
  color: #cfcfcf;
}

.fit-status-section h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 7px;
  padding: 1px 9px;
  background: #222;
  color: #cfcfcf;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: 0;
}

.fit-status-section h3 b {
  color: #cfcfcf;
  font-size: 16px;
}

.fit-status-section:first-of-type h3 b {
  color: #83c768;
}

.fit-status-section:first-of-type h3 b.is-unstable {
  color: #ff6b63;
}

.fit-status-section:first-of-type h3 b.is-stable {
  color: #83c768;
}

.fit-status-section p,
.fit-status-pair,
.fit-status-grid,
.fit-status-defense {
  margin: 0 7px 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.fit-status-pair,
.fit-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 16px;
}

.fit-status-defense {
  display: grid;
  grid-template-columns: 26px 98px minmax(176px, 1fr);
  gap: 6px 6px;
  align-items: center;
}

.fit-status-section b,
.fit-status-section p,
.fit-status-pair span,
.fit-status-grid span,
.fit-status-defense b {
  white-space: nowrap;
}

.fit-status-defense > span {
  color: #aaa;
  text-align: center;
}

.fit-status-defense > i {
  display: block;
}

.fit-resists {
  display: grid;
  grid-template-columns: repeat(4, minmax(38px, 1fr));
  gap: 4px;
}

.fit-resists span {
  position: relative;
  display: block;
  min-width: 30px;
  padding: 1px 3px;
  overflow: hidden;
  text-align: center;
  background: #303030;
  color: #ddd;
}

.fit-resists span::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value, 0%);
  background: var(--resist-color);
}

.fit-resists span b {
  position: relative;
  z-index: 1;
}

.fit-resists .em { --resist-color: #2a78a4; }
.fit-resists .thermal { --resist-color: #9b2727; }
.fit-resists .kinetic { --resist-color: #5b5b5b; }
.fit-resists .explosive { --resist-color: #9a681e; }

@media (max-width: 1280px) {
  .fitting-workbench {
    grid-template-columns: 290px minmax(390px, 1fr) 340px;
  }

  .fitting-game-stage {
    grid-template-columns: 1fr;
  }

  .fitting-fit-wheel {
    width: min(560px, 80vh, 100%);
  }

  .fitting-ship-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .fitting-shell {
    min-height: auto;
  }

  .fitting-workbench {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .fitting-sidebar,
  .fitting-eft-panel {
    position: static;
    max-height: none;
  }

  .fitting-ship-card {
    grid-template-columns: 1fr;
  }

  .fitting-game-stage {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .fitting-shell {
    padding: 12px;
  }

  .fitting-hero {
    grid-template-columns: 1fr;
  }

  .fitting-fit-wheel {
    width: min(92vw, 420px);
  }

  .fitting-wheel-slot img {
    width: 33px;
    height: 33px;
  }

  .fitting-stat-grid,
  .fitting-slots-grid,
  .fitting-resource-bars,
  .fitting-sim-grid {
    grid-template-columns: 1fr;
  }
}

.starmap-detail-open .starmap-real-map-detail {
  display: block;
}

.starmap-real-map-detail span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.starmap-real-map-detail h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 22px;
}

.starmap-real-map-detail p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.6;
}

.starmap-real-map-detail dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.starmap-real-map-detail dl > div {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.035);
}

.starmap-real-map-detail dt {
  color: var(--muted);
  font-size: 11px;
}

.starmap-real-map-detail dd {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 12px;
}

.starmap-real-map-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.starmap-real-map-detail-head a {
  padding: 6px 9px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 12px;
}

.starmap-real-map-detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.starmap-real-map-detail-actions button {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  cursor: pointer;
}

.starmap-real-neighbours.compact {
  max-height: 236px;
  overflow: auto;
}

@media (max-width: 1180px) {
  .starmap-real-search-float {
    top: 54px;
    right: 10px;
    width: 200px;
  }

  .starmap-real-search-float:has(input:focus),
  .starmap-real-search-float:has(.starmap-real-search-results:not(:empty)) {
    width: 260px;
  }

  .starmap-fusion-intel {
    width: min(340px, calc(100% - 28px));
    max-height: 340px;
  }

  .starmap-real-page .starmap-lab-sidebar {
    transform: translateX(calc(-100% + 46px));
  }

  .starmap-real-page .starmap-lab-stage {
    min-height: 640px;
  }


  .starmap-real-page .starmap-lab-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .starmap-real-search-float {
    top: 12px;
    right: 12px;
    left: auto;
    width: calc(100% - 110px);
  }

  .starmap-real-search-float:has(input:focus),
  .starmap-real-search-float:has(.starmap-real-search-results:not(:empty)) {
    width: calc(100% - 110px);
  }

  .starmap-fusion-intel {
    left: 12px;
    right: 12px;
    bottom: 54px;
    width: auto;
    max-height: 230px;
    padding: 10px;
  }

  .starmap-real-page .starmap-lab-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .starmap-real-page .starmap-lab-stage {
    min-height: 560px;
  }
}

.battle-lab-page {
  max-width: 1180px;
  margin: 0 auto;
}

#battles-list,
#battles-container,
.recent-conflicts-panel,
.battle-list-stack {
  min-width: 0;
  max-width: 100%;
}

.battle-list-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.battle-list-card:hover,
.battle-list-card:focus-visible {
  border-color: var(--hud-accent);
}

.battle-list-main {
  flex: 1 1 auto;
  min-width: 0;
}

.candidate-card:hover,
.candidate-card:focus-visible {
  border-color: #22d3ee !important;
}

.tl-loss-head:hover,
.tl-loss-head:focus-visible {
  background: var(--hud-brand-a08);
}

.tl-bar:hover,
.tl-bar:focus {
  opacity: 1;
}

.battle-list-title {
  color: var(--text-primary);
  display: -webkit-box;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 4px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.battle-list-meta {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-list-sides {
  align-items: center;
  display: grid;
  flex: 0 1 360px;
  gap: 10px;
  grid-template-columns: minmax(86px, 1fr) auto minmax(86px, 1fr);
  max-width: 420px;
  min-width: 260px;
}

.battle-list-side {
  min-width: 0;
}

.battle-list-side.red {
  text-align: right;
}

.battle-list-side.blue {
  text-align: left;
}

.battle-list-side div {
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-list-side b {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  margin-top: 2px;
}

.battle-list-side.red,
.battle-list-side.red b {
  color: var(--hud-error);
}

.battle-list-side.blue,
.battle-list-side.blue b {
  color: var(--hud-accent);
}

.battle-list-vs {
  color: var(--text-tertiary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
}

.battle-list-total {
  flex: 0 0 86px;
  min-width: 86px;
  text-align: right;
}

.battle-list-total b {
  color: var(--hud-gold);
  display: block;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
}

.battle-list-total span {
  color: var(--text-tertiary);
  font-size: 11px;
}

.battle-list-bars {
  display: flex;
  gap: 4px;
  height: 8px;
  margin-top: 10px;
  max-width: 380px;
}

.battle-list-bars i {
  min-width: 8px;
  border-radius: 999px;
  box-shadow: 0 0 14px currentColor;
}

.battle-list-bars .red {
  color: rgba(255,79,123,.32);
  background: linear-gradient(90deg, #7c102b, #ff4f7b);
}

.battle-list-bars .blue {
  color: rgba(35,167,255,.32);
  background: linear-gradient(90deg, #128fff, #7ee4ff);
}

.recent-conflicts-panel {
  padding: 18px 20px 20px;
}

.recent-conflicts-head,
.battle-km-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.recent-conflicts-head h3,
.battle-km-detail-head h2 {
  margin: 4px 0 0;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.15;
}

.recent-conflicts-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.recent-conflicts-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

.recent-conflicts-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--hud-accent);
}

.hud-btn-icon {
  width: 38px;
  height: 38px;
  border: 1px solid var(--hud-brand-a20);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.hud-btn-icon:hover {
  border-color: var(--hud-accent);
  color: var(--hud-accent);
}

.recent-conflicts-rail {
  display: flex;
  gap: 14px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 14px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(35,167,255,.35) transparent;
  min-height: 212px;
}

.recent-conflict-card {
  flex: 0 0 360px;
  scroll-snap-align: start;
  border: 1px solid var(--hud-brand-a15);
  border-radius: var(--radius-card);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)),
    rgba(8,13,26,.68);
  padding: 16px;
  min-height: 196px;
  display: grid;
  grid-template-rows: minmax(58px, auto) 34px auto auto 10px;
  align-content: start;
  gap: 8px;
  overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.recent-conflict-card:hover {
  transform: translateY(-2px);
  border-color: var(--hud-accent);
  background:
    linear-gradient(180deg, rgba(35,167,255,.08), rgba(255,255,255,.02)),
    rgba(8,13,26,.76);
}

.recent-conflict-card.scale-epic,
.recent-conflict-card.scale-major {
  border-color: rgba(255,176,32,.40);
}

.recent-conflict-card.scale-medium {
  border-color: rgba(39,224,194,.32);
}

.recent-conflict-card.scale-small {
  border-color: rgba(255,79,123,.26);
}

.recent-conflict-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.recent-conflict-top strong {
  color: var(--text-primary);
  font-size: 17px;
  line-height: 1.25;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-conflict-top span {
  flex-shrink: 0;
  border: 1px solid rgba(255,176,32,.35);
  border-radius: var(--radius-sm);
  color: var(--hud-gold);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.recent-conflict-meta,
.recent-conflict-stats,
.recent-conflict-losses {
  color: var(--text-tertiary);
  font-size: 12px;
  min-width: 0;
}

.recent-conflict-meta {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.recent-conflict-stats,
.recent-conflict-losses {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.recent-conflict-stats b {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.recent-conflict-losses .red { color: #ff6b86; }
.recent-conflict-losses .blue { color: #61d9ff; }

.battle-list-search-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(35,167,255,.12);
  position: relative;
  z-index: 1;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
}

.battle-list-search-row input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--hud-brand-a18);
  border-radius: var(--radius-sm);
  background: rgba(3,8,18,.58);
  color: var(--text-primary);
  padding: 0 14px;
  font: 600 14px var(--font-sans);
  outline: none;
}

.battle-list-search-row input:focus {
  border-color: var(--hud-accent);
}

.battle-list-stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap-panel);
}

.recent-conflicts-empty,
.battle-list-empty {
  color: var(--text-tertiary);
  padding: 24px;
  text-align: center;
}

.battle-lab-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 12px;
}

.battle-lab-hero h1 {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1;
  white-space: nowrap;
}

.battle-lab-hero p {
  margin: 4px 0 0;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.35;
}

.battle-system-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.battle-system-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(0, 212, 170, 0.28);
  border-radius: 999px;
  background: rgba(0, 212, 170, 0.08);
  color: var(--hud-accent);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.battle-system-chip:hover {
  border-color: rgba(0, 212, 170, 0.58);
  background: rgba(0, 212, 170, 0.14);
}

.battle-system-chip small {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

/* 战报顶部快照：红方 | 交换比 | 蓝方 */
.battle-lab-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: stretch;
}

.battle-lab-metric {
  border: 1px solid var(--hud-brand-a15);
  border-radius: var(--radius-card);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, .01) 100%),
    rgba(8, 13, 26, .60);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 22px;
  min-width: 0;
}

.battle-lab-metric.red {
  border-color: rgba(255, 79, 123, .35);
  border-left-width: 4px;
  background:
    linear-gradient(180deg, rgba(255, 79, 123, .10) 0%, rgba(255, 79, 123, .02) 100%),
    rgba(8, 13, 26, .60);
}

.battle-lab-metric.blue {
  border-color: rgba(35, 167, 255, .35);
  border-left-width: 4px;
  background:
    linear-gradient(180deg, rgba(35, 167, 255, .10) 0%, rgba(35, 167, 255, .02) 100%),
    rgba(8, 13, 26, .60);
}

.battle-lab-metric.green {
  border-color: rgba(39, 224, 194, .35);
  background:
    linear-gradient(180deg, rgba(39, 224, 194, .08) 0%, rgba(39, 224, 194, .02) 100%),
    rgba(8, 13, 26, .60);
  text-align: center;
  align-items: center;
}

.battle-lab-metric span {
  display: block;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  margin-bottom: 8px;
}

.battle-lab-metric b {
  display: block;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.1;
}

.battle-lab-metric.red b { color: #ff6b86; }
.battle-lab-metric.blue b { color: #61d9ff; }
.battle-lab-metric.green b { color: #27e0c2; }

.battle-lab-metric small {
  display: block;
  margin-top: 6px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-family: var(--font-mono);
}

.battle-pressure-card {
  padding: 22px;
}

.battle-methodology-note {
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 180, 50, .24);
  border-radius: var(--radius-card);
  background: rgba(255, 180, 50, .055);
}

.battle-methodology-note summary {
  padding: 13px 16px;
  color: var(--hud-gold, #ffb432);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.battle-methodology-note > div {
  display: grid;
  gap: 8px;
  padding: 0 16px 15px;
}

.battle-methodology-note p,
.battle-reference-note {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.7;
}

.battle-methodology-note p strong {
  color: var(--text-secondary);
}

.battle-reference-note {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 180, 50, .18);
  border-radius: var(--radius-sm);
  background: rgba(255, 180, 50, .045);
}

.battle-pressure-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.battle-pressure-head h2 {
  margin: 4px 0 0;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 20px;
}

.battle-pressure-result {
  max-width: min(420px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(39, 224, 194, .32);
  border-radius: 999px;
  background: rgba(39, 224, 194, .08);
  color: #27e0c2;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
  white-space: nowrap;
}

.battle-pressure-row {
  display: grid;
  grid-template-columns: minmax(160px, 280px) minmax(0, 1fr) 54px;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.battle-pressure-label {
  min-width: 0;
}

.battle-pressure-label strong {
  display: block;
  color: var(--text-primary);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-pressure-label span {
  display: block;
  margin-top: 3px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-pressure-track {
  position: relative;
  height: 22px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .28);
}

.battle-pressure-track i {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 6px;
  border-radius: inherit;
  box-shadow: 0 0 16px currentColor;
}

.battle-pressure-row.red .battle-pressure-track i {
  color: rgba(255, 79, 123, .50);
  background: linear-gradient(90deg, #7c102b, #ff3e68 72%, #ff93a8);
}

.battle-pressure-row.blue .battle-pressure-track i {
  color: rgba(35, 167, 255, .50);
  background: linear-gradient(90deg, #064479, #128fff 72%, #7ee4ff);
}

.battle-pressure-row > b {
  color: var(--text-primary);
  font-size: 12px;
  text-align: right;
}

.battle-pressure-row.red > b { color: #ff6b86; }
.battle-pressure-row.blue > b { color: #61d9ff; }

.battle-pressure-third {
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-top: 10px;
  color: #ffb020;
  font-family: var(--font-mono);
  font-size: 12px;
}

.battle-time {
  color: #27e0c2;
  font-family: var(--font-mono);
}

.battle-lab-sandbox {
  padding: 22px;
}

.battle-faction-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-color: rgba(39, 224, 194, .22);
}

.battle-faction-line strong {
  flex: 0 0 auto;
  color: #4ef0d6;
  font-family: var(--font-display);
  font-size: 15px;
}

.battle-faction-line span {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-duel-card {
  padding: 22px;
}

.battle-duel-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.battle-duel-head > span {
  color: var(--text-tertiary);
  font-weight: 900;
  letter-spacing: .1em;
  writing-mode: vertical-rl;
}

.battle-duel-head > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.battle-duel-head strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.55;
  overflow: hidden;
  text-overflow: ellipsis;
}

.battle-duel-head strong.red,
.battle-duel-values .red {
  color: #ff6b86;
}

.battle-duel-head strong.blue,
.battle-duel-values .blue {
  color: #61d9ff;
}

.battle-duel-head b {
  color: var(--text-tertiary);
  font-family: var(--font-display);
  font-size: 22px;
}

.battle-duel-bars {
  display: grid;
  gap: 18px;
}

.battle-duel-values {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) auto minmax(86px, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.battle-duel-values span {
  color: #27e0c2;
  font-weight: 900;
  letter-spacing: .06em;
}

.battle-duel-values b:last-child {
  text-align: right;
}

.battle-duel-track {
  display: flex;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, .28);
}

.battle-duel-track i {
  display: block;
  min-width: 2px;
}

.battle-duel-track .red {
  background: linear-gradient(90deg, #7c102b, #ff3e68);
}

.battle-duel-track .blue {
  background: linear-gradient(90deg, #064479, #128fff);
}

.battle-tactical-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.battle-tactical-head h2 {
  margin: 4px 0 0;
}

.battle-tactical-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-tertiary);
}

.battle-tactical-summary span {
  border: 1px solid var(--hud-brand-a20);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255,255,255,.05);
}

.battle-tactical-summary .red { color: #ff6b86; border-color: rgba(255,79,123,.35); }
.battle-tactical-summary .blue { color: #61d9ff; border-color: rgba(35,167,255,.35); }
.battle-tactical-summary .gold { color: var(--hud-gold); border-color: rgba(255,176,32,.35); }

.battle-tactical-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 280px;
}

.battle-sandbox-filters {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--text-secondary);
  font-size: 12px;
}

.battle-sandbox-filters label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.battle-sandbox-filters input {
  width: 14px;
  height: 14px;
  accent-color: var(--hud-brand);
}

.battle-playback {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.battle-playback-stage {
  position: relative;
  min-height: 184px;
  border: 1px solid var(--hud-brand-a20);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)),
    rgba(5, 9, 18, .56);
  overflow: hidden;
}

.battle-playback-focus {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 14px;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) minmax(120px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius-sm);
  background: rgba(8, 12, 24, .72);
  backdrop-filter: blur(10px);
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(0,0,0,.18);
}

.battle-playback-focus span,
.battle-playback-focus b,
.battle-playback-focus i {
  font-family: var(--font-mono);
  white-space: nowrap;
}

.battle-playback-focus span {
  color: var(--hud-teal);
  font-weight: 800;
}

.battle-playback-focus strong,
.battle-playback-focus em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-playback-focus strong {
  color: var(--text-primary);
  font-size: 14px;
}

.battle-playback-focus em {
  color: var(--text-tertiary);
  font-size: 12px;
  font-style: normal;
}

.battle-playback-focus b {
  color: var(--hud-gold);
  font-size: 12px;
}

.battle-playback-focus i {
  color: var(--text-tertiary);
  font-size: 11px;
  font-style: normal;
}

.battle-playback-focus.red { border-color: rgba(255,79,123,.24); }
.battle-playback-focus.blue { border-color: rgba(35,167,255,.24); }
.battle-playback-focus.gold { border-color: rgba(255,176,32,.24); }

.battle-playback-line {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 62%;
  height: 70px;
  transform: translateY(-50%);
}

.battle-playback-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 30px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,79,123,.76), rgba(255,176,32,.62), rgba(35,167,255,.82));
  box-shadow: 0 0 20px rgba(35,167,255,.20);
}

.battle-playback-node {
  position: absolute;
  top: 19px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.65);
  background: rgba(14, 20, 36, .92);
  box-shadow: 0 0 0 8px rgba(255,255,255,.04);
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.battle-playback-node img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
}

.battle-playback-node span {
  color: #fff;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 900;
}

.battle-playback-node.red { border-color: rgba(255, 107, 134, .85); }
.battle-playback-node.blue { border-color: rgba(97, 217, 255, .85); }
.battle-playback-node.gold { border-color: rgba(255, 176, 32, .85); }
.battle-playback-node.past { opacity: .62; }
.battle-playback-node.active {
  transform: translateX(-50%) scale(1.32);
  opacity: 1;
  z-index: 4;
  box-shadow: 0 0 0 10px rgba(255,255,255,.10), 0 0 28px rgba(35,167,255,.34);
}

.battle-playback-controls {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.battle-playback-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(35, 167, 255, .38);
  border-radius: 999px;
  background: rgba(35, 167, 255, .16);
  color: #7fe9ff;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.battle-playback-button.secondary {
  background: rgba(255,255,255,.06);
  color: var(--text-secondary);
  border-color: rgba(255,255,255,.14);
}

.battle-playback-range {
  min-width: 0;
}

.battle-playback-range input[type="range"] {
  width: 100%;
  accent-color: var(--hud-brand);
}

.battle-sandbox-current {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.battle-sandbox-loss-column {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.035);
  padding: 12px;
  min-width: 0;
}

.battle-sandbox-loss-column.red { border-color: rgba(255,79,123,.25); }
.battle-sandbox-loss-column.blue { border-color: rgba(35,167,255,.25); }
.battle-sandbox-loss-column.gold {
  grid-column: 1 / -1;
  border-color: rgba(255,176,32,.25);
}

.battle-sandbox-loss-column h3 {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 13px;
}

.battle-sandbox-loss-column h3 span {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
}

.battle-sandbox-loss-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,.06);
  text-decoration: none;
}

.battle-sandbox-loss-row img,
.battle-sandbox-loss-row i {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  object-fit: cover;
  background: rgba(255,255,255,.08);
}

.battle-sandbox-loss-row i {
  display: grid;
  place-items: center;
  color: #fff;
  font-style: normal;
  font-weight: 900;
}

.battle-sandbox-loss-row span {
  min-width: 0;
}

.battle-sandbox-loss-row b,
.battle-sandbox-loss-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-sandbox-loss-row b {
  color: var(--text-primary);
  font-size: 12px;
}

.battle-sandbox-loss-row small {
  color: var(--text-tertiary);
  font-size: 11px;
}

.battle-sandbox-loss-row em {
  color: var(--hud-gold);
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.battle-tactical-track {
  border: 1px solid var(--hud-brand-a20);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)),
    rgba(5, 9, 18, .52);
  padding: 26px 22px 14px;
  margin-bottom: 18px;
}

.battle-tactical-line {
  position: relative;
  height: 72px;
}

.battle-tactical-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 33px;
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255,79,123,.78), rgba(255,176,32,.72), rgba(35,167,255,.78));
  box-shadow: 0 0 18px rgba(35,167,255,.20);
}

.battle-tactical-node {
  position: absolute;
  top: 18px;
  transform: translateX(-50%);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  text-decoration: none;
  border: 2px solid rgba(255,255,255,.72);
  background: rgba(11, 16, 31, .92);
  box-shadow: 0 0 0 7px rgba(255,255,255,.04);
  transition: transform .16s ease, box-shadow .16s ease;
}

.battle-tactical-node:hover {
  transform: translateX(-50%) scale(1.12);
  box-shadow: 0 0 0 10px rgba(35,167,255,.12);
}

.battle-tactical-node span {
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
}

.battle-tactical-node.red { background: #ff3e68; }
.battle-tactical-node.blue { background: #128fff; }
.battle-tactical-node.gold { background: #ffae20; }
.battle-tactical-node.muted { background: #657086; }

.battle-tactical-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.battle-tactical-meta b {
  color: var(--text-secondary);
}

.battle-tactical-grid {
  align-items: stretch;
}

.battle-tactical-events {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.battle-tactical-event {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.08);
  border-left: 4px solid rgba(255,255,255,.18);
  border-radius: 6px;
  background: rgba(255,255,255,.045);
  padding: 9px 10px;
  text-decoration: none;
}

.battle-tactical-event.red { border-left-color: #ff4f7b; }
.battle-tactical-event.blue { border-left-color: #23a7ff; }
.battle-tactical-event.gold { border-left-color: #ffb020; }

.battle-tactical-event i {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
}

.battle-tactical-event span {
  color: var(--text-primary);
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-tactical-event small {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.battle-tactical-event b {
  color: var(--hud-gold);
  font-family: var(--font-mono);
  font-size: 12px;
}

.battle-key-losses {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.035);
  overflow: hidden;
}

.battle-key-losses summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 800;
  list-style: none;
}

.battle-key-losses summary::-webkit-details-marker {
  display: none;
}

.battle-key-losses summary::before {
  content: "▸";
  color: var(--hud-accent);
  font-family: var(--font-mono);
  margin-right: 2px;
}

.battle-key-losses[open] summary::before {
  content: "▾";
}

.battle-key-losses summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.battle-key-losses summary b {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.battle-key-loss-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.battle-key-loss-strip .battle-tactical-event {
  grid-template-columns: 58px minmax(0, 1fr);
}

.battle-key-loss-strip .battle-tactical-event b {
  grid-column: 1 / -1;
  justify-self: start;
}

.timeline-suggestion-card {
  border: 1px solid rgba(35,167,255,.28);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(35,167,255,.12), rgba(255,255,255,.025)),
    rgba(8, 13, 26, .68);
  padding: 16px;
}

.timeline-suggestion-card.good {
  border-color: rgba(39,224,194,.38);
}

.timeline-suggestion-card.mid {
  border-color: rgba(255,176,32,.36);
}

.timeline-suggestion-card.low,
.timeline-suggestion-card.muted {
  border-color: rgba(255,255,255,.12);
}

.timeline-suggestion-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.timeline-suggestion-head h3 {
  margin: 4px 0 0;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 20px;
}

.timeline-suggestion-confidence {
  min-width: 86px;
  text-align: center;
  color: var(--hud-accent);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
}

.timeline-suggestion-confidence small {
  display: block;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
}

.timeline-suggestion-sides {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.timeline-suggestion-sides > div {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  background: rgba(255,255,255,.045);
  padding: 10px;
  min-width: 0;
}

.timeline-suggestion-sides > div.red {
  border-color: rgba(255,79,123,.30);
}

.timeline-suggestion-sides > div.blue {
  border-color: rgba(35,167,255,.30);
}

.timeline-suggestion-sides strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 12px;
}

.timeline-suggestion-sides span {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.timeline-suggestion-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.timeline-suggestion-reasons span {
  border-radius: 5px;
  background: rgba(255,255,255,.06);
  color: var(--text-tertiary);
  padding: 6px 8px;
  font-size: 11px;
}

.timeline-suggestion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.battle-lab-sandbox > h2,
.battle-lab-card h2,
.battle-lab-side h2 {
  margin: 0 0 16px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: .02em;
}

.battle-lab-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.battle-lab-side,
.battle-lab-card {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-card);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .04) 0%, rgba(255, 255, 255, .01) 100%),
    rgba(8, 13, 26, .56);
  padding: 20px;
  min-width: 0;
}

.diplomacy-promo {
  border-color: rgba(39, 224, 194, .25) !important;
  background:
    linear-gradient(135deg, rgba(39, 224, 194, .08), rgba(35, 167, 255, .03)),
    rgba(8, 13, 26, .56) !important;
}

.battle-lab-side.red,
.battle-lab-card.red {
  border-color: rgba(255, 79, 123, .28);
  border-left: 3px solid rgba(255, 79, 123, .55);
}

.battle-lab-side.blue,
.battle-lab-card.blue {
  border-color: rgba(35, 167, 255, .28);
  border-left: 3px solid rgba(35, 167, 255, .55);
}

.battle-lab-side > p {
  margin: -8px 0 16px;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.6;
}

.battle-lab-side.red h2,
.battle-lab-card.red h2 {
  color: #ff6b86;
}

.battle-lab-side.blue h2,
.battle-lab-card.blue h2 {
  color: #61d9ff;
}

.battle-lab-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.battle-lab-chip {
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: var(--text-secondary);
  padding: 5px 10px;
  font-size: 12px;
}

.battle-lab-chip b {
  color: var(--text-primary);
}

.battle-lab-chip.red {
  background: rgba(255, 79, 123, .12);
  color: #ff8aa3;
}

.battle-lab-chip.blue {
  background: rgba(35, 167, 255, .12);
  color: #7ee4ff;
}

.battle-lab-chip.green {
  background: rgba(39, 224, 194, .12);
  color: #4ef0d6;
}

.battle-lab-side h3 {
  color: var(--text-tertiary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 10px;
}

.battle-lab-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  padding: 10px 0;
}

.battle-lab-row:last-child {
  border-bottom: none;
}

.battle-lab-row span,
.battle-lab-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-lab-row span {
  color: var(--text-primary);
  font-weight: 700;
}

.battle-lab-row small {
  color: var(--text-tertiary);
}

.battle-lab-row b {
  color: var(--hud-gold);
  font-family: var(--font-mono);
  font-size: 12px;
}

.battle-lab-row b.red { color: #ff6b86; }
.battle-lab-row b.blue { color: #61d9ff; }

.battle-lab-rank {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .04);
  margin-bottom: 8px;
  padding: 9px 11px;
  overflow: hidden;
}

.battle-lab-rank i,
.battle-lab-rank span,
.battle-lab-rank b {
  position: relative;
  z-index: 1;
}

.battle-lab-rank i {
  color: var(--text-tertiary);
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 900;
}

.battle-lab-rank span {
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-lab-rank small {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.battle-lab-rank b {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.battle-lab-rank.red b { color: #ff6b86; }
.battle-lab-rank.blue b { color: #61d9ff; }

.battle-lab-rank em {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  border-radius: 0 0 0 var(--radius-sm);
}

.battle-lab-rank.red em { background: #ff4f7b; }
.battle-lab-rank.blue em { background: #23a7ff; }

.battle-lab-empty {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

.battle-km-detail {
  padding: 20px 22px;
}

.battle-km-detail-head > span {
  color: var(--text-tertiary);
  font-size: 12px;
  text-align: right;
}

.battle-km-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.battle-km-column {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-card);
  background: rgba(8,13,26,.42);
  min-width: 0;
  padding: 14px;
}

.battle-km-column.red {
  border-color: rgba(255,79,123,.28);
}

.battle-km-column.blue {
  border-color: rgba(35,167,255,.28);
}

.battle-km-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.battle-km-column-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
}

.battle-km-column.red .battle-km-column-head h2 { color: #ff6b86; }
.battle-km-column.blue .battle-km-column-head h2 { color: #61d9ff; }

.battle-km-column-head span {
  color: var(--text-tertiary);
  font: 700 12px var(--font-mono);
}

.battle-km-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 720px;
  overflow: auto;
  padding-right: 4px;
}

.battle-km-card {
  display: grid;
  grid-template-columns: 54px 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.035);
  color: inherit;
  min-height: 58px;
  padding: 9px 11px;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease;
}

.battle-km-card:hover {
  background: rgba(255,255,255,.065);
}

.battle-km-card.red:hover { border-color: rgba(255,79,123,.42); }
.battle-km-card.blue:hover { border-color: rgba(35,167,255,.42); }
.battle-km-card.gold:hover { border-color: rgba(255,176,32,.42); }

.battle-km-card img,
.battle-km-card i {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255,255,255,.08);
}

.battle-km-card i {
  display: grid;
  place-items: center;
  color: #fff;
  font-style: normal;
  font-weight: 900;
}

.battle-km-time {
  color: var(--text-tertiary);
  font-size: 12px;
}

.battle-km-main {
  min-width: 0;
}

.battle-km-main strong,
.battle-km-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-km-main strong {
  color: var(--text-primary);
  font-size: 13px;
  margin-bottom: 3px;
}

.battle-km-main span {
  color: var(--text-tertiary);
  font-size: 12px;
}

.battle-km-card > b {
  color: var(--hud-gold);
  font: 800 12px var(--font-mono);
  white-space: nowrap;
}

.battle-km-third {
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 14px;
  padding-top: 12px;
}

.battle-km-third summary {
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 10px;
}

.battle-faction-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.battle-faction-grid > div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-card);
  padding: 14px;
  background: rgba(255, 255, 255, .04);
}

.battle-faction-grid > div.red {
  border-color: rgba(255, 79, 123, .25);
  background: rgba(255, 79, 123, .06);
}

.battle-faction-grid > div.blue {
  border-color: rgba(35, 167, 255, .25);
  background: rgba(35, 167, 255, .06);
}

.battle-faction-grid > div.neutral {
  border-color: rgba(39, 224, 194, .25);
  background: rgba(39, 224, 194, .06);
}

.battle-faction-grid strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  margin-bottom: 6px;
}

.battle-faction-grid > div.red strong { color: #ff8aa3; }
.battle-faction-grid > div.blue strong { color: #7ee4ff; }
.battle-faction-grid > div.neutral strong { color: #4ef0d6; }

.battle-faction-grid p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.battle-ship-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.battle-ship-table th,
.battle-ship-table td {
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  padding: 10px;
  text-align: left;
}

.battle-ship-table th {
  color: var(--text-tertiary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.battle-ship-table td {
  color: var(--text-secondary);
}

.battle-ship-table td.red {
  color: #ff6b86;
  font-family: var(--font-mono);
}

.battle-ship-table td.blue {
  color: #61d9ff;
  font-family: var(--font-mono);
}

@media (max-width: 920px) {
  .battle-list-card {
    align-items: flex-start;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    padding: 14px;
  }

  .battle-list-sides {
    flex: 1 1 auto;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .battle-list-total {
    text-align: left;
    min-width: 0;
    width: 100%;
  }

  .recent-conflicts-head,
  .battle-km-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .recent-conflict-card {
    flex-basis: min(82vw, 320px);
    max-width: calc(100vw - 64px);
  }

  .battle-km-columns {
    grid-template-columns: 1fr;
  }

  .battle-km-card {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .battle-km-card > b {
    grid-column: 2;
    justify-self: start;
  }

  .battle-lab-score,
  .battle-lab-two,
  .battle-faction-grid,
  .timeline-suggestion-sides {
    grid-template-columns: 1fr;
  }

  .battle-lab-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .battle-faction-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .battle-faction-line span {
    white-space: normal;
  }

  .battle-duel-head,
  .battle-duel-head > div {
    grid-template-columns: 1fr;
  }

  .battle-duel-head > span {
    writing-mode: horizontal-tb;
  }

  .battle-duel-head b {
    display: none;
  }

  .battle-pressure-head {
    flex-direction: column;
  }

  .battle-pressure-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .battle-pressure-row > b {
    text-align: left;
  }

  .battle-tactical-head {
    flex-direction: column;
  }

  .battle-tactical-summary {
    justify-content: flex-start;
  }

  .battle-tactical-side {
    align-items: flex-start;
    min-width: 0;
    width: 100%;
  }

  .battle-sandbox-filters {
    justify-content: flex-start;
  }

  .battle-playback-stage {
    overflow-x: auto;
  }

  .battle-playback-focus {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    margin: 12px;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .battle-playback-line {
    min-width: 560px;
    right: auto;
    width: 560px;
    top: 72%;
  }

  .battle-playback-controls,
  .battle-sandbox-current {
    grid-template-columns: 1fr;
  }

  .battle-playback-button {
    width: 100%;
    border-radius: var(--radius-sm);
  }

  .battle-tactical-track {
    padding-inline: 14px;
    overflow-x: auto;
  }

  .battle-tactical-line {
    min-width: 560px;
  }

  .battle-tactical-meta {
    min-width: 560px;
  }

  .battle-tactical-event {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .battle-tactical-event b {
    grid-column: 2;
    justify-self: start;
  }

  .battle-key-loss-strip {
    grid-template-columns: 1fr;
  }

  .timeline-suggestion-head {
    flex-direction: column;
  }

  .timeline-suggestion-confidence {
    text-align: left;
  }
}

@media (max-width: 520px) {
  #battles-list {
    overflow-x: clip;
  }

  .recent-conflicts-panel {
    padding: 14px;
    overflow: hidden;
  }

  .recent-conflicts-rail {
    margin-inline: -2px;
    width: 100%;
    contain: inline-size;
  }

  .recent-conflict-card {
    flex-basis: min(78vw, 304px);
    max-width: min(78vw, 304px);
  }

  .battle-list-side div,
  .battle-list-side b,
  .battle-list-meta {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Compositor safety boundary
 * --------------------------
 * 开明网的大面板、固定导航、动效卡片和助手可能同时覆盖数十万像素。
 * Chromium/WebKit 在多层 backdrop-filter 交叠、滚动或开合时会偶发整页闪烁。
 * 毛玻璃只是装饰，不是产品能力；统一走普通绘制路径，优先保证所有页面稳定。
 * 对话框自身的 ::backdrop 不在此范围内。 */
html * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.starmap-lab-toolbar,
.starmap-lab-note {
  position: absolute;
  z-index: 2;
}

.starmap-lab-toolbar {
  top: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: min(560px, calc(100% - 24px));
}

.starmap-real-page .starmap-lab-toolbar {
  top: 66px;
}

.starmap-lab-toolbar button.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 119, 255, .18);
}

.starmap-lab-note {
  left: 12px;
  bottom: 12px;
  max-width: min(760px, calc(100% - 24px));
  padding: 8px 10px;
  color: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius-sm);
  background: rgba(7, 10, 18, .72);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 960px) {
  .starmap-lab-page {
    padding: 8px 14px 24px;
  }

  .starmap-lab-shell {
    grid-template-columns: 1fr;
  }

  .starmap-lab-sidebar,
  .starmap-lab-stage {
    min-height: 520px;
  }
}

.intel-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.intel-metric,
.intel-focus-card,
.abyss-score-card {
  padding: 14px;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  background: rgba(0,0,0,.22);
}

.intel-metric span,
.intel-focus-card span,
.abyss-score-card span {
  display: block;
  color: var(--text-tertiary);
  font-size: 12px;
}

.intel-metric strong,
.intel-focus-card strong,
.abyss-score-card strong {
  display: block;
  margin-top: 4px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 22px;
  line-height: 1.15;
}

.intel-metric small,
.intel-focus-card b,
.abyss-score-card b,
.abyss-score-card p {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.intel-focus {
  margin-top: 12px;
}

.intel-list,
.intel-news,
.abyss-groups,
.abyss-score-attrs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intel-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: inherit;
  text-decoration: none;
}

.intel-row strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
}

.intel-row small {
  display: block;
  max-width: 420px;
  color: var(--text-tertiary);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.intel-row b {
  color: var(--hud-gold);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

.intel-news-item {
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.025);
  color: inherit;
  text-decoration: none;
}

a.intel-news-item:hover {
  border-color: rgba(0, 122, 255, 0.42);
  background: rgba(0, 122, 255, 0.08);
}

.intel-news-item.is-hot {
  border-color: var(--hud-gold-a25);
  background: var(--hud-gold-a12);
}

.intel-news-item time {
  display: block;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
}

.intel-news-item p {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.intel-empty {
  padding: 14px;
  color: var(--text-tertiary);
  font-size: 13px;
  border: 1px dashed var(--hud-brand-a15);
  border-radius: var(--radius-card);
}

.abyss-group {
  padding: 12px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-card);
  background: rgba(0,0,0,.16);
}

.abyss-lab-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.abyss-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 14px;
}

.abyss-overview-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.abyss-overview-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.abyss-primary-input {
  min-height: 320px;
}

.abyss-highlight-list {
  max-height: 290px;
  overflow: auto;
}

.abyss-highlight {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: transparent;
  cursor: pointer;
}

.abyss-highlight:hover {
  background: rgba(0, 119, 255, .08);
}

.abyss-directory-panel {
  margin-top: 0;
}

.abyss-group h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.abyss-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.abyss-type {
  min-height: 56px;
  text-align: left;
  color: var(--text-primary);
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,.22);
  cursor: pointer;
}

.abyss-type:hover,
.abyss-type.is-cached {
  border-color: var(--hud-brand-a30);
  background: var(--hud-brand-a08);
}

.abyss-type span,
.abyss-type small {
  display: block;
}

.abyss-type small {
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.abyss-input {
  width: 100%;
  min-height: 250px;
  resize: vertical;
  color: var(--text-primary);
  border: 1px solid var(--hud-brand-a15);
  border-radius: var(--radius-card);
  background: rgba(0,0,0,.28);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

.abyss-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

@media (max-width: 980px) {
  .abyss-command-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .abyss-overview-cards {
    grid-template-columns: 1fr;
  }

  .abyss-primary-input {
    min-height: 260px;
  }
}

.wormhole-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 12px;
}

.wormhole-input {
  min-height: 48px;
  resize: none;
}

.wormhole-system-card {
  display: grid;
  gap: 16px;
}

.wormhole-system-card h3 {
  margin: 6px 0 4px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1;
}

.wormhole-system-card p {
  margin: 0;
  color: var(--text-secondary);
}

.wormhole-system-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.wormhole-system-metrics span {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, .18);
}

.wormhole-system-metrics b,
.wormhole-system-metrics small {
  display: block;
}

.wormhole-system-metrics b {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 18px;
}

.wormhole-system-metrics small,
.wormhole-system-warning {
  color: var(--text-tertiary);
  font-size: 12px;
}

.wormhole-graph {
  overflow: hidden;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  background:
    radial-gradient(circle at 50% 48%, rgba(90, 200, 250, .12), transparent 35%),
    radial-gradient(circle at 48% 48%, rgba(255, 59, 48, .10), transparent 42%),
    rgba(0, 0, 0, .28);
}

.wormhole-graph svg {
  display: block;
  width: 100%;
  min-height: 300px;
}

.wormhole-graph rect {
  fill: rgba(1, 6, 18, .58);
}

.wormhole-orbit {
  fill: none;
  stroke: rgba(90, 200, 250, .22);
  stroke-width: 1.4;
  stroke-dasharray: 6 8;
}

.wormhole-orbit.inner {
  stroke: rgba(255, 149, 0, .18);
}

.wormhole-link {
  stroke: rgba(90, 200, 250, .42);
  stroke-width: 1.5;
}

.wormhole-link.static {
  stroke: rgba(255, 149, 0, .72);
  stroke-width: 2.2;
}

.wormhole-link.random {
  stroke: rgba(90, 200, 250, .24);
}

.wormhole-node circle {
  fill: rgba(10, 16, 34, .86);
  stroke: rgba(90, 200, 250, .62);
  stroke-width: 1.6;
}

.wormhole-node.center circle {
  fill: rgba(0, 122, 255, .18);
  stroke: rgba(90, 200, 250, .88);
  stroke-width: 2.4;
  filter: drop-shadow(0 0 16px rgba(90, 200, 250, .32));
}

.wormhole-node.static .wormhole-node-core {
  fill: rgba(255, 149, 0, .16);
  stroke: rgba(255, 149, 0, .88);
}

.wormhole-node.static.destination-highsec .wormhole-node-core,
.wormhole-graph-legend i.static.destination-highsec {
  fill: rgba(49, 210, 124, .18);
  stroke: #31d27c;
  background: #31d27c;
}

.wormhole-node.static.destination-lowsec .wormhole-node-core,
.wormhole-graph-legend i.static.destination-lowsec {
  fill: rgba(245, 196, 81, .18);
  stroke: #f5c451;
  background: #f5c451;
}

.wormhole-node.static.destination-nullsec .wormhole-node-core,
.wormhole-graph-legend i.static.destination-nullsec {
  fill: rgba(255, 91, 110, .18);
  stroke: #ff5b6e;
  background: #ff5b6e;
}

.wormhole-node.static.destination-wormhole .wormhole-node-core,
.wormhole-graph-legend i.static.destination-wormhole {
  fill: rgba(78, 184, 255, .18);
  stroke: #4eb8ff;
  background: #4eb8ff;
}

.wormhole-link.static.destination-highsec { stroke: #31d27c; }
.wormhole-link.static.destination-lowsec { stroke: #f5c451; }
.wormhole-link.static.destination-nullsec { stroke: #ff5b6e; }
.wormhole-link.static.destination-wormhole { stroke: #4eb8ff; }

.wormhole-node-static-ring {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.6 !important;
  stroke-dasharray: 3 3;
  opacity: .78;
}

.wormhole-node.static.destination-highsec { color: #31d27c; }
.wormhole-node.static.destination-lowsec { color: #f5c451; }
.wormhole-node.static.destination-nullsec { color: #ff5b6e; }
.wormhole-node.static.destination-wormhole { color: #4eb8ff; }
.wormhole-node.static.destination-unknown { color: var(--hud-gold); }

.wormhole-node-kind {
  fill: currentColor;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-anchor: middle;
}

.wormhole-node-label {
  fill: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  text-anchor: middle;
}

.wormhole-node.center .wormhole-node-label {
  font-size: 16px;
}

.wormhole-node-sub {
  fill: var(--text-secondary);
  font-size: 11px;
  text-anchor: middle;
}

.wormhole-planet-dot {
  fill: rgba(255, 255, 255, .78);
  stroke: rgba(90, 200, 250, .50);
  stroke-width: 1;
}

.wormhole-graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 14px 14px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.wormhole-graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wormhole-graph-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--hud-accent);
}

.wormhole-graph-legend i.static {
  border: 2px dashed currentColor;
  background: var(--hud-gold);
}

.wormhole-graph-legend i.random {
  background: var(--cyan);
}

.wormhole-graph-legend i.planet {
  background: var(--text-primary);
}

.wormhole-section-title {
  margin: 12px 0 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.wormhole-system-hole {
  cursor: pointer;
}

.wormhole-system-hole.is-static {
  border-left: 3px solid var(--hud-gold);
}

.wormhole-system-hole.is-static.destination-highsec { border-left-color: #31d27c; }
.wormhole-system-hole.is-static.destination-lowsec { border-left-color: #f5c451; }
.wormhole-system-hole.is-static.destination-nullsec { border-left-color: #ff5b6e; }
.wormhole-system-hole.is-static.destination-wormhole { border-left-color: #4eb8ff; }

.wormhole-fixed-badge {
  display: inline-flex;
  margin-right: 8px;
  padding: 2px 6px;
  color: var(--text-primary);
  border: 1px dashed currentColor;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-style: normal;
  line-height: 1;
}

.wormhole-calculator {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wormhole-calculator label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.wormhole-calculator input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--text-primary);
  border: 1px solid var(--hud-brand-a15);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,.26);
  font-family: var(--font-mono);
}

.wormhole-row {
  cursor: pointer;
}

.abyss-score {
  margin-top: 12px;
}

.abyss-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.abyss-detail-head span,
.abyss-detail-head a,
.abyss-detail-head em {
  color: var(--text-tertiary);
  font-size: 12px;
  text-decoration: none;
  font-style: normal;
}

.abyss-detail-head strong {
  color: var(--text-primary);
  font-size: 14px;
}

@media (max-width: 980px) {
  .intel-page {
    padding: 8px 12px 24px;
  }
  .intel-hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .intel-grid-2,
  .intel-grid-3 {
    grid-template-columns: 1fr;
  }
  .influence-map-frame {
    min-height: 280px;
  }
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1500px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.site-footer {
  position: relative;
  z-index: 1;
  width: min(1500px, calc(100vw - 36px));
  margin: 0 auto 24px;
  padding: 14px 0 0;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.7;
}

.site-footer-inner {
  display: grid;
  gap: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--hud-brand-a12);
}

.site-footer p {
  margin: 0;
}

:root[data-theme="light"] .site-footer {
  color: #6b7280;
}

:root[data-theme="light"] .site-footer-inner {
  border-top-color: rgba(15, 23, 42, 0.12);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 12px 0;
  background: rgba(22, 24, 35, 0.88);
  backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--panel-border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 260px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-red);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 67, 91, 0.85), rgba(99, 214, 232, 0.12));
  color: #fff;
  font-weight: 900;
  font-family: var(--font-mono);
  box-shadow: 0 0 16px rgba(255, 67, 91, 0.2);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0.01em;
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
  font-size: 13px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.topnav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.topnav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--soft);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
}

.topnav a:hover {
  border-color: var(--panel-border);
  background: var(--accent-hover);
}

.topnav a.nav-auth {
  border-color: var(--line-red);
  color: var(--text);
  background: rgba(255, 67, 91, 0.14);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.45fr);
  gap: 14px;
  align-items: stretch;
  padding: 16px 0 14px;
}

.module-console,
.status-panel,
.panel {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.module-console {
  min-height: 460px;
  display: grid;
  align-content: space-between;
  gap: 22px;
  padding: clamp(22px, 4vw, 42px);
  border-color: rgba(255, 67, 91, 0.22);
}

.panel-head {
  display: grid;
  gap: 10px;
}

.panel-head.compact {
  gap: 6px;
}

.kicker {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: var(--font-mono);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  color: var(--text);
  font-size: clamp(34px, 5vw, 68px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  letter-spacing: 0.005em;
}

p {
  color: var(--soft);
  line-height: 1.68;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.module-tile {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.18s;
}

.module-tile.active,
.module-tile:hover,
.module-tile:focus-visible {
  border-color: var(--line-red);
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

.module-tile strong,
.module-tile span {
  display: block;
}

.module-tile span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ===== AI 助手浮窗（新版） ===== */

.assistant-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(0, 122, 255, 0.45);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.95), rgba(0, 80, 200, 0.98));
  box-shadow: 0 10px 30px rgba(0, 80, 200, 0.35), inset 0 1px 0 rgba(255,255,255,0.12);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.assistant-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0, 122, 255, 0.45), inset 0 1px 0 rgba(255,255,255,0.15);
}

.assistant-launcher-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 8px #34c759;
  animation: assistant-pulse 2s infinite;
}

.assistant-launcher > small {
  border-left: 1px solid rgba(255,255,255,0.28);
  padding-left: 8px;
  color: rgba(255,255,255,0.74);
  font-size: 9px;
  letter-spacing: 0.12em;
}

@keyframes assistant-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* 页面感知反馈：只在真实读取页面上下文、执行或验证页面动作时启用。
   主路径是 ai-motion 风格的 WebGL2 流动边缘；CSS 只在 WebGL2 不可用时
   提供同方向的周界渐变。页面元素仍在内存中观察，不再把调试编号覆盖到玩家页面。 */
.assistant-page-scan {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  contain: strict;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 0s linear 180ms;
}

.assistant-page-scan.is-active {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.assistant-motion-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: .94;
  filter: saturate(1.12);
  transform-origin: center;
  pointer-events: none;
}

@property --assistant-flow-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@supports ((-webkit-mask-composite: xor) or (mask-composite: exclude)) {
  .assistant-page-scan:not(.has-webgl-motion)::before,
  .assistant-page-scan:not(.has-webgl-motion)::after {
    content: "";
    position: absolute;
    pointer-events: none;
    background: conic-gradient(
      from var(--assistant-flow-angle),
      #48daff,
      #975cff 27%,
      #ff53a8 52%,
      #ffa648 76%,
      #48daff
    );
    -webkit-mask:
      linear-gradient(#000 0 0) content-box,
      linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask:
      linear-gradient(#000 0 0) content-box,
      linear-gradient(#000 0 0);
    mask-composite: exclude;
    animation: assistant-perimeter-flow 5.4s linear infinite;
  }

  .assistant-page-scan:not(.has-webgl-motion)::before {
    inset: -10px;
    padding: 28px;
    border-radius: 26px;
    opacity: .7;
    filter: blur(13px) saturate(1.2);
  }

  .assistant-page-scan:not(.has-webgl-motion)::after {
    inset: 0;
    padding: 3px;
    border-radius: 15px;
    opacity: .94;
    filter: saturate(1.15);
  }
}

.assistant-page-scan-hud {
  position: absolute;
  top: 14px;
  left: 50%;
  min-width: min(420px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(84, 203, 255, .44);
  border-radius: 999px;
  color: #eaf8ff;
  background: linear-gradient(100deg, rgba(3, 15, 35, .94), rgba(11, 25, 62, .92));
  box-shadow: 0 8px 32px rgba(0, 8, 30, .34), inset 0 0 22px rgba(44, 142, 255, .08);
  transform: translate3d(-50%, -8px, 0);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
}

.assistant-page-scan.is-active .assistant-page-scan-hud {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

.assistant-page-scan-hud > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.assistant-page-scan-hud strong,
.assistant-page-scan-hud small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-page-scan-hud strong { font-size: 11px; letter-spacing: .05em; }
.assistant-page-scan-hud small { color: rgba(204, 230, 255, .7); font-size: 9px; }
.assistant-page-scan-hud time { color: #7ee9ff; font: 700 10px var(--font-mono); }

.assistant-page-scan-core {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(102, 229, 255, .7);
  border-radius: 50%;
  box-shadow: inset 0 0 8px rgba(49, 152, 255, .35), 0 0 12px rgba(65, 210, 255, .28);
}

.assistant-page-scan-core::before,
.assistant-page-scan-core::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed #70deff;
  border-radius: 50%;
  animation: assistant-page-core-spin 2s linear infinite;
}

.assistant-page-scan-core::after {
  inset: 6px;
  border: 0;
  background: #68e8ff;
  box-shadow: 0 0 9px #4ab8ff;
  animation: assistant-page-core-breathe 1.15s ease-in-out infinite;
}

@keyframes assistant-perimeter-flow {
  to { --assistant-flow-angle: 360deg; }
}

@keyframes assistant-page-core-breathe {
  0%, 100% { opacity: .52; }
  50% { opacity: 1; }
}

@keyframes assistant-page-core-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-page-scan::before,
  .assistant-page-scan::after {
    animation: none !important;
  }
}

.floating-chat {
  position: fixed;
  right: 22px;
  bottom: 82px;
  z-index: 61;
  width: min(400px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  transition: opacity 220ms ease, transform 220ms ease;
}

.floating-chat[hidden] {
  display: none !important;
}

.floating-chat.is-closed {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.96);
}

/* 空态（仅欢迎语）时高度压到自适应，避免 640px 巨大留白 */
.floating-chat.is-empty {
  height: auto;
  max-height: 360px;
}
.floating-chat.is-empty .chat-log {
  min-height: 0;
}

.assistant-rail {
  /* NOTE: do NOT set grid-template-rows here — let .floating-chat's
     auto auto minmax(0,1fr) auto take effect so the chat-log gets 1fr
     and the ask-box always stays visible at the bottom. */
  border: 1px solid var(--hud-brand-a10, rgba(255,255,255,0.06));
  border-radius: 20px;
  /* A fixed full-window backdrop blur intermittently flashes in WebKit/GPU
     compositing. Keep the same depth with an opaque layered surface instead. */
  background: linear-gradient(180deg, #10182f 0%, #080f20 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255,255,255,0.03) inset;
}

.assistant-rail.is-expanded {
  right: 24px;
  bottom: 24px;
  width: min(980px, calc(100vw - 48px));
  height: min(860px, calc(100vh - 48px));
  max-height: min(860px, calc(100vh - 48px));
}

.chat-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hud-brand-a10, rgba(255,255,255,0.06));
}

.assistant-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assistant-identity-badge {
  margin-left: auto;
  border: 1px solid rgba(0,122,255,0.2);
  border-radius: 999px;
  padding: 3px 8px;
  color: rgba(130,190,255,0.9);
  background: rgba(0,122,255,0.08);
  font-size: 10px;
  line-height: 1.2;
}

.assistant-identity-badge[data-identity="esi"] {
  border-color: rgba(52,199,89,0.28);
  color: rgba(101,220,137,0.95);
  background: rgba(52,199,89,0.09);
}

.assistant-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0,122,255,0.9), rgba(0,80,200,0.95));
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.assistant-title strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.assistant-subtitle {
  display: block;
  font-size: 10px;
  color: var(--text-tertiary, var(--muted));
}

.assistant-head-actions {
  display: flex;
  gap: 2px;
}

.assistant-icon-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  color: var(--text-secondary, var(--soft));
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.assistant-icon-btn:hover {
  color: var(--text-primary, var(--text));
  background: rgba(255,255,255,0.06);
}

.assistant-context {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 14px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.035);
  font-size: 11px;
}

.assistant-context > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.assistant-context > small {
  overflow: hidden;
  max-width: 54%;
  color: var(--text-tertiary, var(--muted));
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-context[hidden] {
  display: none;
}

.assistant-context span {
  color: var(--text-tertiary, var(--muted));
}

.assistant-context strong {
  overflow: hidden;
  color: var(--text-secondary, var(--soft));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-live-status {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 8px minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  margin: 4px 14px 0;
  border: 1px solid rgba(0,122,255,0.16);
  border-radius: 10px;
  padding: 7px 10px;
  background: rgba(0,122,255,0.07);
}

.assistant-live-status[hidden] { display: none; }

.assistant-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #57a9ff;
  box-shadow: 0 0 0 4px rgba(0,122,255,0.12);
}

.assistant-live-status[data-state="working"] .assistant-live-dot {
  animation: assistant-pulse 1.2s ease-in-out infinite;
}

.assistant-live-status[data-state="completed"] {
  border-color: rgba(52,199,89,0.2);
  background: rgba(52,199,89,0.07);
}

.assistant-live-status[data-state="completed"] .assistant-live-dot { background: #34c759; }
.assistant-live-status[data-state="blocked"] .assistant-live-dot { background: #ff9f0a; }

.assistant-live-status strong {
  color: var(--text-primary, var(--text));
  font-size: 11px;
}

.assistant-live-status small {
  overflow: hidden;
  color: var(--text-tertiary, var(--muted));
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.assistant-body > .chat-log { flex: 1; }

.assistant-inspector {
  display: none;
  min-width: 0;
  overflow-y: auto;
  border-left: 1px solid var(--hud-brand-a10, rgba(255,255,255,0.06));
  padding: 14px;
  background: rgba(3,8,20,0.22);
}

.assistant-rail.is-expanded .assistant-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 310px);
}

.assistant-rail.is-expanded .assistant-inspector {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.assistant-inspector > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.assistant-inspector > header span,
.assistant-inspector section > small {
  color: var(--text-tertiary, var(--muted));
  font-size: 10px;
  letter-spacing: 0.04em;
}

.assistant-inspector > header strong {
  border-radius: 999px;
  padding: 3px 8px;
  color: #8ac0ff;
  background: rgba(0,122,255,0.1);
  font-size: 10px;
}

.assistant-inspector > header strong[data-state="completed"] {
  color: #70dc90;
  background: rgba(52,199,89,0.1);
}

.assistant-inspector > header strong[data-state="blocked"],
.assistant-inspector > header strong[data-state="partial"],
.assistant-inspector > header strong[data-state="needs_input"],
.assistant-inspector > header strong[data-state="unavailable"] {
  color: #ffc36b;
  background: rgba(255,159,10,0.1);
}

.assistant-inspector > section {
  border: 1px solid var(--hud-brand-a10, rgba(255,255,255,0.06));
  border-radius: 12px;
  padding: 11px;
  background: rgba(255,255,255,0.025);
}

.assistant-inspector > section > strong {
  display: block;
  margin-top: 5px;
  color: var(--text-primary, var(--text));
  font-size: 13px;
  line-height: 1.45;
}

.assistant-inspector > section > p {
  margin: 6px 0 0;
  color: var(--text-secondary, var(--soft));
  font-size: 11px;
  line-height: 1.55;
}

.assistant-inspector-chips,
.assistant-inspector-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.assistant-inspector-chips span,
.assistant-inspector-evidence span {
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--text-secondary, var(--soft));
  background: rgba(255,255,255,0.035);
  font-size: 9px;
}

.assistant-inspector-chips span.is-private {
  border-color: rgba(52,199,89,0.2);
  color: #70dc90;
  background: rgba(52,199,89,0.08);
}

.assistant-inspector-timeline {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.assistant-inspector-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 2px 7px;
  color: var(--text-secondary, var(--soft));
  font-size: 11px;
}

.assistant-inspector-timeline li::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 50%;
}

.assistant-inspector-timeline li.is-done::before { border-color: #34c759; background: #34c759; }
.assistant-inspector-timeline li.is-working::before { border-color: #57a9ff; background: #57a9ff; }
.assistant-inspector-timeline li.is-blocked::before { border-color: #ff9f0a; background: #ff9f0a; }

.assistant-inspector-timeline li small {
  grid-column: 2;
  color: var(--text-tertiary, var(--muted));
  font-size: 9px;
}

.chat-log {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  overflow-y: auto;
  overflow-x: hidden;
  /* Custom thin scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.chat-log::-webkit-scrollbar {
  width: 4px;
}
.chat-log::-webkit-scrollbar-track {
  background: transparent;
}
.chat-log::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}
.chat-log::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.22);
}

/* 空态/仅欢迎语时垂直居中，避免上下大量留白 */
.chat-log:has(> .message:only-child) {
  justify-content: center;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 88%;
  margin-bottom: 4px;
  animation: message-in 220ms ease both;
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.user {
  align-self: flex-end;
  align-items: flex-end;
}

.message.assistant {
  align-self: flex-start;
  align-items: flex-start;
}

.assistant-message-body {
  width: 100%;
  min-width: 0;
}

.assistant-welcome {
  max-width: 100%;
}

.assistant-welcome .assistant-message-body {
  border: 1px solid rgba(0,122,255,0.15);
  border-radius: 16px 16px 16px 4px;
  padding: 13px 14px 11px;
  background:
    radial-gradient(circle at 15% 0%, rgba(0,122,255,0.12), transparent 44%),
    rgba(255,255,255,0.045);
}

.assistant-welcome .assistant-message-body > p {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.assistant-welcome .message-header span {
  color: var(--text-tertiary, var(--muted));
  font-size: 9px;
}

.assistant-rail.is-expanded .message {
  max-width: min(92%, 640px);
}

.message-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  margin-bottom: 2px;
}

.message-header strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary, var(--muted));
}

.assistant-message-body > p {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.message.user .assistant-message-body > p {
  border-bottom-right-radius: 4px;
  color: #fff;
  background: linear-gradient(135deg, rgba(0,122,255,0.95), rgba(0,90,220,0.98));
  box-shadow: 0 2px 8px rgba(0,122,255,0.2);
}

.message.assistant .assistant-message-body > p {
  border-top-left-radius: 4px;
  color: var(--text-primary, var(--text));
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--hud-brand-a08, rgba(255,255,255,0.05));
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.message.pending .assistant-message-body > p {
  opacity: 0.65;
}

/* Better text formatting inside messages */
.assistant-message-body > p h2,
.assistant-message-body > p h3,
.assistant-message-body > p h4 {
  margin: 8px 0 4px;
  font-weight: 700;
  line-height: 1.3;
}

.assistant-message-body > p h2 { font-size: 16px; }
.assistant-message-body > p h3 { font-size: 15px; }
.assistant-message-body > p h4 { font-size: 14px; }

.assistant-message-body > p strong,
.assistant-message-body > p b {
  font-weight: 700;
}

.assistant-message-body > p a {
  color: var(--hud-accent, #007aff);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.assistant-message-body > p a:hover {
  text-decoration-thickness: 2px;
}

.assistant-message-body > p code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0,0,0,0.25);
  font-family: var(--font-mono);
  font-size: 12px;
}

.assistant-message-body > p ul,
.assistant-message-body > p ol {
  margin: 4px 0;
  padding-left: 20px;
}

.assistant-message-body > p li {
  margin: 2px 0;
}

.message small {
  padding: 0 4px;
  color: var(--text-tertiary, var(--muted));
  font-size: 10px;
  line-height: 1.4;
}

.message-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding: 0 4px;
}

.message-actions a,
.message-actions-more {
  padding: 4px 9px;
  border: 1px solid var(--hud-brand-a10, rgba(255,255,255,0.06));
  border-radius: 999px;
  color: var(--text-secondary, var(--soft));
  font-size: 11px;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.message-actions a:hover {
  border-color: rgba(0,122,255,0.45);
  background: rgba(0,122,255,0.1);
}

.message-actions-more {
  color: var(--text-tertiary, var(--muted));
  background: rgba(255,255,255,0.04);
  cursor: default;
}

.assistant-message-tools {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 2px 4px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.message.assistant:hover .assistant-message-tools,
.assistant-message-tools:focus-within {
  opacity: 1;
}

.assistant-outcome-badge {
  border: 1px solid rgba(87, 169, 255, 0.22);
  border-radius: 999px;
  padding: 3px 8px;
  color: #8ac0ff;
  background: rgba(0, 122, 255, 0.09);
  font-weight: 700;
}

.assistant-outcome-badge.is-completed {
  border-color: rgba(52, 199, 89, 0.22);
  color: #70dc90;
  background: rgba(52, 199, 89, 0.09);
}

.assistant-outcome-badge.is-partial,
.assistant-outcome-badge.is-needs_input,
.assistant-outcome-badge.is-unavailable,
.assistant-outcome-badge.is-blocked {
  border-color: rgba(255, 159, 10, 0.24);
  color: #ffc36b;
  background: rgba(255, 159, 10, 0.09);
}

.assistant-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  padding: 0;
  color: var(--text-tertiary, var(--muted));
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.assistant-tool-btn:hover {
  color: var(--text-secondary, var(--soft));
  background: rgba(255,255,255,0.07);
}

.assistant-tool-btn.is-active {
  color: var(--hud-accent, #007aff);
  background: rgba(0,122,255,0.1);
}

.assistant-tool-btn.is-copied {
  color: var(--hud-success, #34c759);
}

/* 任务轨迹与结果卡片 */
.assistant-task-ui {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  padding: 0 4px;
}

.assistant-task-ui.is-receipt-only {
  gap: 0;
  margin-top: 2px;
}

/* 放大模式由右侧工作台承载状态、执行过程与依据，消息中不再复制。 */
.assistant-rail.is-expanded .assistant-task-ui.is-workbench-only,
.assistant-rail.is-expanded .assistant-task-ui > .assistant-ui-meta,
.assistant-rail.is-expanded .assistant-task-ui > .assistant-sources {
  display: none;
}

.assistant-trace {
  border: 1px solid var(--hud-brand-a10, rgba(255,255,255,0.06));
  border-radius: 12px;
  background: rgba(0,0,0,0.14);
  overflow: hidden;
}

.assistant-trace summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--text-secondary, var(--soft));
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.assistant-trace summary::-webkit-details-marker { display: none; }

.assistant-trace-body {
  padding: 0 12px 12px;
}

.assistant-trace-need {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}

.assistant-trace-need strong {
  font-size: 13px;
  color: var(--text-primary, var(--text));
}

.assistant-trace-need span {
  font-size: 12px;
  color: var(--text-tertiary, var(--muted));
}

.assistant-step-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.assistant-step-list li {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding-left: 2px;
}

.assistant-step-list li::before {
  content: "";
  display: inline-grid;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(55, 215, 126, 0.85);
  font-size: 10px;
  line-height: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='10' height='10'%3E%3Cpath fill='white' d='M5 12l5 5L20 7' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.assistant-step-list li::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 18px;
  bottom: -7px;
  width: 1px;
  background: rgba(255,255,255,0.08);
}

.assistant-step-list li:last-child::after { display: none; }

.assistant-step-list li.is-blocked::before {
  background: rgba(255, 79, 129, 0.9);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='10' height='10'%3E%3Cpath fill='white' d='M12 7v6M12 17h.01' stroke='white' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.assistant-step-list li.is-todo::before {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.25);
  background-image: none;
}

.assistant-step-list li.is-skipped::before {
  background: rgba(148, 163, 184, 0.45);
  background-image: none;
}

.assistant-step-list b {
  color: var(--text-primary, var(--text));
  font-size: 12px;
}

.assistant-step-list span {
  min-width: 0;
  color: var(--text-tertiary, var(--muted));
  font-size: 12px;
}

.assistant-steps-inline {
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: var(--text-secondary, var(--soft));
  line-height: 1.6;
}
.assistant-step-inline {
  white-space: nowrap;
  font-size: 11px;
}
.assistant-step-inline.is-done { color: rgba(55, 215, 126, 0.85); }
.assistant-step-inline.is-blocked { color: rgba(255, 79, 129, 0.9); }
.assistant-step-inline.is-todo { color: var(--text-tertiary, var(--muted)); }
.assistant-step-inline.is-skipped { color: var(--text-tertiary, var(--muted)); }
.assistant-sources-compact {
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 3px;
  padding: 2px 0;
  scrollbar-width: none;
}
.assistant-sources-compact::-webkit-scrollbar { display: none; }
.assistant-sources-compact .assistant-source-chip {
  font-size: 9px;
  padding: 0 3px;
  white-space: nowrap;
  line-height: 1.6;
  border: none;
  opacity: 0.6;
}

.assistant-card-list {
  display: grid;
  gap: 8px;
}

.assistant-result-card {
  padding: 10px 12px;
  border: 1px solid var(--hud-brand-a10, rgba(255,255,255,0.06));
  border-radius: 10px;
  background: rgba(255,255,255,0.045);
}

.assistant-result-card.tone-success {
  border-color: rgba(55, 215, 126, 0.28);
}

.assistant-result-card.tone-warning {
  border-color: rgba(255, 79, 129, 0.42);
}

.assistant-result-card > strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary, var(--text));
}

.assistant-result-card > p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-secondary, var(--soft));
  line-height: 1.45;
}

.assistant-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 6px;
}

.assistant-card-grid span {
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.18);
}

.assistant-card-grid small,
.assistant-card-grid b {
  display: block;
}

.assistant-card-grid small {
  color: var(--text-tertiary, var(--muted));
  font-size: 10px;
}

.assistant-card-grid b {
  margin-top: 1px;
  color: var(--text-primary, var(--text));
  font-size: 12px;
}

.assistant-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.assistant-badges em {
  border: 1px solid var(--hud-brand-a10, rgba(255,255,255,0.06));
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--text-secondary, var(--soft));
  background: rgba(255,255,255,0.05);
  font-size: 10px;
  font-style: normal;
}

.assistant-badges em.is-more {
  color: var(--text-tertiary, var(--muted));
  background: rgba(255,255,255,0.04);
}

.assistant-guide-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.assistant-guide-list a {
  padding: 4px 9px;
  border: 1px solid var(--hud-brand-a10, rgba(255,255,255,0.06));
  border-radius: 999px;
  color: var(--text-secondary, var(--soft));
  background: rgba(0,122,255,0.1);
  font-size: 11px;
  text-decoration: none;
  transition: background 0.15s;
}

.assistant-guide-list a:hover {
  background: rgba(0,122,255,0.18);
}

.assistant-safety {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding-top: 2px;
  color: var(--text-tertiary, var(--muted));
  font-size: 9px;
}

.assistant-safety span {
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(255,255,255,0.035);
}

/* 原生 AI 体验层：能力、执行方式与保存边界 */
.assistant-ui-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.assistant-mode-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 7px;
  color: #9dcbff;
  background: rgba(0,122,255,0.08);
  font-size: 9px;
}
.assistant-model-label {
  display: inline-flex;
  color: var(--text-tertiary, var(--muted));
  font-size: 9px;
}
.assistant-retention-inline {
  margin-left: auto;
  color: var(--text-tertiary, var(--muted));
  font-size: 9px;
}
.assistant-retention-inline.is-private { color: #70dc90; }
.assistant-sources {
  border: 1px solid var(--hud-brand-a10, rgba(255,255,255,0.06));
  border-radius: 10px;
  padding: 7px 9px;
  background: rgba(0,0,0,0.1);
}
.assistant-sources summary {
  color: var(--text-secondary, var(--soft));
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}
.assistant-sources > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.assistant-trust-card,
.assistant-next-step {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(52,199,89,0.2);
  border-radius: 10px;
  padding: 8px 9px;
  background: rgba(52,199,89,0.055);
}
.assistant-trust-card > strong,
.assistant-next-step > strong {
  color: var(--text-primary, var(--text));
  font-size: 10px;
}
.assistant-trust-card > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.assistant-trust-card span,
.assistant-next-step > span {
  color: var(--text-secondary, var(--soft));
  font-size: 9px;
  line-height: 1.45;
}
.assistant-trust-card > div span {
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(52,199,89,0.08);
}
.assistant-next-step {
  border-color: rgba(255,159,10,0.22);
  background: rgba(255,159,10,0.06);
}
.assistant-next-step.is-blocked {
  border-color: rgba(255,69,58,0.22);
  background: rgba(255,69,58,0.055);
}
.assistant-sources-label {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-right: 4px;
}
.assistant-source-chip {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  background: rgba(255,255,255,0.045);
  color: var(--text-secondary, var(--soft));
  border: 1px solid var(--hud-brand-a10, rgba(255,255,255,0.08));
}
.assistant-action-receipts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.assistant-action-receipts span {
  border: 1px solid rgba(52,199,89,0.24);
  border-radius: 9px;
  padding: 6px 8px;
  color: #72df93;
  background: rgba(52,199,89,0.075);
  font-size: 10px;
}
.assistant-action-receipts span.is-unavailable {
  border-color: rgba(255,159,10,0.24);
  color: #ffc36b;
  background: rgba(255,159,10,0.075);
}
.assistant-action-receipts span.is-failed {
  border-color: rgba(255,69,58,0.26);
  color: #ff8b83;
  background: rgba(255,69,58,0.075);
}
.assistant-tool-timeline {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.assistant-tool-timeline li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-secondary, var(--soft));
  font-size: 10px;
}
.assistant-tool-timeline small { padding: 0; }
.assistant-tool-timeline li.is-done small { color: #70dc90; }
.assistant-tool-timeline li.is-warning small { color: #ffc36b; }
.assistant-tool-timeline li.is-blocked small { color: #ff7d7d; }
}
.card-type-route_summary { border-left: 3px solid var(--hud-accent); }
.card-type-market_price { border-left: 3px solid var(--hud-gold, #ff9500); }
.card-type-killmail_summary { border-left: 3px solid var(--hud-error, #ff3b30); }
.card-type-blueprint_cost { border-left: 3px solid var(--hud-accent); }
.card-type-abyss_score { border-left: 3px solid #a855f7; }
.card-type-wormhole_lookup { border-left: 3px solid #06b6d4; }

/* 输入区 */
.ask-box {
  flex-shrink: 0;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--hud-brand-a10, rgba(255,255,255,0.06));
}

.ask-images {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 0 6px 0;
}
.ask-images:empty { display: none; }

.ask-image-preview {
  position: relative;
  width: 48px; height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--hud-brand-a10, rgba(255,255,255,0.08));
  background: rgba(0,0,0,0.25);
  flex-shrink: 0;
}
.ask-image-preview:hover { border-color: var(--hud-accent, var(--accent)); }
.ask-image-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.ask-image-remove {
  position: absolute;
  top: 2px; right: 2px;
  width: 16px; height: 16px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 12px;
  line-height: 16px;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.ask-image-preview:hover .ask-image-remove { opacity: 1; }

.ask-composer {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 3px 3px 3px 10px;
  border: 1px solid var(--hud-brand-a12, rgba(255,255,255,0.08));
  border-radius: 16px;
  background: rgba(0,0,0,0.22);
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.ask-composer:focus-within {
  border-color: transparent;
  box-shadow:
    0 0 0 1px rgba(0,122,255,0.35),
    0 0 0 3px rgba(0,122,255,0.08),
    0 0 20px rgba(0,122,255,0.1);
  animation: none;
}

@keyframes composerGlow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(0,122,255,0.35),
      0 0 0 3px rgba(0,122,255,0.08),
      0 0 20px rgba(0,122,255,0.1);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(0,122,255,0.5),
      0 0 0 3px rgba(0,122,255,0.14),
      0 0 28px rgba(0,122,255,0.18);
  }
}

.ask-composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 120px;
  border: 0;
  padding: 5px 0;
  color: var(--text-primary, var(--text));
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  resize: none;
  outline: none;
}

.ask-composer textarea::placeholder {
  color: var(--text-tertiary, var(--muted));
}

.ask-composer-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.ask-upload-btn,
.ask-send-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ask-upload-btn {
  color: var(--text-tertiary, var(--muted));
  background: transparent;
}

.ask-upload-btn:hover {
  color: var(--text-secondary, var(--soft));
  background: rgba(255,255,255,0.06);
}

.ask-send-btn {
  color: #fff;
  background: linear-gradient(135deg, rgba(0,122,255,0.95), rgba(0,90,220,0.98));
  box-shadow: 0 4px 12px rgba(0,122,255,0.25);
}

.ask-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,122,255,0.35);
}

.ask-disclaimer {
  margin: 4px 0 0;
  text-align: center;
  color: var(--text-tertiary, var(--muted));
  font-size: 9px;
}

/* Light theme overrides for assistant */
:root[data-theme="light"] .assistant-rail {
  background: linear-gradient(180deg, #ffffff 0%, #f2f6fc 100%);
  border-color: rgba(0,0,0,0.06);
  box-shadow: 0 20px 60px rgba(0,0,0,0.16), 0 0 0 1px rgba(0,0,0,0.03);
}

:root[data-theme="light"] .chat-head,
:root[data-theme="light"] .ask-box {
  border-color: rgba(0,0,0,0.06);
}

:root[data-theme="light"] .message.assistant .assistant-message-body > p {
  background: #fff;
  border-color: rgba(0,0,0,0.06);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

:root[data-theme="light"] .message.user .assistant-message-body > p {
  box-shadow: 0 2px 8px rgba(0,122,255,0.15);
}

:root[data-theme="light"] .assistant-trace,
:root[data-theme="light"] .assistant-result-card {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.06);
}

:root[data-theme="light"] .assistant-inspector,
:root[data-theme="light"] .assistant-inspector > section,
:root[data-theme="light"] .assistant-welcome .assistant-message-body,
:root[data-theme="light"] .assistant-sources {
  border-color: rgba(0,88,190,0.12);
  background: rgba(248,251,255,0.86);
}

:root[data-theme="light"] .assistant-identity-badge,
:root[data-theme="light"] .assistant-mode-badge {
  color: #005fca;
  background: rgba(0,122,255,0.08);
}

:root[data-theme="light"] .assistant-inspector-chips span,
:root[data-theme="light"] .assistant-inspector-evidence span,
:root[data-theme="light"] .assistant-safety span {
  border-color: rgba(0,88,190,0.12);
  background: rgba(0,88,190,0.04);
}

:root[data-theme="light"] .ask-composer {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.08);
}

:root[data-theme="light"] .ask-composer:focus-within {
  border-color: transparent;
  box-shadow:
    0 0 0 1px rgba(0,122,255,0.3),
    0 0 0 3px rgba(0,122,255,0.06),
    0 0 16px rgba(0,122,255,0.08);
}

:root[data-theme="light"] .chat-log {
  scrollbar-color: rgba(0,0,0,0.1) transparent;
}
:root[data-theme="light"] .chat-log::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
}
:root[data-theme="light"] .chat-log::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.2);
}

:root[data-theme="light"] .assistant-tool-btn:hover {
  background: rgba(0,0,0,0.05);
}

:root[data-theme="light"] .assistant-tool-btn.is-active {
  background: rgba(0,122,255,0.08);
}

/* Mobile */
@media (max-width: 520px) {
  .floating-chat {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: calc(100dvh - 60px);
    border-radius: 16px 16px 0 0;
  }
  .assistant-rail {
    border-radius: 16px 16px 0 0;
  }
  .assistant-rail.is-expanded {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .assistant-rail.is-expanded .assistant-body {
    display: flex;
  }
  .assistant-rail.is-expanded .assistant-inspector {
    display: none;
  }
  .assistant-context > small {
    display: none;
  }
  .assistant-identity-badge {
    margin-left: auto;
    padding-inline: 6px;
  }
  .assistant-message-tools {
    opacity: 1;
  }
  .assistant-tool-btn {
    width: 44px;
    height: 44px;
  }
  .message-actions a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .assistant-launcher {
    right: 14px;
    bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-page-scan-core::before,
  .assistant-page-scan-core::after {
    animation: none !important;
  }
  .assistant-launcher-dot,
  .assistant-live-status[data-state="working"] .assistant-live-dot {
    animation: none;
  }
  .floating-chat,
  .message,
  .assistant-launcher {
    transition-duration: 0.01ms;
  }
}

/* Old prompt-row (hero/command chips) keep existing behavior */
.prompt-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.prompt-row.compact {
  padding: 0 12px 10px;
}

.prompt-row.compact button {
  min-height: 32px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.ask-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  grid-column: 1 / -1;
}
.ask-input-row input {
  flex: 1;
  min-width: 0;
}

/* 工具页 tabs */
.tools-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  border-bottom: none;
}
.tools-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--hud-brand-a15, rgba(255, 255, 255, 0.10));
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}
.tools-tab:hover {
  color: var(--text-primary);
  background: var(--hud-brand-a08, rgba(255, 255, 255, 0.05));
  border-color: var(--hud-brand-a25, rgba(255, 255, 255, 0.18));
}
.tools-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #007aff, #0f5fd1);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
}

:root[data-theme="light"] .tools-tab {
  border-color: rgba(0, 0, 0, 0.12);
  color: #4b5563;
}
:root[data-theme="light"] .tools-tab:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #111827;
}
:root[data-theme="light"] .tools-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #007aff, #0f5fd1);
  border-color: transparent;
}

.tools-capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 18px 0 6px;
}

.tools-capability-head .tools-capability-grid {
  margin: 0;
}

.tools-capability-card {
  display: grid;
  gap: 4px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(6, 12, 24, .62);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s;
}

.tools-capability-card:hover {
  border-color: var(--accent);
  background: rgba(0, 119, 255, .10);
  transform: translateY(-1px);
}

.tools-capability-card span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tools-capability-card b {
  font-size: 18px;
}

.tools-capability-card small {
  color: var(--muted);
  line-height: 1.5;
}

.tools-capability-card.is-ready {
  border-color: var(--hud-brand-a18);
}

/* 制造工具 2.0：把六个高频能力收进标题栏下的紧凑胶囊，给真实结果留出首屏空间。 */
.tools-page-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.tools-compact-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 3px;
  scrollbar-width: thin;
}

.tools-compact-tab {
  display: grid;
  flex: 0 0 auto;
  gap: 1px;
  min-width: 96px;
  min-height: 48px;
  padding: 7px 14px;
  border: 1px solid rgba(0, 122, 255, .32);
  border-radius: 999px;
  background: rgba(0, 122, 255, .04);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: border-color .16s, background .16s, color .16s, transform .16s;
}

.tools-compact-tab span {
  color: var(--text-tertiary);
  font: 800 9px/1.2 var(--font-mono);
  letter-spacing: .12em;
}

.tools-compact-tab b {
  font-size: 13px;
  line-height: 1.25;
}

.tools-compact-tab:hover {
  border-color: rgba(0, 122, 255, .65);
  background: rgba(0, 122, 255, .10);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.tools-compact-tab.active {
  border-color: transparent;
  background: linear-gradient(135deg, #0787ff, #0872e8);
  color: #fff;
  box-shadow: 0 7px 22px rgba(0, 122, 255, .26);
}

.tools-compact-tab.active span {
  color: rgba(255, 255, 255, .78);
}

.tools-reference-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 180, 50, .24);
  border-radius: var(--radius-sm);
  background: rgba(255, 180, 50, .07);
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.65;
}

.tools-reference-note strong {
  color: var(--hud-gold, #ffb432);
  white-space: nowrap;
}

.tools-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.tools-info-grid > div {
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(255,255,255,.035);
}

.tools-info-grid b {
  color: var(--text);
}

.tools-info-grid span {
  color: var(--muted);
  line-height: 1.65;
}

.tools-roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.tools-roadmap-grid > div {
  padding: 14px 16px;
  border: 1px dashed var(--hud-brand-a20);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.018);
}

.tools-roadmap-grid b {
  display: block;
  color: var(--text-secondary);
  font-size: 15px;
}

.tools-roadmap-grid span {
  display: block;
  margin-top: 6px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.55;
}

.tools-market-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tools-market-sections section {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--hud-brand-a10);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.018);
}

.tools-market-sections h4 {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 14px;
}

.profit-summary-grid {
  margin-bottom: 14px;
}

.profit-ranking-groups {
  display: grid;
  gap: 14px;
}

.profit-ranking-group {
  overflow: hidden;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, .018);
}

.profit-ranking-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.profit-ranking-group h4,
.profit-ranking-group p {
  margin: 0;
}

.profit-ranking-group h4 {
  color: var(--text-primary);
  font-size: 14px;
}

.profit-ranking-group p {
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.profit-ranking-group > header > b {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--hud-brand-a12);
  color: var(--soft);
  font-family: var(--font-mono);
}

.profit-ranking-row {
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.profit-ranking-row:last-child {
  border-bottom: 0;
}

.profit-ranking-row:hover {
  background: var(--hud-brand-a06);
}

.profit-ranking-row .label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.profit-ranking-row .label strong,
.profit-ranking-row .label small,
.profit-ranking-row .value > span,
.profit-ranking-row .value > small {
  display: block;
}

.profit-ranking-row .label small,
.profit-ranking-row .value > small {
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.45;
}

.profit-ranking-row .value {
  min-width: min(100%, 410px);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.profit-rank {
  min-width: 30px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
}

.profit-positive {
  color: var(--hud-success, #37d77e);
}

.profit-volume {
  margin-top: 4px;
  color: var(--hud-gold, #ffb432);
  font-family: var(--font-mono);
  font-size: 11px;
}

.profit-volume.is-verified {
  color: var(--hud-success, #37d77e);
}

.profit-lp-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px dashed rgba(255, 180, 50, .28);
  border-radius: var(--radius-sm);
  background: rgba(255, 180, 50, .05);
}

.profit-lp-status strong,
.profit-lp-status span {
  display: block;
}

.profit-lp-status strong {
  color: var(--text-primary);
  font-size: 13px;
}

.profit-lp-status span,
.profit-method-note {
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.6;
}

.profit-lp-status > b {
  flex: 0 0 auto;
  color: var(--hud-gold, #ffb432);
  font-size: 11px;
}

.profit-method-note {
  margin: 12px 0 0;
}

.home-tool-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.home-tool-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--hud-brand-a18);
  border-radius: var(--radius-sm);
  background: rgba(0, 119, 255, .08);
  color: var(--soft);
  font-family: var(--font-display);
  font-size: 12px;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}

.home-tool-links a:hover {
  border-color: var(--accent);
  background: rgba(0, 119, 255, .16);
  color: var(--accent);
}

/* hero 表单专属微调 */
.hero-ask .ask-input-row input {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.hero-ask .ask-input-row input::placeholder { color: var(--muted); }
.hero-ask .ask-input-row input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.hero-ask .ask-upload-btn { width: 44px; height: 44px; font-size: 24px; }
.hero-ask .ask-input-row button {
  padding: 14px 22px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, transform 0.18s;
  flex-shrink: 0;
}
.hero-ask .ask-input-row button:hover {
  background: var(--red-2);
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-1px);
}

.status-panel {
  padding: 16px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.status-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.status-grid dt {
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-grid dd {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* 实时脉冲点（live indicator） */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 6px;
  vertical-align: middle;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--ok); }
  50% { opacity: 0.5; box-shadow: 0 0 4px var(--ok); }
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

/* ============ 阶段 2 首页 Hero 区 ============ */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: stretch;
  min-height: min(70vh, 640px);
  padding: 24px 0 18px;
}

.hero-ai {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid rgba(255, 67, 91, 0.28);
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(255, 67, 91, 0.08), rgba(16, 18, 28, 0.78));
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero-ai h1 {
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.02;
  background: linear-gradient(120deg, var(--text) 30%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-tagline {
  max-width: 520px;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.7;
}

.hero-ask {
  width: min(560px, 100%);
}
.hero-ask .ask-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-chips button {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--soft);
  font-size: 13px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.prompt-chips button:hover,
.prompt-chips button:focus-visible {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-hover);
}

/* Hero 右侧数据墙 */
.hero-data {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.data-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.data-hero-card {
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.18s, background 0.18s;
}

.data-hero-card:hover {
  border-color: var(--line-red);
  background: rgba(255, 67, 91, 0.06);
}

.data-hero-card dt {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.data-hero-card dd {
  margin: 8px 0 0;
  color: var(--accent);
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  text-shadow: 0 0 18px var(--accent-glow);
}

.hero-data-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ============ 首页功能区（市场 + 右栏） ============ */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.45fr);
  gap: 14px;
  margin-top: 18px;
  align-items: start;
}

.market-panel {
  display: grid;
  gap: 14px;
}

.market-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.18s;
}

.market-row:hover,
.market-row:focus-visible {
  border-color: var(--line-red);
  background: var(--accent-hover);
  box-shadow: 0 0 18px var(--accent-glow);
  transform: translateY(-1px);
}

.market-row-name {
  display: grid;
  gap: 3px;
}

.market-row-name strong {
  font-size: 15px;
  color: var(--text);
}

.market-row-name small {
  color: var(--muted);
  font-size: 14px;
  font-family: var(--font-mono);
}

.market-row-prices {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-shrink: 0;
}

.market-row-prices .price-sell {
  color: var(--accent);
  font-size: 16px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.market-row-prices .price-buy {
  color: var(--cyan);
  font-size: 14px;
  font-family: var(--font-mono);
}

.market-row-prices .price-vol {
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-mono);
}

.market-row-prices .price-empty {
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

.market-row-prices .price-loading {
  color: var(--muted);
  font-size: 14px;
  font-family: var(--font-mono);
}

/* 右侧栏：知识库 + 数据源 */
.info-rail {
  display: grid;
  gap: 14px;
  align-content: start;
}

/* ============ 移动端适配 ============ */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .home-grid {
    grid-template-columns: 1fr;
  }
  .hero-ask {
    width: 100%;
  }
  .market-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .market-row-prices {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .data-hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-ai h1 {
    font-size: clamp(32px, 9vw, 48px);
  }
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr) minmax(260px, 0.55fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  padding: 18px;
}

.panel.wide {
  grid-column: span 2;
}

.workspace-shell {
  margin: 0 0 14px;
}

/* 阶段 3 工作台顶栏（账号信息 + 操作按钮） */
.workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 18px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.workspace-bar .workspace-account {
  display: grid;
  gap: 4px;
}

.workspace-bar .workspace-account h3 {
  margin: 0;
  font-size: 18px;
}

.workspace-bar .workspace-account p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.workspace-bar .workspace-account-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.module-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 24px;
  text-align: center;
}

.auth-page {
  min-height: calc(100vh - 96px);
  display: grid;
  align-items: center;
  padding: 36px 0;
}

.auth-panel {
  width: min(720px, 100%);
  display: grid;
  gap: 16px;
  margin: 0 auto;
  border-color: rgba(255, 67, 91, 0.24);
}

.auth-panel h1 {
  max-width: 680px;
  font-size: clamp(34px, 5vw, 58px);
}

.auth-card.solo {
  width: min(520px, 100%);
}

.auth-switch {
  color: var(--muted);
  font-size: 13px;
}

.auth-switch a {
  color: var(--text);
  text-decoration-color: var(--line-red);
}

.auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--soft);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
}

.action-button.primary {
  border-color: var(--line-red);
  color: var(--text);
  background: rgba(185, 21, 46, 0.36);
}

.workspace-standalone {
  display: grid;
  gap: 14px;
  padding-top: 16px;
}

.workspace-hero {
  min-height: 360px;
}

.workspace-panel {
  display: grid;
  gap: 14px;
  border-color: rgba(255, 67, 91, 0.22);
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.auth-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-card input {
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 0 11px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
  outline: none;
}

.auth-card input:focus {
  border-color: var(--cyan);
}

.auth-card button,
.workspace-account button,
.workspace-actions button {
  min-height: 38px;
  border: 1px solid var(--line-red);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(185, 21, 46, 0.36);
  cursor: pointer;
}

.workspace-private {
  display: grid;
  gap: 14px;
}

.workspace-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.workspace-account h3 {
  margin: 4px 0;
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.workspace-modules {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.workspace-module,
.character-row {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.workspace-module.ready {
  border-color: rgba(124, 227, 139, 0.42);
}

.workspace-module.locked {
  opacity: 0.74;
}

.workspace-module span,
.workspace-module small,
.character-row span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.workspace-characters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.auth-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.auth-status[data-level="ok"] {
  color: var(--ok);
}

.auth-status[data-level="error"] {
  color: var(--red);
}

.callback-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.callback-panel {
  width: min(680px, 100%);
}

.market-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.market-row {
  width: 100%;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.market-row:hover,
.market-row:focus-visible {
  border-color: var(--line-red);
}

.market-row strong,
.market-row small {
  display: block;
}

.market-row small {
  margin-top: 4px;
  color: var(--muted);
}

.market-row b {
  color: var(--gold);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 14px;
}

.knowledge-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
}

.knowledge-list li {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.knowledge-list strong,
.knowledge-list span {
  display: block;
}

.knowledge-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.source-table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
}

.source-table th,
.source-table td {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.source-table th {
  width: 90px;
  color: var(--muted);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.source-table td {
  color: var(--soft);
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 14px;
}

@media (max-width: 1180px) {
  .workbench,
  .section-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  }

  .status-panel {
    grid-column: 1 / -1;
  }

  .panel.wide {
    grid-column: span 1;
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100vw - 20px, 760px);
    padding-bottom: 28px;
  }

  .topbar,
  .workbench,
  .section-grid {
    grid-template-columns: 1fr;
  }

  .topnav {
    justify-content: flex-start;
  }

  h1 {
    font-size: 36px;
  }

  .module-console {
    min-height: auto;
  }

  .module-grid,
  .market-list,
  .auth-grid,
  .workspace-modules,
  .workspace-characters {
    grid-template-columns: 1fr;
  }

  .workspace-account {
    align-items: flex-start;
    flex-direction: column;
  }

  .assistant-rail.is-expanded {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
  }

  .assistant-launcher {
    right: 14px;
    bottom: 14px;
  }
}

/* ============ ESI 绑定页（5 步复制粘贴 UX） ============ */
.esi-bind-shell { max-width: 720px; }
.esi-bind-panel { padding: 2rem; }
.esi-bind-steps { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 1.5rem; }
.esi-step { display: flex; gap: 1rem; align-items: flex-start; }
.esi-step-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 0.95rem;
  font-family: var(--font-mono);
}
.esi-step-body { flex: 1; }
.esi-step-body strong { display: block; margin-bottom: 0.3rem; }
.esi-step-body p { margin: 0 0 0.6rem; color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.esi-step-body code {
  background: rgba(255,255,255,0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85rem;
  word-break: break-all;
}
.esi-bind-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.esi-bind-actions button {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none; border-radius: 4px;
  cursor: pointer; font-size: 0.9rem;
}
.esi-bind-actions button:hover { filter: brightness(1.15); }
.esi-bind-url-input {
  width: 100%;
  padding: 0.6rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  color: inherit;
  font-size: 0.9rem;
  font-family: monospace;
}
.esi-bind-url-input:focus { outline: none; border-color: var(--accent); }
.esi-bind-status { margin-top: 1rem; padding: 0.6rem; background: rgba(255,255,255,0.05); border-radius: 4px; font-size: 0.9rem; }

/* ============ 工作台双标签页 ============ */
.ws-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 1.5rem;
}
.ws-tab {
  padding: 0.5rem 1.2rem;
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  letter-spacing: 0.02em;
  transition: all 0.18s ease;
}
.ws-tab:hover { color: var(--soft); }
.ws-tab.active {
  font-weight: 600;
}
.ws-tab-panel { display: none; }
.ws-tab-panel.active { display: block; }
.ws-tab-panel[hidden] { display: none !important; }

/* ============ 工作台模块卡片 ============ */
.workspace-section { margin-top: 2rem; }
.workspace-section-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.workspace-section-head h3 { margin: 0; }
.workspace-account-actions { display: flex; gap: 0.5rem; }
.module-tile {
  padding: 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.module-tile.ready {
  border-color: rgba(124, 227, 139, 0.35);
  cursor: pointer;
}
.module-tile.ready:hover {
  border-color: rgba(124, 227, 139, 0.6);
  box-shadow: 0 0 16px rgba(124, 227, 139, 0.2);
  transform: translateY(-1px);
}
.module-tile.soon { border-color: rgba(255,255,255,0.08); opacity: 0.5; cursor: default; }
.module-tile.locked { border-color: rgba(255,67,91,0.2); opacity: 0.55; cursor: default; }
.module-tile strong { display: block; margin-bottom: 0.3rem; font-size: 0.95rem; }
.module-tile span { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.4rem; }
.module-tile small { font-size: 0.72rem; color: var(--muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }

/* 模块卡片 icon */
.module-tile-icon { font-size: 1.4rem; display: block; margin-bottom: 0.4rem; }
/* 模块卡片状态徽章 */
.module-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.module-badge.ready { background: rgba(124,227,139,0.15); color: var(--ok); border: 1px solid rgba(124,227,139,0.3); }
.module-badge.locked { background: rgba(255,67,91,0.1); color: var(--accent); border: 1px solid rgba(255,67,91,0.25); }
.module-badge.soon { background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid rgba(255,255,255,0.1); }

/* ============ 角色列表 ============ */
.character-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.8rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.character-info strong { display: block; }
.character-info span { font-size: 0.8rem; color: rgba(255,255,255,0.6); }
.character-actions { display: flex; gap: 0.4rem; }
.character-actions button {
  padding: 0.3rem 0.6rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 3px;
  color: inherit; cursor: pointer; font-size: 0.8rem;
}
.character-actions button:hover { background: rgba(255,255,255,0.15); }
.character-actions button.danger { color: #e74c3c; border-color: rgba(231,76,60,0.4); }
.character-actions button.danger:hover { background: rgba(231,76,60,0.15); }

/* ============ 改密码表单 ============ */
.auth-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.auth-form label { display: flex; flex-direction: column; gap: 0.3rem; }
.auth-form label span { font-size: 0.85rem; color: rgba(255,255,255,0.7); }
.auth-form input {
  padding: 0.6rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  color: inherit;
  font-size: 0.95rem;
}
.auth-form input:focus { outline: none; border-color: var(--accent); }
[data-password-status] { font-size: 0.85rem; min-height: 1.2rem; }

/* ============ 模块详情页 ============ */
.module-detail-shell {
  display: grid;
  gap: 1rem;
  padding-top: 1rem;
}
.module-detail-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.module-detail-back {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.module-detail-back:hover { color: var(--accent); }
.module-detail-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.module-detail-title h1 { font-size: 1.8rem; }
.module-detail-title .module-tile-icon { font-size: 1.8rem; margin: 0; }
.module-detail-content {
  display: grid;
  gap: 1rem;
}
.module-detail-loading {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.module-detail-error {
  padding: 1rem;
  border: 1px solid rgba(255,67,91,0.3);
  border-radius: 8px;
  background: rgba(255,67,91,0.06);
  color: var(--accent);
  font-size: 0.9rem;
}
/* 数据卡片网格（模块详情页内） */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.8rem;
}
.data-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
}
.data-card dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}
.data-card dd {
  margin: 0;
  color: var(--text);
  font-size: 1.3rem;
  font-family: var(--font-mono);
  font-weight: 600;
}
.data-list {
  display: grid;
  gap: 0.5rem;
}
.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
}
.data-row .label { color: var(--soft); }
.data-row .value { color: var(--text); font-family: var(--font-mono); }
.data-row .value.mono { font-family: var(--font-mono); }

/* ============ 阶段 3a 模块详情页 ============ */
.module-detail {
  display: grid;
  gap: 16px;
  padding: 18px 0;
}

.module-detail-head {
  display: grid;
  gap: 8px;
  padding: 4px 2px;
}

.module-detail-head .back-link {
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-mono);
  text-decoration: none;
  transition: color 0.18s;
}

.module-detail-head .back-link:hover {
  color: var(--accent);
}

.module-detail-head h1 {
  font-size: clamp(26px, 3.5vw, 38px);
  margin: 4px 0 0;
}

.module-detail-head p {
  color: var(--soft);
  font-size: 14px;
  line-height: 1.6;
}

.module-detail-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.module-detail-tabs .tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}

.module-detail-tabs .tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.module-detail-tabs .tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.module-detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px;
}

.character-select {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.character-select span {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 13px;
}

.character-select select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  min-width: 240px;
}

.character-select select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.module-detail-bar [data-refresh-module] {
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--soft);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
}

.module-detail-bar [data-refresh-module]:hover {
  border-color: var(--accent);
  color: var(--text);
}

.module-detail-body {
  display: grid;
  gap: 18px;
}

.module-group {
  display: grid;
  gap: 10px;
}

.module-group h3 {
  font-size: 14px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
}

.module-group .data-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.data-card h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--accent);
  font-family: var(--font-mono);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--accent-glow);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.data-card .data-row {
  border: none;
  padding: 4px 0;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
}

.data-card .data-row:last-child {
  border-bottom: none;
}

.data-card.error h4 {
  color: var(--muted);
}

.data-card-error {
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
  margin: 0;
}

.data-raw {
  margin: 0;
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--soft);
  overflow-x: auto;
  max-height: 200px;
}

.module-loading {
  color: var(--muted);
  font-size: 14px;
  padding: 24px 0;
  text-align: center;
}

.module-error {
  color: var(--accent);
  font-size: 14px;
  padding: 16px;
  border: 1px solid var(--line-red);
  border-radius: 8px;
  background: rgba(255, 67, 91, 0.06);
  text-align: center;
}

.module-error button {
  margin-left: 12px;
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
}

.module-placeholder {
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 32px;
}

/* ============ 建筑预警弹窗 ============ */
.alert-popup {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  width: 320px;
  background: rgba(20, 25, 30, 0.95);
  border: 1px solid var(--line-red);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 13px;
}
.alert-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-size: 14px;
}
.alert-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}
.alert-close:hover { color: var(--accent); }
.alert-popup-body { max-height: 300px; overflow-y: auto; padding: 8px 14px; }
.alert-item {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.alert-item:last-child { border-bottom: none; }
.alert-item strong { color: var(--text); font-size: 13px; }
.alert-item span { color: var(--soft); font-size: 12px; }
.alert-item.critical { border-left: 3px solid var(--accent); padding-left: 8px; }
.alert-item.warn { border-left: 3px solid var(--gold); padding-left: 8px; }
.alert-state { color: var(--accent); font-size: 11px; font-family: var(--font-mono); }
.alert-fuel { color: var(--gold); font-size: 11px; font-family: var(--font-mono); }
.alert-more { color: var(--muted); font-size: 11px; text-align: center; margin: 8px 0 0; }
.alert-sync { color: var(--muted); font-size: 10px; text-align: right; padding: 6px 14px; margin: 0; border-top: 1px solid var(--line); }

/* ============ KB 嵌入 ============ */
.kb-embed {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.kb-embed iframe {
  width: 100%;
  height: 600px;
  border: none;
  display: block;
}

/* ============ 战况简报 ============ */
.briefing-panel {
  margin-top: 18px;
}
.briefing-text {
  color: var(--soft);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.captain-briefing {
  display: block;
}

.captain-briefing-layout {
  display: grid;
  gap: 14px;
}

.captain-briefing-summary {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(0, 136, 255, .08), rgba(0, 212, 170, .035));
}

.captain-briefing-copy {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
}

.captain-briefing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.captain-briefing-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: var(--hud-accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--hud-brand-a25);
  border-radius: 999px;
  background: rgba(0, 136, 255, .08);
}

.captain-briefing-actions a:hover {
  color: var(--text-primary);
  border-color: var(--hud-accent);
  background: rgba(0, 136, 255, .16);
}

/* 6 卡片仪表盘：战事 / 主权 / 出行雷达 / 市场 / 每日tip / 服务器状态 */
.captain-intel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.captain-intel-grid--6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.captain-intel-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 168px;
  padding: 14px 14px 12px 16px;
  overflow: hidden;
  color: var(--text-primary);
  text-decoration: none;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.025);
  transition: border-color .15s, background .15s, transform .15s;
}

.captain-intel-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--hud-accent);
  opacity: .9;
}

.captain-intel-card:hover {
  border-color: var(--hud-brand-a35);
  background: rgba(0,136,255,.06);
  transform: translateY(-1px);
}

.captain-intel-card .card-label {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.captain-intel-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

.captain-intel-card .card-core {
  display: block;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.captain-intel-card .card-core b {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* 要点列表：3-5 条紧凑条目 */
.captain-intel-card .card-points {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.captain-intel-card .card-points li {
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.5;
  padding-left: 10px;
  position: relative;
}

.captain-intel-card .card-points li::before {
  content: "·";
  position: absolute;
  left: 2px;
  color: var(--hud-accent);
}

.captain-intel-card .card-points li b {
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.captain-intel-card .card-points li.is-empty {
  opacity: .5;
  font-style: italic;
}

.captain-intel-card em {
  display: block;
  margin-top: auto;
  padding-top: 6px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-style: normal;
  font-family: var(--font-mono);
  line-height: 1.4;
}

/* 独立行动按钮 */
.captain-intel-card .card-action {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  color: var(--hud-accent);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--hud-brand-a25);
  border-radius: 999px;
  background: rgba(0,136,255,.06);
  align-self: flex-start;
}

.captain-intel-card:hover .card-action {
  background: rgba(0,136,255,.14);
}

/* 出行雷达红黄分级 */
.captain-intel-card--radar .radar-danger,
.captain-intel-card--radar .radar-traffic {
  display: inline-block;
  padding: 2px 6px;
  margin-right: 4px;
  border-radius: 3px;
  font-size: 11px;
}

.captain-intel-card--radar .radar-danger {
  color: #ff6b86;
  background: rgba(255,107,134,.1);
}

.captain-intel-card--radar .radar-danger b {
  color: #ff6b86;
  font-family: var(--font-mono);
}

.captain-intel-card--radar .radar-traffic {
  color: #ffb020;
  background: rgba(255,176,32,.1);
}

.captain-intel-card--radar .radar-traffic b {
  color: #ffb020;
  font-family: var(--font-mono);
}

.captain-intel-card--radar .radar-danger.is-empty,
.captain-intel-card--radar .radar-traffic.is-empty {
  opacity: .5;
  background: rgba(255,255,255,.03);
}

/* 4 色阵营系统：红=战事/雷达 蓝绿=主权/中性 金=市场 绿=tip */
.captain-intel-card--combat::before { background: #ff6b86; }
.captain-intel-card--sov::before { background: #61d9ff; }
.captain-intel-card--radar::before { background: linear-gradient(180deg, #ff6b86, #ffb020); }
.captain-intel-card--market::before { background: #ffb020; }
.captain-intel-card--tip::before { background: #27e0c2; }
.captain-intel-card--server::before { background: #27e0c2; }
.captain-intel-card--server.is-maintenance::before { background: #ffb020; }
.captain-intel-card--server.is-unavailable::before { background: var(--text-tertiary); }

.captain-intel-card--combat:hover { border-color: rgba(255,107,134,.45); background: rgba(255,107,134,.06); }
.captain-intel-card--sov:hover { border-color: rgba(97,217,255,.45); background: rgba(97,217,255,.06); }
.captain-intel-card--radar:hover { border-color: rgba(255,176,32,.45); background: rgba(255,176,32,.06); }
.captain-intel-card--market:hover { border-color: rgba(255,176,32,.45); background: rgba(255,176,32,.06); }
.captain-intel-card--tip:hover { border-color: rgba(39,224,194,.45); background: rgba(39,224,194,.06); }
.captain-intel-card--server:hover { border-color: rgba(39,224,194,.45); background: rgba(39,224,194,.06); }

.captain-intel-card--combat strong { color: #ff6b86; }
.captain-intel-card--sov strong { color: #61d9ff; }
.captain-intel-card--radar strong { color: #ffb020; }
.captain-intel-card--market strong { color: #ffb020; }
.captain-intel-card--tip strong { color: #27e0c2; }
.captain-intel-card--server strong { color: #27e0c2; }
.captain-intel-card--server.is-maintenance strong { color: #ffb020; }
.captain-intel-card--server.is-unavailable strong { color: var(--text-secondary); }

/* 兼容旧修饰符（战报页等仍可能引用） */
.captain-intel-card--battle::before { background: #ff6b86; }
.captain-intel-card--map::before { background: #61d9ff; }
.captain-intel-card--abyss::before { background: #27e0c2; }

.captain-briefing-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.captain-briefing-strip div {
  padding: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.02);
}

.captain-briefing-strip span {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.captain-briefing-strip strong {
  display: block;
  margin-top: 5px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

/* ============ 跑马灯 ============ */
.marquee-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 8px;
  background: linear-gradient(90deg, rgba(185,21,46,0.12) 0%, rgba(185,21,46,0.05) 50%, transparent 100%);
  border: 1px solid rgba(185,21,46,0.2);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
/* EVA 风格警示条纹左装饰 */
.marquee-bar::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: repeating-linear-gradient(
    180deg,
    var(--accent) 0px,
    var(--accent) 4px,
    rgba(0,0,0,0.6) 4px,
    rgba(0,0,0,0.6) 8px
  );
  z-index: 1;
}
.marquee-label {
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 14px;
  opacity: 0.9;
  background: rgba(185,21,46,0.15);
  border-right: 1px solid rgba(185,21,46,0.2);
  letter-spacing: 2px;
}
.marquee-track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: 6px 0;
  position: relative;
}
/* 两端渐隐 */
.marquee-track::before,
.marquee-track::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 20px;
  z-index: 1;
  pointer-events: none;
}
.marquee-track::before {
  left: 0;
  background: linear-gradient(90deg, #0a0a12 0%, transparent 100%);
}
.marquee-track::after {
  right: 0;
  background: linear-gradient(270deg, #0a0a12 0%, transparent 100%);
}
/* 双份内容 + CSS 动画实现无缝滚动 */
.marquee-content {
  display: flex;
  width: max-content;
  animation: marquee-scroll 24s linear infinite;
}
.marquee-text {
  flex-shrink: 0;
  padding-right: 32px;
  white-space: nowrap;
  color: #ffd700;
  font-size: 14px;
  font-family: var(--font-mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  animation: marquee-blink 2s ease-in-out infinite;
}

:root[data-theme="light"] .marquee-bar {
  background: linear-gradient(90deg, rgba(0, 122, 255, 0.10), rgba(255, 255, 255, 0.72));
  border-color: rgba(0, 88, 190, 0.16);
}

:root[data-theme="light"] .marquee-label {
  background: rgba(0, 122, 255, 0.10);
  border-right-color: rgba(0, 88, 190, 0.16);
  color: #0f172a;
}

:root[data-theme="light"] .marquee-track::before {
  background: linear-gradient(90deg, rgba(246, 248, 252, 0.98), transparent);
}

:root[data-theme="light"] .marquee-track::after {
  background: linear-gradient(270deg, rgba(246, 248, 252, 0.98), transparent);
}

:root[data-theme="light"] .marquee-text {
  color: #9a6700;
}
@keyframes marquee-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.marquee-content:hover { animation-play-state: paused; }
.marquee-content:hover .marquee-text { animation-play-state: paused; }

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============ 公告 ============ */
.announcement-panel { margin-bottom: 18px; }
.announcement-panel [data-announcements] {
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.announcement-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.announcement-item:last-child { border-bottom: none; }
.announcement-item strong { font-size: 14px; }
.announcement-item p { margin: 4px 0; font-size: 13px; color: var(--soft); }
.announcement-item small { color: var(--muted); font-size: 11px; font-family: var(--font-mono); }
.announcement-item.urgent {
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}
.announcement-item.urgent strong {
  color: var(--accent);
  animation: urgentBlink 1.5s ease-in-out infinite;
}
@keyframes urgentBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* admin 公告管理 */
.announcement-admin-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.announcement-admin-item p { font-size: 13px; color: var(--soft); margin: 4px 0; }
.ann-type { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--accent-hover); color: var(--accent); font-family: var(--font-mono); }
.ann-type.urgent { background: rgba(255,67,91,0.2); }
.ann-type.marquee { background: rgba(99,214,232,0.15); color: var(--cyan); }
.ann-off { font-size: 10px; color: var(--muted); }
.ann-actions { margin-top: 6px; display: flex; gap: 8px; }
.ann-actions button { padding: 4px 12px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--soft); cursor: pointer; font-size: 12px; }
.ann-actions button.danger { border-color: var(--accent); color: var(--accent); }
.ann-actions button:hover { background: var(--accent-hover); }

.scope-detail {
  width: 100%;
  max-width: 480px;
}

.scope-detail summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}

.scope-detail ul {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--soft);
}

@media (max-width: 700px) {
  .module-detail-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .character-select {
    flex-direction: column;
    align-items: stretch;
  }
  .character-select select {
    min-width: 0;
    width: 100%;
  }
  .module-group .data-grid {
    grid-template-columns: 1fr;
  }
}

/* ============ 建筑筛选栏（工作块 A） ============ */
.struct-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.struct-filter-item {
  display: grid;
  gap: 4px;
}
.struct-filter-item > span {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.struct-filter-item select {
  min-width: 130px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.struct-filter-item select:focus {
  outline: none;
  border-color: var(--accent);
}
.struct-filter-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.struct-cat {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  font-family: var(--font-mono);
  margin-left: 6px;
}
.dual-fuel-note .value {
  color: var(--gold);
}
.sov-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-hover);
  color: var(--soft);
  font-size: 13px;
  border-radius: 0 6px 6px 0;
}

/* ============================================================
 * v2 星舰指挥台 组件样式 (附录F.4-F.8)
 * ============================================================ */

/* --- F.4 标准玻璃面板 --- */
.glass-panel {
  /* Large content panels must stay on the normal paint path. Multiple
     overlapping backdrop filters can flash as the browser recomposites. */
  background: linear-gradient(145deg, rgba(14, 22, 42, .97), rgba(8, 14, 29, .98));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  padding: var(--panel-padding);
  transition: border-color 0.2s ease;
}
.glass-panel:hover {
  border-color: var(--hud-brand-a20);
}

/* --- F.4 数据卡片 (stat card) --- */
.stat-card {
  background: var(--hud-panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.stat-card:hover {
  border-color: var(--hud-brand-a20);
}
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--hud-accent), transparent);
  opacity: 0.4;
}
.stat-card .stat-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  text-transform: uppercase;
}
.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* --- F.4 KM 卡片 --- */
.km-card {
  background: rgba(12, 16, 34, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease;
  height: 88px;
  box-sizing: border-box;
}
.km-card:hover {
  border-color: var(--hud-brand-a20);
}
.km-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--hud-error);
}
.km-card.km-card--npc::before { background: var(--hud-success); }
.km-card.km-card--capital {
  border: 2px solid var(--hud-gold);
  animation: gold-border-pulse 3s ease-in-out infinite;
}
.km-card.km-card--capital::before { background: var(--hud-gold); }
.km-card .km-ship-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-card);
  background: var(--hud-brand-a08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.km-card .km-info {
  flex: 1;
  min-width: 0;
}
.km-card .km-pilot {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.km-card .km-detail {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.km-card .km-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}
.km-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 600;
  background: var(--hud-error-a15);
  color: var(--hud-error);
}
.km-badge--npc { background: var(--hud-success-a15); color: var(--hud-success); }
.km-badge--capital { background: var(--hud-gold-a15); color: var(--hud-gold); }

/* --- F.5 导航栏 --- */
.nav-bar {
  background: var(--hud-nav-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-bottom-color: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 12px;
  z-index: 50;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  margin: 12px 32px 0;
  border-radius: 999px;
}
.nav-bar .nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-bar .nav-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--hud-brand-a15);
  border: 1px solid var(--hud-brand-a30);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--hud-accent);
}
.nav-bar .nav-brand-logo {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  object-position: top center;
}
.nav-bar .nav-brand-text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}
.nav-bar .nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-bar .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: all 0.15s ease;
}
.nav-bar .nav-link:hover {
  color: var(--text-primary);
  background: var(--hud-brand-a15);
}
.nav-bar .nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #007aff, #0f5fd1);
  box-shadow: 0 2px 10px rgba(0, 122, 255, 0.30);
}
.nav-bar .nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dark mode default — light appearance to hint "click to go light" */
.theme-toggle {
  height: 32px;
  min-width: 56px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.theme-toggle:hover {
  border-color: rgba(255, 255, 255, 0.40);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

/* Light mode — dark appearance to hint "click to go dark" */
:root[data-theme="light"] .theme-toggle {
  color: #1a1a2e;
  border-color: rgba(0, 0, 0, 0.20);
  background: rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .theme-toggle:hover {
  color: #000;
  border-color: rgba(0, 0, 0, 0.35);
  background: rgba(0, 0, 0, 0.10);
}

/* --- 按钮 --- */
.hud-btn-primary, .hud-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}
.hud-btn-primary {
  height: 32px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--hud-brand-a12);
  border: 1px solid var(--hud-brand-a30);
  color: var(--hud-accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.hud-btn-primary:hover {
  background: var(--hud-brand-a20);
}
.hud-btn-outline {
  height: 32px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid var(--hud-brand-a30);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-message-link {
  position: relative;
  padding-right: 16px;
}
.nav-message-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff3b4a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  pointer-events: none;
}
.nav-message-badge.is-empty,
.nav-message-badge[hidden] {
  display: none !important;
}
.hud-btn-outline:hover {
  border-color: var(--hud-brand-a40);
  color: var(--text-primary);
}

/* --- 快捷标签 --- */
.hud-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--hud-brand-a08);
  border: 1px solid var(--hud-brand-a20);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.hud-chip:hover {
  border-color: var(--hud-brand-a40);
  background: var(--hud-brand-a14);
  color: var(--text-primary);
}

/* --- AI 输入区 --- */
.hud-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-card);
  background: var(--hud-input-bg);
  border: 1px solid var(--hud-brand-a12);
  transition: border-color 0.2s ease;
}
.hud-input-row:focus-within {
  border-color: var(--hud-brand-a30);
}
.hud-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-ui);
}
.hud-input-row input::placeholder {
  color: var(--text-tertiary);
}
.hud-send-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--hud-brand-a12);
  color: var(--hud-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.hud-send-btn:hover {
  background: var(--hud-brand-a20);
}

/* --- AI 回复区 --- */
.hud-ai-response {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--hud-accent);
  background: var(--hud-brand-a06);
}
.hud-ai-response .ai-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.hud-ai-response .ai-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- 市场行情条 --- */
.market-ticker {
  display: flex;
  overflow-x: auto;
  gap: 0;
  padding: 0 24px;
  scrollbar-width: none;
}
.market-ticker::-webkit-scrollbar { display: none; }
.market-ticker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 24px;
  margin-right: 24px;
  border-right: 1px solid var(--hud-brand-a12);
  flex-shrink: 0;
}
.market-ticker-item:last-child {
  border-right: none;
}
.market-ticker-item .item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}
.market-ticker-item .item-price {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.market-ticker-item .item-change {
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}
.market-ticker-item .item-change.up { color: var(--hud-success); }
.market-ticker-item .item-change.down { color: var(--hud-error); }

/* --- LIVE 指示器 --- */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hud-error);
}
.live-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hud-error);
  animation: pulse-glow 2s ease-in-out infinite;
}

/* --- 在线指示灯 --- */
.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hud-success);
  animation: pulse-glow 2s ease-in-out infinite;
}

/* --- F.8 动效 --- */

/* 统一 reduced-motion 守卫 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* 动效1: 数据脉冲 */
@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.4); }
}

/* 动效3: KM 卡片滑入 */
@keyframes km-slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.km-card {
  animation: km-slide-in 0.3s ease-out backwards;
}

/* 动效4: 旗舰金色脉冲 */
@keyframes gold-border-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 149, 0, 0.25); }
  50% { box-shadow: 0 0 20px rgba(255, 149, 0, 0.25); }
}

/* --- v2 布局工具类 --- */
.v2-grid {
  display: grid;
  gap: var(--gap-section);
}
.v2-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.v2-grid-main-sidebar {
  grid-template-columns: 1fr 360px;
}
.v2-section-title {
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.18;
}
.v2-section-subtitle {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-tertiary);
}
.v2-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.v2-panel-kicker {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

/* --- CSS 网格背景 --- */
.hud-grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--hud-brand-a03) 1px, transparent 1px),
    linear-gradient(90deg, var(--hud-brand-a03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* --- Hero 指挥台面板 --- */
.hero-stats-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr);
  gap: 20px;
  padding: 8px 32px 28px;
  align-items: stretch;
}

.hero-stats-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-stats-side .stat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-command-panel {
  position: relative;
  border: 1px solid rgba(255, 67, 91, 0.3);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 67, 91, 0.12) 0%, rgba(0, 122, 255, 0.10) 50%, rgba(15, 20, 40, 0.7) 100%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 40px rgba(255, 67, 91, 0.08);
  overflow: hidden;
}

.hero-command-glow {
  position: absolute;
  top: -100px;
  left: -60px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 67, 91, 0.15), transparent 65%);
  pointer-events: none;
}

.hero-command-glow::after {
  content: "";
  position: absolute;
  top: 40px;
  left: 200px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(0, 122, 255, 0.12), transparent 65%);
}

.hero-command-content {
  position: relative;
  z-index: 1;
  padding: 36px 40px 32px;
}

.hero-command-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.hero-command-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff435b;
  box-shadow: 0 0 16px #ff435b, 0 0 4px #fff;
  animation: pulse-glow 2s ease-in-out infinite;
}

.hero-command-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.08;
  margin: 0 0 14px;
  background: linear-gradient(90deg, #ff435b 0%, #ff6b7a 20%, #c4e0ff 60%, var(--hud-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 12px rgba(255, 67, 91, 0.2));
}

.hero-command-subtitle {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  margin: 0 0 28px;
  letter-spacing: 0.02em;
}

.hero-command-form {
  margin: 0;
}

.hero-command-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--hud-brand-a25);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hero-command-input-row:focus-within {
  border-color: var(--hud-accent);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12), 0 0 24px rgba(0, 122, 255, 0.15);
}

.hero-command-input-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border: none;
  background: transparent;
  padding: 0 16px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-ui);
  outline: none;
}

.hero-command-input-row input::placeholder {
  color: var(--text-tertiary);
}

.hero-command-upload {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--hud-brand-a15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 22px;
  font-weight: 300;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.hero-command-upload:hover {
  border-color: var(--hud-accent);
  color: var(--hud-accent);
  background: var(--hud-brand-a08);
}

.hero-command-send {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 24px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--hud-accent), #0058b5);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.25);
}

.hero-command-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 122, 255, 0.35);
}

.hero-command-send:active {
  transform: translateY(0);
}

.hero-command-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  html:has(body.page-starmap) { height: 100%; overflow: hidden; }
  .v2-grid-3 { grid-template-columns: 1fr; }
  .v2-grid-main-sidebar { grid-template-columns: 1fr; }
  .v2-grid,
  .v2-grid > *,
  .v2-grid-main-sidebar > *,
  .hero-command-panel,
  .glass-panel,
  #fresh-news {
    min-width: 0;
  }
  .nav-bar { padding: 0 16px; }
  .nav-bar .nav-links { display: none; }
  .hero-stats-row {
    grid-template-columns: 1fr;
    padding: 8px 16px 20px;
    gap: 12px;
  }
  .hero-stats-side {
    flex-direction: row;
  }
  .hero-stats-side .stat-card {
    min-height: 72px;
  }
  .hero-command-content { padding: 24px 20px; }
  .hero-command-title { font-size: clamp(28px, 8vw, 40px); }
  .hero-command-subtitle,
  .v2-panel-title,
  #fresh-news {
    overflow-wrap: anywhere;
  }
  .hero-command-input-row { flex-wrap: wrap; }
  .hero-command-send { width: 100%; }
  .hero-command-panel { max-width: 100%; }
  .captain-intel-grid,
  .captain-intel-grid--6,
  .captain-briefing-strip,
  .tools-market-sections {
    grid-template-columns: 1fr;
  }
  .tools-reference-note {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .tools-reference-note strong {
    white-space: normal;
  }
  .profit-ranking-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .profit-ranking-row .value {
    min-width: 0;
    width: 100%;
    text-align: left;
  }
  .profit-lp-status {
    align-items: flex-start;
    flex-direction: column;
  }
  .captain-intel-card {
    min-height: 96px;
  }
  .captain-briefing-summary {
    padding: 12px;
  }
  .app-shell { width: calc(100vw - 16px); padding: 12px 0 40px; }
  section[id="market"],
  section.v2-grid { padding-left: 16px !important; padding-right: 16px !important; }
}

@media (max-width: 920px) {
  .captain-intel-grid--6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .hero-stats-side {
    flex-direction: column;
  }
  .hero-command-chips { gap: 6px; }
  .hud-chip { font-size: 12px; padding: 6px 10px; }
}

/* --- 主题与 H5 体验增强 --- */
:root[data-theme="light"] .nav-bar {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 0, 0, 0.08);
  border-bottom-color: rgba(0, 0, 0, 0.05);
  box-shadow:
    0 12px 40px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

:root[data-theme="light"] .glass-panel,
:root[data-theme="light"] .panel,
:root[data-theme="light"] .module-console,
:root[data-theme="light"] .status-panel,
:root[data-theme="light"] .floating-chat,
:root[data-theme="light"] .intel-hero,
:root[data-theme="light"] .hero-command-panel {
  background: var(--hud-panel-bg);
  border-color: var(--hud-brand-a15);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.10);
}

:root[data-theme="light"] .hero-command-panel {
  background:
    linear-gradient(135deg, rgba(0, 122, 255, 0.10), rgba(255, 255, 255, 0.72) 48%, rgba(255, 149, 0, 0.08)),
    var(--hud-panel-bg);
}

:root[data-theme="light"] .hero-command-title {
  background: linear-gradient(90deg, #0f62c9 0%, #007aff 45%, #0f172a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: none;
}

:root[data-theme="light"] .hero-command-input-row,
:root[data-theme="light"] .hud-input-row,
:root[data-theme="light"] .abyss-input,
:root[data-theme="light"] .influence-map-frame,
:root[data-theme="light"] .intel-metric,
:root[data-theme="light"] .intel-focus-card,
:root[data-theme="light"] .abyss-score-card,
:root[data-theme="light"] .abyss-group,
:root[data-theme="light"] .abyss-type,
:root[data-theme="light"] .wormhole-system-metrics span,
:root[data-theme="light"] .message,
:root[data-theme="light"] .km-card,
:root[data-theme="light"] .market-row,
:root[data-theme="light"] .intel-news-item {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(0, 88, 190, 0.13);
}

:root[data-theme="light"] .message.user {
  background: rgba(0, 122, 255, 0.08);
  border-color: rgba(0, 122, 255, 0.26);
}

:root[data-theme="light"] .chat-head {
  background: rgba(0, 122, 255, 0.08);
}

:root[data-theme="light"] .assistant-rail {
  border-color: rgba(0, 88, 190, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f2f6fc 100%);
  box-shadow: 0 24px 64px rgba(19, 46, 90, 0.18);
}

:root[data-theme="light"] .glass-panel {
  background: linear-gradient(145deg, #ffffff, #f4f7fc);
}

:root[data-theme="light"] .assistant-context,
:root[data-theme="light"] .assistant-ui-block,
:root[data-theme="light"] .assistant-result-card,
:root[data-theme="light"] .assistant-safety {
  border-color: rgba(0, 88, 190, 0.14);
  background: rgba(248, 251, 255, 0.86);
}

:root[data-theme="light"] .assistant-modebar button,
:root[data-theme="light"] .assistant-card-grid span {
  border-color: rgba(0, 88, 190, 0.16);
  background: rgba(255, 255, 255, 0.78);
}

:root[data-theme="light"] .assistant-modebar button.is-active {
  color: #005fca;
  background: rgba(0, 122, 255, 0.14);
}

:root[data-theme="light"] .assistant-badges em,
:root[data-theme="light"] .assistant-guide-list a {
  border-color: rgba(0, 88, 190, 0.18);
  background: rgba(0, 122, 255, 0.08);
}

:root[data-theme="light"] .assistant-launcher {
  color: #ffffff;
  border-color: rgba(0, 88, 190, 0.28);
  background: linear-gradient(135deg, #007aff, #0f62c9);
  box-shadow: 0 18px 42px rgba(0, 88, 190, 0.22);
}

:root[data-theme="light"] .assistant-mode-badge {
  background: rgba(0,122,255,0.08);
}
:root[data-theme="light"] .assistant-source-chip {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.08);
}

:root[data-theme="light"] .influence-map-frame {
  background:
    radial-gradient(circle at 50% 48%, rgba(0, 122, 255, .18), transparent 38%),
    radial-gradient(circle at 28% 62%, rgba(255, 149, 0, .12), transparent 28%),
    rgba(3, 7, 18, .92);
}

:root[data-theme="light"] .starmap-layer-button {
  background: rgba(255, 255, 255, .76);
  border-color: rgba(0, 88, 190, .16);
}

:root[data-theme="light"] .starmap-layer-button.is-active {
  background: rgba(0, 122, 255, .12);
  border-color: rgba(0, 122, 255, .34);
}

:root[data-theme="light"] .wormhole-graph {
  background:
    radial-gradient(circle at 50% 48%, rgba(0, 122, 255, .15), transparent 34%),
    radial-gradient(circle at 44% 44%, rgba(255, 149, 0, .10), transparent 38%),
    rgba(255, 255, 255, .74);
}

:root[data-theme="light"] .wormhole-graph rect {
  fill: rgba(248, 251, 255, .80);
}

:root[data-theme="light"] .wormhole-node circle {
  fill: rgba(255, 255, 255, .88);
}

:root[data-theme="light"] .hud-grid-overlay,
:root[data-theme="light"] body::before {
  opacity: 0.55;
}

@media (max-width: 768px) {
  .nav-bar {
    min-height: 56px;
    height: auto;
    padding: 8px 14px;
    margin: 10px 16px 0;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
  }

  .nav-bar .nav-brand {
    flex: 1 1 auto;
    min-width: 120px;
  }

  .nav-bar .nav-brand-text {
    font-size: 14px;
  }

  .nav-bar .nav-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .nav-bar .nav-actions .hud-btn-outline,
  .nav-bar .nav-actions .hud-btn-primary,
  .theme-toggle {
    height: 30px;
    min-width: 48px;
    padding: 0 10px;
    font-size: 12px;
  }

  .nav-bar .nav-links {
    order: 3;
    display: flex;
    width: 100%;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 0 4px;
    scrollbar-width: none;
  }

  .nav-bar .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-bar .nav-link {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 12px;
    background: var(--hud-brand-a06);
  }

  .intel-page {
    padding: 8px 8px 28px;
    gap: 14px;
  }

  .intel-hero,
  .glass-panel {
    padding: 16px;
  }

  .intel-title {
    font-size: 30px;
  }

  .intel-hero-actions {
    width: 100%;
  }

  .intel-hero-actions .hud-btn-outline,
  .intel-hero-actions .hud-btn-primary {
    flex: 1 1 120px;
    justify-content: center;
  }

  .influence-map-frame {
    min-height: 220px;
  }

  .intel-metrics,
  .starmap-metrics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .starmap-layer-controls {
    gap: 6px;
  }

  .starmap-layer-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .starmap-news-card {
    min-height: auto;
  }

  .starmap-news-panel {
    max-height: 420px;
  }

  .starmap-pulse span {
    left: 50%;
    top: auto;
    bottom: 22px;
    transform: translateX(-50%);
    max-width: min(220px, calc(100vw - 48px));
  }

  .intel-row {
    align-items: flex-start;
  }

  .intel-row small {
    max-width: 220px;
    white-space: normal;
  }

  .abyss-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wormhole-search,
  .wormhole-system-metrics {
    grid-template-columns: 1fr;
  }

  .wormhole-graph svg {
    min-height: 240px;
  }

  .floating-chat {
    left: 8px;
    right: 8px;
    bottom: 76px;
    width: auto;
    height: min(620px, calc(100dvh - 112px));
  }
}

@media (max-width: 420px) {
  .nav-bar .nav-brand-text {
    display: none;
  }

  .nav-bar .nav-actions .hud-btn-outline,
  .nav-bar .nav-actions .hud-btn-primary {
    padding: 0 9px;
  }

  .intel-metrics,
  .abyss-type-grid {
    grid-template-columns: 1fr;
  }

  .hero-command-input-row {
    gap: 8px;
  }
}

@media (max-width: 1400px) {
  .fitting-workbench {
    grid-template-columns: 300px minmax(410px, 1fr) 350px;
  }

  .fitting-category-list button {
    font-size: 17px;
  }

  .fitting-fit-wheel {
    width: min(610px, 82vh, 100%);
  }

  .fit-status-section h3 {
    font-size: 16px;
  }

  .fit-status-section p,
  .fit-status-pair,
  .fit-status-grid,
  .fit-status-defense {
    font-size: 15px;
  }

  .fit-status-defense {
    grid-template-columns: 26px 94px minmax(160px, 1fr);
  }
}

@media (max-width: 980px) {
  .fitting-workbench {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
  }

  .fitting-sidebar,
  .fitting-status-panel {
    min-height: 520px;
  }

  .fitting-main {
    min-height: 640px;
  }
}

@media (max-width: 860px) {
  body.page-fitting {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .page-fitting .app-shell {
    width: 100vw;
    height: auto;
    min-height: 0;
    padding: 8px 0 max(10px, env(safe-area-inset-bottom));
    overflow: visible;
  }

  .fitting-shell {
    height: clamp(560px, calc(100svh - 88px), 820px);
    height: clamp(560px, calc(100dvh - 88px), 820px);
    min-height: 560px;
    padding: 0;
    gap: 0;
    overflow: hidden;
    border-top: 1px solid #242b32;
  }

  .fitting-mobile-switch {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left));
    border-bottom: 1px solid #2a2a2a;
    background: rgba(16, 16, 16, 0.98);
  }

  .fitting-mobile-switch button {
    min-width: 0;
    min-height: 40px;
    border: 1px solid #2f4150;
    border-radius: 0;
    background: #171717;
    color: #c8c8c8;
    font: 800 14px var(--font-ui);
    cursor: pointer;
  }

  .fitting-mobile-switch button.active {
    border-color: #0077ff;
    background: #06376a;
    color: #fff;
  }

  .fitting-workbench {
    display: block;
    height: calc(100% - 57px);
    min-height: 0;
    overflow: hidden;
  }

  .fitting-sidebar,
  .fitting-main,
  .fitting-status-panel {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .fitting-shell[data-mobile-mode="stage"] .fitting-main {
    display: block;
  }

  .fitting-shell[data-mobile-mode="library"] .fitting-sidebar {
    display: flex;
  }

  .fitting-shell[data-mobile-mode="stats"] .fitting-status-panel {
    display: block;
  }

  .fitting-sidebar {
    padding: 10px max(10px, env(safe-area-inset-right)) 10px max(10px, env(safe-area-inset-left));
  }

  .fitting-left-tabs,
  .fitting-left-actions {
    flex-wrap: wrap;
  }

  .fitting-sidebar .fitting-left-tabs {
    flex-wrap: nowrap;
  }

  .fitting-left-actions button,
  .fitting-import-actions button {
    min-height: 36px;
  }

  .fitting-category-list button {
    min-height: 42px;
    font-size: 16px;
  }

  .fitting-category-list button.fitting-tree-header,
  .fitting-category-list button.fitting-tree-leaf {
    min-height: 42px;
  }

  .fitting-tree-leaf b {
    font-size: 14px;
  }

  .fitting-tree-header small,
  .fitting-tree-leaf small {
    font-size: 11px;
  }

  .fitting-main {
    padding: 0;
    min-height: 0;
  }

  .fitting-game-stage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    height: 100%;
    min-height: 0;
    padding: 12px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    overflow: auto;
  }

  .fitting-fit-wheel {
    position: relative;
    left: auto;
    top: auto;
    flex: 0 0 auto;
    width: min(100%, 390px);
    aspect-ratio: 1;
    margin: 8px auto 0;
    transform: none;
  }

  .fitting-stage-meta,
  .fitting-slot-inspector,
  .fitting-hold-strip,
  .fitting-hold-panel {
    position: static;
    width: 100%;
    max-width: none;
    transform: none;
  }

  .fitting-stage-meta {
    order: -1;
    pointer-events: auto;
    gap: 4px;
    padding: 0;
  }

  .fitting-stage-meta .kicker {
    font-size: 14px;
  }

  .fitting-stage-meta h2 {
    font-size: 20px;
    line-height: 1.18;
    overflow-wrap: anywhere;
  }

  .fitting-slot-inspector {
    max-height: none;
    min-height: 88px;
    border: 1px solid #2c3b45;
    background: #151515;
  }

  .fitting-hold-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fitting-hold-button {
    width: 100%;
    min-width: 0;
  }

  .fitting-hold-panel {
    max-height: none;
    box-shadow: none;
  }

  .fitting-status-panel {
    padding: 10px max(10px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .fit-status-defense {
    grid-template-columns: 22px minmax(78px, auto) minmax(0, 1fr);
  }

  .fit-status-section h3 {
    min-height: 32px;
    font-size: 15px;
  }

  .fit-status-section h3 b,
  .fit-status-section p,
  .fit-status-pair,
  .fit-status-grid,
  .fit-status-defense {
    font-size: 13px;
  }

  .fit-resists {
    grid-template-columns: repeat(4, minmax(30px, 1fr));
  }
}

@media (max-width: 768px) {
  .page-fitting .app-shell {
    padding-top: 6px;
  }

  .fitting-shell {
    height: clamp(500px, calc(100svh - 136px), 760px);
    height: clamp(500px, calc(100dvh - 136px), 760px);
    min-height: 500px;
    max-height: none;
  }
}

@media (max-width: 430px) {
  .fitting-mobile-switch {
    gap: 5px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .fitting-mobile-switch button {
    min-height: 38px;
    font-size: 13px;
  }

  .fitting-workbench {
    height: calc(100% - 51px);
  }

  .fitting-fit-wheel {
    width: min(100%, 342px);
  }

  .fitting-slot-face {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }

  .fitting-slot-face img,
  .fitting-wheel-slot img {
    width: 30px;
    height: 30px;
  }

  .fitting-hold-strip {
    grid-template-columns: 1fr;
  }

  .fit-status-defense {
    grid-template-columns: 20px minmax(72px, auto) minmax(0, 1fr);
  }

  .fit-resists {
    gap: 3px;
  }

  .fit-resists span {
    min-width: 26px;
    padding: 1px 2px;
  }
}

/* === Starmap v2 layout: top HUD + fixed right news/detail === */
body.page-starmap {
  overflow: hidden;
}

.starmap-v2-page {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 6px 6px;
  height: calc(100vh - 150px);
  min-height: 620px;
  max-height: calc(100vh - 150px);
  overflow: hidden;
}

.starmap-v2-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  background: var(--panel-bg);
  box-shadow: var(--shadow-panel);
}

.starmap-v2-hud-left,
.starmap-v2-hud-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.starmap-v2-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.starmap-v2-layers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.starmap-v2-layers button {
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid var(--hud-brand-a15);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: all .12s ease;
}

.starmap-v2-layers button:hover {
  border-color: var(--hud-brand-a30);
  color: var(--text-primary);
}

.starmap-v2-layers button.is-active {
  color: #fff;
  border-color: var(--hud-accent);
  background: var(--hud-accent);
}

.starmap-v2-layers button[data-real-layer="campaign"].is-active,
.starmap-lab-layers button[data-real-layer="campaign"].is-active,
.starmap-real-focus-actions button[data-real-focus-layer="campaign"].is-active {
  color: #171100;
  border-color: #ffd60a;
  background: #ffd60a;
  box-shadow: 0 0 16px rgba(255, 214, 10, .28);
}

.starmap-campaign-card {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 214, 10, .46);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(255, 214, 10, .11), rgba(255, 159, 10, .035));
}

.starmap-campaign-card.is-contested {
  border-color: rgba(255, 55, 95, .56);
  background: linear-gradient(135deg, rgba(255, 55, 95, .13), rgba(255, 159, 10, .035));
}

.starmap-campaign-card header,
.starmap-campaign-meta,
.starmap-campaign-score-labels,
.starmap-campaign-countdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.starmap-campaign-card header {
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
}

.starmap-campaign-card header b {
  color: #ffd60a;
}

.starmap-campaign-card.is-contested header b {
  color: #ff6685;
}

.starmap-campaign-meta,
.starmap-campaign-score-labels {
  color: var(--text-secondary);
  font-size: 10px;
}

.starmap-campaign-countdown {
  margin-top: 7px;
  padding: 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .22);
  color: var(--text-secondary);
  font-size: 10px;
}

.starmap-campaign-countdown strong {
  color: #ffd60a;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .04em;
}

.starmap-campaign-score-labels {
  margin-top: 7px;
}

.starmap-campaign-progress {
  display: block;
  width: 100%;
  height: 8px;
  margin-top: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  accent-color: #35d8ff;
}

.starmap-campaign-progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, .09);
  border-radius: 999px;
}

.starmap-campaign-progress::-webkit-progress-value {
  background: linear-gradient(90deg, #1ca8d5, #4ee8ff);
  border-radius: 999px;
}

.starmap-campaign-progress::-moz-progress-bar {
  background: linear-gradient(90deg, #1ca8d5, #4ee8ff);
  border-radius: 999px;
}

.starmap-campaign-progress.is-attacker {
  accent-color: #ff375f;
}

.starmap-campaign-progress.is-attacker::-webkit-progress-value {
  background: linear-gradient(90deg, #d61f46, #ff6685);
}

.starmap-campaign-progress.is-attacker::-moz-progress-bar {
  background: linear-gradient(90deg, #d61f46, #ff6685);
}

.starmap-campaign-unavailable {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.45;
}

.starmap-campaign-card footer {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  color: var(--text-tertiary);
  font-size: 9px;
  line-height: 1.45;
}

.starmap-v2-metrics {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.starmap-v2-metrics strong {
  margin-left: 4px;
  color: var(--text-primary);
}

.starmap-v2-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 8px;
  flex: 1;
  min-height: 0;
  position: relative;
  transition: grid-template-columns .18s ease;
}

.starmap-v2-canvas-wrap {
  position: relative;
  min-height: 0;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  background: var(--panel-bg);
  overflow: hidden;
}

.starmap-v2-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.starmap-v2-canvas-wrap canvas:active {
  cursor: grabbing;
}

.starmap-v2-float-detail {
  position: absolute;
  z-index: 5;
  right: 10px;
  top: 102px;
  width: min(246px, calc(100% - 20px));
  max-height: calc(100% - 116px);
  overflow: auto;
  padding: 7px;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  background: rgba(3, 10, 22, .84);
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(10px);
}

.starmap-v2-float-detail.is-collapsed {
  top: 102px;
  right: 10px;
  width: 38px;
  max-height: none;
  min-height: 96px;
  padding: 4px;
  overflow: hidden;
}

@media (min-width: 901px) {
  .starmap-v2-page.starmap-news-collapsed .starmap-v2-float-detail {
    right: 58px;
  }
}

.starmap-detail-restore {
  width: 100%;
  min-height: 88px;
  border: 1px solid var(--hud-brand-a18);
  border-radius: var(--radius-sm);
  background: var(--hud-brand-a06);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  cursor: pointer;
}

.starmap-detail-restore:hover {
  color: var(--text-primary);
  border-color: var(--hud-brand-a35);
  background: var(--hud-brand-a12);
}

.starmap-v2-float-detail .starmap-detail-head {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hud-brand-a12);
}

.starmap-v2-float-detail .starmap-detail-head > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.starmap-v2-float-detail .starmap-detail-head span {
  font-size: 11px;
  color: var(--hud-accent);
}

.starmap-v2-float-detail .starmap-detail-head strong {
  font-size: 14px;
  color: var(--text-primary);
}

.starmap-v2-float-detail .starmap-detail-head em {
  font-size: 11px;
  color: var(--text-secondary);
  font-style: normal;
}

.starmap-v2-float-detail .starmap-detail-head button {
  flex: none;
  min-width: 42px;
  height: 26px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-secondary);
  border: 1px solid var(--hud-brand-a15);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}

.starmap-v2-float-detail .starmap-detail-head button:hover {
  color: var(--text-primary);
  border-color: var(--hud-brand-a30);
}

.starmap-v2-float-detail dl {
  margin: 0;
  padding: 0;
}

.starmap-v2-float-detail dl > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  font-size: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.starmap-v2-float-detail dt {
  color: var(--text-secondary);
  font-weight: normal;
}

.starmap-v2-float-detail dd {
  margin: 0;
  color: var(--text-primary);
  text-align: right;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.starmap-v2-float-detail .starmap-real-tags {
  gap: 4px;
  margin: 6px 0 7px;
}

.starmap-v2-float-detail .starmap-real-tags i {
  padding: 3px 5px;
  font-size: 10px;
}

.starmap-v2-float-detail .starmap-real-neighbours {
  margin-top: 8px;
  padding-top: 7px;
  max-height: 168px;
  overflow: auto;
  border-top: 1px solid var(--hud-brand-a12);
}

.starmap-v2-float-detail .starmap-real-neighbours b {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.starmap-v2-float-detail .starmap-real-neighbours button {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  padding: 5px 6px;
  margin-bottom: 3px;
  text-align: left;
  color: var(--text-primary);
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-sm);
  background: var(--hud-brand-a06);
  cursor: pointer;
}

.starmap-v2-float-detail .starmap-real-neighbours button:hover {
  background: var(--hud-brand-a10);
}

.starmap-v2-float-detail .starmap-real-neighbours small {
  font-size: 10px;
  color: var(--text-secondary);
}

.starmap-v2-float-detail > .hud-btn-outline {
  display: inline-flex;
  margin-top: 10px;
  padding: 5px 8px;
  font-size: 11px;
}

.starmap-v2-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.starmap-v2-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  background: var(--panel-bg);
  box-shadow: var(--shadow-panel);
}

.starmap-v2-panel .intel-panel-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.starmap-v2-news-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.starmap-v2-news-actions button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--hud-brand-a18, var(--hud-brand-a15));
  border-radius: var(--radius-sm);
  background: var(--hud-brand-a06);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 11px;
  cursor: pointer;
}

.starmap-v2-news-actions button:hover {
  border-color: var(--hud-brand-a35);
  color: var(--text-primary);
  background: var(--hud-brand-a12);
}

.starmap-v2-page.starmap-news-collapsed .starmap-v2-main {
  grid-template-columns: minmax(0, 1fr);
}

.starmap-v2-page.starmap-news-collapsed .starmap-v2-side {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 44px;
  z-index: 26;
  pointer-events: none;
}

.starmap-v2-page.starmap-news-collapsed .starmap-v2-panel {
  align-items: center;
  width: 44px;
  padding: 8px 6px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  pointer-events: auto;
}

.starmap-v2-page.starmap-news-collapsed .starmap-v2-panel .intel-panel-head {
  margin: 0;
  height: 100%;
}

.starmap-v2-page.starmap-news-collapsed .starmap-v2-panel .intel-panel-head > div:not(.starmap-v2-news-actions),
.starmap-v2-page.starmap-news-collapsed [data-starmap-updated],
.starmap-v2-page.starmap-news-collapsed [data-starmap-news] {
  display: none;
}

.starmap-v2-page.starmap-news-collapsed .starmap-v2-news-actions {
  height: 100%;
}

.starmap-v2-page.starmap-news-collapsed [data-starmap-news-toggle] {
  width: 30px;
  min-height: 92px;
  padding: 8px 0;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  background: rgba(8, 13, 26, .72);
  backdrop-filter: blur(10px);
}

.starmap-v2-panel .intel-panel-head .v2-panel-kicker {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--hud-accent);
  text-transform: uppercase;
}

.starmap-v2-panel .intel-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.starmap-v2-panel .intel-news {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.starmap-v2-detail {
  min-height: 0;
  overflow: auto;
}

.starmap-detail-empty {
  color: var(--text-secondary);
}

.starmap-detail-empty span {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.starmap-detail-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

/* Detail content styling */
.starmap-v2-detail .starmap-detail-head {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hud-brand-a12);
}

.starmap-v2-detail .starmap-detail-head > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.starmap-v2-detail .starmap-detail-head span {
  font-size: 11px;
  color: var(--hud-accent);
}

.starmap-v2-detail .starmap-detail-head strong {
  font-size: 18px;
  color: var(--text-primary);
}

.starmap-v2-detail .starmap-detail-head em {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: normal;
}

.starmap-v2-detail .starmap-detail-head button {
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--text-secondary);
  border: 1px solid var(--hud-brand-a15);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}

.starmap-v2-detail .starmap-detail-head button:hover {
  color: var(--text-primary);
  border-color: var(--hud-brand-a30);
}

.starmap-v2-detail .starmap-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.starmap-v2-detail .starmap-detail-row span {
  color: var(--text-secondary);
}

.starmap-v2-detail .starmap-detail-row b {
  color: var(--text-primary);
  font-weight: 500;
}

.starmap-v2-detail .starmap-detail-section {
  margin-top: 10px;
}

.starmap-v2-detail .starmap-detail-section h4 {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.starmap-v2-detail dl {
  margin: 0;
  padding: 0;
}

.starmap-v2-detail dl > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.starmap-v2-detail dt {
  color: var(--text-secondary);
  font-weight: normal;
}

.starmap-v2-detail dd {
  margin: 0;
  color: var(--text-primary);
}

.starmap-v2-detail .starmap-real-tags {
  margin-bottom: 10px;
}

.starmap-v2-detail .starmap-real-neighbours {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--hud-brand-a12);
}

.starmap-v2-detail .starmap-real-neighbours b {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.starmap-v2-detail .starmap-real-neighbours button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 4px;
  text-align: left;
  color: var(--text-primary);
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-sm);
  background: var(--hud-brand-a06);
  cursor: pointer;
}

.starmap-v2-detail .starmap-real-neighbours button:hover {
  background: var(--hud-brand-a10);
}

.starmap-v2-detail .starmap-real-neighbours small {
  font-size: 11px;
  color: var(--text-secondary);
}

.starmap-v2-detail > .hud-btn-outline {
  display: inline-flex;
  margin-top: 12px;
  padding: 6px 12px;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .starmap-v2-main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(420px, 1fr) auto;
  }

  .starmap-v2-side {
    flex-direction: row;
    overflow: auto;
  }

  .starmap-v2-panel {
    flex: 1;
    min-height: 220px;
  }
}

@media (max-width: 760px) {
  body.page-starmap {
    overflow: hidden;
    max-width: 100vw;
  }

  body.page-starmap .hud-grid-overlay {
    width: 100%;
    max-width: 100vw;
  }

  .starmap-v2-page {
    height: calc(100dvh - 104px);
    min-height: 480px;
    max-height: calc(100dvh - 104px);
    max-width: 100%;
    overflow: hidden;
    contain: size layout paint;
  }

  .starmap-v2-hud {
    flex-wrap: wrap;
    height: auto;
    max-width: 100%;
    overflow: hidden;
  }

  .starmap-v2-hud-left,
  .starmap-v2-hud-right {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .starmap-v2-title {
    white-space: normal;
  }

  .starmap-v2-metrics {
    flex-wrap: wrap;
    gap: 6px 12px;
    white-space: normal;
  }

  .starmap-v2-layers {
    order: 3;
    width: 100%;
  }

  .starmap-v2-main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
  }

  .starmap-v2-side {
    display: none;
  }

  .starmap-v2-canvas-wrap {
    min-height: 0;
    height: auto;
    max-height: 100%;
    contain: size layout paint;
  }

  .page-starmap .assistant-launcher {
    right: 10px;
    max-width: calc(100vw - 20px);
  }
}

/* ===== Member identity, battle social and native poster ===== */
.member-auth-page {
  padding: 32px 18px;
}

.member-auth-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr);
  border: 1px solid var(--hud-brand-a12);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(4, 15, 34, .94), rgba(16, 9, 26, .94));
  box-shadow: 0 32px 80px rgba(0, 0, 0, .34);
}

.member-auth-story {
  min-height: 580px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 6vw, 76px);
  background:
    radial-gradient(circle at 18% 16%, rgba(0, 135, 255, .25), transparent 34%),
    radial-gradient(circle at 82% 74%, rgba(220, 34, 82, .18), transparent 38%);
}

.member-auth-story h1 {
  margin: 16px 0;
  font-size: clamp(36px, 5vw, 66px);
  line-height: 1.06;
  letter-spacing: -.045em;
}

.member-auth-story > p {
  max-width: 600px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.8;
}

.member-auth-benefits {
  display: grid;
  gap: 10px;
  margin-top: 32px;
}

.member-auth-benefits span {
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--text-secondary);
}

.member-auth-benefits b { color: var(--hud-accent); font-family: var(--font-mono); }

.member-auth-card.auth-panel {
  width: 100%;
  align-content: center;
  padding: clamp(28px, 5vw, 58px);
  border: 0;
  border-left: 1px solid var(--hud-brand-a12);
  border-radius: 0;
  background: rgba(7, 12, 24, .72);
}

.member-auth-card h2 { margin: 0; font-size: 30px; }
.member-auth-card > p { margin: 0; color: var(--text-secondary); line-height: 1.7; }
.member-auth-card .auth-card { width: 100%; padding: 0; border: 0; background: transparent; }
.member-auth-card .auth-card label { display: grid; gap: 7px; color: var(--text-secondary); font-size: 12px; }
.member-auth-card .auth-card input { width: 100%; min-height: 48px; }
.member-auth-card .auth-card button { min-height: 48px; font-weight: 800; }
.member-auth-emblem { font-size: 58px; color: var(--hud-accent); filter: drop-shadow(0 0 18px rgba(0, 145, 255, .5)); }

.avatar-preset-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 6px;
}

.avatar-preset-grid label { position: relative; place-items: center; cursor: pointer; }
.avatar-preset-grid input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-preset-grid small { color: var(--text-tertiary); font-size: 10px; }
.avatar-preset-grid input:checked + .member-avatar { border-color: var(--hud-accent); box-shadow: 0 0 0 3px rgba(0, 130, 255, .18), 0 0 24px rgba(0, 130, 255, .28); }

.member-avatar {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--hud-brand-a20);
  border-radius: 18px;
  color: #dff3ff;
  font: 800 26px var(--font-display);
  background: linear-gradient(145deg, rgba(17, 104, 219, .7), rgba(22, 20, 51, .94));
  object-fit: cover;
}
.member-avatar-vanguard { background: linear-gradient(145deg, #8e263f, #261120); }
.member-avatar-hunter { background: linear-gradient(145deg, #147b72, #0b242d); }
.member-avatar-engineer { background: linear-gradient(145deg, #9b5d16, #292014); }
.member-avatar-diplomat { background: linear-gradient(145deg, #633a9f, #20162f); }
.member-avatar-navigator { background: linear-gradient(145deg, #2359a3, #101d39); }
.member-avatar-character { border-radius: 18px; }
.member-avatar-stack { position: relative; display: grid; width: 56px; height: 56px; flex: 0 0 auto; }
.member-avatar-stack > .member-avatar { grid-area: 1 / 1; }
.member-avatar-stack > img { position: relative; z-index: 1; }

.workspace-identity-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--hud-brand-a15);
  border-radius: 16px;
  background: linear-gradient(115deg, rgba(7, 35, 72, .8), rgba(20, 10, 34, .75));
  box-shadow: var(--shadow-panel);
}
.workspace-identity-avatar .member-avatar, .workspace-identity-avatar .member-avatar-stack { width: 88px; height: 88px; border-radius: 24px; font-size: 40px; }
.workspace-identity-copy h1 { margin: 4px 0 8px; font-size: clamp(28px, 4vw, 46px); }
.workspace-identity-copy p { margin: 10px 0 0; color: var(--text-secondary); }
.member-badge-row { display: flex; flex-wrap: wrap; gap: 7px; }
.member-badge { padding: 4px 9px; border: 1px solid var(--hud-brand-a18); border-radius: 999px; color: var(--text-secondary); font-size: 11px; text-decoration: none; }
.member-badge.verified { color: #5ee6a8; border-color: rgba(54, 219, 145, .38); background: rgba(31, 160, 102, .12); }
.member-badge.pending { color: #ffbc55; border-color: rgba(255, 180, 70, .36); }
.member-badge.corp { color: #8bc7ff; }
.workspace-onboarding { display: grid; gap: 7px; }
.workspace-onboarding span { padding: 6px 9px; border-left: 2px solid var(--hud-brand-a15); color: var(--text-tertiary); font-size: 11px; }
.workspace-onboarding span.done { border-color: #36db91; color: #78eab8; }
.workspace-identity-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.workspace-profile-panel summary { cursor: pointer; font-weight: 700; }
.workspace-profile-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 10px; margin-top: 14px; }
.workspace-profile-form label { display: grid; gap: 5px; color: var(--text-secondary); font-size: 11px; }
.workspace-profile-form input, .workspace-profile-form select { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text-primary); background: var(--panel-bg); }
.workspace-profile-status { grid-column: 1 / -1; min-height: 20px; margin: 0; color: var(--text-secondary); font-size: 12px; }
.workspace-profile-status[data-level="ok"] { color: #54e6a4; }
.workspace-profile-status[data-level="error"] { color: var(--hud-error); }
.character-row { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.character-portrait { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; }
.esi-verified-inline { color: #4edb98; font-size: 10px; }

.battle-lab-hero { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 14px; padding: 16px 18px; }
.battle-lab-hero > div:first-child { min-width: 0; }
.battle-lab-hero h1 { white-space: normal; overflow-wrap: anywhere; }
.battle-hero-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.battle-hero-actions button { cursor: pointer; }
.battle-poster-button { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; min-height: 52px; padding: 7px 14px; border: 1px solid #37b8ff; border-radius: 9px; color: #fff; background: linear-gradient(135deg, #087ee5, #045bb9); box-shadow: 0 0 0 3px rgba(22, 151, 255, .12), 0 10px 28px rgba(0, 101, 214, .3); }
.battle-poster-button > span { grid-row: 1 / 3; font-size: 24px; }
.battle-poster-button strong { font-size: 13px; line-height: 1.1; }
.battle-poster-button small { color: #bfe7ff; font-size: 9px; line-height: 1.1; }
.battle-danmaku-console { display: grid; grid-template-columns: auto minmax(280px, 1fr); gap: 14px 24px; align-items: center; padding: 12px 16px; }
.battle-danmaku-console > div { display: grid; gap: 2px; }
.battle-danmaku-console strong { font-size: 16px; }
.battle-danmaku-console small, .battle-danmaku-console p { color: var(--text-tertiary); font-size: 11px; }
.battle-danmaku-console form { display: flex; gap: 8px; }
.battle-danmaku-console input { min-width: 0; flex: 1; min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--text-primary); background: rgba(0, 0, 0, .22); }
.battle-danmaku-console button { min-height: 38px; padding: 0 16px; border: 1px solid var(--hud-accent); border-radius: 7px; color: #fff; background: var(--hud-accent); cursor: pointer; }
.battle-danmaku-console > p { grid-column: 2; min-height: 15px; margin: -8px 0 0; }
.battle-danmaku-console a { color: var(--hud-accent); }
.battle-danmaku-layer { position: fixed; z-index: 72; left: 0; right: 0; top: 300px; height: min(30vh, 280px); overflow: hidden; pointer-events: none; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.battle-danmaku-item { --lane: 0; --delay: 0s; --duration: 18s; position: absolute; top: calc(8px + var(--lane) * 52px); left: 100%; width: max-content; max-width: 72vw; display: flex; align-items: center; gap: 7px; padding: 5px 11px 5px 6px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: #fff; background: rgba(3, 9, 19, .82); box-shadow: 0 7px 24px rgba(0,0,0,.34); backdrop-filter: blur(8px); animation: battle-danmaku-fly var(--duration) linear var(--delay) infinite; }
.battle-danmaku-item > span { width: 28px; height: 28px; flex: 0 0 auto; }
.battle-danmaku-item img, .battle-danmaku-item i { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; object-fit: cover; background: #17427d; font-style: normal; }
.battle-danmaku-item b { font-size: 11px; color: #8bc7ff; }
.battle-danmaku-item b em { margin-left: 4px; color: #54e6a4; font-size: 8px; font-style: normal; }
.battle-danmaku-item p { margin: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.danmaku-muted .battle-danmaku-layer { display: none; }
@keyframes battle-danmaku-fly { from { transform: translateX(0); } to { transform: translateX(calc(-100vw - 120%)); } }

:root[data-theme="light"] .member-auth-shell,
:root[data-theme="light"] .workspace-identity-hero { background: linear-gradient(135deg, #f7fbff, #fff7fa); }
:root[data-theme="light"] .member-auth-card.auth-panel { background: rgba(255,255,255,.88); }
:root[data-theme="light"] .battle-danmaku-console input { background: #fff; }

@media (max-width: 820px) {
  .member-auth-shell { grid-template-columns: 1fr; }
  .member-auth-story { min-height: auto; padding: 36px 26px; }
  .member-auth-story h1 { font-size: 38px; }
  .member-auth-card.auth-panel { border-left: 0; border-top: 1px solid var(--hud-brand-a12); }
  .avatar-preset-grid { grid-template-columns: repeat(3, 1fr); }
  .workspace-identity-hero { grid-template-columns: auto minmax(0, 1fr); }
  .workspace-onboarding { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .workspace-profile-form { grid-template-columns: 1fr; }
  .battle-danmaku-console { grid-template-columns: 1fr; }
  .battle-danmaku-console > p { grid-column: 1; margin-top: -5px; }
  .battle-hero-actions { width: 100%; justify-content: flex-start; }
  .battle-danmaku-layer { top: 360px; height: 240px; }
  .battle-danmaku-item { max-width: 88vw; }
}

@media (prefers-reduced-motion: reduce) {
  .battle-danmaku-layer { display: none; }
}

.pvp-intel-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 16px;
  align-items: start;
}

.pvp-intel-board {
  display: grid;
  gap: 14px;
}

.pvp-jump-panel .panel-head {
  align-items: flex-end;
  gap: 14px;
}

.pvp-jump-panel h3 {
  margin: 3px 0 0;
}

.pvp-jump-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.pvp-jump-controls-public {
  justify-content: flex-start;
  margin-bottom: 8px;
}

.pvp-jump-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3,8,18,.35);
}

.pvp-jump-tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font: 700 12px var(--font-sans);
  padding: 7px 10px;
  cursor: pointer;
}

.pvp-jump-tabs button.active {
  color: #06101a;
  background: var(--accent);
}

.pvp-jump-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 8px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.pvp-jump-meta span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
}

.pvp-jump-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pvp-jump-list-compact {
  grid-template-columns: 1fr;
}

.pvp-jump-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 46px 58px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 86%, transparent);
  color: var(--text);
  text-decoration: none;
}

.pvp-jump-row:hover {
  border-color: var(--accent);
}

.pvp-jump-row .rank {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-weight: 800;
}

.pvp-jump-row .system {
  display: grid;
  min-width: 0;
}

.pvp-jump-row .system b,
.pvp-jump-row .system small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pvp-jump-row .system small {
  color: var(--text-tertiary);
  font-size: 11px;
  margin-top: 2px;
}

.pvp-jump-row .security {
  color: var(--text-secondary);
  font-size: 12px;
}

.pvp-jump-row strong {
  color: var(--accent);
  text-align: right;
  font-family: var(--font-mono);
}

.pvp-intel-report-panel {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 12px;
}

.pvp-intel-table {
  display: grid;
  gap: 6px;
  width: 100%;
  overflow-x: auto;
}

.pvp-intel-head,
.pvp-intel-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) minmax(88px, 0.8fr) minmax(88px, 0.8fr) minmax(120px, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 620px;
}

.pvp-intel-head {
  color: var(--text-tertiary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

.pvp-intel-row {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 84%, transparent);
  color: var(--text);
  font-size: 13px;
}

.pvp-intel-note {
  margin: 8px 0 0;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.6;
}

.pvp-report,
.pvp-report-empty {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  max-height: 560px;
  overflow: auto;
}

.pvp-report h2,
.pvp-report h3,
.pvp-report h4 {
  margin: 10px 0 6px;
  color: var(--text);
  letter-spacing: 0;
}

.pvp-report p {
  margin: 6px 0;
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 13px;
}

.pvp-report-line {
  padding-left: 8px;
}

.pvp-report-item {
  width: 100%;
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

.pvp-report-item:hover {
  border-color: var(--accent);
}

.pvp-report-item span,
.pvp-report-item small {
  color: var(--text-tertiary);
  font-size: 12px;
}

.module-access-table {
  display: grid;
  gap: 8px;
}

.module-access-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.module-access-row span {
  display: grid;
  gap: 2px;
}

.module-access-row small {
  color: var(--text-tertiary);
}

.module-access-row b {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 980px) {
  .pvp-intel-shell {
    grid-template-columns: 1fr;
  }

  .pvp-intel-report-panel {
    position: static;
  }

  .pvp-jump-list {
    grid-template-columns: 1fr;
  }

  .pvp-jump-panel .panel-head {
    align-items: flex-start;
  }

  .pvp-jump-controls {
    justify-content: flex-start;
  }
}

/* --- 2026-07-03 导航悬浮岛与资料页精修 --- */
.nav-bar {
  width: min(1360px, calc(100vw - 64px));
  height: 56px;
  margin: 14px auto 0;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius-pill);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .06) 0%, rgba(255, 255, 255, .02) 100%),
    rgba(10, 14, 26, .98);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, .32),
    0 8px 24px rgba(0, 0, 0, .18),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}

.nav-bar .nav-links {
  gap: 2px;
  min-width: 0;
}

.nav-bar .nav-link {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  white-space: nowrap;
  color: rgba(255, 255, 255, .65);
}

.nav-bar .nav-link:hover {
  color: rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .08);
}

.nav-bar .nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #007aff, #005fd1);
  box-shadow: 0 2px 10px rgba(0, 122, 255, .30);
}

.nav-bar .nav-brand-icon {
  border-radius: 8px;
}

.app-shell {
  padding-top: 22px;
}

:root[data-theme="light"] .nav-bar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98) 0%, rgba(247, 250, 255, .98) 100%),
    #f8fafc;
  border-color: rgba(15, 23, 42, .10);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, .14),
    0 8px 24px rgba(15, 23, 42, .08),
    inset 0 1px 0 rgba(255, 255, 255, .90);
}

:root[data-theme="light"] .nav-bar .nav-link {
  color: rgba(15, 23, 42, .60);
}

:root[data-theme="light"] .nav-bar .nav-link:hover {
  color: rgba(15, 23, 42, .90);
  background: rgba(15, 23, 42, .06);
}

:root[data-theme="light"] .nav-bar .nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #007aff, #005fd1);
  box-shadow: 0 2px 10px rgba(0, 122, 255, .22);
}

:root[data-theme="light"] .battle-lab-metric {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, .72) 100%),
    rgba(248, 250, 252, .90);
  border-color: rgba(15, 23, 42, .10);
}

:root[data-theme="light"] .battle-lab-metric.red {
  border-color: rgba(255, 79, 123, .30);
  background:
    linear-gradient(180deg, rgba(255, 79, 123, .08) 0%, rgba(255, 255, 255, .72) 100%),
    rgba(248, 250, 252, .90);
}

:root[data-theme="light"] .battle-lab-metric.blue {
  border-color: rgba(35, 167, 255, .30);
  background:
    linear-gradient(180deg, rgba(35, 167, 255, .08) 0%, rgba(255, 255, 255, .72) 100%),
    rgba(248, 250, 252, .90);
}

:root[data-theme="light"] .battle-lab-metric.green {
  border-color: rgba(39, 224, 194, .30);
  background:
    linear-gradient(180deg, rgba(39, 224, 194, .08) 0%, rgba(255, 255, 255, .72) 100%),
    rgba(248, 250, 252, .90);
}

:root[data-theme="light"] .battle-lab-side,
:root[data-theme="light"] .battle-lab-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, .70) 100%),
    rgba(248, 250, 252, .90);
  border-color: rgba(15, 23, 42, .10);
}

:root[data-theme="light"] .battle-lab-side.red,
:root[data-theme="light"] .battle-lab-card.red {
  border-color: rgba(255, 79, 123, .25);
}

:root[data-theme="light"] .battle-lab-side.blue,
:root[data-theme="light"] .battle-lab-card.blue {
  border-color: rgba(35, 167, 255, .25);
}

:root[data-theme="light"] .battle-lab-chip {
  background: rgba(15, 23, 42, .06);
  color: var(--text-secondary);
}

:root[data-theme="light"] .battle-lab-chip.red {
  background: rgba(255, 79, 123, .10);
  color: #c41e3a;
}

:root[data-theme="light"] .battle-lab-chip.blue {
  background: rgba(35, 167, 255, .10);
  color: #0066cc;
}

:root[data-theme="light"] .battle-lab-chip.green {
  background: rgba(39, 224, 194, .10);
  color: #0d9488;
}

:root[data-theme="light"] .battle-lab-row {
  border-bottom-color: rgba(15, 23, 42, .08);
}

:root[data-theme="light"] .battle-lab-rank {
  background: rgba(15, 23, 42, .05);
}

:root[data-theme="light"] .battle-faction-grid > div {
  background: rgba(15, 23, 42, .04);
  border-color: rgba(15, 23, 42, .08);
}

:root[data-theme="light"] .battle-faction-grid > div.red {
  background: rgba(255, 79, 123, .06);
  border-color: rgba(255, 79, 123, .20);
}

:root[data-theme="light"] .battle-faction-grid > div.blue {
  background: rgba(35, 167, 255, .06);
  border-color: rgba(35, 167, 255, .20);
}

:root[data-theme="light"] .battle-faction-grid > div.neutral {
  background: rgba(39, 224, 194, .06);
  border-color: rgba(39, 224, 194, .20);
}

:root[data-theme="light"] .battle-ship-table th,
:root[data-theme="light"] .battle-ship-table td {
  border-bottom-color: rgba(15, 23, 42, .08);
}

:root[data-theme="light"] .battle-time {
  color: #0d9488;
}

.abyss-map {
  overflow: hidden;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  background:
    linear-gradient(rgba(0, 122, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 122, 255, .035) 1px, transparent 1px),
    rgba(0, 0, 0, .20);
  background-size: 28px 28px;
}

.abyss-command-grid {
  align-items: start;
}

.abyss-score-panel {
  min-height: 0;
}

.abyss-paste-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  background: rgba(0, 122, 255, .07);
}

.abyss-paste-intro p {
  display: grid;
  gap: 3px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.abyss-paste-intro strong {
  color: var(--text-primary);
  font-size: 13px;
}

.abyss-paste-intro .hud-btn-outline {
  flex: 0 0 auto;
}

.abyss-paste-status,
.wormhole-search-hint {
  margin: 8px 0 0;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.55;
}

.abyss-paste-status[data-tone="success"] { color: var(--hud-success, #37d77e); }
.abyss-paste-status[data-tone="warning"] { color: var(--hud-gold, #ffb432); }
.abyss-paste-status[data-tone="error"] { color: var(--hud-error, #ff4f81); }

.abyss-recognition-card {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(55, 215, 126, .28);
  border-radius: var(--radius-card);
  background: rgba(55, 215, 126, .07);
}

.abyss-recognition-card.is-warning {
  border-color: var(--hud-gold-a25);
  background: var(--hud-gold-a12);
}

.abyss-recognition-card span,
.abyss-recognition-card small {
  color: var(--text-tertiary);
  font-size: 11px;
}

.abyss-recognition-card strong {
  color: var(--text-primary);
  font-size: 14px;
}

.abyss-score-card.is-guidance strong {
  font-size: 18px;
}

.abyss-map-svg {
  display: block;
  width: 100%;
  min-height: 260px;
}

.abyss-map-svg rect {
  fill: rgba(2, 7, 20, .62);
}

.abyss-map-orbit {
  fill: none;
  stroke: rgba(90, 200, 250, .24);
  stroke-width: 1.4;
  stroke-dasharray: 5 7;
}

.abyss-map-orbit.inner {
  stroke: rgba(255, 149, 0, .18);
}

.abyss-map-link {
  stroke: rgba(90, 200, 250, .26);
  stroke-width: 1.2;
}

.abyss-map-core circle,
.abyss-map-node circle {
  fill: rgba(10, 16, 34, .88);
  stroke: rgba(90, 200, 250, .72);
  stroke-width: 1.5;
}

.abyss-map-core circle {
  fill: rgba(0, 122, 255, .20);
  stroke-width: 2;
}

.abyss-map-core text,
.abyss-map-node text {
  fill: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
}

.abyss-map-core text:first-of-type {
  fill: var(--text-secondary);
  font-size: 10px;
  letter-spacing: .08em;
}

.abyss-map-node text:last-child {
  fill: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
}

.abyss-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 12px 12px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.abyss-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.abyss-map-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--cyan);
}

.abyss-map-legend i.cached {
  background: var(--hud-accent);
}

.abyss-score-row {
  display: grid;
  gap: 7px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.abyss-score-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.abyss-score-row-head strong,
.abyss-score-row-head small {
  display: block;
}

.abyss-score-row-head strong {
  color: var(--text-primary);
  font-size: 13px;
}

.abyss-score-row-head small {
  color: var(--text-tertiary);
  font-size: 11px;
}

.abyss-score-row-head b {
  color: var(--hud-gold);
  font-family: var(--font-mono);
  font-size: 12px;
}

.abyss-score-row > i {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
}

.abyss-score-row > i::before {
  content: "";
  display: block;
  width: var(--score, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--hud-accent), var(--hud-gold));
}

.wormhole-command-grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(420px, 1.05fr);
  gap: var(--gap-panel);
  align-items: stretch;
}

.wormhole-search-hint {
  margin: -2px 0 10px;
}

.wormhole-inline-results {
  max-height: 230px;
  margin-bottom: 12px;
  overflow-y: auto;
}

.wormhole-lookup-mode {
  padding: 10px 12px;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-sm);
  background: rgba(0, 122, 255, .06);
  color: var(--text-secondary);
  font-size: 12px;
}

.wormhole-lookup-mode strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.wormhole-system-card.wormhole-code-card {
  min-height: 0;
  align-content: start;
}

.wormhole-code-card .wormhole-system-metrics b {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.wormhole-calculator-panel {
  grid-column: 1 / -1;
}

.wormhole-query-panel,
.wormhole-graph-panel {
  min-width: 0;
}

.wormhole-graph-panel .wormhole-graph {
  min-height: 100%;
}

.wormhole-data-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .8fr);
  gap: var(--gap-panel);
}

.wormhole-system-card {
  min-height: 314px;
  align-content: center;
}

.wormhole-graph {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025), 0 18px 48px rgba(0,0,0,.16);
}

.wormhole-graph svg {
  min-height: 364px;
}

.wormhole-system-metrics span,
.intel-metric,
.abyss-score-card {
  box-shadow: inset 0 1px rgba(255,255,255,.035);
}

.info-page {
  display: flex;
  flex-direction: column;
  gap: var(--gap-section);
  padding: 8px 32px 42px;
}

.info-hero {
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--hud-brand-a15);
  border-radius: var(--radius-card);
  background:
    linear-gradient(135deg, var(--hud-brand-a12), rgba(255,255,255,.02)),
    rgba(10, 13, 24, .72);
}

.info-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1;
  white-space: nowrap;
}

.info-hero p {
  max-width: 980px;
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.info-section-grid,
.friend-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-panel);
}

.about-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.about-subnav a {
  min-height: 34px;
  padding: 7px 16px;
  border: 1px solid rgba(45, 150, 255, .32);
  border-radius: 999px;
  color: var(--text-secondary);
  background: rgba(8, 24, 48, .52);
  text-decoration: none;
}

.about-subnav a:hover,
.about-subnav a.active {
  border-color: rgba(45, 150, 255, .76);
  color: #fff;
  background: rgba(18, 112, 224, .72);
}

.info-card,
.friend-link-card,
.friend-link-note {
  padding: 22px;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  background: rgba(15, 20, 40, .58);
  color: inherit;
  text-decoration: none;
}

.info-card-wide {
  grid-column: 1 / -1;
}

.info-card span,
.friend-link-card span,
.friend-link-note span,
.info-line-title span {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.info-card h2,
.friend-link-card h2,
.info-line-title h2 {
  margin: 8px 0 10px;
  color: var(--text-primary);
  font-size: 24px;
}

.info-card p,
.friend-link-card p,
.friend-link-note p {
  margin: 0;
  color: var(--text-secondary);
}

.info-line-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.info-line-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hud-brand-a15);
}

.info-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap-panel);
}

.info-feature-grid a {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--hud-brand-a12);
  border-radius: var(--radius-card);
  background: rgba(255,255,255,.025);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
}

.info-feature-grid span {
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
}

.friend-link-card {
  min-height: 240px;
  background:
    linear-gradient(135deg, rgba(0,122,255,.16), rgba(255,255,255,.025)),
    rgba(15, 20, 40, .58);
}

.friend-link-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.friend-link-card b {
  display: inline-flex;
  margin-top: 22px;
  color: var(--hud-accent);
}

.info-qr-card {
  background:
    linear-gradient(135deg, rgba(0, 122, 255, .12), rgba(255, 255, 255, .02)),
    rgba(15, 20, 40, .58);
}

.info-qr-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.info-qr-content h2 {
  margin-top: 0;
}

.info-qr-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.info-qr-img {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  border: 1px solid var(--hud-brand-a15);
  background: #fff;
  object-fit: contain;
}

.info-qr-figure span {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .info-qr-content {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .info-qr-img {
    width: 160px;
    height: 160px;
  }
}

.compact-page-hud {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 12px;
  border: 1px solid var(--hud-brand-a15);
  border-radius: var(--radius-card);
  background:
    linear-gradient(135deg, rgba(0, 122, 255, .12), rgba(255,255,255,.012)),
    rgba(10, 13, 24, .66);
}

.compact-page-hud.is-simple {
  grid-template-columns: minmax(0, 1fr);
}

.compact-page-hud.has-actions {
  grid-template-columns: minmax(0, 1fr) auto;
}

.compact-page-headline {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.compact-page-headline h1 {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1;
  white-space: nowrap;
}

.compact-page-headline span {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  white-space: nowrap;
}

.compact-page-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.compact-page-tags button,
.compact-page-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(0,122,255,.22);
  border-radius: 999px;
  background: rgba(0,122,255,.08);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.compact-page-tags button {
  font: inherit;
}

.compact-page-tags button.is-active,
.compact-page-tags a.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, #007aff, #0f5fd1);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 122, 255, .22);
}

.compact-page-tags a:hover {
  border-color: rgba(0,122,255,.46);
  color: var(--hud-accent);
}

.compact-page-tags button:hover {
  border-color: rgba(0,122,255,.46);
  color: var(--hud-accent);
}

.compact-page-tags button.is-active:hover {
  color: #fff;
}

.aw-tab-panel {
  display: block;
}

.aw-tab-panel[hidden] {
  display: none !important;
}

[data-aw-action][hidden] {
  display: none !important;
}

.compact-page-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.module-divider {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  scroll-margin-top: 118px;
  margin: 28px 0 18px;
  padding: 18px 22px;
  border: 1px solid var(--hud-brand-a20);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(0,122,255,.13), rgba(90,200,250,.04));
}

.module-divider h2 {
  margin: 6px 0 6px;
  color: var(--text-primary);
  font-size: 24px;
}

.module-divider p {
  max-width: 920px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.65;
}

.tools-page-hud {
  grid-template-columns: auto minmax(180px, auto) minmax(0, 1fr);
}

.tools-page-hud .back-link {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.tools-page-hud .back-link:hover {
  color: var(--hud-accent);
}

.info-hero {
  min-height: 56px;
  align-items: center;
  padding: 8px 12px;
}

.info-hero h1 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
}

.info-hero p {
  max-width: 980px;
  font-size: 12px;
  line-height: 1.35;
}

:root[data-theme="light"] .abyss-map,
:root[data-theme="light"] .info-card,
:root[data-theme="light"] .friend-link-card,
:root[data-theme="light"] .friend-link-note {
  background: rgba(255,255,255,.78);
  border-color: rgba(0, 88, 190, .13);
}

:root[data-theme="light"] .abyss-map {
  background:
    radial-gradient(circle at 50% 45%, rgba(0,122,255,.12), transparent 42%),
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(238,247,255,.78));
}

:root[data-theme="light"] .abyss-map-svg rect {
  fill: rgba(248,251,255,.90);
}

:root[data-theme="light"] .abyss-map-core circle {
  fill: rgba(0,122,255,.16);
  stroke: rgba(0,122,255,.42);
}

:root[data-theme="light"] .abyss-map-node circle {
  fill: rgba(255,255,255,.94);
  stroke: rgba(0,122,255,.46);
}

:root[data-theme="light"] .abyss-map-orbit {
  stroke: rgba(0,122,255,.20);
}

:root[data-theme="light"] .abyss-map-orbit.inner {
  stroke: rgba(255,149,0,.20);
}

:root[data-theme="light"] .abyss-map-link {
  stroke: rgba(0,122,255,.20);
}

:root[data-theme="light"] .abyss-primary-input {
  background: rgba(255,255,255,.92);
  border-color: rgba(0, 88, 190, .14);
  color: var(--text-primary);
}

:root[data-theme="light"] .abyss-primary-input::placeholder {
  color: rgba(71,85,105,.56);
  opacity: 1;
}

:root[data-theme="light"] .diplomacy-promo {
  background:
    linear-gradient(135deg, rgba(0,122,255,.10), rgba(255,255,255,.84)),
    rgba(255,255,255,.86) !important;
  border-color: rgba(0, 88, 190, .14) !important;
}

:root[data-theme="light"] .info-hero {
  background:
    linear-gradient(135deg, rgba(0,122,255,.10), rgba(255,255,255,.72)),
    var(--hud-panel-bg);
}

@media (max-width: 1180px) {
  .nav-bar {
    width: min(1100px, calc(100vw - 32px));
  }

  .nav-bar .nav-link {
    padding: 0 9px;
    font-size: 12px;
  }

  .wormhole-command-grid,
  .wormhole-data-grid {
    grid-template-columns: 1fr;
  }

  .info-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .abyss-paste-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .abyss-paste-intro .hud-btn-outline {
    justify-content: center;
    width: 100%;
  }

  .wormhole-inline-results {
    max-height: 280px;
  }
}

@media (max-width: 768px) {
  .nav-bar {
    width: calc(100vw - 20px);
    margin-top: 8px;
    border-radius: 18px;
    padding: 8px 12px;
  }

  .app-shell {
    padding-top: 14px;
  }

  .info-page {
    padding: 8px 8px 28px;
  }

  .info-hero {
    min-height: 56px;
    padding: 8px 12px;
  }

  .info-hero p {
    font-size: 12px;
  }

  .info-section-grid,
  .friend-link-grid,
  .info-feature-grid {
    grid-template-columns: 1fr;
  }

  .compact-page-hud {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 56px;
    padding: 8px 10px;
    overflow: hidden;
  }

  .compact-page-hud.is-simple,
  .compact-page-hud.has-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .compact-page-headline {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .compact-page-headline span,
  .tools-page-hud .back-link {
    display: none;
  }

  .compact-page-tags {
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .compact-page-tags::-webkit-scrollbar {
    display: none;
  }

  .compact-page-actions {
    justify-content: stretch;
  }

  .compact-page-actions .hud-btn-outline {
    width: 100%;
    justify-content: center;
  }

  .abyss-lab-page > .compact-page-hud {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    overflow: visible;
  }

  .abyss-lab-page > .compact-page-hud .compact-page-headline {
    display: none;
  }

  .abyss-lab-page > .compact-page-hud .compact-page-tags {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
  }

  .abyss-lab-page > .compact-page-hud .compact-page-tags button {
    justify-content: center;
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
  }

  .abyss-lab-page > .compact-page-hud .compact-page-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .abyss-lab-page > .compact-page-hud .compact-page-actions button {
    justify-content: center;
    width: 100%;
  }
}

/* ===== 旗舰跳跃路径规划面板 ===== */
.jump-route-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 300px;
  max-height: calc(100% - 24px);
  display: flex;
  flex-direction: column;
  background: rgba(13, 18, 32, 0.92);
  border: 1px solid rgba(120, 180, 255, 0.22);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  z-index: 20;
  font-family: var(--font-sans, "DM Sans", sans-serif);
  color: #e8ecf4;
}

.jump-route-panel--starmap-v2 {
  top: 54px;
  left: 10px;
  right: auto;
  width: 260px;
  max-height: calc(100% - 68px);
}

.jump-route-panel--starmap-v2.is-result-view {
  width: 340px;
}

:root[data-theme="light"] .jump-route-panel {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(0, 88, 190, 0.22);
  color: #111827;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.jump-route-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(120, 180, 255, 0.14);
  background: linear-gradient(135deg, rgba(54, 110, 255, 0.12), rgba(180, 120, 255, 0.08));
}
.jump-route-title {
  font-family: var(--font-display, "Orbitron", sans-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #6eb1ff, #b478ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.jump-route-toggle {
  background: rgba(120, 180, 255, 0.10);
  border: 1px solid rgba(120, 180, 255, 0.16);
  border-radius: 6px;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  padding: 5px 7px;
  opacity: 0.7;
}
.jump-route-toggle:hover { opacity: 1; }

.jump-route-panel--starmap-v2.is-collapsed {
  width: 38px;
  min-height: 96px;
  padding: 4px;
  overflow: hidden;
}

.jump-route-panel--starmap-v2.is-collapsed .jump-route-header {
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
}

.jump-route-panel--starmap-v2.is-collapsed .jump-route-toggle {
  width: 100%;
  min-height: 88px;
  padding: 8px 0;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  border-radius: var(--radius-sm);
  background: var(--hud-brand-a06);
}

.jump-route-panel--starmap-v2 .jump-route-row-inline {
  flex-direction: column;
}
.jump-route-body {
  flex: 1 1 auto;
  padding: 10px 12px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.jump-route-setup-view,
.jump-route-result-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.jump-route-body > .jump-route-setup-view[hidden],
.jump-route-body > .jump-route-result-view[hidden],
.jump-route-body > [aria-hidden="true"] {
  display: none !important;
}

.jump-route-result-view {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.jump-route-panel.is-setup-view .jump-route-result-view,
.jump-route-panel.is-result-view .jump-route-setup-view {
  display: none !important;
}

.jump-route-result-view::-webkit-scrollbar,
.jump-route-alt-legs::-webkit-scrollbar,
.jump-route-legs::-webkit-scrollbar {
  width: 7px;
}

.jump-route-result-view::-webkit-scrollbar-track,
.jump-route-alt-legs::-webkit-scrollbar-track,
.jump-route-legs::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.jump-route-result-view::-webkit-scrollbar-thumb,
.jump-route-alt-legs::-webkit-scrollbar-thumb,
.jump-route-legs::-webkit-scrollbar-thumb {
  background: rgba(100, 220, 255, 0.36);
  border-radius: 999px;
}

.jump-route-result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(120, 180, 255, 0.14);
}

.jump-route-result-bar button {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(120, 180, 255, 0.22);
  border-radius: 6px;
  background: rgba(120, 180, 255, 0.08);
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.jump-route-result-bar button:hover {
  border-color: rgba(100, 220, 255, 0.48);
  background: rgba(100, 220, 255, 0.12);
}

.jump-route-result-bar span {
  color: var(--text-tertiary, #8da1b8);
  font-size: 11px;
  font-weight: 800;
}

.jump-route-panel [hidden] {
  display: none !important;
}
.jump-route-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.jump-route-row-inline {
  flex-direction: row;
  gap: 10px;
}
.jump-route-row-inline > div { flex: 1; }
.jump-route-label {
  font-size: 11px;
  color: var(--text-tertiary, #8da1b8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.jump-route-modes {
  display: flex;
  gap: 4px;
}
.jump-route-mode {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid rgba(120, 180, 255, 0.2);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: all 0.12s;
}
.jump-route-mode:hover { border-color: rgba(120, 180, 255, 0.4); }
.jump-route-mode.is-active {
  background: rgba(54, 110, 255, 0.18);
  border-color: rgba(54, 110, 255, 0.5);
  color: #6eb1ff;
}
.jump-route-profile .jump-route-mode {
  padding: 6px 5px;
  font-size: 11px;
}
.jump-route-input,
.jump-route-select {
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid rgba(120, 180, 255, 0.2);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  color: inherit;
  font-family: inherit;
  outline: none;
}
:root[data-theme="light"] .jump-route-input,
:root[data-theme="light"] .jump-route-select {
  background: rgba(0, 0, 0, 0.03);
}
.jump-route-input:focus,
.jump-route-select:focus {
  border-color: rgba(54, 110, 255, 0.55);
}
.jump-route-select-sm { padding: 4px 6px; font-size: 12px; }
.jump-route-range {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 14px;
  font-weight: 700;
  color: #ffb432;
  padding: 4px 0;
}
.jump-route-suggest {
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid rgba(120, 180, 255, 0.15);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
}
:root[data-theme="light"] .jump-route-suggest {
  background: rgba(255, 255, 255, 0.6);
}
.jump-route-suggest button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 5px 8px;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
}
.jump-route-suggest button:hover { background: rgba(54, 110, 255, 0.15); }
.jump-route-suggest button b { font-weight: 600; }
.jump-route-suggest button small { color: var(--text-tertiary, #8da1b8); font-size: 10px; }
.jump-route-plan-btn {
  margin-top: 4px;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #366eff, #7c4dff);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.12s;
}
.jump-route-plan-btn:hover { opacity: 0.88; }
.jump-route-plan-btn:disabled { opacity: 0.5; cursor: wait; }
.jump-route-result {
  font-size: 12px;
  line-height: 1.5;
  min-height: 0;
  overflow: visible;
}
.jump-route-error {
  padding: 8px;
  border-radius: 6px;
  background: rgba(255, 79, 123, 0.12);
  border: 1px solid rgba(255, 79, 123, 0.3);
  color: #ff4f7b;
  font-size: 12px;
}
.jump-route-alternatives {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 7px;
}
.jump-route-alt-card {
  overflow: hidden;
  border: 1px solid rgba(120, 180, 255, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}
.jump-route-alt-card:hover {
  border-color: rgba(100, 220, 255, 0.42);
  background: rgba(100, 220, 255, 0.07);
}
.jump-route-alt-card.is-active {
  border-color: rgba(54, 110, 255, 0.64);
  background: rgba(54, 110, 255, 0.14);
}
.jump-route-alt {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 44px;
  padding: 7px 8px;
  border: 1px solid rgba(120, 180, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
:root[data-theme="light"] .jump-route-alt-card {
  background: rgba(0, 0, 0, 0.022);
}
.jump-route-alt-card .jump-route-alt {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.jump-route-alt-card .jump-route-alt:hover,
.jump-route-alt-card .jump-route-alt.is-active {
  border-color: transparent;
  background: transparent;
}
.jump-route-alt:hover {
  border-color: rgba(100, 220, 255, 0.42);
  background: rgba(100, 220, 255, 0.08);
}
.jump-route-alt.is-active {
  border-color: rgba(54, 110, 255, 0.62);
  background: rgba(54, 110, 255, 0.15);
}
.jump-route-alt span {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 900;
}
.jump-route-alt small {
  color: var(--text-tertiary, #8da1b8);
  font-size: 11px;
  line-height: 1.25;
}
:root[data-theme="light"] .jump-route-alt {
  background: rgba(0, 0, 0, 0.025);
}
.jump-route-alt-detail {
  display: grid;
  gap: 5px;
  padding: 0 8px 8px;
}
.jump-route-alt-detail.is-empty {
  color: var(--text-tertiary, #8da1b8);
  font-size: 11px;
}
.jump-route-alt-endpoints {
  overflow: hidden;
  color: var(--text-secondary, #b8c2d3);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jump-route-alt-endpoints span {
  color: var(--hud-accent, #6eb1ff);
}
.jump-route-alt-legs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 118px;
  overflow-y: auto;
  padding-right: 2px;
}
.jump-route-summary {
  padding: 7px 8px;
  border-radius: 6px;
  background: rgba(54, 110, 255, 0.1);
  border: 1px solid rgba(54, 110, 255, 0.2);
  margin-bottom: 6px;
}
.jump-route-ship {
  font-size: 11px;
  color: var(--text-tertiary, #8da1b8);
  margin-bottom: 4px;
}
.jump-route-profile-info {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(54, 110, 255, 0.16);
  color: #6eb1ff;
  font-size: 11px;
  font-weight: 800;
}
.jump-route-endpoints {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}
.jr-start-dot,
.jr-end-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: #06101f;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}
.jr-start-dot {
  background: #36ff8b;
  box-shadow: 0 0 10px rgba(54,255,139,.45);
}
.jr-end-dot {
  background: #ff4f7b;
  box-shadow: 0 0 10px rgba(255,79,123,.45);
}
.jr-route-arrow {
  color: var(--hud-accent);
}
.jump-route-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}
.jump-route-stats span {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}
:root[data-theme="light"] .jump-route-stats span {
  background: rgba(0, 0, 0, 0.04);
}
.jr-stat-gate { color: #64dcff; }
.jr-stat-jump { color: #ffb432; }
.jr-stat-fuel { color: #36ff8b; }
.jump-route-warn {
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 4px;
  background: rgba(255, 159, 10, 0.12);
  border-left: 3px solid #ff9f0a;
  font-size: 11px;
  color: #ffcc4d;
}
.jump-route-warn-compact {
  display: grid;
  gap: 3px;
  margin: 6px 0 0;
}
.jump-route-warn-compact small {
  color: rgba(255, 204, 77, 0.72);
  font-size: 10px;
  line-height: 1.35;
}
:root[data-theme="light"] .jump-route-warn { color: #b87400; }
.jump-route-legs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
}

.jump-route-panel.is-result-view .jump-route-legs {
  max-height: 290px;
}

.jump-route-leg-toggle {
  width: 100%;
  min-height: 30px;
  margin-top: 6px;
  border: 1px solid rgba(120, 180, 255, 0.24);
  border-radius: 6px;
  background: rgba(120, 180, 255, 0.08);
  color: var(--hud-accent, #6eb1ff);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.jump-route-leg-toggle:hover {
  border-color: rgba(100, 220, 255, 0.5);
  background: rgba(100, 220, 255, 0.12);
}

:root[data-theme="light"] .jump-route-leg-toggle {
  background: rgba(14, 165, 233, 0.08);
  color: #075985;
}
.jr-leg {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 11px;
}
.jr-leg-gate { background: rgba(100, 220, 255, 0.06); }
.jr-leg-jump { background: rgba(255, 180, 50, 0.08); }
.jr-leg-icon { font-size: 12px; flex-shrink: 0; }
.jr-leg-gate .jr-leg-icon { color: #64dcff; }
.jr-leg-jump .jr-leg-icon { color: #ffb432; }
.jr-leg-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-leg-dist { color: #ffb432; font-family: var(--font-mono, monospace); font-size: 10px; }
.jr-leg-kind {
  color: var(--text-tertiary, #8da1b8);
  font-size: 10px;
  flex-shrink: 0;
}
.jr-leg-sec { font-size: 10px; color: var(--text-tertiary, #8da1b8); flex-shrink: 0; }
.jr-leg-compact {
  padding: 3px 5px;
  font-size: 10px;
}
.jr-leg-compact .jr-leg-icon,
.jr-leg-compact .jr-leg-kind,
.jr-leg-compact .jr-leg-sec {
  font-size: 10px;
}

.jump-route-security-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 5px 0 7px;
}

.jr-sec-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  border: 1px solid currentColor;
}

.jr-sec-highsec,
.jr-leg-sec-highsec .jr-leg-icon,
.jr-leg-sec-highsec .jr-leg-sec {
  color: #64dcff;
}

.jr-sec-lowsec,
.jr-leg-sec-lowsec .jr-leg-icon,
.jr-leg-sec-lowsec .jr-leg-sec {
  color: #ffb236;
}

.jr-sec-nullsec,
.jr-leg-sec-nullsec .jr-leg-icon,
.jr-leg-sec-nullsec .jr-leg-sec {
  color: #ff4c70;
}

.jr-sec-unknown,
.jr-leg-sec-unknown .jr-leg-icon,
.jr-leg-sec-unknown .jr-leg-sec {
  color: #8da1b8;
}

.jump-route-dynamic-avoid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: -2px 0 7px;
}

.jump-route-dynamic-avoid span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 159, 10, 0.55);
  background: rgba(255, 159, 10, 0.12);
  color: #ffb236;
  font-size: 11px;
  font-weight: 900;
}

.jr-leg-sec-highsec {
  background: rgba(100, 220, 255, 0.08);
  border-left: 3px solid rgba(100, 220, 255, 0.92);
}

.jr-leg-sec-lowsec {
  background: rgba(255, 178, 54, 0.11);
  border-left: 3px solid rgba(255, 178, 54, 0.95);
}

.jr-leg-sec-nullsec {
  background: rgba(255, 76, 112, 0.13);
  border-left: 3px solid rgba(255, 76, 112, 0.95);
}

.jr-leg-sec-unknown {
  border-left: 3px solid rgba(141, 161, 184, 0.72);
}

.jr-leg.is-active {
  outline: 1px solid currentColor;
  box-shadow: 0 0 18px rgba(100, 220, 255, 0.18);
}

.jump-route-actions {
  margin: 6px 0;
}

.jump-route-sim-btn {
  width: 100%;
  min-height: 30px;
  border: 1px solid rgba(100, 220, 255, 0.38);
  border-radius: 6px;
  background: rgba(100, 220, 255, 0.10);
  color: #dff8ff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.jump-route-sim-btn:hover {
  border-color: rgba(100, 220, 255, 0.68);
  background: rgba(100, 220, 255, 0.16);
}

:root[data-theme="light"] .jump-route-sim-btn {
  color: #075985;
  background: rgba(14, 165, 233, 0.10);
}

.starmap-system-menu {
  position: fixed;
  z-index: 120;
  width: 178px;
  padding: 8px;
  border: 1px solid rgba(100, 220, 255, 0.26);
  border-radius: 8px;
  background: rgba(7, 12, 25, 0.94);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
  color: #e8ecf4;
}

.starmap-system-menu-title {
  display: grid;
  gap: 2px;
  padding: 2px 4px 7px;
  border-bottom: 1px solid rgba(120, 180, 255, 0.14);
}

.starmap-system-menu-title span {
  color: #64dcff;
  font-size: 11px;
  font-weight: 800;
}

.starmap-system-menu-title strong {
  color: #fff;
  font-size: 13px;
}

.starmap-system-menu button {
  width: 100%;
  margin-top: 6px;
  padding: 7px 8px;
  border: 1px solid rgba(120, 180, 255, 0.18);
  border-radius: 6px;
  background: rgba(120, 180, 255, 0.08);
  color: inherit;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.starmap-system-menu button:hover {
  border-color: rgba(100, 220, 255, 0.46);
  background: rgba(100, 220, 255, 0.14);
}

:root[data-theme="light"] .starmap-system-menu {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 88, 190, 0.22);
  color: #111827;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.16);
}

:root[data-theme="light"] .starmap-system-menu-title strong {
  color: #111827;
}
@media (max-width: 768px) {
  .jump-route-panel,
  .jump-route-panel--starmap-v2 {
    top: 66px;
    right: 12px;
    width: calc(100% - 24px);
    max-height: 50%;
  }
}

/* ===== Workspace 紧凑标题栏（参照 starmap-v2-hud） ===== */
.workspace-bar-compact {
  min-height: 44px;
  padding: 6px 12px;
  margin-bottom: 14px;
  gap: 12px;
  align-items: center;
}
.workspace-account-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.workspace-account-inline .kicker {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(54, 110, 255, 0.14);
  color: var(--hud-accent, #6eb1ff);
  flex-shrink: 0;
}
.workspace-account-inline h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
.workspace-account-inline p {
  margin: 0;
  font-size: 12px;
  color: var(--text-tertiary, #8da1b8);
  white-space: nowrap;
}
.action-button-sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
}

/* ===== 首页底部工具卡片三栏 ===== */
.home-tool-row {
  gap: 14px;
}
.home-tool-card {
  display: flex;
  flex-direction: column;
}
.home-tool-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  flex-wrap: wrap;
}
.home-tool-card-btn {
  flex: 1;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  text-decoration: none;
  border-radius: 8px;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .home-tool-row { grid-template-columns: 1fr; }
}

/* ===== 浅色主题修复 ===== */
:root[data-theme="light"] .compact-page-hud {
  background: var(--hud-panel-bg, rgba(255, 255, 255, 0.82));
  border-color: rgba(0, 88, 190, 0.16);
  backdrop-filter: blur(12px);
}
:root[data-theme="light"] .compact-page-hud .v2-panel-kicker,
:root[data-theme="light"] .compact-page-hud .compact-page-title {
  color: var(--text-primary, #111827);
}
:root[data-theme="light"] .fitting-topbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: rgba(0, 0, 0, 0.08);
  color: #111827;
}
:root[data-theme="light"] .fitting-shell {
  background: #f5f6f8;
}
:root[data-theme="light"] .page-fitting {
  background: #f5f6f8;
}

:root[data-theme="light"] .starmap-v2-hud,
:root[data-theme="light"] .starmap-v2-canvas-wrap,
:root[data-theme="light"] .starmap-v2-panel,
:root[data-theme="light"] .starmap-v2-float-detail {
  background: rgba(255, 255, 255, .86);
  border-color: rgba(0, 88, 190, .14);
  box-shadow: 0 18px 46px rgba(15, 23, 42, .10);
}

:root[data-theme="light"] .starmap-v2-float-detail dl > div {
  border-bottom-color: rgba(15, 23, 42, .08);
}

:root[data-theme="light"] .starmap-campaign-card {
  color: #172033;
  border-color: rgba(176, 133, 0, .42);
  background: linear-gradient(135deg, rgba(255, 214, 10, .22), rgba(255, 255, 255, .82));
}

:root[data-theme="light"] .starmap-campaign-card.is-contested {
  border-color: rgba(196, 29, 67, .40);
  background: linear-gradient(135deg, rgba(255, 55, 95, .14), rgba(255, 255, 255, .86));
}

:root[data-theme="light"] .starmap-campaign-countdown {
  background: rgba(255, 255, 255, .74);
}

:root[data-theme="light"] .starmap-campaign-card header b,
:root[data-theme="light"] .starmap-campaign-countdown strong {
  color: #765700;
}

:root[data-theme="light"] .starmap-campaign-card.is-contested header b {
  color: #ad1238;
}

:root[data-theme="light"] .starmap-campaign-card footer {
  border-top-color: rgba(15, 23, 42, .10);
}

:root[data-theme="light"] .starmap-v2-float-detail .starmap-real-neighbours button,
:root[data-theme="light"] .starmap-v2-news-actions button {
  background: rgba(0, 88, 190, .06);
  border-color: rgba(0, 88, 190, .16);
}

:root[data-theme="light"] .starmap-v2-page.starmap-news-collapsed .starmap-v2-panel {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

:root[data-theme="light"] .starmap-v2-page.starmap-news-collapsed [data-starmap-news-toggle],
:root[data-theme="light"] .starmap-detail-restore,
:root[data-theme="light"] .jump-route-panel--starmap-v2.is-collapsed .jump-route-toggle {
  background: rgba(255, 255, 255, .76);
  border-color: rgba(0, 88, 190, .18);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .12);
  backdrop-filter: blur(10px);
}

:root[data-theme="light"] .tools-capability-card {
  background: rgba(255, 255, 255, .82);
  border-color: rgba(15, 23, 42, .10);
  color: var(--text-primary);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

:root[data-theme="light"] .tools-capability-card:hover {
  background: rgba(0, 122, 255, .07);
  border-color: rgba(0, 88, 190, .28);
}

:root[data-theme="light"] .tools-capability-card span,
:root[data-theme="light"] .tools-capability-card small {
  color: var(--text-tertiary);
}

:root[data-theme="light"] .auth-form label span {
  color: var(--text-secondary);
}

:root[data-theme="light"] .auth-form input,
:root[data-theme="light"] .auth-form select,
:root[data-theme="light"] .auth-form textarea {
  background: rgba(255, 255, 255, .92);
  border-color: rgba(15, 23, 42, .14);
  color: var(--text-primary);
}

:root[data-theme="light"] .action-button.primary {
  border-color: rgba(0, 88, 190, .24);
  background: linear-gradient(135deg, #007aff, #0062d6);
  color: #fff;
}

:root[data-theme="light"] .action-button {
  background: rgba(255, 255, 255, .72);
  border-color: rgba(15, 23, 42, .12);
  color: var(--text-secondary);
}

.ask-box button {
  border-color: rgba(0, 122, 255, .36);
  background: linear-gradient(135deg, var(--hud-accent), #0058b5);
  color: #fff;
}

.prompt-row button {
  border-color: var(--hud-brand-a15);
  background: var(--hud-brand-a08);
  color: var(--text-secondary);
}

.prompt-row button:hover {
  border-color: var(--hud-brand-a35);
  color: var(--text-primary);
  background: var(--hud-brand-a12);
}

:root[data-theme="light"] .ask-box input {
  background: rgba(255, 255, 255, .92);
  border-color: rgba(15, 23, 42, .14);
  color: var(--text-primary);
}

:root[data-theme="light"] .ask-box button {
  border-color: rgba(0, 88, 190, .24);
  background: linear-gradient(135deg, #007aff, #0062d6);
  color: #fff;
}

:root[data-theme="light"] .prompt-row button {
  background: rgba(0, 88, 190, .06);
  border-color: rgba(0, 88, 190, .14);
  color: var(--text-secondary);
}

/* ============ UNIFIED HUD PILLS (tabs / tag buttons) ============ */
.hud-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.hud-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--hud-brand-a15, rgba(255, 255, 255, 0.10));
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
  vertical-align: middle;
}
.hud-pill:hover {
  color: var(--text-primary);
  background: var(--hud-brand-a08, rgba(255, 255, 255, 0.05));
  border-color: var(--hud-brand-a25, rgba(255, 255, 255, 0.18));
}
.hud-pill.active,
.hud-pill[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(135deg, #007aff, #0f5fd1);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
}

/* Light theme pill overrides */
:root[data-theme="light"] .hud-pill {
  border-color: rgba(0, 0, 0, 0.12);
  color: #4b5563;
}
:root[data-theme="light"] .hud-pill:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #111827;
  border-color: rgba(0, 0, 0, 0.18);
}
:root[data-theme="light"] .hud-pill.active,
:root[data-theme="light"] .hud-pill[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(135deg, #007aff, #0f5fd1);
  border-color: transparent;
}

/* ============ UNIFIED HUD ACTION BUTTONS ============ */
.hud-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--hud-accent, #007aff);
  background: transparent;
  color: var(--hud-accent, #007aff);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
  line-height: 1;
}
.hud-action-btn:hover {
  background: rgba(0, 122, 255, 0.10);
}
.hud-action-btn.primary {
  background: linear-gradient(135deg, #007aff, #0f5fd1);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
}
.hud-action-btn.primary:hover {
  background: linear-gradient(135deg, #006ae6, #0d56b8);
}

/* Light theme action btn overrides */
:root[data-theme="light"] .hud-action-btn {
  border-color: rgba(0, 88, 190, 0.30);
  color: #0058b5;
}
:root[data-theme="light"] .hud-action-btn:hover {
  background: rgba(0, 122, 255, 0.08);
}
:root[data-theme="light"] .hud-action-btn.primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #007aff, #0f5fd1);
}

/* ============ FITTING LEFT TABS → pill style ============ */
.fitting-left-tabs button {
  border-radius: 999px;
  border: 1px solid var(--hud-brand-a15, rgba(255, 255, 255, 0.10));
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  padding-inline: 7px;
  font-size: 12px;
  transition: all 0.18s ease;
}
.fitting-left-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, #007aff, #0f5fd1);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
}

:root[data-theme="light"] .fitting-left-tabs button {
  border-color: rgba(0, 0, 0, 0.12);
  color: #4b5563;
}
:root[data-theme="light"] .fitting-left-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, #007aff, #0f5fd1);
  border-color: transparent;
}

@media (max-width: 860px) {
  .page-fitting .nav-bar {
    position: relative;
    top: auto;
    z-index: 12;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: min(1200px, calc(100vw - 20px));
    height: auto;
    min-height: 56px;
    margin: 10px auto 0;
    padding: 8px 14px;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
  }

  .page-fitting .nav-bar .nav-brand {
    flex: 1 1 auto;
    min-width: 120px;
  }

  .page-fitting .nav-bar .nav-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .page-fitting .nav-bar .nav-links {
    grid-column: 1 / -1;
    order: initial;
    display: flex;
    width: 100%;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 0 4px;
    scrollbar-width: none;
  }

  .page-fitting .nav-bar .nav-links::-webkit-scrollbar {
    display: none;
  }

  .page-fitting .nav-bar .nav-link {
    flex: 0 0 auto;
    height: 34px;
  }

  .page-fitting .fitting-mobile-switch {
    z-index: 30;
  }
}

/* ============ FITTING HARDWARE KIND → pill style ============ */
.fitting-hardware-kind button {
  border-radius: 999px;
  border: 1px solid var(--hud-brand-a15, rgba(255, 255, 255, 0.10));
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 12px;
  transition: all 0.18s ease;
}
.fitting-hardware-kind button.active {
  color: #fff;
  background: linear-gradient(135deg, #007aff, #0f5fd1);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.18);
}

:root[data-theme="light"] .fitting-hardware-kind button {
  border-color: rgba(0, 0, 0, 0.12);
  color: #4b5563;
}
:root[data-theme="light"] .fitting-hardware-kind button.active {
  color: #fff;
  background: linear-gradient(135deg, #007aff, #0f5fd1);
  border-color: transparent;
}

/* ============ WS-TAB → pill style ============ */
.ws-tab {
  border-radius: 999px;
  border: 1px solid var(--hud-brand-a15, rgba(255, 255, 255, 0.10));
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--hud-brand-a15, rgba(255, 255, 255, 0.10));
  margin-bottom: 0;
  transition: all 0.18s ease;
}
.ws-tab:hover {
  color: var(--text-primary);
  background: var(--hud-brand-a08, rgba(255, 255, 255, 0.05));
}
.ws-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #007aff, #0f5fd1);
  border-color: transparent;
  border-bottom-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
  font-weight: 600;
}

:root[data-theme="light"] .ws-tab {
  border-color: rgba(0, 0, 0, 0.12);
  color: #4b5563;
}
:root[data-theme="light"] .ws-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #007aff, #0f5fd1);
  border-color: transparent;
}

/* ============ PVP HUB / WAR ROOM / WIKI ============ */
.pvp-hub,
.war-room-page,
.wiki-page {
  padding: 8px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-page,
.workspace-shell,
.fitting-shell,
.intel-page,
.starmap-lab-page {
  padding-top: 8px;
}

.page-fitting .fitting-shell {
  padding-top: 0;
}

.pvp-hero {
  min-height: 56px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--hud-brand-a15, rgba(0, 122, 255, 0.22));
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.12), rgba(13, 18, 36, 0.78));
}

.pvp-hero h1 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.pvp-hero > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.pvp-hero .v2-panel-kicker {
  margin: 0;
  white-space: nowrap;
}

.pvp-hero p {
  display: none;
}

body.page-pvp_hub .pvp-hero > div:first-child,
body.page-wiki .pvp-hero > div:first-child {
  display: flex !important;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

body.page-pvp_hub .pvp-hero p,
body.page-wiki .pvp-hero p {
  display: none !important;
}

.pvp-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 220px;
}

.pvp-search-panel,
.pvp-section {
  border: 1px solid var(--hud-brand-a15, rgba(0, 122, 255, 0.18));
  border-radius: 8px;
  background: rgba(12, 18, 34, 0.74);
  padding: 18px 22px;
}

.pvp-section[data-pvp-overview] {
  border: 0;
  background: transparent;
  padding: 0;
}

.pvp-section[data-pvp-conflicts] {
  border: 0;
  background: transparent;
  padding: 0;
}

.pvp-page-hud.has-actions {
  grid-template-columns: minmax(190px, auto) auto minmax(260px, 420px);
  min-height: 50px;
  padding: 6px 10px;
}

.pvp-page-hud .compact-page-headline h1 {
  font-size: clamp(18px, 1.7vw, 23px);
}

.pvp-page-hud .compact-page-actions {
  gap: 6px;
}

.pvp-page-hud .compact-page-actions a,
.pvp-page-hud .pvp-search-form button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.pvp-page-hud .pvp-search-form {
  gap: 6px;
}

.pvp-page-hud .pvp-search-form input {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.pvp-search-result:empty {
  display: none;
}

.pvp-km-submit-strip {
  padding: 10px 12px;
}

.pvp-km-submit-strip .pvp-km-submit-form {
  margin-top: 0;
}

.pvp-search-panel h2,
.pvp-section h2,
.war-room-grid h2 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: 0;
}

.pvp-search-panel p {
  margin: 0 0 14px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.pvp-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.pvp-km-submit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}
.pvp-km-submit-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 11px 13px;
}
.pvp-km-submit-form small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.5;
}
@media (max-width: 720px) {
  .pvp-km-submit-form { grid-template-columns: 1fr; }
  .pvp-km-submit-form small { grid-column: 1; }
}

.pvp-search-form input,
.pvp-bounty-form input,
.pvp-bounty-form select,
.pvp-bounty-form textarea,
.ws-claim-form input,
.ws-claim-form select,
.ws-claim-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  background: rgba(4, 8, 18, 0.78);
  color: var(--text-primary);
  padding: 10px 12px;
  font: inherit;
  box-sizing: border-box;
}

.pvp-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pvp-bounty-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pvp-bounty-templates button {
  min-height: 32px;
  border: 1px solid rgba(0, 122, 255, 0.32);
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.12);
  color: #62cfff;
  padding: 5px 10px;
  font: 800 12px var(--font-mono);
  cursor: pointer;
}

.pvp-bounty-templates button:hover {
  border-color: rgba(39, 224, 194, 0.44);
  color: #4ef0d6;
}

.pvp-search-result {
  margin-top: 14px;
  scroll-margin-top: 112px;
}

.home-unified-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 9px 10px 9px 14px;
  border: 1px solid rgba(0, 180, 255, 0.26);
  border-radius: 9px;
  background: rgba(3, 10, 24, 0.62);
}

.home-unified-search > span {
  color: var(--hud-accent);
  font: 800 11px var(--font-mono);
  letter-spacing: .08em;
  white-space: nowrap;
}

.home-unified-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: 500 13px var(--font-body);
}

.home-unified-search button {
  min-height: 34px;
  border: 1px solid rgba(0, 180, 255, 0.38);
  border-radius: 7px;
  background: rgba(0, 122, 255, 0.18);
  color: #74d9ff;
  padding: 6px 12px;
  font: 800 12px var(--font-body);
  cursor: pointer;
}

.pvp-unified-search-panel {
  padding: 16px 18px;
  border-color: rgba(0, 180, 255, 0.3);
}

.pvp-unified-search-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.pvp-unified-search-head h2 {
  margin: 2px 0 0;
  font-size: 19px;
}

.pvp-unified-search-head > span {
  color: var(--text-tertiary);
  font-size: 12px;
  text-align: right;
}

.pvp-search-profile {
  overflow: hidden;
  border: 1px solid rgba(0, 180, 255, 0.24);
  border-radius: 10px;
  background: rgba(4, 10, 22, 0.72);
}

.pvp-search-profile-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.pvp-search-profile-main > img {
  width: 92px;
  height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.04);
}

.pvp-search-profile-copy h3 {
  margin: 3px 0 4px;
  font-size: 25px;
  line-height: 1.15;
}

.pvp-search-profile-copy h3 small {
  color: var(--text-secondary);
  font-size: 13px;
}

.pvp-search-profile-copy h3 a,
.pvp-search-profile-copy p a {
  color:var(--hud-accent);
  text-decoration:underline;
  text-underline-offset:3px;
}

.pvp-search-profile-copy p,
.pvp-search-source,
.pvp-search-stat-note {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 12px;
}

.pvp-search-type {
  color: var(--hud-accent);
  font: 800 11px var(--font-mono);
  letter-spacing: .08em;
}

.pvp-search-source {
  align-self: flex-start;
  text-align: right;
  white-space: nowrap;
}

.pvp-search-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pvp-search-badges span,
.pvp-search-badges a {
  border: 1px solid rgba(39, 224, 194, 0.22);
  border-radius: 999px;
  background: rgba(39, 224, 194, 0.08);
  color: #6ae8d5;
  padding: 4px 8px;
  font-size: 11px;
  text-decoration:none;
}

.pvp-search-description {
  max-height: 210px;
  overflow: auto;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
}

.pvp-search-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.pvp-search-stats > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.pvp-search-stats > div:last-child { border-right: 0; }
.pvp-search-stats span { color: var(--text-tertiary); font-size: 11px; }
.pvp-search-stats strong { color: var(--text-primary); font: 800 16px var(--font-mono); }
.pvp-search-stat-note { padding: 0 16px 12px; }

.pvp-search-history {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 11px 16px;
}

.pvp-search-history summary {
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.pvp-search-history > div {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.pvp-search-history a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-radius: 6px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
}

.pvp-search-matches {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  margin-top: 10px;
  padding-bottom: 4px;
}

.pvp-search-matches > span { color: var(--text-tertiary); font-size: 11px; white-space: nowrap; }
.pvp-search-matches a {
  display: grid;
  grid-template-columns: 28px auto;
  grid-template-rows: auto auto;
  column-gap: 7px;
  min-width: 150px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  color: var(--text-secondary);
  text-decoration: none;
}
.pvp-search-matches img { grid-row: 1 / 3; width: 28px; height: 28px; border-radius: 5px; object-fit: cover; }
.pvp-search-matches b { font-size: 12px; }
.pvp-search-matches small { color: var(--text-tertiary); font-size: 10px; }

.pvp-search-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.pvp-search-columns > section {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  background: rgba(4, 10, 22, 0.56);
}

.pvp-search-columns .pvp-km-row {
  grid-template-columns: 120px minmax(0, 1fr) auto;
}

.pvp-search-columns .pvp-km-row strong {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pvp-search-columns .pvp-km-row small {
  color: var(--text-tertiary);
  font-weight: 500;
}

.pvp-search-km-profile .pvp-search-profile-main {
  grid-template-columns: minmax(0, 1fr) auto;
}

@media (max-width: 760px) {
  .home-unified-search { grid-template-columns: 1fr auto; }
  .home-unified-search > span { grid-column: 1 / -1; }
  .pvp-unified-search-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .pvp-unified-search-head > span { text-align: left; }
  .pvp-search-profile-main { grid-template-columns: 68px minmax(0, 1fr); gap: 10px; }
  .pvp-search-profile-main > img { width: 68px; height: 68px; }
  .pvp-search-profile-copy h3 { font-size: 20px; }
  .pvp-search-source { grid-column: 1 / -1; text-align: left; }
  .pvp-search-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pvp-search-stats > div:nth-child(2) { border-right: 0; }
  .pvp-search-columns { grid-template-columns: 1fr; }
  .pvp-search-columns .pvp-km-row { grid-template-columns: 1fr auto; }
  .pvp-search-columns .pvp-km-row > span { grid-column: 1 / -1; }
  .pvp-search-km-profile .pvp-search-profile-main { grid-template-columns: 1fr; }
}

.pvp-gateway-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pvp-gateway-card,
.pvp-conflict-card {
  display: flex;
  flex-direction: column;
  min-height: 118px;
  padding: 16px;
  border: 1px solid rgba(0, 122, 255, 0.24);
  border-radius: 8px;
  background: rgba(12, 18, 34, 0.82);
  text-decoration: none;
  color: var(--text-primary);
  overflow: hidden;
}

.pvp-gateway-card:hover,
.pvp-conflict-card:hover {
  border-color: rgba(0, 180, 255, 0.52);
  background: rgba(14, 26, 48, 0.92);
}

.pvp-gateway-card span {
  color: var(--hud-accent);
  font-size: 13px;
  font-weight: 700;
}

.pvp-gateway-card strong {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.42;
  letter-spacing: 0;
}

.pvp-section-head,
.pvp-mini-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.pvp-section-head h2,
.pvp-mini-head h3 {
  margin: 0;
  letter-spacing: 0;
}

.pvp-section-head span,
.pvp-mini-head span,
.pvp-mini-head a {
  color: var(--text-tertiary);
  font-size: 12px;
  text-decoration: none;
}

.pvp-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.pvp-status-strip > div {
  min-height: 70px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
}

.pvp-status-strip span {
  display: block;
  color: var(--text-tertiary);
  font-size: 12px;
  margin-bottom: 8px;
}

.pvp-status-strip strong {
  font-size: 22px;
}

.pvp-columns,
.war-room-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.war-room-grid {
  grid-template-columns: 1.2fr 1fr 1fr;
}

.pvp-conflict-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pvp-card-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
  min-height: 46px;
}

.pvp-card-meta,
.pvp-card-stats,
.pvp-loss-row {
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 10px;
}

.pvp-bounty-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.asset-estimate-options {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.asset-estimate-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.asset-estimate-options select {
  min-width: 88px;
}

.asset-estimate-detail {
  grid-column: 1 / -1;
}

.asset-estimate-detail h4 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.asset-estimate-detail h4 small,
.asset-estimate-detail .data-row span small,
.asset-estimate-detail .data-row span em {
  display: block;
  margin-top: 3px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-style: normal;
  line-height: 1.35;
}

.asset-estimate-detail .data-row span b {
  display: block;
  color: inherit;
  font-size: 12px;
}

.asset-estimate-detail .data-row > span {
  min-width: 135px;
}

.asset-estimate-detail .data-row > span:first-child {
  min-width: 210px;
}

.tools-table-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
}

.tools-table-head span {
  color: var(--text-tertiary) !important;
  font-size: 10px !important;
  font-weight: 700;
  letter-spacing: .04em;
}

.asset-estimate-missing {
  color: var(--text-tertiary);
}

.asset-estimate-status {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.asset-estimate-status > span,
.asset-estimate-status > small {
  color: var(--muted);
}

.asset-estimate-status.is-partial {
  border-color: color-mix(in srgb, var(--hud-gold) 48%, var(--line));
  background: color-mix(in srgb, var(--hud-gold) 8%, transparent);
}

.asset-estimate-status.is-none {
  border-color: color-mix(in srgb, var(--red) 48%, var(--line));
  background: color-mix(in srgb, var(--red) 8%, transparent);
}

@media (max-width: 760px) {
  .asset-estimate-detail .data-list {
    overflow-x: auto;
  }
  .asset-estimate-detail .data-row {
    min-width: 690px;
  }
}

.pvp-bounty-actions .hud-btn-outline {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}

.pvp-bounty-actions .pvp-bounty-candidate-action {
  margin-left: auto;
}

.pvp-bounty-actions .pvp-bounty-cancel {
  border-color: rgba(251, 113, 133, 0.52);
  background: rgba(190, 24, 93, 0.10);
  color: #fda4af;
}

.pvp-bounty-actions .pvp-bounty-cancel:hover {
  border-color: rgba(251, 113, 133, 0.82);
  background: rgba(190, 24, 93, 0.20);
  color: #fff1f2;
}

.pvp-bounty-closed-note {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.pvp-bounty-candidates {
  margin-top: 10px;
}

.pvp-bounty-list .pvp-empty,
.pvp-bounty-claims .pvp-empty,
.pvp-bounty-candidates .pvp-empty {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.pvp-sync-note {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid rgba(39,224,194,.16);
  border-radius: 8px;
  background: rgba(39,224,194,.07);
  color: #8ff7e8;
  font: 700 12px var(--font-mono);
}

.pvp-candidate-list {
  display: grid;
  gap: 8px;
}

.pvp-candidate-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(130px, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(4, 8, 18, 0.52);
}

.pvp-candidate-row.claimable {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(10, 58, 48, 0.24);
}

.pvp-candidate-row a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 800;
}

.pvp-candidate-row span,
.pvp-candidate-row small {
  color: var(--text-secondary);
  font-size: 13px;
}

.pvp-candidate-row strong {
  color: var(--hud-accent);
  white-space: nowrap;
}

.pvp-candidate-row small {
  grid-column: 1 / span 2;
}

.pvp-card-stats,
.pvp-loss-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pvp-loss-row .red { color: #ff5b7e; }
.pvp-loss-row .blue { color: #55d5ff; }

.pvp-ratio-bar,
.war-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.28);
  overflow: hidden;
  margin-top: auto;
}

.pvp-ratio-bar i,
.war-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #b41142, #ff4d79);
}

.pvp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pvp-list-row,
.pvp-km-row,
.pvp-bounty-card,
.war-campaign-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
  color: var(--text-primary);
  text-decoration: none;
}

.pvp-list-row span,
.pvp-km-row span,
.pvp-km-row em {
  color: var(--text-tertiary);
  font-size: 12px;
  font-style: normal;
}

.pvp-bounty-card span,
.pvp-bounty-card p,
.pvp-bounty-card small {
  color: var(--text-secondary);
  font-size: 13px;
  font-style: normal;
}

.pvp-bounty-card small {
  color: #cbd5e1;
  font-family: var(--font-mono);
}

.pvp-bounty-card {
  align-items: stretch;
  flex-direction: column;
  gap: 10px;
}

.pvp-bounty-card-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.pvp-bounty-card-main > div {
  min-width: 0;
}

.pvp-bounty-card strong {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.pvp-bounty-card p {
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.pvp-bounty-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pvp-bounty-tags span {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 999px;
  background: rgba(148, 163, 184, .08);
  color: #d7e0ee;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pvp-bounty-progress {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 122, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 122, 255, 0.08);
}

.pvp-bounty-progress span:last-child {
  color: #8ff7e8;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.pvp-bounty-rules {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px;
  border-color: rgba(39, 224, 194, 0.18);
  background: rgba(8, 18, 32, 0.62);
}

.pvp-bounty-rules > div {
  min-height: 82px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  box-sizing: border-box;
}

.pvp-bounty-rules strong {
  display: block;
  margin-bottom: 6px;
  color: #4ef0d6;
  font-size: 13px;
}

.pvp-bounty-rules span {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.tiny-action {
  margin-left: 8px;
  border: 1px solid rgba(39,224,194,.35);
  border-radius: 999px;
  background: rgba(39,224,194,.12);
  color: #4ef0d6;
  padding: 3px 9px;
  font: 800 11px var(--font-mono);
  cursor: pointer;
}

.tiny-action.review {
  border-color: rgba(255, 183, 77, 0.42);
  background: rgba(255, 183, 77, 0.12);
  color: #ffca7a;
}

.tiny-action:disabled {
  cursor: wait;
  opacity: .65;
}

.pvp-search-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.pvp-search-kms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pvp-bounty-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
}

.pvp-bounty-layout-compact {
  grid-template-columns: minmax(320px, 0.7fr) minmax(0, 1.3fr);
}

.pvp-bounty-order-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.pvp-bounty-order-card h3,
.pvp-bounty-order-card p {
  margin: 0;
}

.pvp-bounty-order-card p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.pvp-bounty-order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
  gap: 16px;
  align-items: start;
}

.pvp-bounty-form-wide {
  gap: 14px;
}

.pvp-bounty-form-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.pvp-bounty-fieldset {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(0, 122, 255, 0.14);
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
}

.pvp-bounty-fieldset h4 {
  margin: 0;
  color: var(--hud-accent);
  font-size: 14px;
}

.pvp-bounty-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.pvp-bounty-forms {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pvp-bounty-form,
.ws-claim-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pvp-bounty-form h3 {
  margin: 4px 0 0;
  font-size: 18px;
  letter-spacing: 0;
}

.pvp-form-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.pvp-claim-result {
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(39,224,194,.32);
  border-radius: 8px;
  background: rgba(39,224,194,.10);
  color: #4ef0d6;
  font-size: 13px;
  line-height: 1.5;
}

.pvp-claim-list {
  display: grid;
  gap: 8px;
}

.pvp-claim-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.pvp-claim-ledger > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(39,224,194,.16);
  border-radius: 8px;
  background: rgba(39,224,194,.07);
}

.pvp-claim-ledger span,
.pvp-claim-ledger small {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.pvp-claim-ledger strong {
  display: block;
  margin: 3px 0;
  color: #4ef0d6;
  font: 900 20px var(--font-mono);
}

.pvp-claim-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(4, 8, 18, 0.52);
}

.pvp-claim-row strong {
  display: block;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pvp-claim-row span,
.pvp-claim-row small,
.pvp-claim-row em {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
  font-style: normal;
}

.pvp-claim-row small {
  margin-top: 4px;
  color: #8ff7e8;
}

.pvp-claim-row-side {
  min-width: 120px;
  text-align: right;
}

.pvp-claim-row-side a {
  display: block;
  color: var(--hud-accent);
  font: 800 12px var(--font-mono);
  text-decoration: none;
}

.pvp-claim-row-side strong {
  color: var(--hud-accent);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.pvp-claim-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.pvp-claim-evidence span {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--text-secondary);
  font: 800 11px var(--font-mono);
  overflow-wrap: anywhere;
}

.pvp-claim-evidence span.ok {
  border-color: rgba(39,224,194,.32);
  background: rgba(39,224,194,.10);
  color: #8ff7e8;
}

.pvp-claim-evidence span.warn {
  border-color: rgba(245,158,11,.32);
  background: rgba(245,158,11,.11);
  color: #fbbf24;
}

.pvp-claim-status {
  display: inline-flex;
  justify-content: center;
  width: fit-content;
  margin-left: auto;
  margin-bottom: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--text-tertiary);
  font: 800 11px var(--font-mono);
}

.pvp-claim-status.verified {
  border-color: rgba(39,224,194,.38);
  background: rgba(39,224,194,.12);
  color: #4ef0d6;
}

.pvp-claim-status.paid {
  border-color: rgba(52,211,153,.38);
  background: rgba(52,211,153,.14);
  color: #72f5af;
}

.pvp-claim-status.pending {
  border-color: rgba(245,158,11,.34);
  background: rgba(245,158,11,.12);
  color: #fbbf24;
}

.war-campaign-card {
  display: block;
}

.war-campaign-top,
.war-progress-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.war-progress-labels {
  margin: 8px 0 0;
  color: var(--text-tertiary);
  font-size: 12px;
}

.wiki-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.not-found-page { max-width: 760px; margin: 9vh auto 18vh; padding: clamp(32px, 7vw, 76px); text-align: center; background: radial-gradient(circle at 50% 0, rgba(24, 124, 233, .17), transparent 48%), rgba(4, 10, 22, .9); }
.not-found-page h1 { margin: 10px 0; font-size: clamp(32px, 6vw, 58px); }
.not-found-page p { max-width: 560px; margin: 0 auto 24px; color: var(--text-secondary); line-height: 1.7; }
.not-found-page > div { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

.wiki-layout[hidden],
.wiki-contribute-panel[hidden],
.wiki-chronicle[hidden] {
  display: none !important;
}

.wiki-page-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.wiki-mode-tabs {
  display: flex;
  gap: 9px;
}

.wiki-mode-tab {
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid rgba(0, 122, 255, .38);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 900;
}

.wiki-mode-tab.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, #0787ff, #0872e8);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 122, 255, .24);
}

.wiki-review-badge {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff486d;
  color: #fff;
  font-size: 10px;
  line-height: 1;
}

.wiki-review-badge[hidden] {
  display: none !important;
}

.wiki-promo-disclosure {
  margin-bottom: 12px;
  padding: 0;
  overflow: hidden;
}
.wiki-promo-disclosure > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 10px 15px;
  cursor: pointer;
  list-style: none;
}
.wiki-promo-disclosure > summary::-webkit-details-marker { display: none; }
.wiki-promo-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.wiki-promo-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(64, 172, 255, .36);
  border-radius: 50%;
  background: rgba(22, 117, 210, .15);
  color: #79d0ff;
  font-size: 11px;
  transition: transform .18s ease;
}
.wiki-promo-disclosure[open] .wiki-promo-mark { transform: rotate(90deg); }
.wiki-promo-summary-copy { display: grid; gap: 2px; }
.wiki-promo-summary-copy b { color: var(--text-primary); font-size: 14px; }
.wiki-promo-summary-copy small { color: var(--text-tertiary); font-size: 11px; }
.wiki-promo-action { color: var(--hud-accent); font-size: 11px; font-weight: 800; }
.wiki-promo-body {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(420px, 1.28fr);
  gap: 22px;
  align-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 82% 12%, rgba(37, 140, 255, .16), transparent 40%),
    linear-gradient(135deg, rgba(5, 18, 39, .96), rgba(5, 10, 23, .90));
}
.wiki-media-copy h2 { margin: 7px 0 9px; font-size: clamp(24px, 3vw, 38px); }
.wiki-media-copy p { margin: 0; color: var(--text-secondary); line-height: 1.7; }
.wiki-media-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.wiki-media-pills span { padding: 5px 9px; border: 1px solid rgba(64, 172, 255, .32); border-radius: 999px; color: #83d7ff; font: 800 10px var(--font-mono); }
.wiki-promo-video { margin: 0; border: 1px solid rgba(72, 166, 255, .28); border-radius: 13px; background: #020711; overflow: hidden; box-shadow: 0 18px 44px rgba(0, 0, 0, .28); }
.wiki-promo-video video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #020711; object-fit: cover; }
.wiki-promo-video figcaption { padding: 8px 11px; color: var(--text-tertiary); font-size: 10px; }

.wiki-inline-media {
  width: min(100%, 760px);
  margin: 16px auto 24px;
  overflow: hidden;
  border: 1px solid rgba(71, 161, 247, .24);
  border-radius: 12px;
  background: rgba(2, 8, 18, .72);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .18);
}
.wiki-inline-media.is-wide { width: 100%; }
.wiki-inline-media.is-compact { width: fit-content; max-width: min(100%, 620px); }
.wiki-inline-media.is-portrait { width: fit-content; max-width: min(100%, 340px); }
.wiki-inline-media img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #020711;
}
.wiki-inline-media.is-portrait img { max-height: 520px; }
.wiki-inline-media figcaption {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-top: 1px solid rgba(71, 161, 247, .15);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}
.wiki-inline-media figcaption a {
  width: fit-content;
  color: var(--hud-accent);
  font-size: 11px;
}

.wiki-community-intro {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 16px;
  padding: 0;
  overflow: hidden;
}

.wiki-community-intro > div {
  display: grid;
  gap: 5px;
  padding: 15px 17px;
  border-right: 1px solid var(--line);
}

.wiki-community-intro > div:last-child { border-right: 0; }
.wiki-community-intro strong { color: var(--text-primary); font-size: 13px; }
.wiki-community-intro span { color: var(--text-tertiary); font-size: 12px; line-height: 1.55; }

.wiki-chronicle {
  display: grid;
  gap: 16px;
}

.wiki-chronicle-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border-color: rgba(255, 180, 50, .28);
  background: linear-gradient(135deg, rgba(112, 65, 8, .18), rgba(4, 11, 24, .58));
}

.wiki-chronicle-intro h2 { margin: 5px 0 7px; }
.wiki-chronicle-intro p { max-width: 850px; margin: 0; color: var(--text-secondary); line-height: 1.65; }
.wiki-chronicle-intro button { flex: 0 0 auto; }

.wiki-chronicle-items {
  display: grid;
  gap: 8px;
}

.wiki-chronicle-items button {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.wiki-chronicle-items button.active {
  border-color: rgba(255, 180, 50, .55);
  background: rgba(255, 180, 50, .10);
}

.wiki-chronicle-items small { color: var(--text-tertiary); font-size: 11px; line-height: 1.45; }

.wiki-chronicle-empty {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px dashed rgba(255, 180, 50, .30);
  border-radius: 10px;
  color: var(--text-secondary);
}

.wiki-chronicle-empty strong { color: var(--text-primary); }
.wiki-chronicle-empty p { margin: 0; line-height: 1.65; }

/* 曙光编年史总览重设计 */
.wiki-community-intro[hidden],
.wiki-promo-disclosure[hidden] {
  display: none !important;
}

.wiki-chronicle-hero {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-color: rgba(255, 180, 50, .28);
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 180, 50, .12), transparent 28%),
    linear-gradient(135deg, rgba(112, 65, 8, .16), rgba(4, 11, 24, .72));
}
.wiki-chronicle-hero.is-compact {
  grid-template-columns: 1fr;
}
.wiki-chronicle-hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.wiki-chronicle-hero-copy h2 { margin: 4px 0 6px; font-size: clamp(22px, 3vw, 30px); }
.wiki-chronicle-hero-copy p { margin: 0; max-width: 900px; color: var(--text-secondary); line-height: 1.55; font-size: 13px; }
.wiki-chronicle-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wiki-chronicle-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(68px, auto));
  gap: 8px;
}
.wiki-chronicle-hero-stats article {
  display: grid;
  gap: 2px;
  min-width: 72px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(0,0,0,.18);
}
.wiki-chronicle-hero-stats span { color: var(--text-tertiary); font-size: 11px; }
.wiki-chronicle-hero-stats strong { color: var(--text-primary); font-size: 18px; line-height: 1.1; }

.wiki-chronicle-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
}
.wiki-chronicle-legend strong { color: var(--text-primary); }
.wiki-chronicle-legend p { margin: 0; color: var(--text-tertiary); font-size: 12px; line-height: 1.5; }
.wiki-chronicle-legend-items { display: flex; flex-wrap: wrap; gap: 8px; }

.wiki-source-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255,255,255,.03);
}
.wiki-source-pill.is-official { color: #8dffc4; border-color: rgba(53,220,152,.35); background: rgba(53,220,152,.08); }
.wiki-source-pill.is-network { color: #ffd27a; border-color: rgba(255,180,50,.35); background: rgba(255,180,50,.08); }
.wiki-source-pill.is-live { color: #8ecbff; border-color: rgba(110,180,255,.35); background: rgba(110,180,255,.08); }
.wiki-source-pill.is-community { color: #d7b8ff; border-color: rgba(170,120,255,.35); background: rgba(170,120,255,.08); }

.wiki-chronicle-eras {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.wiki-chronicle-era {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(8, 14, 26, .72);
  min-height: 100%;
}
.wiki-chronicle-era.tone-cyan { border-color: rgba(110,200,255,.22); box-shadow: inset 0 0 0 1px rgba(110,200,255,.05); }
.wiki-chronicle-era.tone-crimson { border-color: rgba(255,110,130,.22); }
.wiki-chronicle-era.tone-gold { border-color: rgba(255,196,90,.24); }
.wiki-chronicle-era.tone-violet { border-color: rgba(170,120,255,.24); }
.wiki-chronicle-era-head { display: grid; gap: 4px; }
.wiki-chronicle-era-head span { color: var(--text-tertiary); font-size: 12px; }
.wiki-chronicle-era-head strong { color: var(--text-primary); font-size: 18px; }
.wiki-chronicle-era p { margin: 0; color: var(--text-secondary); line-height: 1.65; font-size: 13px; }
.wiki-chronicle-era-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.wiki-chronicle-era-tags span,
.wiki-chronicle-faction-items article div span {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-tertiary);
  font-size: 11px;
}
.wiki-chronicle-era button { justify-self: start; }

.wiki-chronicle-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  align-items: start;
}
.wiki-chronicle-grid-main {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
}
.wiki-chronicle-panel {
  padding: 16px;
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 0;
}
.wiki-chronicle-sov-panel {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}
.wiki-chronicle-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}
.wiki-chronicle-panel-head h3 { margin: 4px 0 0; }
.wiki-chronicle-panel-head small,
.wiki-chronicle-panel-head a { color: var(--text-tertiary); font-size: 12px; }

.wiki-chronicle-timeline { display: grid; gap: 0; }
.wiki-chronicle-timeline-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
}
.wiki-chronicle-timeline-rail {
  position: relative;
  width: 18px;
}
.wiki-chronicle-timeline-rail::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(255,180,50,.55), rgba(255,255,255,.08));
}
.wiki-chronicle-timeline-rail::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255,180,50,.8);
  background: #101826;
  box-shadow: 0 0 0 4px rgba(255,180,50,.08);
}
.wiki-chronicle-timeline-card {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}
.wiki-chronicle-timeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wiki-chronicle-timeline-card h4,
.wiki-chronicle-battle-card h4 { margin: 0; color: var(--text-primary); }
.wiki-chronicle-timeline-card p,
.wiki-chronicle-battle-card p,
.wiki-chronicle-mechanics p,
.wiki-chronicle-memory p,
.wiki-chronicle-faction-items p { margin: 0; color: var(--text-secondary); line-height: 1.65; font-size: 13px; }
.wiki-chronicle-timeline-card button,
.wiki-chronicle-battle-card button {
  justify-self: start;
  border: 0;
  background: transparent;
  color: #8ecbff;
  cursor: pointer;
  padding: 0;
}

.wiki-chronicle-sov-list,
.wiki-chronicle-live-battles,
.wiki-chronicle-battles,
.wiki-chronicle-mechanics,
.wiki-chronicle-memory { display: grid; gap: 8px; }
.wiki-chronicle-sov-list article,
.wiki-chronicle-live-battle,
.wiki-chronicle-battle-card,
.wiki-chronicle-mechanics article,
.wiki-chronicle-memory article {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}
.wiki-chronicle-sov-list article {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.wiki-chronicle-rank {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255,210,122,.28);
  color: #ffd27a;
  font: 800 11px var(--font-mono);
  background: rgba(255,180,50,.08);
}
.wiki-chronicle-sov-list b,
.wiki-chronicle-live-battle b,
.wiki-chronicle-memory b { color: var(--text-primary); }
.wiki-chronicle-sov-list small,
.wiki-chronicle-live-battle small { color: var(--text-tertiary); }
.wiki-chronicle-sov-list strong,
.wiki-chronicle-live-battle-side strong,
.wiki-chronicle-battle-card strong { color: #ffd27a; white-space: nowrap; }
.wiki-chronicle-sov-events { display: grid; gap: 6px; padding-top: 4px; }
.wiki-chronicle-sov-events h4 { margin: 0; color: var(--text-primary); font-size: 13px; }
.wiki-chronicle-sov-events p { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.wiki-chronicle-sov-events time { color: var(--text-tertiary); margin-right: 6px; }

.wiki-chronicle-relations {
  display: grid;
  gap: 10px;
}
.wiki-chronicle-relation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.wiki-chronicle-relation-grid section {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(0,0,0,.14);
}
.wiki-chronicle-relation-grid h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: 13px;
}
.wiki-chronicle-relation-grid article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(110,180,255,.14);
  background: rgba(110,180,255,.05);
}
.wiki-chronicle-relation-grid article.is-foe {
  border-color: rgba(255,110,130,.18);
  background: rgba(255,110,130,.05);
}
.wiki-chronicle-relation-grid article b {
  color: var(--text-primary);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.wiki-chronicle-relation-grid article span {
  color: var(--text-tertiary);
  font-size: 11px;
  white-space: nowrap;
}
.wiki-chronicle-relation-empty,
.wiki-chronicle-relation-note {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.55;
}

.wiki-chronicle-live-battle { text-decoration: none; color: inherit; transition: border-color .15s ease, transform .15s ease; }
.wiki-chronicle-live-battle:hover { border-color: rgba(110,180,255,.35); transform: translateY(-1px); }
.wiki-chronicle-live-battle-side { display: grid; gap: 3px; }
.wiki-chronicle-live-battle-side span { color: var(--text-tertiary); font-size: 12px; }

.wiki-chronicle-factions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.wiki-chronicle-faction-layer {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.14);
  align-content: start;
  min-height: 0;
}
.wiki-chronicle-faction-layer header { display: grid; gap: 4px; }
.wiki-chronicle-faction-layer header strong { color: var(--text-primary); }
.wiki-chronicle-faction-layer header span { color: var(--text-tertiary); font-size: 12px; }
.wiki-chronicle-faction-items { display: grid; gap: 8px; }
.wiki-chronicle-faction-items article {
  display: grid;
  gap: 5px;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.03);
}
.wiki-chronicle-faction-items article b { color: var(--text-primary); }
.wiki-chronicle-faction-items article div { display: flex; flex-wrap: wrap; gap: 6px; }

@media (max-width: 1100px) {
  .wiki-chronicle-hero,
  .wiki-chronicle-grid,
  .wiki-chronicle-grid-main,
  .wiki-chronicle-eras,
  .wiki-chronicle-factions,
  .wiki-chronicle-relation-grid { grid-template-columns: 1fr; }
  .wiki-chronicle-sov-panel { position: static; max-height: none; }
  .wiki-chronicle-hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .wiki-chronicle-hero-stats { grid-template-columns: 1fr 1fr; }
  .wiki-chronicle-hero-actions { width: 100%; }
  .wiki-chronicle-hero-actions .hud-btn-primary,
  .wiki-chronicle-hero-actions .hud-btn-secondary,
  .wiki-chronicle-hero-actions .hud-btn-outline { flex: 1 1 auto; text-align: center; }
}


.wiki-categories {
  position: sticky;
  top: 112px;
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 136px);
  overflow: auto;
  padding: 14px;
}

.wiki-tree-head,
.wiki-category summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wiki-tree-head {
  padding: 2px 2px 8px;
  border-bottom: 1px solid rgba(0, 122, 255, 0.12);
}

.wiki-tree-head span,
.wiki-category summary small {
  color: var(--text-tertiary);
  font: 800 11px var(--font-mono);
}

.wiki-category {
  border: 1px solid rgba(0, 122, 255, 0.14);
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
}

.wiki-category summary {
  min-height: 42px;
  padding: 10px 12px;
  color: var(--hud-accent);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.wiki-category summary::-webkit-details-marker {
  display: none;
}

.wiki-category summary::before {
  content: "›";
  color: var(--text-tertiary);
  font-size: 18px;
  transition: transform .16s ease;
}

.wiki-category[open] summary::before {
  transform: rotate(90deg);
}

.wiki-category-items {
  display: grid;
  gap: 6px;
  padding: 0 8px 10px 28px;
}

.wiki-category button,
.wiki-category a.wiki-article-link {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  cursor: pointer;
  line-height: 1.45;
  text-decoration: none;
  box-sizing: border-box;
}

.wiki-category button.active,
.wiki-category a.wiki-article-link.active {
  border-color: rgba(0, 122, 255, 0.50);
  background: rgba(0, 122, 255, 0.16);
  color: var(--hud-accent);
  font-weight: 900;
}

.wiki-content {
  min-height: calc(100vh - 190px);
  scroll-margin-top: 112px;
}

.wiki-article {
  max-width: 860px;
}

.wiki-article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.wiki-article-meta > span:not(.v2-panel-kicker) {
  padding: 4px 8px;
  border: 1px solid rgba(0, 122, 255, .18);
  border-radius: 999px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.wiki-contributor-badge { display: inline-flex; align-items: center; gap: 6px; }
.wiki-contributor-badge img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.wiki-contributor-badge b { color: var(--text-primary); font-size: 11px; }
.wiki-contributor-badge small { color: #50e69a; font-size: 9px; }

.wiki-source-refs {
  margin-top: 24px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .025);
  color: var(--text-secondary);
}

.wiki-source-refs summary { cursor: pointer; color: var(--hud-accent); font-weight: 800; }
.wiki-source-refs ul { margin-bottom: 0; }

.wiki-contribute-panel { padding: 20px; }
.wiki-contribute-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.wiki-contribute-head h2 { margin: 5px 0 7px; }
.wiki-contribute-head p { max-width: 760px; margin: 0; color: var(--text-secondary); line-height: 1.65; }
.wiki-author-status { flex: 0 0 auto; padding: 7px 11px; border: 1px solid rgba(255, 91, 126, .35); border-radius: 999px; color: #ff6b87; font-size: 12px; }
.wiki-author-status.is-ready { border-color: rgba(47, 214, 130, .4); color: #50e69a; }
.wiki-contribution-form { display: grid; gap: 12px; margin-top: 20px; }
.wiki-contribution-form label { display: grid; gap: 6px; color: var(--text-secondary); font-size: 12px; }
.wiki-contribution-form input,
.wiki-contribution-form select,
.wiki-contribution-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: rgba(4, 9, 20, .72); color: var(--text-primary); padding: 10px 12px; font: inherit; }
.wiki-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wiki-attest { grid-template-columns: auto 1fr !important; align-items: start; }
.wiki-attest input { width: auto; margin-top: 3px; }
.wiki-form-actions { display: flex; align-items: center; gap: 12px; color: var(--text-tertiary); font-size: 12px; }
.wiki-contribution-gate { display: grid; justify-items: start; gap: 9px; max-width: 680px; margin-top: 20px; padding: 18px; border: 1px dashed rgba(0, 122, 255, .38); border-radius: 12px; }
.wiki-contribution-gate p { margin: 0; color: var(--text-secondary); line-height: 1.65; }
.wiki-my-contributions { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; }
.wiki-my-head { display: flex; align-items: center; justify-content: space-between; }
.wiki-contribution-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.wiki-contribution-row div { display: grid; gap: 3px; }
.wiki-contribution-row span { color: var(--text-tertiary); font-size: 11px; }
.wiki-contribution-row strong { color: #ffb432; font-size: 12px; }
.wiki-contribution-row strong[data-status="approved"] { color: #50e69a; }
.wiki-contribution-row strong[data-status="rejected"] { color: #ff6b87; }
.wiki-contribution-row p { grid-column: 1 / -1; margin: 0; color: var(--text-secondary); font-size: 12px; }
.wiki-review-panel { display: grid; gap: 14px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.wiki-review-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wiki-review-head h3 { margin: 3px 0 0; }
.wiki-review-row { display: grid; gap: 11px; padding: 16px; border: 1px solid rgba(0, 122, 255, .24); border-radius: 12px; background: rgba(4, 9, 20, .45); }
.wiki-review-row header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.wiki-review-row header > div { display: grid; gap: 4px; }
.wiki-review-row header span,
.wiki-review-row label span { color: var(--text-tertiary); font-size: 11px; }
.wiki-review-summary { margin: 0; color: var(--text-secondary); line-height: 1.65; }
.wiki-review-row details { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.wiki-review-row summary { cursor: pointer; color: var(--text-secondary); }
.wiki-review-body { max-height: 360px; overflow: auto; padding-top: 10px; }
.wiki-review-row label { display: grid; gap: 6px; }
.wiki-review-row textarea,
.wiki-rollback-form input { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: rgba(4, 9, 20, .72); color: var(--text-primary); padding: 10px 12px; font: inherit; }
.wiki-review-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.wiki-review-actions span,
.wiki-rollback-form > span { color: var(--text-secondary); font-size: 12px; }
.wiki-rollback-form { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(110px, .55fr) minmax(230px, 1.6fr) auto; align-items: end; gap: 10px; padding: 14px; border: 1px dashed rgba(255, 180, 50, .35); border-radius: 12px; }
.wiki-rollback-form > div { grid-column: 1 / -1; display: grid; gap: 3px; }
.wiki-rollback-form > div span { color: var(--text-tertiary); font-size: 11px; }
.wiki-rollback-form label { display: grid; gap: 5px; color: var(--text-secondary); font-size: 11px; }

.public-changelog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.public-changelog-head strong { font-size: 18px; }
.public-changelog-head p { max-width: 760px; margin: 5px 0 0; color: var(--text-secondary); line-height: 1.6; }
.public-changelog-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.public-changelog-actions > span { flex: 0 0 auto; padding: 6px 10px; border: 1px solid rgba(47, 214, 130, .35); border-radius: 999px; color: #50e69a; font-size: 11px; }
.public-changelog-actions button { min-height: 30px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(4, 11, 24, .42); color: var(--text-secondary); font-size: 11px; }
.public-changelog-actions button:hover { border-color: rgba(42, 159, 255, .42); color: var(--hud-accent); }
.public-changelog-overview { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 13px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid rgba(42, 159, 255, .2); border-radius: 12px; background: rgba(5, 28, 58, .42); }
.public-changelog-overview > strong { color: var(--hud-accent); font-size: 12px; }
.public-changelog-overview > div { display: flex; flex-wrap: wrap; gap: 7px; }
.public-changelog-overview span,
.public-changelog-topics span { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-secondary); background: rgba(255, 255, 255, .025); font-size: 11px; }
.public-changelog-list { display: grid; gap: 10px; }
.public-changelog-entry { border: 1px solid var(--line); border-radius: 13px; background: rgba(4, 11, 24, .38); overflow: hidden; }
.public-changelog-entry.is-latest { border-color: rgba(42, 159, 255, .38); box-shadow: inset 3px 0 0 var(--hud-accent); }
.public-changelog-entry summary { display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; align-items: start; gap: 16px; padding: 16px 17px; cursor: pointer; list-style: none; }
.public-changelog-entry summary::-webkit-details-marker { display: none; }
.public-changelog-entry time { padding-top: 3px; color: var(--hud-accent); font: 800 12px var(--font-mono); }
.public-changelog-entry h3 { margin: 0 0 6px; font-size: 17px; }
.public-changelog-entry p { margin: 0; color: var(--text-secondary); line-height: 1.65; }
.public-changelog-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.public-changelog-toggle { align-self: center; color: var(--text-tertiary); font-size: 0; white-space: nowrap; }
.public-changelog-toggle::after { content: "查看详情"; font-size: 11px; }
.public-changelog-entry[open] .public-changelog-toggle { color: var(--hud-accent); }
.public-changelog-entry[open] .public-changelog-toggle::after { content: "收起详情"; }
.public-changelog-detail { padding: 0 17px 16px 145px; border-top: 1px solid var(--line); }
.public-changelog-entry ul { margin: 14px 0 0; padding-left: 20px; color: var(--text-secondary); line-height: 1.75; }

.wiki-article h1 {
  margin: 4px 0 18px;
  font-size: 30px;
  letter-spacing: 0;
}

.wiki-article h2 {
  margin: 24px 0 10px;
  font-size: 20px;
}

.wiki-article p,
.wiki-article li {
  color: var(--text-secondary);
  line-height: 1.85;
  font-size: 15px;
}

.wiki-article footer {
  margin-top: 28px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.pvp-empty,
.pvp-loading,
.pvp-error {
  color: var(--text-tertiary);
  font-size: 13px;
  padding: 12px;
}

.pvp-error {
  color: #ff5b7e;
}

.pvp-overview-conflicts {
  margin-bottom: 16px;
}

.pvp-kb-featured,
.pvp-kb-latest {
  padding: 20px;
  margin-bottom: 16px;
}

.pvp-kb-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.pvp-kb-section-head h2 {
  margin: 2px 0 0;
  font-size: 24px;
}

.pvp-kb-section-head > span,
.pvp-kb-section-head > a {
  color: var(--text-tertiary);
  font-size: 12px;
  text-decoration: none;
  text-align: right;
}

.pvp-featured-grid {
  display: grid;
  /* Prefer actual card count so a short week does not leave an empty 6th cell. */
  grid-template-columns: repeat(var(--pvp-featured-cols, 6), minmax(0, 1fr));
  gap: 10px;
}

.pvp-featured-groups,
.pvp-featured-group {
  display: grid;
  gap: 14px;
}

.pvp-featured-group + .pvp-featured-group {
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.pvp-featured-group .pvp-mini-head {
  margin-bottom: 0;
}

.pvp-featured-group .pvp-mini-head > div > span,
.pvp-featured-group .pvp-mini-head > small {
  color: var(--text-tertiary);
  font: 800 10px var(--font-mono);
  letter-spacing: .08em;
}

.pvp-featured-kill {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 78, 121, .2);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(180, 17, 66, .13), rgba(4, 10, 22, .72));
  color: var(--text-primary);
  text-decoration: none;
}

.pvp-featured-kill:hover { border-color: rgba(255, 78, 121, .58); transform: translateY(-1px); }
.pvp-featured-kill img { width: 52px; height: 52px; border-radius: 7px; object-fit: cover; background: rgba(255,255,255,.05); }
.pvp-featured-kill div { min-width: 0; display: grid; gap: 3px; }
.pvp-featured-kill strong,
.pvp-featured-kill span,
.pvp-featured-kill small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pvp-featured-kill span { color: #ff7695; font-size: 12px; }
.pvp-featured-kill small { color: var(--text-tertiary); font-size: 10px; }
.pvp-featured-kill > b { grid-column: 1 / -1; color: #ffd166; font: 800 14px var(--font-mono); }
.pvp-featured-rank { position: absolute; top: 5px; left: 5px; min-width: 18px; padding: 2px 4px; border-radius: 5px; background: #b41142; color: #fff !important; font: 800 10px var(--font-mono); text-align: center; }

.pvp-live-head,
.pvp-live-kill {
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) minmax(160px, 1fr) minmax(160px, 1fr) minmax(120px, auto);
  gap: 14px;
  align-items: center;
}

.pvp-live-head { padding: 0 12px 8px 70px; color: var(--text-tertiary); font-size: 10px; letter-spacing: .08em; }
.pvp-live-list { display: grid; gap: 6px; }
.pvp-live-kill { grid-template-columns: 46px minmax(180px, 1.35fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(110px, auto); padding: 9px 12px; border: 1px solid rgba(255,255,255,.07); border-radius: 8px; background: rgba(255,255,255,.028); color: var(--text-primary); text-decoration: none; }
.pvp-live-kill:hover { border-color: rgba(0,180,255,.38); background: rgba(0,122,255,.07); }
.pvp-live-kill > img { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; background: rgba(255,255,255,.05); }
.pvp-live-ship,
.pvp-live-party { min-width: 0; display: grid; gap: 2px; }
.pvp-live-ship strong,
.pvp-live-party strong,
.pvp-live-party small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pvp-live-ship small,
.pvp-live-party span,
.pvp-live-party small { color: var(--text-tertiary); font-size: 10px; }
.pvp-live-party strong { font-size: 13px; }
.pvp-live-kill > b { color: #ffd166; font: 800 12px var(--font-mono); text-align: right; white-space: nowrap; }

.pvp-kb-rankings { margin-bottom: 16px; }
.pvp-kb-ranking-head { padding: 4px 2px 0; }
.pvp-ranking-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pvp-ranking-card { min-width: 0; padding: 16px; }
.pvp-ranking-card .pvp-mini-head { align-items: flex-end; }
.pvp-ranking-card .pvp-mini-head span { color: var(--hud-accent); font: 800 10px var(--font-mono); letter-spacing: .08em; }
.pvp-ranking-card .pvp-mini-head small { color: var(--text-tertiary); }
.pvp-ranking-tabs { display: flex; align-items: center; gap: 4px; }
.pvp-ranking-tabs button { min-height: 27px; padding: 3px 8px; border: 1px solid rgba(255,255,255,.09); border-radius: 6px; background: transparent; color: var(--text-tertiary); font: 700 11px var(--font-body); cursor: pointer; }
.pvp-ranking-tabs button.active { border-color: rgba(0,180,255,.42); background: rgba(0,122,255,.18); color: #72d8ff; }
.pvp-ranking-tabs small { margin-left: 4px; }
.pvp-ranking-list { display: grid; gap: 5px; }
.pvp-ranking-list[hidden] { display: none; }
.pvp-ranking-list > a { display: grid; grid-template-columns: 24px 34px minmax(0,1fr) auto; gap: 8px; align-items: center; min-width: 0; padding: 8px; border-radius: 7px; color: var(--text-primary); text-decoration: none; background: rgba(255,255,255,.028); }
.pvp-ranking-list > a:hover { background: rgba(0,122,255,.1); }
.pvp-ranking-list em { color: var(--text-tertiary); font: 800 12px var(--font-mono); font-style: normal; text-align: center; }
.pvp-ranking-list img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; background: rgba(255,255,255,.05); }
.pvp-ranking-list span { min-width: 0; display: grid; gap: 2px; }
.pvp-ranking-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.pvp-ranking-list small { color: var(--text-tertiary); font-size: 10px; }
.pvp-ranking-list b { color: #ffd166; font: 800 10px var(--font-mono); white-space: nowrap; }

.pvp-overview-conflicts .recent-conflicts-rail {
  min-height: 168px;
}

.pvp-overview-conflicts {
  padding: 12px 14px 10px;
}

.pvp-overview-conflicts .recent-conflicts-head {
  margin-bottom: 8px;
}

.pvp-overview-conflicts .recent-conflicts-head h3 {
  font-size: 18px;
}

.pvp-overview-conflicts .recent-conflict-card {
  flex-basis: 310px;
  min-height: 150px;
  padding: 11px 12px;
  grid-template-rows: minmax(38px, auto) 22px auto auto 7px;
  gap: 5px;
}

.pvp-overview-conflicts .recent-conflict-top strong {
  font-size: 14px;
}

.pvp-overview-conflicts .recent-conflict-stats,
.pvp-overview-conflicts .recent-conflict-losses,
.pvp-overview-conflicts .recent-conflict-meta {
  font-size: 11px;
}

.pvp-unified-search {
  display: grid;
  gap: 12px;
}

.pvp-unified-search .pvp-search-result {
  margin-top: 0;
}

.pvp-intel-grid-public {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.pvp-intel-grid-public > section {
  min-height: 320px;
  padding: 18px;
}

#pvp-intel-public {
  scroll-margin-top: 112px;
}

.pvp-public-jump-card .pvp-jump-list {
  max-height: 420px;
  overflow: auto;
}

.pvp-intel-brief {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 122, 255, 0.14);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
}

.pvp-intel-brief strong {
  color: var(--hud-accent);
  font-size: 22px;
}

.pvp-intel-brief span {
  color: var(--text-secondary);
  line-height: 1.7;
}

.pvp-intel-brief small {
  color: var(--text-tertiary);
}

.tools-contract-drawer {
  position: fixed;
  top: 106px;
  right: 22px;
  z-index: 80;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 132px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(0, 122, 255, 0.28);
  border-radius: 8px;
  background: rgba(8, 12, 22, 0.96);
  box-shadow: 0 24px 80px rgba(0,0,0,0.46);
  transform: translateX(calc(100% + 34px));
  opacity: 0;
  pointer-events: none;
  transition: transform .18s ease, opacity .18s ease;
}

.tools-contract-drawer.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.tools-contract-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.tools-contract-drawer-head span {
  display: block;
  color: var(--text-tertiary);
  font: 800 11px var(--font-mono);
}

.tools-contract-drawer-head strong {
  color: var(--text-primary);
  font-size: 18px;
}

.tools-contract-drawer-head button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
}

.tools-contract-drawer-body {
  overflow: auto;
  padding: 0;
}

.tools-contract-detail {
  min-width: 0;
}

.contract-game-window {
  display: grid;
  gap: 14px;
  padding: 16px 18px 18px;
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 212, 170, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012));
}

.contract-game-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.contract-game-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(142, 224, 255, 0.28);
  border-radius: 6px;
  background: rgba(142, 224, 255, 0.08);
  color: var(--text-primary);
  font: 800 20px var(--font-mono);
}

.contract-game-titlebar > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.contract-game-titlebar span {
  display: block;
  color: var(--text-tertiary);
  font: 800 11px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.contract-game-titlebar h3 {
  margin: 2px 0 2px;
  font-size: 22px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.contract-game-titlebar p {
  margin: 0;
  color: var(--text-tertiary);
  font: 700 12px var(--font-mono);
  overflow-wrap: anywhere;
}

.contract-game-titlebar > strong {
  color: var(--accent);
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
  font: 900 18px var(--font-mono);
}

.contract-info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  margin: 0;
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.contract-info-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  min-height: 28px;
  align-items: baseline;
}

.contract-info-row dt {
  color: var(--text-secondary);
  font-weight: 800;
}

.contract-info-row dd {
  margin: 0;
  color: var(--text-primary);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.contract-info-row dd.is-accent {
  color: var(--accent);
}

.contract-money-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.contract-money-strip > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 6px;
  background: rgba(255,255,255,0.035);
}

.contract-money-strip span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-tertiary);
  font-weight: 800;
}

.contract-money-strip b {
  color: var(--text-primary);
  font: 900 16px var(--font-mono);
  overflow-wrap: anywhere;
}

.contract-abyss-panel {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(255, 176, 32, 0.28);
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(255,176,32,0.08), rgba(35,167,255,0.045));
}

.contract-abyss-panel-head,
.contract-abyss-score-head,
.contract-abyss-verdict,
.contract-abyss-attr > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.contract-abyss-panel-head span,
.contract-abyss-score-head span {
  display: block;
  color: var(--text-tertiary);
  font: 800 10px var(--font-mono);
  letter-spacing: .08em;
}

.contract-abyss-panel-head h4,
.contract-abyss-score-head h5 {
  margin: 2px 0 0;
  color: var(--text-primary);
}

.contract-abyss-panel-head small {
  color: var(--text-secondary);
  text-align: right;
}

.contract-abyss-score {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: rgba(5,9,16,0.52);
  box-shadow: inset 4px 0 0 rgba(255,176,32,0.72);
}

.contract-abyss-score + .contract-abyss-score {
  margin-top: 10px;
}

.contract-abyss-score-head > strong {
  color: #ffcf66;
  font: 900 28px var(--font-mono);
  white-space: nowrap;
}

.contract-abyss-score-head > strong small {
  color: var(--text-tertiary);
  font-size: 12px;
}

.contract-abyss-verdict {
  padding: 8px 10px;
  border-radius: 5px;
  background: rgba(255,255,255,0.045);
}

.contract-abyss-verdict b {
  color: #ffcf66;
}

.contract-abyss-verdict span {
  color: var(--text-secondary);
  font-size: 11px;
  text-align: right;
}

.contract-abyss-attrs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.contract-abyss-attr {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(255,255,255,0.075);
  border-radius: 5px;
  background: rgba(255,255,255,0.025);
}

.contract-abyss-attr b,
.contract-abyss-attr strong {
  color: var(--text-primary);
}

.contract-abyss-attr strong {
  font: 900 13px var(--font-mono);
}

.contract-abyss-attr p,
.contract-abyss-disclaimer,
.contract-abyss-score.is-pending > p {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.55;
}

.contract-abyss-attr i {
  display: block;
  height: 3px;
  margin-top: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffb020 var(--attr-score), rgba(255,255,255,0.09) var(--attr-score));
}

.contract-abyss-disclaimer {
  padding-top: 8px;
  border-top: 1px dashed rgba(255,255,255,0.09);
}

.contract-abyss-score.is-pending {
  box-shadow: inset 4px 0 0 rgba(142,224,255,0.45);
}

.contract-ledger-stack {
  display: grid;
  gap: 14px;
}

.contract-ledger-section {
  min-width: 0;
}

.contract-ledger-section h4 {
  margin: 0 0 8px;
  color: var(--text-primary);
  font-size: 15px;
}

.contract-ledger-section.is-get h4 {
  color: #23f26f;
}

.contract-ledger-section.is-pay h4 {
  color: #ff4f6d;
}

.contract-ledger-table {
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 6px;
  overflow: hidden;
}

.contract-ledger-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.8fr) 88px 92px minmax(90px, .9fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: var(--text-secondary);
}

.contract-ledger-row:first-child {
  border-top: 0;
}

.contract-ledger-row-head {
  color: var(--text-tertiary);
  background: rgba(255,255,255,0.045);
  font: 800 11px var(--font-mono);
  text-transform: uppercase;
}

.contract-ledger-name {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.contract-ledger-name img,
.contract-item-icon,
.contract-ledger-name > span:first-child {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.contract-ledger-name img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.contract-item-icon.is-empty::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 3px;
}

.contract-ledger-name > span:last-child {
  display: grid;
  min-width: 0;
}

.contract-ledger-name b {
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.contract-ledger-name small {
  color: var(--text-tertiary);
  font: 700 11px var(--font-mono);
}

.contract-ledger-empty {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: var(--text-tertiary);
  background: rgba(255,255,255,0.025);
}

.contract-window-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.contract-game-link-hint {
  flex: 1 1 260px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.5;
}

:root[data-theme="light"] .tools-contract-drawer {
  background: rgba(255,255,255,0.98);
  border-color: rgba(15,23,42,0.14);
  box-shadow: 0 24px 70px rgba(15,23,42,0.18);
}

:root[data-theme="light"] .tools-contract-drawer-head button {
  background: rgba(15,23,42,0.04);
  border-color: rgba(15,23,42,0.14);
}

:root[data-theme="light"] .contract-game-window {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.92));
}

:root[data-theme="light"] .contract-info-list,
:root[data-theme="light"] .contract-game-titlebar {
  border-color: rgba(15,23,42,0.12);
}

:root[data-theme="light"] .contract-money-strip > div,
:root[data-theme="light"] .contract-ledger-table,
:root[data-theme="light"] .contract-ledger-empty,
:root[data-theme="light"] .contract-abyss-score {
  background: rgba(255,255,255,0.78);
  border-color: rgba(15,23,42,0.12);
}

:root[data-theme="light"] .contract-ledger-row {
  border-color: rgba(15,23,42,0.08);
}

:root[data-theme="light"] .contract-ledger-row-head {
  background: rgba(15,23,42,0.04);
}

@media (max-width: 760px) {
  .tools-contract-drawer {
    top: 76px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100vh - 92px);
  }

  .tools-contract-drawer-head {
    padding: 12px;
  }

  .contract-game-window {
    padding: 12px;
  }

  .contract-game-titlebar {
    align-items: flex-start;
  }

  .contract-game-titlebar > strong {
    font-size: 14px;
  }

  .contract-info-list,
  .contract-money-strip,
  .contract-abyss-attrs {
    grid-template-columns: 1fr;
  }

  .contract-abyss-panel-head,
  .contract-abyss-score-head,
  .contract-abyss-verdict {
    align-items: flex-start;
  }

  .contract-abyss-panel-head,
  .contract-abyss-verdict {
    flex-direction: column;
  }

  .contract-abyss-panel-head small,
  .contract-abyss-verdict span {
    text-align: left;
  }

  .contract-abyss-panel-head > div {
    width: 100%;
  }

  .contract-abyss-panel-head h4 {
    white-space: nowrap;
  }

  .contract-info-row {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .contract-ledger-table {
    overflow-x: auto;
  }

  .contract-ledger-row {
    grid-template-columns: minmax(160px, 1.7fr) 72px 70px minmax(86px, .9fr);
    min-width: 480px;
  }

  .contract-window-actions {
    justify-content: stretch;
  }

  .contract-game-link-hint {
    flex-basis: 100%;
  }

  .contract-window-actions button {
    flex: 1;
  }
}

:root[data-theme="light"] .pvp-search-panel,
:root[data-theme="light"] .pvp-section,
:root[data-theme="light"] .pvp-gateway-card,
:root[data-theme="light"] .pvp-conflict-card,
:root[data-theme="light"] .recent-conflict-card,
:root[data-theme="light"] .pvp-list-row,
:root[data-theme="light"] .pvp-km-row,
:root[data-theme="light"] .pvp-bounty-card,
:root[data-theme="light"] .war-campaign-card,
:root[data-theme="light"] .pvp-bounty-rules,
:root[data-theme="light"] .pvp-bounty-rules > div,
:root[data-theme="light"] .pvp-bounty-fieldset,
:root[data-theme="light"] .wiki-category,
:root[data-theme="light"] .wiki-category button,
:root[data-theme="light"] .wiki-category a.wiki-article-link,
:root[data-theme="light"] .pvp-intel-brief,
:root[data-theme="light"] .pvp-jump-row,
:root[data-theme="light"] .pvp-claim-row,
:root[data-theme="light"] .pvp-candidate-row {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.12);
  color: var(--text-primary);
  box-shadow: none;
}

:root[data-theme="light"] .pvp-section[data-pvp-overview] {
  background: transparent;
  border-color: transparent;
}

:root[data-theme="light"] .pvp-gateway-card:hover,
:root[data-theme="light"] .recent-conflict-card:hover,
:root[data-theme="light"] .wiki-category button.active,
:root[data-theme="light"] .wiki-category a.wiki-article-link.active {
  background: rgba(0, 122, 255, 0.10);
  border-color: rgba(0, 122, 255, 0.34);
}

:root[data-theme="light"] .pvp-search-form input,
:root[data-theme="light"] .pvp-bounty-form input,
:root[data-theme="light"] .pvp-bounty-form select,
:root[data-theme="light"] .pvp-bounty-form textarea,
:root[data-theme="light"] .ws-claim-form input,
:root[data-theme="light"] .ws-claim-form select,
:root[data-theme="light"] .ws-claim-form textarea,
:root[data-theme="light"] .battle-list-search-row input {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.16);
  color: #111827;
}

:root[data-theme="light"] .pvp-bounty-rules strong,
:root[data-theme="light"] .pvp-gateway-card span,
:root[data-theme="light"] .wiki-category summary,
:root[data-theme="light"] .pvp-mini-head a,
:root[data-theme="light"] .recent-conflicts-actions a {
  color: #0066d6;
}

:root[data-theme="light"] .pvp-bounty-card span,
:root[data-theme="light"] .pvp-bounty-card p,
:root[data-theme="light"] .pvp-bounty-card small,
:root[data-theme="light"] .pvp-bounty-rules span,
:root[data-theme="light"] .pvp-form-note,
:root[data-theme="light"] .pvp-claim-row span,
:root[data-theme="light"] .pvp-claim-row em,
:root[data-theme="light"] .pvp-claim-ledger span,
:root[data-theme="light"] .pvp-claim-ledger small,
:root[data-theme="light"] .pvp-candidate-row span,
:root[data-theme="light"] .pvp-candidate-row small,
:root[data-theme="light"] .pvp-bounty-closed-note,
:root[data-theme="light"] .pvp-bounty-list .pvp-empty,
:root[data-theme="light"] .pvp-bounty-claims .pvp-empty,
:root[data-theme="light"] .pvp-bounty-candidates .pvp-empty {
  color: #334155;
}

:root[data-theme="light"] .pvp-bounty-tags span {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #334155;
}

:root[data-theme="light"] .pvp-bounty-progress {
  border-color: rgba(0, 102, 214, 0.24);
  background: rgba(0, 102, 214, 0.07);
}

:root[data-theme="light"] .pvp-bounty-progress span:last-child,
:root[data-theme="light"] .pvp-sync-note,
:root[data-theme="light"] .pvp-claim-result,
:root[data-theme="light"] .pvp-claim-ledger strong,
:root[data-theme="light"] .pvp-claim-row small,
:root[data-theme="light"] .pvp-claim-evidence span.ok,
:root[data-theme="light"] .pvp-claim-status.verified,
:root[data-theme="light"] .tiny-action {
  color: #0f766e;
}

:root[data-theme="light"] .pvp-sync-note,
:root[data-theme="light"] .pvp-claim-result,
:root[data-theme="light"] .pvp-claim-ledger > div,
:root[data-theme="light"] .pvp-claim-evidence span.ok {
  border-color: #99e6d8;
  background: #f0fdfa;
}

:root[data-theme="light"] .pvp-candidate-row strong,
:root[data-theme="light"] .pvp-claim-row-side a,
:root[data-theme="light"] .pvp-claim-row-side strong {
  color: #005fc4;
}

:root[data-theme="light"] .pvp-claim-status.paid {
  border-color: #86efac;
  background: #f0fdf4;
  color: #047857;
}

:root[data-theme="light"] .pvp-claim-status.pending,
:root[data-theme="light"] .pvp-claim-evidence span.warn,
:root[data-theme="light"] .tiny-action.review {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

:root[data-theme="light"] .pvp-bounty-actions .pvp-bounty-cancel {
  border-color: #fda4af;
  background: #fff1f2;
  color: #be123c;
}

:root[data-theme="light"] .recent-conflict-card.scale-epic,
:root[data-theme="light"] .recent-conflict-card.scale-major {
  border-color: rgba(217, 119, 6, 0.34);
}

:root[data-theme="light"] .recent-conflict-card.scale-medium {
  border-color: rgba(13, 148, 136, 0.28);
}

:root[data-theme="light"] .recent-conflict-card.scale-small {
  border-color: rgba(190, 18, 60, 0.24);
}

@media (max-width: 980px) {
  .pvp-hub,
  .war-room-page,
  .wiki-page {
    padding: 8px 16px 32px;
  }
  .pvp-hero,
  .pvp-section-head,
  .pvp-mini-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .pvp-hero {
    min-height: 56px;
    flex-direction: row;
    align-items: center;
    overflow: hidden;
  }
  .pvp-hero .v2-panel-kicker {
    display: none;
  }
  .pvp-hero > div:first-child {
    min-width: 0;
  }
  .pvp-hero-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .pvp-hero-actions::-webkit-scrollbar {
    display: none;
  }
  .pvp-hero-actions {
    min-width: 0;
    justify-content: flex-start;
  }
  .pvp-gateway-grid,
  .pvp-status-strip,
  .pvp-columns,
  .pvp-intel-grid-public,
  .war-room-grid,
  .pvp-conflict-grid,
  .pvp-search-kms,
  .pvp-bounty-layout,
  .pvp-bounty-order-layout,
  .pvp-bounty-rules,
  .pvp-claim-ledger,
  .wiki-layout {
    grid-template-columns: 1fr;
  }
  .wiki-categories {
    position: static;
    max-height: none;
  }
  .pvp-bounty-form-head {
    flex-direction: column;
  }
  .pvp-search-form {
    grid-template-columns: 1fr;
  }
  .pvp-form-grid {
    grid-template-columns: 1fr;
  }
  .pvp-claim-row {
    grid-template-columns: 1fr;
  }
  .pvp-claim-row-side {
    text-align: left;
  }
}

@media (max-width: 1100px) {
  .pvp-featured-grid { grid-template-columns: repeat(min(3, var(--pvp-featured-cols, 3)), minmax(0, 1fr)); }
  .pvp-ranking-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .pvp-kb-section-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .pvp-kb-section-head > span { text-align: left; }
  .pvp-featured-grid { grid-template-columns: repeat(min(2, var(--pvp-featured-cols, 2)), minmax(0, 1fr)); }
  .pvp-live-head { display: none; }
  .pvp-live-kill { grid-template-columns: 46px minmax(0,1fr) auto; }
  .pvp-live-party { grid-column: 2 / -1; grid-template-columns: 58px minmax(0,1fr); align-items: baseline; }
  .pvp-live-party small { grid-column: 2; }
  .pvp-live-kill > b { grid-column: 3; grid-row: 1; }
  .pvp-bounty-card-main,
  .pvp-bounty-progress {
    flex-direction: column;
  }
  .pvp-bounty-progress span:last-child {
    white-space: normal;
  }
  .pvp-bounty-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .pvp-bounty-actions .hud-btn-outline,
  .pvp-bounty-actions .pvp-bounty-candidate-action {
    width: 100%;
    min-height: 44px;
    margin-left: 0;
  }
  .pvp-candidate-row {
    grid-template-columns: 1fr;
  }
  .pvp-candidate-row small {
    grid-column: 1;
  }
}
/* Infinity abyss module market cards — MutaMarket-style information density, Infinity data only */
.abyss-module-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  align-items:start;
  padding:8px 0;
}
.abyss-lab-page #abyss-contracts.intel-grid-2 { grid-template-columns:minmax(0,1fr); }
.abyss-lab-page #abyss-contracts > article:last-child .intel-news {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:10px;
}
.abyss-module-card {
  appearance:none;
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:100%;
  padding:0;
  overflow:hidden;
  border:1px solid rgba(148,163,184,.24);
  border-radius:0;
  background:#15171c;
  color:#edf4ff;
  text-align:left;
  box-shadow:0 10px 24px rgba(0,0,0,.18);
}
button.abyss-module-card { cursor:pointer; transition:border-color .16s ease,transform .16s ease,box-shadow .16s ease; }
button.abyss-module-card:hover,
button.abyss-module-card:focus-visible { border-color:rgba(0,209,117,.72); transform:translateY(-2px); box-shadow:0 16px 32px rgba(0,0,0,.28); outline:none; }
.abyss-module-card-head {
  display:grid;
  grid-template-columns:36px minmax(0,1fr) auto;
  gap:9px;
  align-items:center;
  min-height:58px;
  padding:8px 10px 7px;
}
.abyss-module-icon { width:34px; height:34px; display:grid; place-items:center; color:#f0c15a; font:800 12px var(--font-mono); }
.abyss-module-icon img { width:32px; height:32px; object-fit:contain; }
.abyss-module-card-head > span:nth-child(2) { min-width:0; display:grid; gap:2px; }
.abyss-module-card-head b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#f4f7ff; font:700 13px/1.25 var(--font-mono); }
.abyss-module-card-head small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#7f8ca3; font:500 10px/1.2 var(--font-mono); }
.abyss-module-card-head em { align-self:start; color:#16e68a; font:800 11px/1 var(--font-mono); font-style:normal; }
.abyss-module-card-head em.is-directional { color:#f0b429; }
.abyss-module-card-line { height:2px; width:100%; background:#00d175; }
.abyss-module-attributes { display:flex; flex-direction:column; padding:0 9px; }
.abyss-card-attribute {
  display:grid;
  grid-template-columns:30px minmax(0,1fr) 30px;
  gap:7px;
  align-items:center;
  min-height:57px;
  border-bottom:1px solid rgba(255,255,255,.055);
}
.abyss-card-attribute-icon { color:#c7a968; font:500 22px/1 serif; text-align:center; }
.abyss-card-attribute-copy { display:grid; min-width:0; gap:2px; }
.abyss-card-attribute-copy small { color:#7f8ca3; font:500 10px/1.15 var(--font-mono); }
.abyss-card-attribute-copy b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#eaf0fb; font:600 11px/1.2 var(--font-mono); }
.abyss-card-attribute-copy b em { color:#f0b429; font-style:normal; }
.abyss-card-attribute.is-good .abyss-card-attribute-copy b em,
.abyss-card-attribute.is-good > strong { color:#00e889; }
.abyss-card-attribute.is-bad .abyss-card-attribute-copy b em,
.abyss-card-attribute.is-bad > strong { color:#ff4e5f; }
.abyss-card-attribute.is-neutral .abyss-card-attribute-copy b em,
.abyss-card-attribute.is-neutral > strong { color:#f0b429; }
.abyss-card-attribute-copy i { position:relative; display:block; height:3px; margin-top:2px; overflow:hidden; background:rgba(255,255,255,.07); font-style:normal; }
.abyss-card-attribute-copy i > span { display:block; width:var(--abyss-attr-score); height:100%; background:#f0b429; }
.abyss-card-attribute.is-good .abyss-card-attribute-copy i > span { background:#00d175; }
.abyss-card-attribute.is-bad .abyss-card-attribute-copy i > span { background:#ff4358; }
.abyss-card-attribute > strong { font:800 12px/1 var(--font-mono); text-align:right; }
.abyss-module-pending { padding:26px 8px; color:#7f8ca3; font:500 11px var(--font-mono); text-align:center; }
.abyss-module-card-foot {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:end;
  margin-top:auto;
  padding:9px 10px;
  border-top:1px solid rgba(255,255,255,.08);
  background:#101217;
}
.abyss-module-card-foot small { min-width:0; overflow:hidden; color:#758198; font:500 9px/1.4 var(--font-mono); }
.abyss-module-card-foot b { color:#f2f5fb; font:700 12px/1.2 var(--font-mono); white-space:nowrap; }
.abyss-market-filters {
  display:grid;
  grid-template-columns:minmax(170px,1.5fr) repeat(3,minmax(130px,1fr));
  gap:10px;
  align-items:end;
  padding:14px;
  margin:12px 0;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface-soft);
}
.abyss-market-filters label { display:grid; gap:5px; min-width:0; }
.abyss-market-filters label > span { color:var(--muted); font-size:11px; }
.abyss-market-filters input[type="search"],
.abyss-market-filters select {
  width:100%;
  min-height:38px;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--surface);
  color:var(--text);
}
.abyss-market-filters .abyss-filter-check { display:flex; align-items:center; gap:7px; }
.abyss-market-filters .abyss-filter-check input { width:16px; height:16px; }
.abyss-market-filters > small { color:var(--muted); align-self:center; }
@media (max-width: 1100px) {
  .abyss-market-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .abyss-module-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .abyss-market-filters { grid-template-columns:1fr; }
  .abyss-module-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .abyss-module-grid { grid-template-columns:1fr; }
}
.admin-analytics-shell { gap: 18px; }
.admin-analytics-privacy,
.analytics-generated { color: var(--text-muted); font-size: .86rem; }
.analytics-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.analytics-metrics article { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.analytics-metrics span,
.analytics-metrics small { display: block; color: var(--text-muted); }
.analytics-metrics strong { display: block; margin: 7px 0 4px; color: var(--accent); font: 700 1.55rem var(--font-display); }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.analytics-conversation-panel { grid-column: 1 / -1; }
.analytics-conversation-panel details { max-width: 760px; }
.analytics-conversation-panel details p { white-space: pre-wrap; overflow-wrap: anywhere; }
.analytics-table-wrap { overflow-x: auto; }
.analytics-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.analytics-table th,
.analytics-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.analytics-table th { color: var(--text-muted); font-weight: 600; }
.analytics-table code { color: var(--accent); }
@media (max-width: 980px) {
  .analytics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .analytics-metrics { grid-template-columns: 1fr; }
}

/* 2026-07 mobile density pass: one-row global header and viewport-bound tools. */
.nav-menu-toggle { display: none; }

@media (max-width: 768px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .nav-bar,
  .page-fitting .nav-bar {
    position: sticky;
    top: max(6px, env(safe-area-inset-top));
    z-index: 100;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    width: calc(100vw - 16px);
    max-width: none;
    height: 52px;
    min-height: 52px;
    margin: 6px 8px 0;
    padding: 5px 7px;
    gap: 5px;
    border-radius: 14px;
  }
  .nav-brand { flex: 0 0 auto; padding: 0; gap: 0; }
  .nav-brand-logo { width: 36px; height: 36px; border-radius: 7px; }
  .nav-brand-text { display: none; }
  .nav-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 48px;
    min-height: 36px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text-primary);
    background: var(--panel-bg);
    font-size: 12px;
    font-weight: 700;
  }
  .nav-bar .nav-links,
  .page-fitting .nav-bar .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    padding: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #0d1424;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .28);
    backdrop-filter: blur(18px);
  }
  .nav-bar.menu-open .nav-links,
  .page-fitting .nav-bar.menu-open .nav-links { display: grid; }
  .nav-link,
  .page-fitting .nav-link {
    display: flex;
    justify-content: flex-start;
    min-width: 0;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 8px;
    white-space: normal;
    line-height: 1.2;
  }
  .nav-actions { flex: 1 1 auto; justify-content: flex-end; gap: 4px; min-width: 0; }
  .nav-actions .theme-toggle,
  .nav-actions .hud-btn-outline,
  .nav-actions .hud-btn-primary {
    min-width: 0;
    min-height: 36px;
    padding: 0 8px;
    border-radius: 9px;
    font-size: 11px;
    white-space: nowrap;
  }
  .app-shell,
  .page-fitting .app-shell { padding-top: 10px; }
  .assistant-launcher {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    min-width: 70px;
    height: 44px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 22px;
    font-size: 14px;
  }

  .pvp-hub { padding-left: 8px; padding-right: 8px; }
  .pvp-page-hud.has-actions { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px; }
  .pvp-page-hud .compact-page-actions { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .pvp-page-hud .compact-page-actions a { flex: 0 0 auto; }
  .pvp-page-hud .pvp-search-form,
  .pvp-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; min-width: 0; }
  .pvp-page-hud .pvp-search-form input,
  .pvp-search-form input { width: 100%; min-width: 0; }

  .battle-lab-hero { gap: 10px; padding: 12px; }
  .battle-lab-hero h1 { font-size: 24px; line-height: 1.12; }
  .battle-hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; padding-top: 10px; }
  .battle-hero-actions > :first-child { grid-column: 1 / -1; width: 100%; }
  .battle-hero-actions a,
  .battle-hero-actions button { justify-content: center; min-width: 0; text-align: center; }
  .battle-danmaku-console { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px; }
  .battle-danmaku-console form,
  .battle-danmaku-console > p { grid-column: 1; }

  .starmap-v2-page {
    height: calc(100dvh - 70px);
    min-height: 420px;
    max-height: calc(100dvh - 70px);
    overflow: hidden;
    contain: size layout paint;
  }
  .starmap-v2-hud { flex-wrap: nowrap; min-height: 56px; padding: 7px 8px; overflow: hidden; }
  .starmap-v2-hud-left { width: 100%; min-width: 0; flex-wrap: nowrap; gap: 7px; }
  .starmap-v2-title { flex: 0 0 auto; font-size: 14px; white-space: nowrap; }
  .starmap-v2-layers { order: initial; width: auto; min-width: 0; flex: 1 1 auto; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .starmap-v2-layers::-webkit-scrollbar { display: none; }
  .starmap-v2-layers button { flex: 0 0 auto; min-height: 34px; padding: 5px 9px; }
  .starmap-v2-hud-right { display: none; }
  body.page-starmap .app-shell { height: calc(100dvh - 64px); overflow: hidden; }
  body.page-starmap .site-footer { display: none; }

  .page-fitting .fitting-shell { height: calc(100dvh - 72px); max-height: calc(100dvh - 72px); }
  :root[data-theme="light"] .nav-bar .nav-links { background: #fff; }
}

@media (max-width: 390px) {
  .nav-actions .hud-btn-outline { display: none; }
  .nav-actions .theme-toggle,
  .nav-actions .hud-btn-primary { padding-inline: 7px; }
}

/* 2026-07 verified light-theme contrast pass. These target real mixed-surface
 * failures found in the live UI; the dark canvas/workspaces remain deliberate. */
:root[data-theme="light"] .pvp-featured-kill {
  color: #111827;
  border-color: rgba(180, 17, 66, 0.22);
  background: linear-gradient(135deg, rgba(255, 232, 239, 0.96), rgba(255, 255, 255, 0.92));
}

:root[data-theme="light"] .pvp-featured-kill span { color: #a60f3b; }
:root[data-theme="light"] .pvp-featured-kill > b,
:root[data-theme="light"] .pvp-live-kill > b,
:root[data-theme="light"] .pvp-ranking-list b { color: #8a5a00; }

:root[data-theme="light"] .pvp-live-kill,
:root[data-theme="light"] .pvp-ranking-list > a {
  border: 1px solid rgba(15, 23, 42, 0.11);
  background: rgba(248, 251, 255, 0.94);
}

:root[data-theme="light"] .pvp-live-kill:hover,
:root[data-theme="light"] .pvp-ranking-list > a:hover {
  border-color: rgba(0, 102, 204, 0.30);
  background: rgba(0, 102, 204, 0.07);
}

:root[data-theme="light"] .pvp-ranking-tabs button.active {
  border-color: rgba(0, 102, 204, 0.34);
  background: rgba(0, 102, 204, 0.10);
  color: #0056a8;
}

:root[data-theme="light"] .recent-conflict-losses .red { color: #b71936; }
:root[data-theme="light"] .recent-conflict-losses .blue { color: #005fb8; }
:root[data-theme="light"] .battle-list-bars i { box-shadow: none; }

:root[data-theme="light"] [data-asset-estimate-form] textarea,
:root[data-theme="light"] [data-refining-form] textarea {
  color: #111827 !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

:root[data-theme="light"] [data-asset-estimate-form] textarea:focus,
:root[data-theme="light"] [data-refining-form] textarea:focus {
  border-color: rgba(0, 102, 204, 0.58) !important;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.10);
  outline: none;
}

:root[data-theme="light"] .starmap-real-search-float input,
:root[data-theme="light"] .starmap-real-search-float input:focus,
:root[data-theme="light"] .starmap-real-search-results,
:root[data-theme="light"] .starmap-real-map-detail {
  color: #111827;
  border-color: rgba(0, 88, 190, 0.22);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.16);
}

:root[data-theme="light"] .starmap-real-search-results .starmap-lab-results button,
:root[data-theme="light"] .starmap-real-map-detail dl > div,
:root[data-theme="light"] .starmap-real-map-detail-actions button {
  color: #111827;
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(247, 250, 255, 0.92);
}

/* Ten primary destinations plus the message action do not fit between the
 * brand and account actions below a wide desktop. Switch only the navigation
 * to its menu form there; keep
 * page-specific mobile layouts at the existing 768px breakpoint. */
@media (min-width: 769px) and (max-width: 1519.98px) {
  .nav-brand-text { display: none; }
  .nav-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 54px;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text-primary);
    background: var(--hud-panel-bg);
    font-size: 12px;
    font-weight: 700;
  }
  .nav-bar .nav-links,
  .page-fitting .nav-bar .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    padding: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(13, 20, 36, 0.97);
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(18px);
  }
  .nav-bar.menu-open .nav-links,
  .page-fitting .nav-bar.menu-open .nav-links { display: grid; }
  .nav-link,
  .page-fitting .nav-link {
    display: flex;
    justify-content: flex-start;
    min-width: 0;
    min-height: 40px;
    padding: 9px 11px;
    white-space: normal;
  }
  .nav-actions { margin-left: auto; }
  :root[data-theme="light"] .nav-bar .nav-links { background: rgba(255, 255, 255, 0.98); }
}

/* Official partnership mark: retain the supplied artwork pixel-for-pixel and
 * crop only its source canvas whitespace in CSS. */
.nav-bar {
  justify-content: flex-start;
  gap: 10px;
}

.nav-bar .nav-actions { margin-left: auto; }

.nav-official-partner {
  display: grid;
  grid-template-rows: 27px 8px;
  flex: 0 0 122px;
  width: 122px;
  height: 44px;
  padding: 3px 4px;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(89, 205, 255, .34);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(22, 77, 120, .72), rgba(5, 18, 38, .88));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .035) inset, 0 8px 22px rgba(0, 122, 255, .16);
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.nav-official-partner:hover,
.nav-official-partner:focus-visible {
  border-color: rgba(102, 216, 255, .72);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06) inset, 0 10px 28px rgba(0, 122, 255, .28);
  transform: translateY(-1px);
  outline: none;
}

.partner-mark-crop {
  position: relative;
  display: block;
  overflow: hidden;
  background: #fff;
}

.partner-mark-crop img {
  position: absolute;
  top: 50%;
  left: -11.35%;
  display: block;
  width: 116%;
  max-width: none;
  height: auto;
  transform: translateY(-50%);
}

.nav-partner-mark {
  width: 100%;
  height: auto;
  aspect-ratio: 1551 / 362;
  border-radius: 5px;
}

.nav-partner-status {
  align-self: center;
  color: #92ddff;
  font: 800 8px/1 var(--font-mono);
  letter-spacing: .11em;
  text-align: center;
  white-space: nowrap;
}

:root[data-theme="light"] .nav-official-partner {
  border-color: rgba(0, 103, 174, .28);
  background: linear-gradient(135deg, rgba(232, 247, 255, .98), rgba(255, 255, 255, .94));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .9) inset, 0 8px 20px rgba(15, 73, 118, .12);
}

:root[data-theme="light"] .nav-official-partner:hover,
:root[data-theme="light"] .nav-official-partner:focus-visible {
  border-color: rgba(0, 105, 180, .52);
  box-shadow: 0 10px 24px rgba(15, 73, 118, .18);
}

:root[data-theme="light"] .nav-partner-status { color: #005d9e; }

.about-official-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(86, 209, 255, .36);
  border-radius: 999px;
  background: rgba(0, 122, 255, .12);
  color: #86dcff;
  font: 800 10px/1 var(--font-mono);
  letter-spacing: .08em;
}

.info-partner-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(83, 207, 255, .34);
  background:
    radial-gradient(circle at 82% 28%, rgba(70, 190, 255, .18), transparent 32%),
    linear-gradient(135deg, rgba(0, 92, 170, .19), rgba(15, 20, 40, .70));
  box-shadow: inset 0 1px rgba(255, 255, 255, .05), 0 20px 54px rgba(0, 73, 132, .14);
}

#official-partner { scroll-margin-top: 92px; }

.info-partner-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 480px);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
}

.info-partner-copy {
  display: grid;
  gap: 12px;
}

.info-card .info-partner-kicker {
  color: #70d2ff;
  font-size: 11px;
  letter-spacing: .16em;
}

.info-partner-copy h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.18;
}

.info-partner-copy p { max-width: 820px; line-height: 1.78; }
.info-partner-copy .info-partner-note { color: var(--text-tertiary); font-size: 12px; }

.info-partner-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.info-partner-tags strong,
.info-card .info-partner-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(93, 205, 255, .22);
  border-radius: 999px;
  background: rgba(0, 122, 255, .08);
  color: var(--text-secondary);
  font: 700 11px/1 var(--font-mono);
}

.info-partner-tags strong {
  border-color: rgba(90, 209, 255, .42);
  color: #9be4ff;
  background: rgba(0, 122, 255, .16);
}

.info-partner-mark {
  width: 100%;
  height: auto;
  aspect-ratio: 1551 / 362;
  border: 1px solid rgba(255, 255, 255, .20);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .24), 0 0 34px rgba(58, 188, 255, .12);
}

:root[data-theme="light"] .about-official-chip {
  border-color: rgba(0, 103, 174, .28);
  background: rgba(0, 122, 255, .08);
  color: #005d9e;
}

:root[data-theme="light"] .info-partner-card {
  border-color: rgba(0, 103, 174, .22);
  background:
    radial-gradient(circle at 82% 28%, rgba(55, 174, 232, .13), transparent 34%),
    linear-gradient(135deg, rgba(231, 247, 255, .96), rgba(255, 255, 255, .88));
  box-shadow: 0 20px 48px rgba(15, 73, 118, .10);
}

:root[data-theme="light"] .info-card .info-partner-kicker,
:root[data-theme="light"] .info-partner-tags strong { color: #0066a8; }

:root[data-theme="light"] .info-partner-tags strong,
:root[data-theme="light"] .info-card .info-partner-tags span {
  border-color: rgba(0, 103, 174, .18);
  background: rgba(0, 122, 255, .06);
  color: #334155;
}

:root[data-theme="light"] .info-partner-tags strong {
  border-color: rgba(0, 103, 174, .34);
  color: #005d9e;
  background: rgba(0, 122, 255, .10);
}

@media (min-width: 769px) and (max-width: 1519.98px) {
  .nav-bar { gap: 8px; }
  .page-fitting .nav-bar {
    position: sticky;
    top: 12px;
    display: flex;
    width: min(1100px, calc(100vw - 32px));
    height: 56px;
    min-height: 56px;
    padding: 0 18px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .page-fitting .nav-bar .nav-brand { flex: 0 0 auto; min-width: 0; }
  .page-fitting .nav-bar .nav-actions { margin-left: auto; }
}

@media (max-width: 768px) {
  .nav-bar,
  .page-fitting .nav-bar {
    justify-content: flex-start;
    gap: 5px;
  }
  .nav-bar .nav-actions,
  .page-fitting .nav-bar .nav-actions {
    flex: 0 0 auto;
    margin-left: auto;
  }
  .nav-official-partner {
    grid-template-rows: 18px 8px;
    flex-basis: 82px;
    width: 82px;
    height: 36px;
    padding: 3px;
    border-radius: 8px;
  }
  .nav-bar .nav-brand,
  .page-fitting .nav-bar .nav-brand {
    flex: 0 0 36px;
    width: 36px;
    min-width: 0;
    gap: 0;
  }
  .nav-partner-mark { border-radius: 4px; }
  .nav-partner-status { font-size: 7px; letter-spacing: .035em; }
  .info-partner-content { grid-template-columns: 1fr; gap: 22px; }
  .info-partner-mark { width: 100%; }
}

@media (max-width: 350px) {
  .nav-official-partner { flex-basis: 70px; width: 70px; }
  .nav-partner-status { letter-spacing: 0; }
}

/* Fitting screenshot review: model output is always a review candidate, never an import action. */
.fitting-screenshot-picker {
  display: grid;
  gap: 7px;
  margin: 10px 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.fitting-screenshot-picker input {
  width: 100%;
  color: var(--muted);
  font: inherit;
}

.fitting-screenshot-preview {
  display: block;
  width: 100%;
  max-height: 190px;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(3, 9, 20, .5);
  object-fit: contain;
}

.fitting-screenshot-preview[hidden],
.fitting-screenshot-review[hidden] { display: none; }

.fitting-screenshot-status {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.fitting-screenshot-status[data-state="error"] { color: #ff6f86; }
.fitting-screenshot-status[data-state="ready"] { color: #3edcc9; }

.fitting-screenshot-review {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.fitting-screenshot-review-head,
.fitting-screenshot-review-row,
.fitting-screenshot-unrecognized {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 17, 34, .42);
  color: var(--text);
}

.fitting-screenshot-review-row[data-match="unresolved"],
.fitting-screenshot-review-row[data-match="ambiguous"],
.fitting-screenshot-unrecognized {
  border-color: rgba(255, 184, 77, .48);
}

.fitting-screenshot-review-row b,
.fitting-screenshot-review-head b { font-size: 13px; }

.fitting-screenshot-review-row small,
.fitting-screenshot-review-head small,
.fitting-screenshot-unrecognized small {
  color: var(--muted);
  line-height: 1.45;
}

.fitting-screenshot-review select {
  width: 100%;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--hud-input-bg);
  color: var(--text);
}

.fitting-screenshot-ack {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

:root[data-theme="light"] .fitting-screenshot-preview,
:root[data-theme="light"] .fitting-screenshot-review-head,
:root[data-theme="light"] .fitting-screenshot-review-row,
:root[data-theme="light"] .fitting-screenshot-unrecognized {
  background: rgba(239, 246, 255, .9);
}

/* Strict manufacturing quote: explicit inputs only; GET reference remains visually separate. */
.industry-quote-shell {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(43, 167, 255, .38);
  border-radius: 14px;
  background: rgba(4, 15, 33, .58);
}

.industry-quote-shell > summary {
  cursor: pointer;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.industry-quote-intro,
.industry-quote-group > p,
.industry-quote-evidence {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.industry-quote-intro-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.industry-quote-intro-row .industry-quote-intro { margin-bottom: 0; }

.industry-quote-intro-row > a {
  flex: 0 0 auto;
  margin-top: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.industry-quote-intro-row > a:hover { text-decoration: underline; }

.industry-quote-template-bar {
  display: grid;
  grid-template-columns: minmax(190px, .75fr) minmax(420px, 1.8fr);
  gap: 10px 16px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(43, 167, 255, .28);
  border-radius: 12px;
  background: rgba(43, 167, 255, .07);
}

.industry-quote-template-copy {
  display: grid;
  gap: 4px;
}

.industry-quote-template-copy strong { color: var(--text); }
.industry-quote-template-copy small { color: var(--muted); line-height: 1.45; }

.industry-quote-template-controls {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(180px, 1.25fr) auto auto auto;
  gap: 7px;
  min-width: 0;
}

.industry-quote-template-controls input,
.industry-quote-template-controls select,
.industry-quote-template-controls button {
  min-width: 0;
  min-height: 36px;
}

.industry-quote-template-controls button {
  padding: 7px 10px;
  border: 1px solid rgba(43, 167, 255, .38);
  border-radius: 9px;
  background: rgba(43, 167, 255, .09);
  color: var(--soft);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.industry-quote-template-controls button:hover {
  border-color: rgba(43, 167, 255, .72);
  color: var(--accent);
}

.industry-quote-template-controls [data-industry-template-delete] {
  border-color: rgba(208, 100, 112, .28);
  color: var(--muted);
}

.industry-quote-template-controls input,
.industry-quote-template-controls select {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--hud-input-bg);
  color: var(--text);
  font: inherit;
}

.industry-quote-template-status {
  grid-column: 1 / -1;
  min-height: 17px;
  color: var(--accent);
  font-size: 11px;
}

.industry-quote-template-status.is-error { color: var(--danger); }

.industry-quote-help {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(43, 167, 255, .34);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
}

.industry-quote-help > summary {
  cursor: pointer;
  color: var(--soft);
  font-weight: 750;
}

.industry-quote-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.industry-quote-help-grid p {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 9px;
  border-radius: 9px;
  background: rgba(43, 167, 255, .06);
}

.industry-quote-help-grid strong { color: var(--text); }
.industry-quote-help > p { margin: 10px 0 0; line-height: 1.6; }

.industry-quote-group {
  min-width: 0;
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.industry-quote-group legend {
  padding: 0 7px;
  color: var(--soft);
  font-weight: 700;
}

.industry-quote-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.industry-quote-field {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--text);
  font-size: 12px;
}

.industry-quote-label {
  position: relative;
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  border-radius: 5px;
  outline: none;
  cursor: help;
}

.industry-quote-label:focus-visible {
  box-shadow: 0 0 0 2px rgba(43, 167, 255, .38);
}

.industry-quote-help-mark {
  display: inline-grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  border: 1px solid rgba(43, 167, 255, .55);
  border-radius: 50%;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.industry-quote-tooltip {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  left: 0;
  display: none;
  width: min(320px, calc(100vw - 56px));
  box-sizing: border-box;
  padding: 10px 11px;
  border: 1px solid rgba(43, 167, 255, .55);
  border-radius: 10px;
  background: rgba(5, 14, 30, .98);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .34);
  color: var(--soft);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.55;
}

.industry-quote-tooltip strong {
  display: block;
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: .04em;
}

.industry-quote-tooltip strong:not(:first-child) { margin-top: 7px; }

.industry-quote-label:hover .industry-quote-tooltip,
.industry-quote-label:focus .industry-quote-tooltip,
.industry-quote-label:focus-within .industry-quote-tooltip { display: block; }

.industry-quote-field input,
.industry-quote-field select,
.industry-quote-field textarea {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--hud-input-bg);
  color: var(--text);
  font: inherit;
}

.industry-quote-field textarea {
  min-height: 100px;
  resize: vertical;
}

.industry-quote-field small { color: var(--muted); }
.industry-quote-shell [hidden] { display: none !important; }

.industry-quote-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.industry-quote-result {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(7, 17, 34, .52);
}

.industry-quote-result.is-incomplete { border-color: rgba(255, 184, 77, .52); }
.industry-quote-result.is-complete { border-color: rgba(62, 220, 201, .52); }
.industry-quote-result > header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.industry-quote-result > header span { color: var(--accent); font-size: 11px; }
.industry-quote-result h4 { margin: 3px 0 8px; }
.industry-quote-result > header > b { color: var(--muted); font-size: 10px; }
.industry-quote-breakdown { margin-top: 12px; }

:root[data-theme="light"] .industry-quote-shell,
:root[data-theme="light"] .industry-quote-result {
  background: rgba(239, 246, 255, .9);
}

:root[data-theme="light"] .industry-quote-tooltip {
  background: rgba(248, 252, 255, .99);
  box-shadow: 0 14px 34px rgba(33, 70, 110, .18);
}

@media (max-width: 900px) {
  .industry-quote-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .industry-quote-template-bar { grid-template-columns: 1fr; }
  .industry-quote-template-controls { grid-template-columns: minmax(130px, 1fr) minmax(170px, 1.2fr) repeat(3, auto); }
}

@media (max-width: 560px) {
  .industry-quote-grid { grid-template-columns: 1fr; }
  .industry-quote-shell { padding: 10px; }
  .industry-quote-result > header { display: grid; }
  .industry-quote-actions { align-items: stretch; flex-direction: column; }
  .industry-quote-intro-row { display: grid; gap: 0; }
  .industry-quote-intro-row > a { margin-top: 0; }
  .industry-quote-template-controls { grid-template-columns: 1fr 1fr; }
  .industry-quote-template-controls input,
  .industry-quote-template-controls select { grid-column: 1 / -1; }
  .industry-quote-template-controls [data-industry-template-delete] { grid-column: 1 / -1; }
  .industry-quote-help-grid { grid-template-columns: 1fr; }
}


/* ===== Contracts workbench (tools > contracts panel only) ===== */
.panel.contracts-panel {
  overflow: visible;
}
.contracts-panel-head {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.contracts-panel-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.contracts-panel-title h3 {
  margin: 0;
}
.contracts-mode-tabs {
  margin-left: auto;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 10, 16, 0.55);
  flex-shrink: 0;
}
.contracts-mode-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.contracts-mode-tab.is-active {
  background: rgba(102, 216, 255, 0.16);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(102, 216, 255, 0.32);
}
.contracts-workbench {
  display: grid !important;
  grid-template-columns: 300px minmax(0, 1fr) !important;
  gap: 14px;
  align-items: start;
  margin-top: 10px;
  width: 100%;
}
.contracts-filter-panel,
.contracts-results-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 10, 16, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  min-width: 0;
}
.contracts-filter-panel {
  padding: 14px;
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contracts-filter-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.contracts-filter-title strong {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}
.contracts-filter-title span {
  font-size: 11px;
  color: var(--muted);
}
.contracts-filter-form {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  gap: 10px;
  margin: 0 !important;
  width: 100%;
}
/* inline style=display:none loses to the flex !important above; class wins. */
.contracts-filter-form.is-hidden,
.contracts-results-panel > .is-hidden {
  display: none !important;
}
.contracts-suggest-wrap {
  position: relative;
  width: 100%;
}
.contracts-suggest {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(110, 170, 255, 0.28);
  background: rgba(8, 14, 26, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
}
.contracts-suggest[hidden] {
  display: none !important;
}
.contracts-suggest button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.contracts-suggest button:hover,
.contracts-suggest button:focus-visible {
  background: rgba(54, 110, 255, 0.16);
  outline: none;
}
.contracts-suggest button b {
  font-weight: 600;
  font-size: 13px;
}
.contracts-suggest button small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.contracts-filter-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}
:root[data-theme="light"] .contracts-suggest {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(40, 80, 160, 0.18);
  box-shadow: 0 10px 24px rgba(20, 40, 80, 0.12);
}
.contracts-filter-form .contracts-field,
.contracts-filter-form label {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px;
  margin: 0;
  width: 100%;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}
.contracts-filter-form .contracts-field > span,
.contracts-filter-form label > span {
  display: block;
  line-height: 1.2;
  color: rgba(210, 220, 235, 0.72);
}
.contracts-filter-form input,
.contracts-filter-form select {
  display: block;
  box-sizing: border-box;
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  min-height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(8, 10, 16, 0.82) !important;
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
  appearance: none;
}
.contracts-filter-form input:focus,
.contracts-filter-form select:focus {
  outline: none;
  border-color: rgba(102, 216, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(102, 216, 255, 0.12);
}
.contracts-filter-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  width: 100%;
}
.contracts-filter-actions {
  display: grid !important;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}
.contracts-search-btn {
  width: 100%;
  justify-content: center;
}
.contracts-filter-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
.contracts-results-panel {
  min-height: 420px;
  padding: 14px;
  display: flex;
  flex-direction: column;
}
.contracts-empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  min-height: 280px;
  padding: 24px;
  border: 1px dashed rgba(102, 216, 255, 0.18);
  border-radius: 12px;
  background: rgba(8, 12, 20, 0.35);
}
.contracts-empty-state strong {
  font-size: 14px;
  color: var(--text);
}
.contracts-empty-state span {
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 42ch;
}
.contracts-results-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.contracts-results-head p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.contracts-results-head b {
  color: var(--text);
}
.contracts-coverage {
  color: var(--accent) !important;
}
.contracts-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(70vh, 760px);
  overflow: auto;
  padding-right: 2px;
}
.contracts-result-card {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(120, 140, 170, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(16, 22, 34, 0.92), rgba(10, 14, 22, 0.88));
  color: inherit;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.contracts-result-card:hover {
  border-color: rgba(102, 216, 255, 0.46);
  background: linear-gradient(180deg, rgba(20, 30, 46, 0.96), rgba(12, 18, 28, 0.94));
  transform: translateY(-1px);
}
.contracts-result-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.contracts-result-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  min-width: 0;
}
.contracts-result-title strong {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
}
.contracts-result-title span {
  font-size: 11px;
  color: var(--muted);
}
.contracts-result-price {
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.contracts-result-meta {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
.contracts-result-items {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(190, 210, 230, 0.88);
}
.contracts-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.contracts-badge.is-live {
  color: #8ef0c3;
  background: rgba(56, 180, 120, 0.14);
  border-color: rgba(56, 180, 120, 0.35);
}
.contracts-badge.is-gone {
  color: var(--muted);
  background: rgba(140, 150, 170, 0.12);
  border-color: rgba(140, 150, 170, 0.28);
}
@media (max-width: 1100px) {
  .contracts-workbench {
    grid-template-columns: 270px minmax(0, 1fr) !important;
  }
}
@media (max-width: 900px) {
  .contracts-workbench {
    grid-template-columns: 1fr !important;
  }
  .contracts-filter-panel {
    position: static;
  }
  .contracts-filter-actions {
    grid-template-columns: 1fr 1fr;
  }
}
:root[data-theme="light"] .contracts-filter-panel,
:root[data-theme="light"] .contracts-results-panel {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}
:root[data-theme="light"] .contracts-result-card {
  background: #fff;
}
:root[data-theme="light"] .contracts-result-card:hover {
  background: #f7fafc;
}
:root[data-theme="light"] .contracts-mode-tabs {
  background: rgba(255, 255, 255, 0.85);
}
:root[data-theme="light"] .contracts-filter-form input,
:root[data-theme="light"] .contracts-filter-form select {
  background: #fff !important;
}
:root[data-theme="light"] .contracts-filter-form .contracts-field > span,
:root[data-theme="light"] .contracts-filter-form label > span {
  color: rgba(40, 50, 70, 0.72);
}
:root[data-theme="light"] .contracts-empty-state {
  background: rgba(248, 250, 252, 0.9);
  border-color: rgba(80, 120, 160, 0.2);
}
:root[data-theme="light"] .contracts-result-items {
  color: rgba(40, 55, 75, 0.82);
}

@media (max-width: 900px) {
  .tools-page-hud,
  .wiki-page-hud,
  .wiki-contribute-head,
  .wiki-chronicle-intro {
    align-items: stretch;
    flex-direction: column;
  }
  .tools-compact-tabs { width: 100%; padding-bottom: 7px; }
  .tools-compact-tab { min-width: 92px; min-height: 44px; padding: 6px 11px; }
  .wiki-community-intro { grid-template-columns: 1fr; }
  .wiki-promo-body { grid-template-columns: 1fr; }
  .wiki-community-intro > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .wiki-community-intro > div:last-child { border-bottom: 0; }
  .wiki-author-status { align-self: flex-start; }
  .wiki-rollback-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .wiki-mode-tabs { display: grid; grid-template-columns: 1fr; width: 100%; }
  .wiki-mode-tab { width: 100%; padding: 0 12px; }
  .wiki-form-row { grid-template-columns: 1fr; }
  .wiki-promo-disclosure > summary { grid-template-columns: auto minmax(0, 1fr); }
  .wiki-promo-action { grid-column: 2; }
  .wiki-promo-body { padding: 14px; }
  .wiki-form-actions { align-items: stretch; flex-direction: column; }
  .wiki-review-head,
  .wiki-review-row header { align-items: stretch; flex-direction: column; }
  .wiki-rollback-form { grid-template-columns: 1fr; }
  .public-changelog-head { flex-direction: column; }
  .public-changelog-actions { justify-content: flex-start; }
  .public-changelog-overview { grid-template-columns: 1fr; }
  .public-changelog-entry summary { grid-template-columns: 1fr auto; gap: 7px 12px; }
  .public-changelog-entry summary time { grid-column: 1 / -1; }
  .public-changelog-detail { padding: 0 14px 14px; }
}

.ask-privacy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
}
.ask-privacy-row > label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-tertiary);
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}
.ask-privacy-row input { accent-color: var(--accent, #168cff); }
.ask-privacy-row .ask-disclaimer {
  width: 100%;
  margin: 0;
  text-align: left;
}
.assistant-retention-badge {
  margin-left: auto;
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--text-tertiary);
  background: rgba(255,255,255,0.035);
  font-size: 9px;
  white-space: nowrap;
}
.assistant-retention-badge.is-private {
  color: #70dc90;
  background: rgba(52,199,89,0.08);
}
.auth-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
.privacy-self-service {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.privacy-self-service button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--surface-elevated, rgba(10, 24, 42, .78));
  color: var(--text-primary);
  cursor: pointer;
}
.privacy-self-service button.danger {
  border-color: rgba(244, 63, 94, .48);
  color: #fb7185;
}
.privacy-self-service p {
  flex-basis: 100%;
  margin: 2px 0 0;
  min-height: 1.5em;
}
.privacy-self-service p[data-level="ok"] { color: #34d399; }
.privacy-self-service p[data-level="error"] { color: #fb7185; }

/* ===== 2026-07-20 command workspace + compact industry UI ===== */
.workspace-command-shell {
  display: grid;
  gap: 12px;
}

.workspace-command-deck {
  overflow: hidden;
  border: 1px solid rgba(48, 145, 255, .28);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(16, 92, 176, .10) 1px, transparent 1px),
    linear-gradient(rgba(16, 92, 176, .08) 1px, transparent 1px),
    radial-gradient(circle at 12% 0%, rgba(0, 136, 255, .18), transparent 34%),
    linear-gradient(135deg, rgba(5, 17, 35, .96), rgba(11, 12, 31, .95));
  background-size: 52px 52px, 52px 52px, auto, auto;
  box-shadow: 0 22px 54px rgba(0, 0, 0, .24);
}

.workspace-command-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid rgba(48, 145, 255, .18);
}

.workspace-command-identity .workspace-identity-avatar .member-avatar,
.workspace-command-identity .workspace-identity-avatar .member-avatar-stack {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  font-size: 34px;
}

.workspace-command-identity .workspace-identity-copy h1 {
  margin: 3px 0 7px;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1;
  letter-spacing: -.035em;
}

.workspace-command-identity .workspace-identity-copy p {
  margin: 8px 0 0;
  color: var(--text-tertiary);
  font-size: 11px;
}

.workspace-command-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #36a6ff;
  font: 800 10px/1.2 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.workspace-command-kicker i {
  padding-left: 8px;
  border-left: 1px solid rgba(104, 177, 255, .28);
  color: var(--text-tertiary);
  font-style: normal;
}

.member-badge.alliance { color: #c7a8ff; border-color: rgba(155, 113, 255, .30); }

.workspace-command-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.workspace-command-actions > a,
.workspace-command-actions > button,
.workspace-command-actions > details > summary {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(60, 151, 255, .22);
  border-radius: 7px;
  color: var(--text-secondary);
  background: rgba(4, 16, 34, .68);
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
}

.workspace-command-actions > details { position: relative; }
.workspace-command-actions > details > summary { list-style: none; }
.workspace-command-actions > details > summary::-webkit-details-marker { display: none; }
.workspace-command-actions > details > div {
  position: absolute;
  z-index: 15;
  top: calc(100% + 6px);
  right: 0;
  min-width: 132px;
  display: grid;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-bg, #081222);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .28);
}
.workspace-command-actions > details a { padding: 7px 9px; color: var(--text-secondary); text-decoration: none; font-size: 11px; }
.workspace-command-actions > details a:hover { color: var(--text-primary); background: rgba(30, 138, 255, .12); }
.workspace-section-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.esi-bind-mode { display: inline-flex; gap: 5px; margin: 16px 0 8px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: rgba(4, 13, 27, .55); }
.esi-bind-mode button { min-height: 34px; padding: 0 13px; border: 0; border-radius: 7px; color: var(--text-secondary); background: transparent; cursor: pointer; }
.esi-bind-mode button.active { color: #fff; background: #167de7; box-shadow: 0 6px 18px rgba(20, 122, 228, .24); }
.esi-bind-mode-note { margin: 0 0 14px; color: var(--text-tertiary); font-size: 12px; line-height: 1.65; }

.workspace-command-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  min-height: 104px;
}

.workspace-command-stat {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px 16px;
  border-right: 1px solid rgba(48, 145, 255, .14);
}
.workspace-skill-stat {
  width: 100%;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.workspace-skill-stat:hover,
.workspace-skill-stat:focus-visible { background: rgba(39, 151, 255, .09); outline: none; }
.workspace-skill-stat small::after { content: " · 点击查看队列"; color: #58baff; }
.workspace-command-stat:last-child { border-right: 0; }
.workspace-command-stat span { color: var(--text-tertiary); font: 800 9px/1.2 var(--font-mono); letter-spacing: .12em; }
.workspace-command-stat strong { overflow: hidden; color: var(--text-primary); font-size: clamp(15px, 1.4vw, 21px); line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.workspace-command-stat small { overflow: hidden; color: var(--text-tertiary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-command-stat.is-online strong { color: #51e5a0; }
.workspace-command-stat.is-loading strong { opacity: .42; animation: workspace-stat-pulse 1.1s ease-in-out infinite alternate; }
.workspace-command-stat.is-empty,
.workspace-command-stat.is-locked,
.workspace-command-stat.is-error { grid-column: 1 / -1; border-right: 0; text-align: center; }
.workspace-command-stat.is-error strong { color: #ff788a; }
.workspace-command-stat.is-training strong { color: #63d8ff; }
@keyframes workspace-stat-pulse { to { opacity: .88; } }

.workspace-skill-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid rgba(54, 160, 255, .34);
  border-radius: 16px;
  color: var(--text-primary);
  background: var(--panel-bg, #071426);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .64);
}
.workspace-skill-dialog::backdrop { background: rgba(0, 5, 14, .76); backdrop-filter: blur(5px); }
.workspace-skill-dialog-card { display: grid; min-height: 220px; }
.workspace-skill-dialog-card > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.workspace-skill-dialog-card h2 { margin: 4px 0 0; font-size: 22px; }
.workspace-skill-dialog-card > header button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--text-secondary); background: transparent; font-size: 21px; cursor: pointer; }
.workspace-skill-dialog-body { min-height: 160px; padding: 14px; overflow: auto; }
.workspace-skill-queue { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.workspace-skill-queue li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(4, 13, 27, .58); }
.workspace-skill-queue li.is-active { border-color: rgba(48, 169, 255, .48); background: rgba(31, 135, 229, .11); }
.workspace-skill-order { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid rgba(62, 163, 255, .28); border-radius: 50%; color: #61c3ff; font: 800 11px var(--font-mono); }
.workspace-skill-queue li > div { min-width: 0; display: grid; gap: 4px; }
.workspace-skill-queue li > div:last-child { justify-items: end; text-align: right; }
.workspace-skill-queue strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-skill-queue small,
.workspace-skill-queue time { color: var(--text-tertiary); font-size: 10px; }
.workspace-skill-queue b { color: #67dbff; font-size: 12px; }
.workspace-skill-empty { min-height: 150px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--text-tertiary); text-align: center; }
.workspace-skill-empty strong { color: var(--text-primary); font-size: 17px; }

.workspace-briefing-strip {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(7, 17, 33, .72);
}
.workspace-briefing-strip > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 15px;
  list-style: none;
  cursor: pointer;
}
.workspace-briefing-strip > summary::-webkit-details-marker { display: none; }
.workspace-briefing-strip > summary span { display: flex; align-items: baseline; gap: 10px; }
.workspace-briefing-strip > summary b { font-size: 13px; }
.workspace-briefing-strip > summary small,
.workspace-briefing-strip > summary em { color: var(--text-tertiary); font-size: 10px; font-style: normal; }
.workspace-briefing-strip[open] > summary { border-bottom: 1px solid var(--line); }
.workspace-briefing-strip > div { display: grid; gap: 8px; padding: 12px 15px; }
.workspace-briefing-strip .announcement-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.workspace-briefing-strip .announcement-item:last-child { border-bottom: 0; }

.workspace-module-deck {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 15, 29, .64);
}
.workspace-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}
.workspace-module-head h2 { margin: 2px 0 0; font-size: 20px; }
.workspace-module-head .ws-tabs { margin: 0; }
.workspace-module-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.workspace-module-grid .module-tile { min-height: 108px; padding: 14px; border-radius: 10px; }
.workspace-module-grid .module-tile span { line-height: 1.45; }
.workspace-account-drawer {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(5, 13, 26, .48);
}
.workspace-account-drawer > summary { display: flex; gap: 8px; padding: 13px 14px; list-style: none; cursor: pointer; }
.workspace-account-drawer > summary::-webkit-details-marker { display: none; }
.workspace-account-drawer > summary span { color: var(--text-tertiary); font-size: 11px; font-weight: 400; }
.workspace-account-drawer .workspace-profile-form { padding: 0 14px; }
.workspace-account-drawer .workspace-section { margin: 8px 14px 14px; }
.workspace-corp-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 11px 13px;
  border: 1px solid rgba(132, 104, 255, .20);
  border-radius: 9px;
  background: linear-gradient(90deg, rgba(92, 64, 195, .12), transparent);
}
.workspace-corp-summary span { color: var(--text-tertiary); font-size: 10px; }
.workspace-corp-summary strong { font-size: 15px; }
.workspace-corp-summary small { color: var(--text-tertiary); font-size: 10px; text-align: right; }

/* Manufacturing tabs follow the site's slim HUD pill language. */
.tools-page-hud { gap: 12px; min-height: 58px; padding-top: 9px; padding-bottom: 9px; }
.tools-page-hud .compact-page-headline h1 { font-size: clamp(22px, 2.5vw, 32px); }
.tools-compact-tabs { gap: 5px; padding: 2px; }
.tools-compact-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font: 800 11px/1 var(--font-sans);
  white-space: nowrap;
}
.tools-compact-tab.active { box-shadow: 0 5px 15px rgba(0, 122, 255, .22); }
.blueprint-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.blueprint-search-form input { min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text-primary); background: rgba(5, 13, 27, .72); }
.blueprint-search-form button { min-width: 88px; }
.blueprint-results { margin-top: 12px; }
.blueprint-result-layout { display: grid; grid-template-columns: minmax(190px, 250px) minmax(0, 1fr); gap: 12px; align-items: start; }
.blueprint-result-list { max-height: 520px; display: grid; gap: 5px; overflow-y: auto; }
.blueprint-result-option {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-primary);
  background: rgba(7, 16, 31, .62);
  text-align: left;
  cursor: pointer;
}
.blueprint-result-option span { color: var(--text-tertiary); font-size: 10px; }
.blueprint-result-option:hover,
.blueprint-result-option.is-active { border-color: rgba(39, 151, 255, .56); background: rgba(16, 105, 207, .13); }
.blueprint-result-detail { min-width: 0; }
.blueprint-cost-shell { overflow: hidden; border: 1px solid rgba(44, 145, 255, .22); border-radius: 12px; background: rgba(5, 13, 27, .68); }
.blueprint-cost-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 15px 12px; border-bottom: 1px solid var(--line); }
.blueprint-cost-head h3 { margin: 3px 0 0; font-size: 20px; }
.blueprint-cost-badge { padding: 5px 8px; border: 1px solid rgba(58, 160, 255, .28); border-radius: 999px; color: #78c7ff; font-size: 9px; white-space: nowrap; }
.blueprint-cost-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.blueprint-cost-summary article { min-width: 0; display: grid; gap: 4px; padding: 12px 14px; border-right: 1px solid var(--line); }
.blueprint-cost-summary article:last-child { border-right: 0; }
.blueprint-cost-summary span { color: var(--text-tertiary); font: 800 9px/1.2 var(--font-mono); letter-spacing: .08em; }
.blueprint-cost-summary strong { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.blueprint-cost-summary small { overflow: hidden; color: var(--text-tertiary); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.blueprint-cost-summary .is-accent strong { color: #42b5ff; }
.blueprint-materials { padding: 13px 15px 8px; }
.blueprint-materials > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.blueprint-materials > header > div { display: flex; align-items: center; gap: 7px; }
.blueprint-materials > header span { font-size: 13px; font-weight: 800; }
.blueprint-materials > header small,
.blueprint-materials > header p { margin: 0; color: var(--text-tertiary); font-size: 9px; }
.blueprint-export-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.blueprint-export-actions p {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 9px;
}
.blueprint-export-btn {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
}
.blueprint-export-btn.is-copied {
  color: #7ee3b6;
  border-color: rgba(65, 211, 146, .35);
}
.blueprint-export-hint {
  margin: 0 0 8px;
  color: var(--text-tertiary);
  font-size: 10px;
  line-height: 1.5;
}
.blueprint-materials > header {
  align-items: flex-start;
}

.blueprint-material-table { max-height: 390px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.blueprint-material-row { display: grid; grid-template-columns: minmax(150px, 1.45fr) .55fr .85fr .9fr; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 11px; }
.blueprint-material-row:last-child { border-bottom: 0; }
.blueprint-material-row.is-head { position: sticky; z-index: 2; top: 0; min-height: 30px; color: var(--text-tertiary); background: var(--panel-bg, #091425); font-size: 9px; font-weight: 800; }
.blueprint-material-row > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blueprint-material-row > strong small { margin-left: 5px; color: #ffc25e; font-size: 8px; }
.blueprint-material-row > b { color: #49b9ff; text-align: right; }
.blueprint-material-row > span:nth-child(n+2) { text-align: right; }
.blueprint-material-row > span > small { display: block; margin-top: 2px; color: var(--text-tertiary); font-size: 8px; line-height: 1.25; }
.blueprint-cost-state { margin: 4px 15px 10px; padding: 9px 10px; border: 1px solid rgba(65, 211, 146, .22); border-radius: 7px; color: #7ee3b6; background: rgba(38, 177, 115, .07); font-size: 10px; line-height: 1.55; }
.blueprint-cost-state.is-incomplete { border-color: rgba(255, 177, 63, .25); color: #ffc56b; background: rgba(255, 160, 28, .07); }
.blueprint-cost-evidence,
.blueprint-cost-shell > .industry-quote-shell { margin: 0 15px 10px; border-top: 1px solid var(--line); color: var(--text-tertiary); font-size: 10px; }
.blueprint-cost-evidence summary,
.blueprint-cost-shell > .industry-quote-shell > summary { padding: 10px 0; color: var(--text-secondary); cursor: pointer; }
.blueprint-cost-evidence p { line-height: 1.65; }
.blueprint-raw-materials { max-height: 280px; overflow-y: auto; }

:root[data-theme="light"] .workspace-command-deck { background: radial-gradient(circle at 12% 0%, rgba(0, 125, 255, .12), transparent 34%), linear-gradient(135deg, #f8fbff, #fff); }
:root[data-theme="light"] .workspace-briefing-strip,
:root[data-theme="light"] .workspace-module-deck,
:root[data-theme="light"] .workspace-account-drawer,
:root[data-theme="light"] .workspace-skill-dialog,
:root[data-theme="light"] .blueprint-result-option,
:root[data-theme="light"] .blueprint-cost-shell,
:root[data-theme="light"] .blueprint-search-form input { background: rgba(255, 255, 255, .88); }
:root[data-theme="light"] .workspace-skill-queue li { background: #f7faff; }
:root[data-theme="light"] .workspace-skill-queue li.is-active { background: #e9f5ff; }
:root[data-theme="light"] .workspace-skill-stat:hover,
:root[data-theme="light"] .workspace-skill-stat:focus-visible { background: rgba(20, 118, 215, .08); }
:root[data-theme="light"] .workspace-command-actions > a,
:root[data-theme="light"] .workspace-command-actions > button,
:root[data-theme="light"] .workspace-command-actions > details > summary,
:root[data-theme="light"] .workspace-command-actions > details > div,
:root[data-theme="light"] .workspace-skill-dialog,
:root[data-theme="light"] .workspace-skill-queue li { color: #17324f; background: rgba(255, 255, 255, .96); box-shadow: 0 8px 24px rgba(45, 87, 130, .08); }
:root[data-theme="light"] .workspace-skill-queue li.is-active { background: #eef8ff; }
:root[data-theme="light"] .esi-bind-mode { background: rgba(241, 247, 253, .9); }

@media (max-width: 1100px) {
  .workspace-command-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workspace-command-stat:nth-child(3) { border-right: 0; }
  .workspace-command-stat:nth-child(-n+3) { border-bottom: 1px solid rgba(48, 145, 255, .14); }
  .workspace-module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tools-page-hud { align-items: flex-start; flex-direction: column; }
  .tools-compact-tabs { width: 100%; }
}

@media (max-width: 760px) {
  .workspace-command-identity { grid-template-columns: auto minmax(0, 1fr); padding: 15px; }
  .workspace-command-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .workspace-command-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-command-stat:nth-child(3) { border-right: 1px solid rgba(48, 145, 255, .14); }
  .workspace-command-stat:nth-child(even) { border-right: 0; }
  .workspace-command-stat:nth-child(-n+4) { border-bottom: 1px solid rgba(48, 145, 255, .14); }
  .workspace-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-profile-form { grid-template-columns: 1fr; }
  .workspace-module-head { align-items: flex-end; }
  .workspace-corp-summary { grid-template-columns: 1fr; }
  .workspace-corp-summary small { text-align: left; }
  .blueprint-result-layout { grid-template-columns: 1fr; }
  .blueprint-result-list { max-height: 156px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blueprint-cost-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blueprint-cost-summary article:nth-child(2) { border-right: 0; }
  .blueprint-cost-summary article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .blueprint-materials > header { align-items: flex-start; flex-direction: column; }
  .blueprint-material-row { grid-template-columns: minmax(130px, 1.2fr) .45fr .8fr; }
  .blueprint-material-row > :nth-child(3) { display: none; }
}

@media (max-width: 500px) {
  .workspace-command-identity .workspace-identity-avatar .member-avatar,
  .workspace-command-identity .workspace-identity-avatar .member-avatar-stack { width: 58px; height: 58px; border-radius: 14px; }
  .workspace-command-identity .workspace-identity-copy h1 { font-size: 23px; }
  .workspace-command-stats { grid-template-columns: 1fr; }
  .workspace-command-stat { border-right: 0 !important; border-bottom: 1px solid rgba(48, 145, 255, .14); }
  .workspace-command-stat:last-child { border-bottom: 0; }
  .workspace-module-grid { grid-template-columns: 1fr; }
  .workspace-module-head { align-items: stretch; flex-direction: column; }
  .workspace-module-head .ws-tabs { align-self: flex-start; }
  .workspace-briefing-strip > summary small { display: none; }
  .workspace-account-drawer > summary { align-items: flex-start; flex-direction: column; }
  .blueprint-search-form { grid-template-columns: 1fr; }
  .blueprint-result-list { grid-template-columns: 1fr; }
  .blueprint-material-row { grid-template-columns: minmax(110px, 1.2fr) .45fr .9fr; }
}

/* Player public profiles, follows and private on-site messaging */
.player-social-shell {
  width: min(1380px, calc(100% - 40px));
  margin: 20px auto 48px;
  display: grid;
  gap: 16px;
}
.player-social-hud { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.player-social-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.player-directory-panel { padding: 18px; }
.player-directory-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.player-directory-search label,
.player-profile-editor label,
.player-start-message label,
.player-message-compose label { display: grid; gap: 7px; color: var(--text-secondary); font-size: 12px; }
.player-directory-search input,
.player-profile-editor textarea,
.player-profile-editor select,
.player-start-message textarea,
.player-message-compose textarea,
.player-badge-admin input,
.player-badge-admin select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 11px 12px;
  font: inherit;
}
.player-directory-search input:focus,
.player-profile-editor textarea:focus,
.player-profile-editor select:focus,
.player-start-message textarea:focus,
.player-message-compose textarea:focus { outline: 2px solid var(--hud-brand-a20); border-color: var(--hud-accent); }
.player-social-note,
.player-social-safety p,
.player-badge-admin p,
.player-profile-editor > p { margin: 10px 0 0; color: var(--text-tertiary); font-size: 12px; line-height: 1.7; }
.player-directory-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.player-directory-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.player-directory-card:hover { transform: translateY(-2px); border-color: var(--hud-accent); }
.player-directory-card > div:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.player-directory-card strong { color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-directory-card span { color: var(--hud-success); font-size: 11px; }
.player-directory-card small { color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-directory-card .player-badge-row { grid-column: 1 / -1; }
.player-avatar { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px; object-fit: cover; border: 1px solid var(--hud-brand-a20); background: var(--bg-elevated); }
.player-avatar-large { width: 92px; height: 92px; border-radius: 24px; }
.player-avatar-small { width: 38px; height: 38px; border-radius: 11px; }
.player-avatar-preset { display: inline-grid; place-items: center; color: var(--hud-accent); font-size: 22px; font-weight: 900; }
.player-avatar-large.player-avatar-preset { font-size: 38px; }
.player-badge-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.player-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-secondary); font-size: 11px; }
.player-badge.is-combat { color: #ff9c7d; border-color: rgba(255, 95, 64, .35); background: rgba(255, 95, 64, .08); }
.player-badge.is-developer { color: #74d7ff; border-color: rgba(65, 177, 255, .35); background: rgba(65, 177, 255, .08); }
.player-badge.is-administrator { color: #ffd36e; border-color: rgba(255, 196, 64, .4); background: rgba(255, 196, 64, .1); }
.player-profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.player-profile-card { padding: 22px; min-height: 360px; }
.player-profile-side { display: grid; gap: 12px; }
.player-social-safety,
.player-badge-admin { padding: 17px; }
.player-profile-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.player-profile-heading { min-width: 0; display: grid; gap: 7px; }
.player-profile-heading h2 { margin: 0; color: var(--text-primary); font-size: clamp(24px, 4vw, 38px); overflow-wrap: anywhere; }
.player-profile-kicker { color: var(--hud-success); font: 700 11px/1.2 var(--font-mono); letter-spacing: .08em; }
.player-profile-counts { display: flex; gap: 18px; }
.player-profile-counts span { display: grid; gap: 2px; color: var(--text-tertiary); font-size: 11px; text-align: center; }
.player-profile-counts b { color: var(--text-primary); font-size: 18px; }
.player-profile-body { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 22px 0; }
.player-profile-body section { min-width: 0; }
.player-profile-body section > span { color: var(--text-tertiary); font: 700 11px/1.2 var(--font-mono); letter-spacing: .08em; }
.player-profile-body p { color: var(--text-secondary); line-height: 1.8; overflow-wrap: anywhere; }
.player-character-card { display: grid; gap: 5px; margin-top: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--hud-brand-a05); }
.player-character-card strong { color: var(--text-primary); }
.player-character-card span { color: var(--text-secondary); }
.player-character-card small,
.player-character-empty { color: var(--text-tertiary); }
.player-profile-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.player-profile-actions .is-danger { color: var(--hud-error); }
.player-start-message { display: grid; gap: 10px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.player-inline-check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 8px !important; }
.player-profile-private,
.player-social-empty,
.player-message-placeholder { text-align: center; color: var(--text-tertiary); padding: 32px; }
.player-profile-private h2,
.player-message-placeholder strong { color: var(--text-primary); }
.player-profile-private .player-avatar { margin: 0 auto; }
.player-badge-admin form { display: grid; gap: 9px; margin-top: 12px; }
.player-badge-admin form > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.player-badge-admin button { border: 1px solid var(--line); border-radius: 9px; background: var(--bg-elevated); color: var(--text-primary); padding: 9px; cursor: pointer; }
.player-social-status { min-height: 18px; margin: 0; color: var(--hud-success); font-size: 12px; }
.player-profile-form-status { min-height: 18px; margin: 2px 0 0; color: var(--hud-success); font-size: 12px; line-height: 1.5; }
.player-profile-form-status.is-error { color: var(--hud-error); }
.player-profile-editor button[type="submit"]:disabled { opacity: 0.7; cursor: wait; }
.player-social-status.is-error { color: var(--hud-error); }
.member-auth-card .auth-card .auth-privacy-note { margin: 0; color: var(--text-tertiary); font-size: 11px; line-height: 1.7; }
.player-messages-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 14px; min-height: 650px; }
.player-message-sidebar { display: grid; gap: 12px; align-content: start; }
.player-profile-editor,
.player-conversation-list-panel { padding: 16px; }
.player-profile-editor form { display: grid; gap: 10px; margin-top: 12px; }
.player-panel-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.player-panel-title a { color: var(--hud-accent); font-size: 11px; }
.player-conversation-list { display: grid; gap: 6px; margin-top: 12px; max-height: 430px; overflow: auto; }
.player-conversation-row { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.player-conversation-row:hover,
.player-conversation-row.is-active { border-color: var(--hud-brand-a20); background: var(--hud-brand-a05); }
.player-conversation-row > span { min-width: 0; display: grid; gap: 3px; }
.player-conversation-row strong,
.player-conversation-row small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-conversation-row strong { color: var(--text-primary); }
.player-conversation-row small { color: var(--text-tertiary); }
.player-conversation-row > b { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 999px; background: var(--hud-error); color: white; font-size: 10px; }
.player-message-thread { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 650px; overflow: hidden; }
.player-thread-head { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.player-thread-head a { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.player-thread-head a > span { display: grid; gap: 2px; }
.player-thread-head strong { color: var(--text-primary); }
.player-thread-head small { color: var(--hud-success); }
.player-message-log { min-height: 0; padding: 18px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.player-message { max-width: min(76%, 650px); display: grid; gap: 4px; }
.player-message p { margin: 0; padding: 10px 13px; border: 1px solid var(--line); border-radius: 13px; color: var(--text-primary); line-height: 1.6; overflow-wrap: anywhere; }
.player-message span { color: var(--text-tertiary); font-size: 10px; }
.player-message.is-mine { align-self: flex-end; justify-items: end; }
.player-message.is-mine p { background: var(--hud-brand-a12); border-color: var(--hud-brand-a20); }
.player-message.is-theirs { align-self: flex-start; }
.player-message.is-system p { border-color: color-mix(in srgb, var(--hud-accent) 45%, var(--line)); background: color-mix(in srgb, var(--hud-accent) 10%, transparent); }
.player-message.is-theirs p { background: var(--bg-elevated); }
.player-message-compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; padding: 14px 18px; border-top: 1px solid var(--line); }
.player-message-compose textarea { grid-row: 1 / span 2; resize: vertical; }

@media (max-width: 1000px) {
  .player-directory-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-profile-layout,
  .player-messages-layout { grid-template-columns: 1fr; }
  .player-message-sidebar { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .player-social-shell { width: min(100% - 20px, 1380px); margin-top: 10px; }
  .player-social-hud { align-items: flex-start; flex-direction: column; }
  .player-directory-search,
  .player-directory-results,
  .player-message-sidebar { grid-template-columns: 1fr; }
  .player-profile-main { grid-template-columns: auto minmax(0, 1fr); }
  .player-profile-counts { grid-column: 1 / -1; justify-content: flex-start; }
  .player-profile-body { grid-template-columns: 1fr; }
  .player-message-thread { min-height: 580px; }
  .player-message { max-width: 90%; }
  .player-message-compose { grid-template-columns: 1fr; }
  .player-message-compose textarea { grid-row: auto; }
}

/* 玩家交易所浅色主题：避免深色卡片与浅色文字令牌交叉后降低可读性。 */
:root[data-theme="light"] .exchange-safety-note {
  background: linear-gradient(120deg, rgba(226, 241, 255, .94), rgba(248, 251, 255, .96));
}
:root[data-theme="light"] .exchange-post-card,
:root[data-theme="light"] .exchange-contact-dialog,
:root[data-theme="light"] .exchange-type-suggest {
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 14px 36px rgba(23, 55, 92, .10);
}
:root[data-theme="light"] .exchange-filter-bar input,
:root[data-theme="light"] .exchange-filter-bar select,
:root[data-theme="light"] .exchange-form-grid input,
:root[data-theme="light"] .exchange-form-grid select,
:root[data-theme="light"] .exchange-form-wide textarea,
:root[data-theme="light"] .exchange-item-edit-row input,
:root[data-theme="light"] .exchange-contact-card textarea,
:root[data-theme="light"] .exchange-item-edit-row,
:root[data-theme="light"] .exchange-post-item {
  background: rgba(248, 251, 255, .96);
  color: var(--text-primary);
}
:root[data-theme="light"] .exchange-type-suggest button,
:root[data-theme="light"] .exchange-dialog-close,
:root[data-theme="light"] .exchange-post-item-main strong {
  color: var(--text-primary);
}

.exchange-reference-updated {
  display: block;
  margin-top: 6px;
  color: var(--text-tertiary);
  font-size: 9px;
}

/* 玩家交易所 2.0：借鉴游戏市场的信息架构，不复用游戏界面资产。 */
.exchange-market-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(67, 153, 219, .28);
  border-radius: 8px;
  background: rgba(4, 10, 20, .82);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .24);
}
.exchange-market-browser {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid rgba(75, 153, 211, .24);
  background: linear-gradient(180deg, rgba(12, 26, 41, .96), rgba(6, 15, 27, .96));
}
.exchange-market-browser > header {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 16px 18px 13px;
  border-bottom: 1px solid rgba(94, 173, 229, .18);
}
.exchange-browser-close { display: none; }
.exchange-market-browser > header span,
.exchange-group-view > header span,
.exchange-market-evidence > header span {
  color: #5ca9d8;
  font: 600 9px var(--font-mono);
  letter-spacing: .16em;
}
.exchange-market-browser > header strong { font-size: 18px; }
.exchange-market-search {
  display: grid;
  grid-template-columns: 1fr 40px;
  margin: 12px;
  border: 1px solid rgba(84, 166, 224, .3);
  background: rgba(1, 8, 16, .62);
}
.exchange-market-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 10px 12px;
  background: transparent;
  color: var(--text-primary);
}
.exchange-market-search button {
  border: 0;
  border-left: 1px solid rgba(84, 166, 224, .22);
  background: rgba(54, 139, 199, .09);
  color: #80c8f3;
  font-size: 21px;
}
.exchange-market-quick,
.exchange-tree-options button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  border: 0;
  border-left: 2px solid transparent;
  padding: 9px 16px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
}
.exchange-market-quick:hover,
.exchange-market-quick.active,
.exchange-tree-options button:hover,
.exchange-tree-options button.active {
  border-left-color: #49a7e2;
  background: linear-gradient(90deg, rgba(50, 143, 201, .18), transparent);
  color: #d8effd;
}
.exchange-tree-options i { width: 7px; height: 7px; border-radius: 50%; background: #70889a; }
.exchange-tree-options i.is-sell { background: #e69b62; box-shadow: 0 0 8px rgba(230, 155, 98, .45); }
.exchange-tree-options i.is-buy { background: #54c8a3; box-shadow: 0 0 8px rgba(84, 200, 163, .4); }
.exchange-market-tree { border-top: 1px solid rgba(95, 166, 215, .13); }
.exchange-market-tree summary {
  cursor: pointer;
  padding: 11px 14px;
  color: #8ba9bd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  list-style-position: inside;
}
.exchange-market-catalog { min-height: 0; flex: 1; overflow: auto; }
.exchange-market-items { display: grid; gap: 2px; padding: 0 7px 10px; }
.exchange-market-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid transparent;
  padding: 7px 8px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
}
.exchange-market-item:hover,
.exchange-market-item.active {
  border-color: rgba(86, 176, 231, .24);
  background: rgba(54, 143, 199, .13);
}
.exchange-market-item.active { box-shadow: inset 2px 0 #55b9ec; }
.exchange-market-item-symbol,
.exchange-item-title-mark {
  display: grid;
  place-items: center;
  border: 1px solid rgba(94, 189, 237, .42);
  background: radial-gradient(circle at 30% 25%, rgba(91, 198, 245, .25), rgba(12, 38, 55, .72));
  color: #9cddfb;
  font-family: var(--font-display);
}
.exchange-market-item-symbol { width: 28px; height: 28px; font-size: 12px; }
.exchange-market-item > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.exchange-market-item strong { overflow: hidden; color: #c9dce8; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.exchange-market-item small { color: #6f899b; font-size: 9px; }
.exchange-market-item > b { color: #78a4c0; font: 600 10px var(--font-mono); }
.exchange-market-catalog-empty { padding: 16px; color: var(--text-tertiary); font-size: 11px; text-align: center; }
.exchange-market-browser > footer {
  display: grid;
  gap: 3px;
  margin-top: auto;
  padding: 10px 14px;
  border-top: 1px solid rgba(94, 173, 229, .16);
  color: #819aaa;
  font-size: 10px;
}
.exchange-market-browser > footer small { color: #536b7a; }
.exchange-topic-index {
  display: grid;
  gap: 7px;
  min-height: 0;
  padding: 12px 8px;
  border-top: 1px solid rgba(95, 166, 215, .13);
}
.exchange-topic-index > header { display: grid; gap: 2px; padding: 0 7px 3px; }
.exchange-topic-index > header span { color: #5ca9d8; font: 600 8px var(--font-mono); letter-spacing: .14em; }
.exchange-topic-index > header strong { color: #b7d4e5; font-size: 12px; }
.exchange-topic-index > div { display: grid; gap: 4px; }
.exchange-topic-index > div > p { margin: 4px 8px; color: #61798a; font-size: 10px; line-height: 1.5; }
.exchange-topic-index-item {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid transparent;
  padding: 8px;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
}
.exchange-topic-index-item:hover,
.exchange-topic-index-item.active { border-color: rgba(86, 176, 231, .24); background: rgba(54, 143, 199, .13); }
.exchange-topic-index-item.active { box-shadow: inset 2px 0 #55b9ec; }
.exchange-topic-index-item > i { width: 7px; height: 7px; border-radius: 50%; background: #e69b62; box-shadow: 0 0 8px rgba(230, 155, 98, .4); }
.exchange-topic-index-item.is-buy > i { background: #54c8a3; box-shadow: 0 0 8px rgba(84, 200, 163, .38); }
.exchange-topic-index-item > span { display: grid; min-width: 0; gap: 2px; }
.exchange-topic-index-item strong { overflow: hidden; color: #c9dce8; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.exchange-topic-index-item small { overflow: hidden; color: #6f899b; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.exchange-topic-index-item time { color: #648096; font: 600 8px var(--font-mono); white-space: nowrap; }
.exchange-market-workspace { display: grid; min-width: 0; grid-template-rows: auto minmax(0, 1fr) auto; background: linear-gradient(155deg, rgba(10, 22, 35, .84), rgba(3, 10, 20, .9)); }
.exchange-market-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(80, 159, 215, .24);
  background: rgba(9, 20, 32, .78);
}
.exchange-view-tabs,
.exchange-mode-tabs { display: flex; align-items: center; gap: 3px; }
.exchange-view-tabs button,
.exchange-mode-tabs button,
.exchange-mode-tabs a {
  border: 1px solid transparent;
  padding: 7px 12px;
  background: transparent;
  color: #7893a6;
  font-size: 11px;
  text-decoration: none;
}
.exchange-view-tabs button.active,
.exchange-mode-tabs button.active,
.exchange-mode-tabs a:hover {
  border-color: rgba(76, 169, 224, .3);
  background: rgba(46, 137, 194, .14);
  color: #bce8ff;
}
.exchange-market-stage { min-width: 0; min-height: 0; scroll-margin-top: 90px; }
.exchange-post-feed,
.exchange-post-detail { padding: 18px; }
.exchange-post-feed { display: grid; gap: 14px; }
.exchange-post-feed[hidden],
.exchange-post-detail[hidden] { display: none; }
.exchange-post-feed .exchange-list-head { margin-top: 0; }
.exchange-post-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(75, 153, 211, .2);
  border-radius: 8px;
}
.exchange-topic-result {
  display: grid;
  grid-template-columns: 78px minmax(230px, 1.55fr) 105px 100px minmax(150px, 1fr) 84px 52px;
  align-items: center;
  gap: 11px;
  width: 100%;
  box-sizing: border-box;
  min-height: 72px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(75, 153, 211, .13);
  border-left: 3px solid #e69b62;
  background: rgba(8, 17, 30, .72);
  color: var(--text-secondary);
  text-align: left;
}
.exchange-topic-result:last-child { border-bottom: 0; }
.exchange-topic-result:hover,
.exchange-topic-result:focus-visible { outline: 0; background: rgba(45, 119, 166, .14); box-shadow: inset 0 0 0 1px rgba(91, 181, 231, .16); }
.exchange-topic-result.is-buy { border-left-color: #54c8a3; }
.exchange-topic-result.is-closed { opacity: .68; }
.exchange-topic-result-side { display: grid; justify-items: start; gap: 4px; }
.exchange-topic-result-side .exchange-side-badge,
.exchange-topic-result-side .exchange-status-badge { margin: 0; }
.exchange-topic-result-main,
.exchange-topic-result-meta { display: grid; min-width: 0; gap: 4px; }
.exchange-topic-result-main strong { overflow: hidden; color: #dceef8; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.exchange-topic-result-main small { overflow: hidden; color: #708b9d; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.exchange-topic-result-main small b { margin-right: 6px; color: #5ca9d8; font-weight: 700; }
.exchange-topic-result-meta small { color: #5f788a; font-size: 8px; }
.exchange-topic-result-meta strong { overflow: hidden; color: #9fb7c7; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.exchange-topic-result-meta.is-owner strong { color: #70d8ff; }
.exchange-topic-result time { color: #648096; font: 600 8px var(--font-mono); white-space: nowrap; }
.exchange-topic-result-open { color: #6bbce8; font-size: 9px; white-space: nowrap; }
.exchange-topic-drawer { z-index: 95; width: min(820px, calc(100vw - 32px)); }
.exchange-topic-drawer {
  bottom: max(18px, env(safe-area-inset-bottom));
  max-height: none;
  overflow: hidden;
}
.exchange-topic-drawer .tools-contract-drawer-body {
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.exchange-topic-drawer .exchange-post-card { min-height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.exchange-topic-drawer .exchange-post-card > footer {
  position: sticky;
  z-index: 3;
  bottom: 0;
  margin: 8px -18px -18px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(76, 164, 224, .22);
  background: rgba(8, 18, 35, .97);
  box-shadow: 0 -12px 28px rgba(2, 8, 18, .48);
}
.exchange-share-status {
  flex: 1 0 100%;
  min-height: 18px;
  color: var(--text-tertiary);
  font-size: 11px;
  text-align: right;
}
.page-exchange.exchange-drawer-open .assistant-launcher {
  right: auto;
  left: max(22px, env(safe-area-inset-left));
}
.exchange-post-detail .exchange-post-card { width: 100%; box-sizing: border-box; }
.exchange-view-tabs > strong { padding: 7px 4px; color: #bce8ff; font-size: 12px; }
.exchange-market-empty {
  display: grid;
  min-height: 340px;
  place-content: center;
  justify-items: center;
  padding: 30px;
  text-align: center;
  background: radial-gradient(circle at 50% 45%, rgba(53, 127, 175, .09), transparent 32%);
}
.exchange-market-empty[hidden] { display: none; }
.exchange-market-empty[data-exchange-post-empty][hidden]::before { content: none; }
.exchange-market-empty::before { content: "◇"; color: rgba(108, 189, 232, .26); font-size: 76px; line-height: 1; }
.exchange-market-empty span { color: #547084; font: 600 9px var(--font-mono); letter-spacing: .18em; }
.exchange-market-empty strong { margin-top: 9px; color: #a7c1d1; font-size: 22px; }
.exchange-market-empty p { max-width: 410px; color: #657e8e; font-size: 12px; line-height: 1.7; }
.exchange-market-detail { min-width: 0; }

@media (max-height: 720px) and (min-width: 761px) {
  .exchange-topic-drawer {
    top: 16px;
    bottom: 16px;
  }
}

@media (max-width: 760px) {
  .exchange-topic-drawer {
    bottom: max(8px, env(safe-area-inset-bottom));
    max-height: none;
  }
  .exchange-topic-drawer .exchange-post-card > footer {
    margin-right: -13px;
    margin-bottom: -13px;
    margin-left: -13px;
    padding-right: 13px;
    padding-left: 13px;
  }
  .page-exchange.exchange-drawer-open .assistant-launcher {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
.exchange-item-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 19px 22px;
  border-bottom: 1px solid rgba(78, 157, 210, .2);
  background: linear-gradient(90deg, rgba(43, 122, 170, .12), transparent 62%);
}
.exchange-item-title-mark { width: 54px; height: 54px; font-size: 23px; }
.exchange-item-header > div:last-child { display: grid; gap: 2px; }
.exchange-item-header span { color: #5f8ca7; font: 600 9px var(--font-mono); letter-spacing: .1em; }
.exchange-item-header h2 { margin: 0; color: #dfedf4; font-size: 23px; }
.exchange-item-header p { margin: 0; color: #718a9a; font-size: 11px; }
.exchange-order-sections { display: grid; grid-template-columns: minmax(0, 1fr) 280px; min-width: 0; }
.exchange-order-books { min-width: 0; border-right: 1px solid rgba(78, 157, 210, .17); }
.exchange-order-book + .exchange-order-book { border-top: 1px solid rgba(78, 157, 210, .2); }
.exchange-order-book > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(35, 91, 126, .09);
}
.exchange-order-book > header > div { display: flex; align-items: center; gap: 8px; }
.exchange-order-book > header i { width: 6px; height: 18px; background: #d98b52; }
.exchange-order-book.is-buy > header i { background: #50b993; }
.exchange-order-book > header strong { color: #b9d2e1; font-size: 12px; }
.exchange-order-book > header span,
.exchange-order-book > header small { color: #617d90; font-size: 9px; }
.exchange-order-table-wrap { min-width: 0; overflow-x: auto; }
.exchange-order-table { width: 100%; min-width: 810px; border-collapse: collapse; table-layout: fixed; }
.exchange-order-table th { padding: 7px 10px; border-bottom: 1px solid rgba(74, 147, 198, .14); color: #587588; font-size: 9px; font-weight: 600; text-align: left; }
.exchange-order-table th:nth-child(1) { width: 130px; }
.exchange-order-table th:nth-child(2) { width: 78px; }
.exchange-order-table th:nth-child(3) { width: 105px; }
.exchange-order-table th:nth-child(4) { width: 200px; }
.exchange-order-table th:nth-child(5) { width: 92px; }
.exchange-order-table th:nth-child(6) { width: 66px; }
.exchange-order-table th:nth-child(7) { width: 100px; }
.exchange-order-table td { overflow: hidden; padding: 9px 10px; border-bottom: 1px solid rgba(74, 147, 198, .09); color: #8ca4b3; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.exchange-order-table tbody tr:hover { background: rgba(49, 135, 187, .08); }
.exchange-order-table td > a { display: grid; color: #bcd4e2; text-decoration: none; }
.exchange-order-table td > a span { color: #4ea985; font-size: 8px; }
.exchange-order-table td > b { color: #e1bd7e; font: 600 10px var(--font-mono); }
.exchange-order-status { display: inline-flex; border: 1px solid rgba(81, 180, 146, .22); padding: 3px 6px; color: #62c8a5; }
.exchange-order-status.is-closed { border-color: rgba(137, 151, 161, .2); color: #788b98; }
.exchange-order-actions { display: flex; gap: 4px; }
.exchange-order-actions button { border: 1px solid rgba(74, 156, 209, .28); padding: 4px 6px; background: rgba(38, 113, 160, .1); color: #83c4ea; font-size: 9px; }
.exchange-order-actions button.is-contact { border-color: rgba(71, 188, 148, .3); color: #6fd0ad; }
.exchange-order-actions button.is-danger { border-color: rgba(208, 100, 112, .3); color: #e78b98; }
.exchange-order-actions button:disabled { opacity: .35; }
.exchange-order-muted,
.exchange-order-none { color: #566d7c; font-size: 9px; }
.exchange-order-none { padding: 22px !important; text-align: center; }
.exchange-price-risk { display: block; margin-top: 4px; max-width: 190px; overflow: hidden; color: #d7a75b; font-size: 8px; line-height: 1.35; text-overflow: ellipsis; white-space: normal; }
.exchange-price-risk.is-strong_warning { color: #ff768c; }
.exchange-price-risk.is-caution { color: #e6b05a; }
.exchange-price-risk.is-no_evidence { color: #7893a5; }
.exchange-compose-guidance { grid-column: 1 / -1; min-height: 18px; padding: 7px 9px; border-left: 2px solid rgba(75, 158, 210, .35); background: rgba(36, 106, 151, .07); color: #718c9e; font-size: 10px; line-height: 1.5; }
.exchange-compose-guidance[hidden] { display: none; }
.exchange-compose-guidance strong,.exchange-compose-guidance small { display: block; }
.exchange-compose-guidance small { margin-top: 3px; color: #6f8797; font-size: 9px; }
.exchange-compose-guidance.is-normal { border-color: #4ab58e; color: #73c9aa; }
.exchange-compose-guidance.is-caution { border-color: #d4a148; color: #ddb96f; background: rgba(191, 133, 43, .08); }
.exchange-compose-guidance.is-strong_warning { border-color: #e4556b; color: #ff8797; background: rgba(181, 48, 72, .1); }
.exchange-compose-guidance.is-no_evidence { border-color: #607b8d; color: #7893a5; }
.exchange-market-evidence { display: grid; align-content: start; gap: 12px; padding: 16px; background: rgba(4, 13, 23, .42); }
.exchange-market-evidence > header { display: grid; gap: 2px; }
.exchange-market-evidence > header strong { color: #b8cfdd; font-size: 14px; }
.exchange-market-reference-grid { display: grid; gap: 7px; }
.exchange-market-reference-grid article { display: grid; gap: 3px; padding: 9px; border: 1px solid rgba(74, 156, 209, .15); background: rgba(42, 107, 149, .06); }
.exchange-market-reference-grid small { color: #5b7789; font-size: 9px; }
.exchange-market-reference-grid b { overflow-wrap: anywhere; color: #c1d4df; font: 600 11px var(--font-mono); }
.exchange-market-evidence > p { margin: 0; color: #6d8493; font-size: 10px; line-height: 1.6; }
.exchange-market-evidence .exchange-evidence-actions { display: grid; grid-template-columns: 1fr; }
.exchange-market-evidence .exchange-evidence-actions button { border-radius: 2px; padding: 7px 8px; text-align: left; }
.exchange-group-view { padding: 18px; }
.exchange-group-view > header { display: grid; gap: 3px; margin-bottom: 15px; }
.exchange-group-view > header strong { color: #c2d8e5; font-size: 19px; }
.exchange-group-view > header p { margin: 0; color: #698293; font-size: 11px; }
.exchange-group-view > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.exchange-market-item.is-group-card { border-color: rgba(80, 159, 215, .15); padding: 12px; background: rgba(34, 90, 126, .06); }
.exchange-market-workspace > .exchange-pagination { margin: 0; padding: 9px; border-top: 1px solid rgba(75, 153, 211, .17); }
.exchange-market-workspace > .exchange-pagination[hidden] { display: none; }
.exchange-market-workspace > .exchange-compose { margin: 14px; }
.exchange-browser-toggle { display: none; }

:root[data-theme="light"] .exchange-market-layout,
:root[data-theme="light"] .exchange-market-workspace,
:root[data-theme="light"] .exchange-market-browser,
:root[data-theme="light"] .exchange-market-toolbar,
:root[data-theme="light"] .exchange-market-evidence {
  background: #f7fafc;
  color: var(--text-primary);
}
:root[data-theme="light"] .exchange-market-item strong,
:root[data-theme="light"] .exchange-item-header h2,
:root[data-theme="light"] .exchange-order-table td > a,
:root[data-theme="light"] .exchange-market-reference-grid b,
:root[data-theme="light"] .exchange-market-evidence > header strong { color: #294355; }
:root[data-theme="light"] .exchange-market-quick:hover,
:root[data-theme="light"] .exchange-market-quick.active,
:root[data-theme="light"] .exchange-tree-options button:hover,
:root[data-theme="light"] .exchange-tree-options button.active { color: #245473; }
:root[data-theme="light"] .exchange-market-search input { color: #203b4d; }
:root[data-theme="light"] .exchange-topic-index-item strong,
:root[data-theme="light"] .exchange-topic-result-main strong { color: #294355; }
:root[data-theme="light"] .exchange-topic-index-item:hover,
:root[data-theme="light"] .exchange-topic-index-item.active { background: #e7f3fa; }
:root[data-theme="light"] .exchange-topic-result { background: #fff; border-color: #d6e2ea; color: #20384a; }
:root[data-theme="light"] .exchange-topic-result:hover,
:root[data-theme="light"] .exchange-topic-result:focus-visible { background: #edf7fc; }
:root[data-theme="light"] .exchange-topic-result-meta strong { color: #526d7e; }
:root[data-theme="light"] .exchange-topic-result-meta.is-owner strong { color: #0876b3; }

@media (max-width: 1180px) {
  .exchange-market-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .exchange-topic-result { grid-template-columns: 72px minmax(210px, 1.5fr) 96px minmax(135px, 1fr) 82px 48px; }
  .exchange-topic-result-meta.is-location { display: none; }
  .exchange-order-sections { grid-template-columns: 1fr; }
  .exchange-order-books { border-right: 0; }
  .exchange-market-evidence { grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid rgba(78, 157, 210, .17); }
  .exchange-market-evidence > header,
  .exchange-market-evidence > p,
  .exchange-market-evidence > .exchange-reference-updated,
  .exchange-market-evidence > .exchange-item-insight { grid-column: 1 / -1; }
  .exchange-market-reference-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .exchange-shell { width: min(100% - 16px, 1500px); }
  .exchange-browser-toggle { display: block; border: 1px solid rgba(74, 156, 209, .3); padding: 10px 12px; background: rgba(34, 99, 139, .12); color: #8fd0f2; }
  .exchange-market-layout { display: block; min-height: 0; overflow: visible; }
  .exchange-market-browser {
    position: fixed;
    z-index: 120;
    inset: 70px 8px 8px;
    display: none;
    max-height: none;
    overflow-y: auto;
    border: 1px solid rgba(75, 153, 211, .38);
    box-shadow: 0 26px 80px rgba(0, 0, 0, .72);
  }
  .exchange-shell[data-browser-open="1"] .exchange-market-browser { display: flex; }
  .exchange-market-catalog { overflow: visible; }
  .exchange-browser-close {
    position: absolute;
    top: 9px;
    right: 10px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(80, 159, 215, .3);
    background: rgba(23, 66, 93, .35);
    color: #a8d8f1;
    font-size: 20px;
  }
  .exchange-market-toolbar { align-items: stretch; flex-direction: column; gap: 6px; }
  .exchange-view-tabs,
  .exchange-mode-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .exchange-view-tabs { grid-template-columns: 1fr 1fr; }
  .exchange-view-tabs button,
  .exchange-mode-tabs button,
  .exchange-mode-tabs a { text-align: center; }
  .exchange-market-empty { min-height: 430px; }
  .exchange-post-feed { padding: 12px; }
  .exchange-list-head { align-items: flex-start; }
  .exchange-topic-result {
    grid-template-columns: 66px minmax(0, 1fr) 42px;
    grid-template-areas: "side main open" "side owner open" "side location open" "side price open" "side time open";
    gap: 5px 9px;
    min-height: 0;
    padding: 11px 10px;
  }
  .exchange-topic-result-side { grid-area: side; align-self: start; }
  .exchange-topic-result-main { grid-area: main; }
  .exchange-topic-result-meta { display: flex; align-items: baseline; gap: 6px; }
  .exchange-topic-result-meta.is-owner { grid-area: owner; }
  .exchange-topic-result-meta.is-location { display: flex; grid-area: location; }
  .exchange-topic-result-meta.is-price { grid-area: price; }
  .exchange-topic-result time { grid-area: time; }
  .exchange-topic-result-open { grid-area: open; align-self: center; }
  .exchange-item-header { align-items: flex-start; padding: 15px; }
  .exchange-item-title-mark { width: 44px; height: 44px; }
  .exchange-order-sections { display: block; }
  .exchange-market-evidence { display: grid; grid-template-columns: 1fr; }
  .exchange-market-evidence > * { grid-column: auto !important; }
  .exchange-market-reference-grid { grid-template-columns: 1fr 1fr; }
  .exchange-group-view > div { grid-template-columns: 1fr; }
  .exchange-order-table { min-width: 720px; }
  .exchange-order-table th:nth-child(4) { width: 160px; }
}

/* ===== Complete light-theme surfaces: fitting, exchange, workspace, wiki/about and ESI ===== */
:root[data-theme="light"] .page-fitting,
:root[data-theme="light"] .fitting-shell {
  background: #eef3f8;
}
:root[data-theme="light"] .fitting-workbench {
  background: radial-gradient(circle at 70% 46%, rgba(0, 112, 210, .08), transparent 42%), #edf2f7;
}
:root[data-theme="light"] .fitting-topbar,
:root[data-theme="light"] .fitting-sidebar,
:root[data-theme="light"] .fitting-status-panel {
  border-color: #c5d1dc;
  background: rgba(255, 255, 255, .96);
  color: #203345;
  box-shadow: 0 12px 30px rgba(31, 61, 89, .10);
}
:root[data-theme="light"] .fitting-topbar a,
:root[data-theme="light"] .fitting-topbar span,
:root[data-theme="light"] .fitting-stage-meta .kicker,
:root[data-theme="light"] .fitting-stage-meta h2,
:root[data-theme="light"] .fit-status-section,
:root[data-theme="light"] .fit-status-section h3,
:root[data-theme="light"] .fit-status-section h3 b { color: #24384a; }
:root[data-theme="light"] .fitting-topbar a:hover,
:root[data-theme="light"] .fitting-topbar-brand { color: #0069b8 !important; }
:root[data-theme="light"] .fitting-left-panel input,
:root[data-theme="light"] .fitting-import-panel textarea,
:root[data-theme="light"] .fitting-character-select {
  border-color: #aab8c5;
  background: #fff;
  color: #1f3345;
}
:root[data-theme="light"] .fitting-hardware-kind button,
:root[data-theme="light"] .fitting-slot-filters button,
:root[data-theme="light"] .fitting-filter-row button,
:root[data-theme="light"] .fitting-utility-drawer summary,
:root[data-theme="light"] .fitting-import-actions button,
:root[data-theme="light"] .fitting-public-library-head button,
:root[data-theme="light"] .fitting-public-head button,
:root[data-theme="light"] .fitting-public-publish {
  border-color: #b9c7d3;
  background: #f7fafc;
  color: #294355;
}
:root[data-theme="light"] .fitting-hardware-kind button.active,
:root[data-theme="light"] .fitting-hardware-kind button:hover,
:root[data-theme="light"] .fitting-slot-filters button.active,
:root[data-theme="light"] .fitting-slot-filters button:hover,
:root[data-theme="light"] .fitting-filter-row button.active,
:root[data-theme="light"] .fitting-filter-row button:hover {
  border-color: #1681cf;
  background: #dceeff;
  color: #104c78;
}
:root[data-theme="light"] .fitting-category-list,
:root[data-theme="light"] .fitting-tree-group,
:root[data-theme="light"] .fitting-category-list button,
:root[data-theme="light"] .fitting-category-list button.fitting-tree-header,
:root[data-theme="light"] .fitting-category-list button.fitting-tree-leaf,
:root[data-theme="light"] .fitting-result-list,
:root[data-theme="light"] .fitting-result,
:root[data-theme="light"] .fitting-result:nth-child(odd),
:root[data-theme="light"] .fitting-public-row {
  background: #fff;
  color: #263b4d;
}
:root[data-theme="light"] .fitting-tree-leaf:nth-child(even),
:root[data-theme="light"] .fitting-result:nth-child(even) { background: #f4f7fa; }
:root[data-theme="light"] .fitting-tree-header:hover,
:root[data-theme="light"] .fitting-tree-group.is-open > .fitting-tree-header,
:root[data-theme="light"] .fitting-tree-leaf:hover,
:root[data-theme="light"] .fitting-result:hover,
:root[data-theme="light"] .fitting-public-row:hover {
  background: #e5f1fb;
  color: #153f5e;
}
:root[data-theme="light"] .fitting-category-list button,
:root[data-theme="light"] .fitting-tree-header,
:root[data-theme="light"] .fitting-tree-leaf b,
:root[data-theme="light"] .fitting-result b,
:root[data-theme="light"] .fitting-public-row b,
:root[data-theme="light"] .fitting-public-head { color: #24384a; }
:root[data-theme="light"] .fitting-category-list span,
:root[data-theme="light"] .fitting-tree-header small,
:root[data-theme="light"] .fitting-tree-leaf small,
:root[data-theme="light"] .fitting-result small,
:root[data-theme="light"] .fitting-public-row span,
:root[data-theme="light"] .fitting-public-row small,
:root[data-theme="light"] .fitting-panel-total,
:root[data-theme="light"] .fitting-filter-icons,
:root[data-theme="light"] .fitting-privacy-note { color: #5c6e7d; }
:root[data-theme="light"] .fitting-import-panel,
:root[data-theme="light"] .fitting-history-panel,
:root[data-theme="light"] .fitting-public-panel { border-color: #d4dde6; }
:root[data-theme="light"] .fitting-game-stage {
  background: radial-gradient(circle at 58% 46%, rgba(74, 145, 187, .13), transparent 38%), #e8eef3;
}
:root[data-theme="light"] .fitting-fit-wheel {
  background: radial-gradient(circle at 50% 42%, rgba(100, 165, 186, .25) 0 22%, rgba(205, 222, 226, .96) 23% 48%, rgba(150, 174, 184, .90) 49% 65%, transparent 66%), conic-gradient(from 210deg, #d4dce2, #a9bdc4, #e4e9ed, #a9bdc4, #d4dce2);
  box-shadow: inset 0 0 0 2px rgba(60, 79, 91, .24), inset 0 0 56px rgba(65, 95, 109, .20), 0 20px 44px rgba(31, 55, 70, .20);
}
:root[data-theme="light"] .fitting-ring-outer { filter: drop-shadow(0 0 5px rgba(42, 65, 78, .28)); }
:root[data-theme="light"] .fitting-ring-outer circle { stroke: #778b96; }
:root[data-theme="light"] .fitting-ring-outer rect { fill: #778b96; }
:root[data-theme="light"] .fitting-ring-inner circle { stroke: rgba(73, 99, 111, .44); }
:root[data-theme="light"] .fitting-fit-wheel::after { background: #b6c7ce; border-color: #647985; }
:root[data-theme="light"] .fitting-ship-render {
  background: radial-gradient(circle at 50% 37%, rgba(255,255,255,.82), rgba(166, 201, 208, .82) 48%, rgba(87, 123, 131, .82) 75%), #a9c5cc;
}
:root[data-theme="light"] .fitting-slot-inspector,
:root[data-theme="light"] .fitting-hold-panel,
:root[data-theme="light"] .fitting-hold-button,
:root[data-theme="light"] .fitting-estimate-panel,
:root[data-theme="light"] .fit-status-section h3,
:root[data-theme="light"] .fit-resists span {
  border-color: #bdc9d3;
  background: rgba(255,255,255,.92);
  color: #294052;
}
:root[data-theme="light"] .fitting-hold-head { background: #eaf0f5; }
:root[data-theme="light"] .fitting-hold-row:hover,
:root[data-theme="light"] .fitting-drone-row:hover { background: #fceaea; }
:root[data-theme="light"] .fitting-charge-picker button,
:root[data-theme="light"] .fitting-state-controls button {
  border-color: #aebdca;
  background: #f8fafc;
  color: #2d4659;
}
:root[data-theme="light"] .fitting-charge-picker button:hover,
:root[data-theme="light"] .fitting-state-controls button.active,
:root[data-theme="light"] .fitting-state-controls button:hover { background: #dff1e4; color: #235238; }
:root[data-theme="light"] .fitting-estimate-panel span,
:root[data-theme="light"] .fitting-estimate-panel small,
:root[data-theme="light"] .fit-status-defense > span { color: #607283; }
:root[data-theme="light"] .fitting-estimate-panel b { color: #20384a; }

:root[data-theme="light"] .exchange-safety-note,
:root[data-theme="light"] .exchange-compose,
:root[data-theme="light"] .exchange-item-edit-row,
:root[data-theme="light"] .exchange-post-card,
:root[data-theme="light"] .exchange-post-item,
:root[data-theme="light"] .exchange-contact-dialog,
:root[data-theme="light"] .exchange-contact-card,
:root[data-theme="light"] .exchange-market-layout,
:root[data-theme="light"] .exchange-market-browser,
:root[data-theme="light"] .exchange-market-workspace,
:root[data-theme="light"] .exchange-market-toolbar,
:root[data-theme="light"] .exchange-market-evidence {
  border-color: #c8d8e4;
  background: #fff;
  color: #20384a;
  box-shadow: 0 12px 30px rgba(38, 75, 102, .08);
}
:root[data-theme="light"] .exchange-filter-bar input,
:root[data-theme="light"] .exchange-filter-bar select,
:root[data-theme="light"] .exchange-form-grid input,
:root[data-theme="light"] .exchange-form-grid select,
:root[data-theme="light"] .exchange-form-wide textarea,
:root[data-theme="light"] .exchange-item-edit-row input,
:root[data-theme="light"] .exchange-contact-card textarea,
:root[data-theme="light"] .exchange-market-search {
  border-color: #b9cbd8;
  background: #f8fbfd;
  color: #20384a;
}
:root[data-theme="light"] .exchange-type-suggest { border-color: #9db9cc; background: #fff; box-shadow: 0 16px 36px rgba(39, 72, 96, .14); }
:root[data-theme="light"] .exchange-type-suggest button,
:root[data-theme="light"] .exchange-dialog-close,
:root[data-theme="light"] .exchange-post-item-main strong,
:root[data-theme="light"] .exchange-owner strong,
:root[data-theme="light"] .exchange-market-item strong,
:root[data-theme="light"] .exchange-item-header h2,
:root[data-theme="light"] .exchange-order-book > header strong,
:root[data-theme="light"] .exchange-order-table td > a,
:root[data-theme="light"] .exchange-market-reference-grid b,
:root[data-theme="light"] .exchange-group-view > header strong { color: #294355; }
:root[data-theme="light"] .exchange-market-tree summary,
:root[data-theme="light"] .exchange-market-item small,
:root[data-theme="light"] .exchange-market-item > b,
:root[data-theme="light"] .exchange-market-browser > footer,
:root[data-theme="light"] .exchange-market-browser > footer small,
:root[data-theme="light"] .exchange-item-header span,
:root[data-theme="light"] .exchange-item-header p,
:root[data-theme="light"] .exchange-order-book > header span,
:root[data-theme="light"] .exchange-order-book > header small,
:root[data-theme="light"] .exchange-order-table th,
:root[data-theme="light"] .exchange-order-table td,
:root[data-theme="light"] .exchange-market-evidence > p,
:root[data-theme="light"] .exchange-group-view > header p { color: #5b7283; }
:root[data-theme="light"] .exchange-market-empty strong { color: #314b5d; }
:root[data-theme="light"] .exchange-market-empty p,
:root[data-theme="light"] .exchange-market-empty span { color: #61798a; }
:root[data-theme="light"] .exchange-view-tabs button,
:root[data-theme="light"] .exchange-mode-tabs button,
:root[data-theme="light"] .exchange-mode-tabs a { color: #4c6678; }
:root[data-theme="light"] .exchange-view-tabs button.active,
:root[data-theme="light"] .exchange-mode-tabs button.active,
:root[data-theme="light"] .exchange-mode-tabs a:hover { color: #174c70; background: #e6f3fb; }
:root[data-theme="light"] .exchange-market-reference-grid article,
:root[data-theme="light"] .exchange-market-item.is-group-card,
:root[data-theme="light"] .exchange-order-book > header { background: #f3f8fb; }
:root[data-theme="light"] .exchange-contact-dialog::backdrop,
:root[data-theme="light"] .workspace-skill-dialog::backdrop { background: rgba(33, 47, 61, .34); }

:root[data-theme="light"] .workspace-command-kicker { color: #0068b5; }
:root[data-theme="light"] .workspace-command-stat.is-online strong,
:root[data-theme="light"] .wiki-author-status.is-ready,
:root[data-theme="light"] .wiki-contributor-badge small { color: #087f4f; }
:root[data-theme="light"] .workspace-skill-stat small::after,
:root[data-theme="light"] .workspace-skill-order,
:root[data-theme="light"] .workspace-skill-queue b { color: #0874ba; }
:root[data-theme="light"] .workspace-corp-summary { background: linear-gradient(90deg, rgba(102, 72, 196, .10), rgba(255,255,255,.80)); }

:root[data-theme="light"] .info-hero,
:root[data-theme="light"] .info-card,
:root[data-theme="light"] .friend-link-card,
:root[data-theme="light"] .friend-link-note,
:root[data-theme="light"] .wiki-promo-disclosure,
:root[data-theme="light"] .wiki-community-intro,
:root[data-theme="light"] .wiki-chronicle-intro,
:root[data-theme="light"] .wiki-contribute-panel,
:root[data-theme="light"] .wiki-review-row,
:root[data-theme="light"] .wiki-source-refs,
:root[data-theme="light"] .public-changelog-entry,
:root[data-theme="light"] .public-changelog-overview {
  border-color: rgba(45, 93, 132, .16);
  background: rgba(255,255,255,.90);
  color: var(--text-primary);
  box-shadow: 0 10px 28px rgba(33, 68, 96, .07);
}
:root[data-theme="light"] .about-subnav a,
:root[data-theme="light"] .public-changelog-actions button { background: #f5f9fc; color: #345064; }
:root[data-theme="light"] .about-subnav a:hover,
:root[data-theme="light"] .about-subnav a.active { background: #167ee6; color: #fff; }
:root[data-theme="light"] .wiki-promo-body { background: radial-gradient(circle at 82% 12%, rgba(37, 140, 255, .12), transparent 40%), linear-gradient(135deg, #f2f8ff, #fff); }
:root[data-theme="light"] .wiki-media-pills span { color: #096a9e; }
:root[data-theme="light"] .wiki-inline-media { background: #f7fafc; box-shadow: 0 12px 26px rgba(33, 68, 96, .08); }
:root[data-theme="light"] .wiki-promo-video,
:root[data-theme="light"] .wiki-promo-video video,
:root[data-theme="light"] .wiki-inline-media img { background: #e8eef3; }
:root[data-theme="light"] .wiki-contribution-form input,
:root[data-theme="light"] .wiki-contribution-form select,
:root[data-theme="light"] .wiki-contribution-form textarea,
:root[data-theme="light"] .wiki-review-row textarea,
:root[data-theme="light"] .wiki-rollback-form input {
  border-color: #bdccd7;
  background: #fff;
  color: #1f3548;
}
:root[data-theme="light"] .wiki-chronicle-items button { background: #fff; }
:root[data-theme="light"] .wiki-chronicle-items button.active { background: #fff5df; }
:root[data-theme="light"] .public-changelog-topics span,
:root[data-theme="light"] .public-changelog-overview span { background: #f4f8fb; }

:root[data-theme="light"] .esi-step-body p { color: var(--text-secondary); }
:root[data-theme="light"] .esi-step-body code,
:root[data-theme="light"] .esi-bind-url-input,
:root[data-theme="light"] .esi-bind-status {
  border-color: #b9cad7;
  background: #f4f8fb;
  color: #22394b;
}

/* Bright tactical accents need darker light-theme counterparts on white cards. */
:root[data-theme="light"] .captain-intel-card--combat strong,
:root[data-theme="light"] .captain-intel-card--radar .radar-danger,
:root[data-theme="light"] .captain-intel-card--radar .radar-danger b { color: #b42346; }
:root[data-theme="light"] .captain-intel-card--sov strong { color: #006a94; }
:root[data-theme="light"] .captain-intel-card--radar strong,
:root[data-theme="light"] .captain-intel-card--market strong,
:root[data-theme="light"] .captain-intel-card--radar .radar-traffic,
:root[data-theme="light"] .captain-intel-card--radar .radar-traffic b,
:root[data-theme="light"] .captain-intel-card--server.is-maintenance strong { color: #8a4f00; }
:root[data-theme="light"] .captain-intel-card--tip strong,
:root[data-theme="light"] .captain-intel-card--server strong { color: #087765; }
:root[data-theme="light"] .wiki-promo-mark,
:root[data-theme="light"] .wiki-promo-badges span { color: #096a9e; }

@media (max-width: 760px) {
  :root[data-theme="light"] .exchange-browser-toggle,
  :root[data-theme="light"] .exchange-browser-close { border-color: #a9c3d5; background: #eef7fc; color: #245b7c; }
}


/* 邮箱验证码与账号安全引导 */
.auth-code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.auth-code-row button,
[data-send-email-code] {
  min-height: 42px;
  white-space: nowrap;
}
.auth-reset-box {
  margin-top: 12px;
  border: 1px solid color-mix(in srgb, var(--hud-line, #2d3b55) 80%, transparent);
  border-radius: 14px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--hud-panel, #101826) 88%, transparent);
}
.auth-reset-box summary {
  cursor: pointer;
  color: var(--hud-text-dim, #9db0c9);
}
.workspace-email-guide {
  margin: 14px 0 0;
  padding: 16px 18px;
}
.workspace-email-guide h2 {
  margin: 4px 0 8px;
  font-size: 1.15rem;
}
.workspace-email-guide .auth-card {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}


/* 玩家主页装扮与经历 */
.player-profile-shell {
  position: relative;
  border-radius: 22px;
  padding: 1px;
  overflow: hidden;
  isolation: isolate;
}
.player-profile-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 12% 18%, rgba(110, 203, 255, .14), transparent 28%),
    radial-gradient(circle at 86% 12%, rgba(255, 110, 170, .10), transparent 26%),
    linear-gradient(135deg, rgba(28, 42, 72, .55), rgba(8, 12, 22, .18));
  z-index: -2;
}
.player-profile-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--hud-accent, #6ecbff) 28%, transparent);
  pointer-events: none;
  z-index: 2;
}
.player-profile-shell > * { position: relative; z-index: 1; }
.player-profile-shell.theme-deep-crimson {
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 70, 110, .22), transparent 34%),
    linear-gradient(135deg, rgba(128,24,56,.34), rgba(18, 10, 24, .55));
  box-shadow: inset 0 0 0 1px rgba(255, 90, 130, .18), 0 18px 40px rgba(0,0,0,.28);
}
.player-profile-shell.theme-pink-cute {
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 170, 220, .28), transparent 32%),
    linear-gradient(135deg, rgba(255,120,180,.22), rgba(120,80,160,.20));
  box-shadow: inset 0 0 0 1px rgba(255, 150, 210, .24), 0 18px 36px rgba(80,20,60,.22);
}
.player-profile-shell.theme-space-rogue {
  background:
    radial-gradient(circle at 80% 18%, rgba(255, 214, 110, .18), transparent 30%),
    linear-gradient(135deg, rgba(212,175,55,.18), rgba(16, 18, 28, .55));
  box-shadow: inset 0 0 0 1px rgba(212,175,55,.24), 0 18px 40px rgba(0,0,0,.28);
}
.player-profile-shell.theme-industrial-steel {
  background:
    radial-gradient(circle at 16% 80%, rgba(160, 185, 210, .16), transparent 34%),
    linear-gradient(135deg, rgba(120,140,160,.22), rgba(28, 34, 44, .55));
  box-shadow: inset 0 0 0 1px rgba(160,185,210,.18), 0 18px 36px rgba(0,0,0,.26);
}
.player-profile-shell.theme-corp-banner {
  background:
    radial-gradient(circle at 78% 22%, rgba(80, 160, 255, .20), transparent 32%),
    linear-gradient(135deg, rgba(40,110,180,.24), rgba(14, 22, 40, .55));
  box-shadow: inset 0 0 0 1px rgba(90, 160, 255, .22), 0 18px 40px rgba(0,0,0,.28);
}
.player-profile-shell.theme-neon-cyber {
  background:
    radial-gradient(circle at 15% 20%, rgba(0, 255, 209, .20), transparent 34%),
    linear-gradient(135deg, rgba(88, 40, 180, .30), rgba(10, 18, 36, .55));
  box-shadow: inset 0 0 0 1px rgba(0, 255, 209, .24), 0 0 28px rgba(0, 255, 209, .08);
}
.player-profile-shell.theme-aurora-mint {
  background:
    radial-gradient(circle at 20% 18%, rgba(120, 255, 210, .18), transparent 32%),
    linear-gradient(135deg, rgba(40, 160, 140, .22), rgba(12, 24, 36, .52));
  box-shadow: inset 0 0 0 1px rgba(120, 255, 210, .18);
}
.player-profile-shell.theme-void-purple {
  background:
    radial-gradient(circle at 78% 20%, rgba(190, 120, 255, .20), transparent 32%),
    linear-gradient(135deg, rgba(90, 40, 150, .28), rgba(12, 10, 28, .55));
  box-shadow: inset 0 0 0 1px rgba(190, 120, 255, .22);
}
.player-profile-shell.theme-solar-gold {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 170, 70, .22), transparent 30%),
    linear-gradient(135deg, rgba(180, 80, 30, .24), rgba(24, 14, 10, .55));
  box-shadow: inset 0 0 0 1px rgba(255, 170, 70, .22);
}
.player-profile-shell.theme-ice-blue {
  background:
    radial-gradient(circle at 80% 18%, rgba(150, 210, 255, .20), transparent 32%),
    linear-gradient(135deg, rgba(60, 120, 180, .22), rgba(10, 18, 30, .55));
  box-shadow: inset 0 0 0 1px rgba(150, 210, 255, .20);
}
.player-profile-avatar { position: relative; display: inline-grid; place-items: center; }
.player-profile-avatar::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--hud-accent, #6ecbff) 55%, transparent), transparent 40%, color-mix(in srgb, var(--hud-accent, #6ecbff) 35%, transparent), transparent 75%);
  opacity: .55;
  filter: blur(.2px);
  animation: playerFrameSpin 8s linear infinite;
  z-index: 0;
}
.player-profile-avatar > * { position: relative; z-index: 1; }
.player-profile-avatar.frame-signal::after,
.player-profile-avatar.frame-esi-verified::after,
.player-profile-avatar.frame-combat::after,
.player-profile-avatar.frame-industrial::after,
.player-profile-avatar.frame-pink-cute::after,
.player-profile-avatar.frame-space-rogue::after,
.player-profile-avatar.frame-administrator::after,
.player-profile-avatar.frame-neon-cyber::after,
.player-profile-avatar.frame-aurora-mint::after,
.player-profile-avatar.frame-void-purple::after,
.player-profile-avatar.frame-solar-gold::after,
.player-profile-avatar.frame-ice-blue::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--hud-accent, #6ecbff) 70%, transparent);
  box-shadow: 0 0 0 4px rgba(0,0,0,.18), 0 0 22px color-mix(in srgb, var(--hud-accent, #6ecbff) 35%, transparent);
  pointer-events: none;
  z-index: 2;
}
.player-profile-avatar.frame-esi-verified::after { border-color: #35dc98; box-shadow: 0 0 0 4px rgba(0,0,0,.18), 0 0 22px rgba(53,220,152,.45); }
.player-profile-avatar.frame-combat::after { border-color: #ff6b7a; box-shadow: 0 0 0 4px rgba(0,0,0,.18), 0 0 22px rgba(255,107,122,.42); }
.player-profile-avatar.frame-industrial::after { border-color: #9db0c9; box-shadow: 0 0 0 4px rgba(0,0,0,.18), 0 0 18px rgba(157,176,201,.35); }
.player-profile-avatar.frame-pink-cute::after { border-color: #ff8fc8; box-shadow: 0 0 0 4px rgba(0,0,0,.18), 0 0 22px rgba(255,143,200,.45); }
.player-profile-avatar.frame-space-rogue::after { border-color: #d4af37; box-shadow: 0 0 0 4px rgba(0,0,0,.18), 0 0 22px rgba(212,175,55,.42); }
.player-profile-avatar.frame-administrator::after { border-color: #8ab4ff; box-shadow: 0 0 0 4px rgba(0,0,0,.18), 0 0 22px rgba(138,180,255,.42); }
.player-profile-avatar.frame-neon-cyber::after { border-color: #00ffd1; box-shadow: 0 0 0 4px rgba(0,0,0,.18), 0 0 24px rgba(0,255,209,.48); }
.player-profile-avatar.frame-aurora-mint::after { border-color: #78ffd2; box-shadow: 0 0 0 4px rgba(0,0,0,.18), 0 0 22px rgba(120,255,210,.42); }
.player-profile-avatar.frame-void-purple::after { border-color: #be78ff; box-shadow: 0 0 0 4px rgba(0,0,0,.18), 0 0 22px rgba(190,120,255,.45); }
.player-profile-avatar.frame-solar-gold::after { border-color: #ffaa46; box-shadow: 0 0 0 4px rgba(0,0,0,.18), 0 0 22px rgba(255,170,70,.45); }
.player-profile-avatar.frame-ice-blue::after { border-color: #96d2ff; box-shadow: 0 0 0 4px rgba(0,0,0,.18), 0 0 22px rgba(150,210,255,.42); }
@keyframes playerFrameSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .player-profile-avatar::before { animation: none; }
}
.player-tag-row, .player-badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.player-tag { display: inline-flex; padding: 2px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--hud-line, #2d3b55) 80%, transparent); color: var(--hud-text-dim, #9db0c9); font-size: 12px; }
.player-achievement-grid, .player-highlight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.player-achievement-card, .player-highlight-card { border: 1px solid color-mix(in srgb, var(--hud-line, #2d3b55) 80%, transparent); border-radius: 12px; padding: 10px; background: color-mix(in srgb, var(--hud-panel, #101826) 88%, transparent); text-decoration: none; color: inherit; }
.player-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.player-timeline li { display: grid; grid-template-columns: 120px 1fr; gap: 8px; color: var(--hud-text-dim, #9db0c9); }
.player-timeline time { color: var(--hud-text, #e8eef8); }
.esi-extra-panel { margin-top: 12px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--hud-line, #2d3b55) 80%, transparent); border-radius: 14px; }
.esi-extra-panel label { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; }


/* 新增 5 套玩家主页装扮 */
.player-profile-shell.theme-neon-cyber {
  background:
    radial-gradient(circle at 15% 20%, rgba(0, 255, 209, .16), transparent 34%),
    linear-gradient(135deg, rgba(88, 40, 180, .24), rgba(10, 18, 36, .45));
  box-shadow: inset 0 0 0 1px rgba(0, 255, 209, .18);
}
.player-profile-shell.theme-aurora-mint {
  background:
    radial-gradient(circle at 80% 10%, rgba(120, 255, 210, .18), transparent 36%),
    linear-gradient(135deg, rgba(38, 120, 98, .22), rgba(18, 36, 42, .4));
}
.player-profile-shell.theme-void-purple {
  background:
    radial-gradient(circle at 30% 80%, rgba(168, 96, 255, .2), transparent 40%),
    linear-gradient(135deg, rgba(62, 28, 110, .28), rgba(16, 12, 28, .5));
}
.player-profile-shell.theme-solar-gold {
  background:
    radial-gradient(circle at 70% 25%, rgba(255, 196, 84, .2), transparent 34%),
    linear-gradient(135deg, rgba(150, 92, 20, .24), rgba(36, 24, 12, .46));
}
.player-profile-shell.theme-ice-blue {
  background:
    radial-gradient(circle at 20% 30%, rgba(140, 210, 255, .18), transparent 38%),
    linear-gradient(135deg, rgba(36, 88, 140, .24), rgba(12, 22, 40, .48));
}

.player-profile-avatar.frame-neon-cyber::after,
.player-profile-avatar.frame-aurora-mint::after,
.player-profile-avatar.frame-void-purple::after,
.player-profile-avatar.frame-solar-gold::after,
.player-profile-avatar.frame-ice-blue::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  pointer-events: none;
}
.player-profile-avatar.frame-neon-cyber::after {
  border: 2px solid #39ffd0;
  box-shadow: 0 0 16px rgba(57, 255, 208, .35), inset 0 0 10px rgba(140, 80, 255, .25);
}
.player-profile-avatar.frame-aurora-mint::after {
  border: 2px solid #7dffc8;
  box-shadow: 0 0 14px rgba(125, 255, 200, .3);
}
.player-profile-avatar.frame-void-purple::after {
  border: 2px solid #b57bff;
  box-shadow: 0 0 16px rgba(181, 123, 255, .35);
}
.player-profile-avatar.frame-solar-gold::after {
  border: 2px solid #ffc45a;
  box-shadow: 0 0 16px rgba(255, 196, 90, .32);
}
.player-profile-avatar.frame-ice-blue::after {
  border: 2px solid #8ed2ff;
  box-shadow: 0 0 14px rgba(142, 210, 255, .32);
}

.player-profile-shell.theme-neon-cyber .player-tag { border-color: rgba(57,255,208,.35); color: #9ff7e4; }
.player-profile-shell.theme-aurora-mint .player-tag { border-color: rgba(125,255,200,.35); color: #b8ffe2; }
.player-profile-shell.theme-void-purple .player-tag { border-color: rgba(181,123,255,.35); color: #ddc4ff; }
.player-profile-shell.theme-solar-gold .player-tag { border-color: rgba(255,196,90,.35); color: #ffe0a3; }
.player-profile-shell.theme-ice-blue .player-tag { border-color: rgba(142,210,255,.35); color: #c9e9ff; }

/* 制造工具 2.0：LP 兑换与虫洞目录 */
.tools-browser-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) minmax(150px, .55fr) minmax(170px, .65fr) auto;
  gap: 10px;
  align-items: end;
  margin: 14px 0;
}
.tools-browser-toolbar label { display: grid; gap: 6px; min-width: 0; }
.tools-browser-toolbar label > span { color: var(--muted); font-size: 12px; }
.tools-browser-toolbar input,
.tools-browser-toolbar select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field-bg, rgba(7, 17, 34, .72));
  color: var(--text);
  padding: 8px 11px;
}
.lp-workbench-list { display: grid; gap: 10px; margin-top: 14px; }
.lp-workbench-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  padding: 13px;
}
.lp-workbench-rank {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-weight: 800;
}
.lp-workbench-main > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.lp-workbench-main > div strong { font-size: 16px; }
.lp-workbench-main > div span { color: var(--muted); font-size: 12px; }
.lp-workbench-main dl { display: grid; grid-template-columns: repeat(6, minmax(105px, 1fr)); gap: 8px; margin: 11px 0 0; }
.lp-workbench-main dl div { min-width: 0; border-top: 1px solid var(--line); padding-top: 8px; }
.lp-workbench-main dt { color: var(--muted); font-size: 11px; }
.lp-workbench-main dd { margin: 3px 0 0; color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.tools-evidence-empty {
  display: grid;
  gap: 7px;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
}
.tools-evidence-empty strong { color: var(--text); font-size: 16px; }
.tools-directory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.tools-directory-card,
.tools-system-query-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--text);
  padding: 13px;
  text-decoration: none;
  transition: border-color .16s ease, transform .16s ease;
}
.tools-directory-card:hover,
.tools-system-query-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.tools-directory-card > div { display: flex; justify-content: space-between; gap: 8px; }
.tools-directory-card > div strong { color: var(--accent); font-size: 18px; }
.tools-directory-card > div span { color: var(--muted); text-align: right; }
.tools-directory-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.tools-directory-card dt { color: var(--muted); font-size: 10px; }
.tools-directory-card dd { margin: 3px 0 0; font-size: 12px; }
.tools-system-query-card { margin-bottom: 12px; background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.tools-system-query-card span { color: var(--muted); font-size: 12px; }
.tools-known-systems { display: grid; gap: 9px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.tools-known-systems > div { display: flex; flex-wrap: wrap; gap: 7px; }
.tools-known-systems a { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 12px; }
.tools-known-systems a:hover { border-color: var(--accent); color: var(--accent); }

.tools-item-center { margin-bottom: 14px; }
.tools-item-center-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  margin: 10px 0 12px;
}
.tools-item-center-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field-bg, rgba(7, 17, 34, .72));
  color: var(--text);
  padding: 0 12px;
}
.tools-item-summary-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}
.tools-item-summary-card > div:first-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}
.tools-item-summary-card strong { font-size: 18px; }
.tools-item-summary-card span { color: var(--muted); font-size: 12px; }
.tools-item-summary-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.tools-item-summary-card dt { color: var(--muted); font-size: 11px; }
.tools-item-summary-card dd { margin: 4px 0 0; font-size: 13px; }
.tools-item-summary-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tools-orderbook-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.tools-orderbook-grid h4 { margin: 0 0 8px; font-size: 14px; }

@media (max-width: 900px) {
  .tools-item-center-form { grid-template-columns: 1fr; }
  .tools-item-summary-card dl,
  .tools-orderbook-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .tools-item-summary-card dl,
  .tools-orderbook-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .tools-browser-toolbar { grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(140px, .6fr)); }
  .tools-browser-toolbar > .action-button { grid-column: 1 / -1; justify-self: start; }
  .lp-workbench-main dl { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
}

@media (max-width: 680px) {
  .tools-browser-toolbar { grid-template-columns: 1fr; }
  .tools-browser-toolbar > .action-button { width: 100%; justify-content: center; }
  .lp-workbench-card { grid-template-columns: 34px minmax(0, 1fr); padding: 10px; }
  .lp-workbench-rank { width: 30px; height: 30px; }
  .lp-workbench-main dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools-directory-grid { grid-template-columns: 1fr; }
  .tools-directory-card dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* ===== Tools Market Center (competitor-style two-pane) ===== */
.tools-market-center,
.tools-lp-center,
.tools-wormhole-center{
  display:grid;
  grid-template-columns:minmax(260px,320px) minmax(0,1fr);
  gap:14px;
  align-items:start;
  min-height:560px;
}
.tools-market-side{
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(8,12,20,.55);
  padding:12px;
  display:grid;
  gap:10px;
  max-height:min(78vh,920px);
  overflow:auto;
}
.tools-market-main{
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(8,12,20,.35);
  padding:14px;
  min-height:560px;
}
.tools-market-side-tabs{
  display:flex;
  gap:8px;
}
.tools-market-side-tabs button{
  border:1px solid var(--line);
  background:transparent;
  color:var(--text);
  border-radius:999px;
  padding:6px 12px;
  cursor:pointer;
}
.tools-market-side-tabs button.active{
  border-color:var(--accent);
  color:var(--accent);
}
.tools-market-search,
.tools-wormhole-filters{
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
}
.tools-wormhole-filters{
  grid-template-columns:1fr;
}
.tools-wormhole-filters > label,
.tools-browser-toolbar label{
  display:grid;
  gap:4px;
  font-size:12px;
  color:var(--muted);
}
.tools-market-search input,
.tools-wormhole-filters input,
.tools-wormhole-filters select,
.tools-browser-toolbar select,
.tools-browser-toolbar input{
  width:100%;
  border:1px solid var(--line);
  border-radius:8px;
  background:rgba(0,0,0,.25);
  color:var(--text);
  padding:8px 10px;
}
.tools-market-tree-list{
  list-style:none;
  margin:0;
  padding:0;
}
.tools-market-tree-list .tools-market-tree-list{
  padding-left:14px;
}
.tools-market-tree-row,
.tools-market-type-row{
  width:100%;
  display:flex;
  align-items:center;
  gap:8px;
  border:0;
  background:transparent;
  color:var(--text);
  text-align:left;
  padding:7px 8px;
  border-radius:8px;
  cursor:pointer;
}
.tools-market-tree-row:hover,
.tools-market-type-row:hover,
.tools-market-tree-item.is-selected > .tools-market-tree-row,
.tools-market-type-row.is-selected{
  background:rgba(56,132,255,.12);
  color:var(--accent);
}
.tools-market-tree-toggle{
  width:1rem;
  color:var(--muted);
}
.tools-market-tree-name,
.tools-market-type-row span{
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tools-market-tree-count{
  color:var(--muted);
  font-size:12px;
}
.tools-market-types{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:4px;
}
.tools-type-icon{
  width:28px;
  height:28px;
  border-radius:6px;
  object-fit:contain;
  background:rgba(255,255,255,.04);
  flex:0 0 auto;
}
.tools-type-icon.is-missing{
  opacity:.35;
  filter:grayscale(1);
}
.lp-workbench-title{
  display:flex;
  gap:10px;
  align-items:flex-start;
}
.lp-workbench-title .tools-type-icon{
  margin-top:2px;
}
.tools-lp-reward{
  display:flex;
  gap:8px;
  align-items:center;
}
.tools-market-item-title .tools-type-icon{
  width:40px;
  height:40px;
}
.tools-market-item-title{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:12px;
}
.tools-market-item-title h3{
  margin:0 0 4px;
}
.tools-market-item-title p,
.tools-market-breadcrumb,
.tools-market-updated{
  margin:0;
  color:var(--muted);
  font-size:13px;
}
.tools-market-main-toolbar{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
  flex-wrap:wrap;
}
.tools-market-breadcrumb{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
}
.tools-linkish{
  border:0;
  background:none;
  color:var(--accent);
  cursor:pointer;
  padding:0;
}
.tools-sep{color:var(--muted)}
.tools-chip-row,
.tools-market-subgroups{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:10px;
}
.tools-chip{
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--text);
  border-radius:999px;
  padding:4px 10px;
  font-size:12px;
  cursor:pointer;
}
.tools-data-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
.tools-data-table th,
.tools-data-table td{
  border-bottom:1px solid rgba(255,255,255,.06);
  padding:10px 8px;
  vertical-align:top;
}
.tools-data-table th{
  color:var(--muted);
  font-weight:600;
  text-align:left;
}
.tools-lp-reward{
  display:flex;
  gap:8px;
  align-items:center;
}
.tools-lp-reward b{color:#f0a35a}
.tools-orderbook-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
@media (max-width: 980px){
  .tools-market-center,
  .tools-lp-center,
  .tools-wormhole-center,
  .tools-orderbook-grid{
    grid-template-columns:1fr;
  }
  .tools-market-side{max-height:none}
}


/* ===== Player homepage cosmetics upgrade ===== */
.player-profile-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--hud-accent) 24%, var(--line));
  background:
    radial-gradient(circle at 12% 0%, rgba(88, 168, 255, .10), transparent 28%),
    linear-gradient(180deg, rgba(10, 16, 28, .96), rgba(6, 10, 18, .98));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .34);
}
.player-profile-shell {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 0;
  border-radius: 0;
  min-height: 100%;
  box-shadow: none;
}
.player-profile-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0%, rgba(255,255,255,.045) 28%, transparent 52%),
    radial-gradient(circle at 88% 0%, rgba(255,255,255,.06), transparent 24%),
    radial-gradient(circle at 8% 100%, rgba(80,140,255,.08), transparent 30%);
  opacity: .95;
}
.player-profile-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.player-profile-shell > * { position: relative; z-index: 1; }

.player-profile-hero {
  position: relative;
  margin: -6px -6px 18px;
  padding: 18px 16px 16px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 70%),
    radial-gradient(circle at 20% 0%, rgba(120,190,255,.10), transparent 42%);
  border: 1px solid rgba(130, 180, 255, .10);
}
.player-profile-main {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px 20px;
  align-items: center;
  padding-bottom: 0;
  border-bottom: 0;
}
.player-profile-heading { gap: 8px; }
.player-profile-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.08;
  letter-spacing: .01em;
  text-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.player-profile-subtitle {
  margin: 0;
  color: color-mix(in srgb, var(--text-secondary) 88%, #9fd0ff);
  font-size: 13px;
}
.player-profile-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(70, 210, 150, .28);
  background: rgba(40, 180, 120, .10);
  color: #7dffc0;
  font: 700 11px/1.2 var(--font-mono);
  letter-spacing: .08em;
}
.player-profile-counts {
  gap: 10px;
}
.player-profile-counts span {
  min-width: 72px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(130, 180, 255, .12);
  background: rgba(8, 14, 24, .42);
  color: var(--text-tertiary);
  font-size: 11px;
}
.player-profile-counts b {
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1.1;
}

.player-avatar {
  border-radius: 50%;
  border: 1px solid rgba(150, 200, 255, .18);
  background:
    radial-gradient(circle at 30% 25%, rgba(120,190,255,.22), transparent 42%),
    linear-gradient(160deg, rgba(18, 28, 48, .95), rgba(8, 12, 22, .98));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.player-avatar-large { width: 108px; height: 108px; border-radius: 50%; }
.player-avatar-preset {
  color: #9fd0ff;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .04em;
  text-shadow: 0 0 18px rgba(110, 190, 255, .35);
}
.player-avatar-large.player-avatar-preset { font-size: 42px; }

.player-profile-avatar {
  position: relative;
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
}
.player-profile-avatar .player-avatar,
.player-profile-avatar img,
.player-profile-avatar .player-avatar-preset {
  width: 108px !important;
  height: 108px !important;
  border-radius: 50%;
  object-fit: cover;
}
.player-profile-avatar::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: conic-gradient(
    from 180deg,
    transparent 0deg,
    rgba(110, 200, 255, .0) 40deg,
    rgba(110, 200, 255, .55) 90deg,
    rgba(255, 140, 200, .35) 150deg,
    transparent 210deg,
    rgba(110, 200, 255, .25) 280deg,
    transparent 360deg
  );
  filter: blur(.2px);
  animation: playerFrameSpin 10s linear infinite;
  opacity: .72;
  z-index: 0;
}
.player-profile-avatar::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid rgba(150, 210, 255, .55);
  box-shadow:
    0 0 0 5px rgba(6, 10, 18, .78),
    0 0 24px rgba(110, 200, 255, .28);
  pointer-events: none;
  z-index: 2;
}
.player-profile-frame-glow {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  box-shadow: inset 0 0 18px rgba(255,255,255,.08);
  pointer-events: none;
  z-index: 3;
}
.player-profile-avatar .player-avatar,
.player-profile-avatar .player-avatar-preset {
  position: relative;
  z-index: 1;
  box-shadow:
    0 0 0 3px rgba(8,12,20,.88),
    0 10px 24px rgba(0,0,0,.35);
}

.player-profile-avatar.frame-signal::after { border-color: #6ecbff; box-shadow: 0 0 0 5px rgba(6,10,18,.78), 0 0 24px rgba(110,203,255,.38); }
.player-profile-avatar.frame-esi-verified::after { border-color: #35dc98; box-shadow: 0 0 0 5px rgba(6,10,18,.78), 0 0 26px rgba(53,220,152,.42); }
.player-profile-avatar.frame-combat::after { border-color: #ff6b7a; box-shadow: 0 0 0 5px rgba(6,10,18,.78), 0 0 24px rgba(255,107,122,.38); }
.player-profile-avatar.frame-industrial::after { border-color: #9db0c9; box-shadow: 0 0 0 5px rgba(6,10,18,.78), 0 0 20px rgba(157,176,201,.30); }
.player-profile-avatar.frame-pink-cute::after { border-color: #ff8fc8; box-shadow: 0 0 0 5px rgba(6,10,18,.78), 0 0 26px rgba(255,143,200,.42); }
.player-profile-avatar.frame-space-rogue::after { border-color: #d4af37; box-shadow: 0 0 0 5px rgba(6,10,18,.78), 0 0 26px rgba(212,175,55,.40); }
.player-profile-avatar.frame-administrator::after { border-color: #8ab4ff; box-shadow: 0 0 0 5px rgba(6,10,18,.78), 0 0 24px rgba(138,180,255,.40); }
.player-profile-avatar.frame-neon-cyber::after { border-color: #39ffd0; box-shadow: 0 0 0 5px rgba(6,10,18,.78), 0 0 28px rgba(57,255,208,.45), inset 0 0 12px rgba(140,80,255,.22); }
.player-profile-avatar.frame-aurora-mint::after { border-color: #7dffc8; box-shadow: 0 0 0 5px rgba(6,10,18,.78), 0 0 24px rgba(125,255,200,.38); }
.player-profile-avatar.frame-void-purple::after { border-color: #b57bff; box-shadow: 0 0 0 5px rgba(6,10,18,.78), 0 0 26px rgba(181,123,255,.42); }
.player-profile-avatar.frame-solar-gold::after { border-color: #ffc45a; box-shadow: 0 0 0 5px rgba(6,10,18,.78), 0 0 26px rgba(255,196,90,.40); }
.player-profile-avatar.frame-ice-blue::after { border-color: #8ed2ff; box-shadow: 0 0 0 5px rgba(6,10,18,.78), 0 0 24px rgba(142,210,255,.38); }

@keyframes playerFrameSpin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .player-profile-avatar::before { animation: none; }
}

.player-profile-body {
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 4px 0 8px;
}
.player-panel-block {
  min-width: 0;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid rgba(130, 180, 255, .10);
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 48%),
    rgba(8, 14, 24, .42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.player-panel-wide { grid-column: 1 / -1; }
.player-profile-body section > span {
  display: inline-block;
  margin-bottom: 8px;
  color: color-mix(in srgb, var(--text-tertiary) 80%, #9fd0ff);
  font: 700 11px/1.2 var(--font-mono);
  letter-spacing: .08em;
  text-transform: none;
}
.player-profile-body p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.75;
}
.player-character-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 4px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(130, 180, 255, .14);
  background:
    radial-gradient(circle at 0% 0%, rgba(90,160,255,.12), transparent 48%),
    rgba(10, 16, 28, .55);
}
.player-character-portrait {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(150, 200, 255, .18);
  box-shadow: 0 8px 18px rgba(0,0,0,.28);
  background: rgba(0,0,0,.25);
}
.player-character-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.player-character-card strong {
  color: var(--text-primary);
  font-size: 15px;
}
.player-character-card span { color: var(--text-secondary); font-size: 13px; }
.player-character-card small,
.player-character-empty { color: var(--text-tertiary); font-size: 12px; }

.player-badge {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}
.player-tag {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(130, 180, 255, .16);
  background: rgba(255,255,255,.03);
  color: #c7daf5;
  font-size: 12px;
}
.player-achievement-grid,
.player-highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
}
.player-achievement-card,
.player-highlight-card {
  border: 1px solid rgba(130, 180, 255, .12);
  border-radius: 14px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 55%),
    rgba(8, 14, 24, .55);
  text-decoration: none;
  color: inherit;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.player-achievement-card:hover,
.player-highlight-card:hover {
  transform: translateY(-1px);
  border-color: rgba(130, 180, 255, .28);
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
}
.player-achievement-card strong,
.player-highlight-card strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  margin-bottom: 4px;
}
.player-achievement-card small,
.player-highlight-card small {
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.5;
}
.player-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.player-timeline li {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(130, 180, 255, .08);
  background: rgba(255,255,255,.02);
  color: var(--text-secondary);
}
.player-timeline time {
  color: #9fd0ff;
  font: 600 12px/1.4 var(--font-mono);
}
.player-profile-actions {
  margin-top: 8px;
  padding-top: 4px;
}

.player-profile-shell.theme-deep-crimson {
  background:
    radial-gradient(circle at 12% 12%, rgba(255,72,118,.24), transparent 30%),
    linear-gradient(145deg, rgba(92,14,40,.58), rgba(12,8,16,.96));
}
.player-profile-shell.theme-pink-cute {
  background:
    radial-gradient(circle at 18% 14%, rgba(255,150,210,.30), transparent 32%),
    radial-gradient(circle at 86% 10%, rgba(180,130,255,.18), transparent 28%),
    linear-gradient(145deg, rgba(78,28,62,.52), rgba(16,10,24,.96));
}
.player-profile-shell.theme-space-rogue {
  background:
    radial-gradient(circle at 16% 16%, rgba(255,214,110,.20), transparent 28%),
    linear-gradient(145deg, rgba(56,40,14,.56), rgba(10,12,18,.96));
}
.player-profile-shell.theme-industrial-steel {
  background:
    radial-gradient(circle at 14% 14%, rgba(170,190,210,.16), transparent 30%),
    linear-gradient(145deg, rgba(48,58,70,.56), rgba(10,14,20,.96));
}
.player-profile-shell.theme-corp-banner {
  background:
    radial-gradient(circle at 16% 16%, rgba(80,150,255,.22), transparent 30%),
    linear-gradient(145deg, rgba(18,48,96,.56), rgba(8,14,26,.96));
}
.player-profile-shell.theme-neon-cyber {
  background:
    radial-gradient(circle at 14% 16%, rgba(0,255,209,.20), transparent 34%),
    radial-gradient(circle at 86% 8%, rgba(160,80,255,.18), transparent 28%),
    linear-gradient(135deg, rgba(42,18,96,.48), rgba(8,12,26,.97));
  box-shadow: inset 0 0 0 1px rgba(0,255,209,.16);
}
.player-profile-shell.theme-aurora-mint {
  background:
    radial-gradient(circle at 80% 10%, rgba(120,255,210,.22), transparent 36%),
    linear-gradient(135deg, rgba(18,90,78,.42), rgba(8,20,24,.96));
}
.player-profile-shell.theme-void-purple {
  background:
    radial-gradient(circle at 28% 78%, rgba(168,96,255,.26), transparent 40%),
    linear-gradient(135deg, rgba(54,20,100,.52), rgba(12,8,22,.97));
}
.player-profile-shell.theme-solar-gold {
  background:
    radial-gradient(circle at 70% 22%, rgba(255,196,84,.24), transparent 34%),
    linear-gradient(135deg, rgba(124,72,12,.48), rgba(22,14,8,.96));
}
.player-profile-shell.theme-ice-blue {
  background:
    radial-gradient(circle at 18% 28%, rgba(140,210,255,.22), transparent 38%),
    linear-gradient(135deg, rgba(22,72,120,.46), rgba(8,14,28,.97));
}

.player-profile-shell.theme-neon-cyber .player-tag { border-color: rgba(57,255,208,.35); color: #9ff7e4; }
.player-profile-shell.theme-aurora-mint .player-tag { border-color: rgba(125,255,200,.35); color: #b8ffe2; }
.player-profile-shell.theme-void-purple .player-tag { border-color: rgba(181,123,255,.35); color: #ddc4ff; }
.player-profile-shell.theme-solar-gold .player-tag { border-color: rgba(255,196,90,.35); color: #ffe0a3; }
.player-profile-shell.theme-ice-blue .player-tag { border-color: rgba(142,210,255,.35); color: #c9e9ff; }

.player-profile-live-preview {
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 126px;
  padding: 12px;
  background: rgba(0,0,0,.18);
}
.player-profile-live-preview .player-profile-shell {
  min-height: 102px;
  padding: 12px;
  border-radius: 14px;
}
.player-profile-live-preview .player-profile-hero {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.player-profile-live-preview .player-profile-main {
  grid-template-columns: auto 1fr;
  gap: 12px;
  border: 0;
  padding: 0;
}
.player-profile-live-preview .player-profile-avatar,
.player-profile-live-preview .player-profile-avatar .player-avatar,
.player-profile-live-preview .player-profile-avatar .player-avatar-preset {
  width: 62px !important;
  height: 62px !important;
}
.player-profile-live-preview .player-profile-heading h2 { font-size: 18px; }
.player-profile-live-preview .player-profile-counts,
.player-profile-live-preview .player-profile-subtitle { display: none; }

@media (max-width: 680px) {
  .player-profile-shell { padding: 16px; }
  .player-profile-hero { margin: 0 0 14px; padding: 14px 12px; }
  .player-profile-main { grid-template-columns: auto minmax(0, 1fr); }
  .player-profile-counts { grid-column: 1 / -1; justify-content: flex-start; }
  .player-profile-body { grid-template-columns: 1fr; }
  .player-timeline li { grid-template-columns: 1fr; gap: 4px; }
}


/* ===== Exchange inventory-first cards (QQ-like share readability) ===== */
.exchange-item-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.exchange-item-icon-tile {
  display: grid;
  gap: 4px;
  min-width: 0;
  justify-items: center;
  text-align: center;
}
.exchange-item-icon-media {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(120, 180, 230, .22);
  background:
    radial-gradient(circle at 30% 25%, rgba(90,150,220,.18), transparent 50%),
    linear-gradient(160deg, rgba(12,20,34,.96), rgba(6,10,18,.98));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
.exchange-item-icon-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.exchange-item-icon-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #8eb7d2;
  font-weight: 800;
  font-size: 22px;
}
.exchange-item-icon-media b {
  position: absolute;
  right: 3px;
  bottom: 3px;
  min-width: 24px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font: 800 10px/1.4 var(--font-mono);
  text-align: center;
}
.exchange-item-icon-tile strong {
  max-width: 72px;
  color: #d8e8f5;
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exchange-item-icon-tile small {
  max-width: 72px;
  color: #ffd27a;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exchange-item-icon-more {
  display: grid;
  place-items: center;
  min-height: 64px;
  border-radius: 12px;
  border: 1px dashed rgba(120,180,230,.28);
  color: #8eb7d2;
  font-weight: 800;
  font-size: 14px;
}
.exchange-item-icon-empty {
  color: var(--text-tertiary);
  font-size: 12px;
  padding: 8px 0;
}
.exchange-inventory-panel {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(93,174,229,.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 50%),
    rgba(5,12,24,.55);
}
.exchange-inventory-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.exchange-inventory-head strong {
  color: #ffb86c;
  font-size: 14px;
  letter-spacing: .04em;
}
.exchange-post-card.is-buy .exchange-inventory-head strong { color: #55e0ad; }
.exchange-inventory-head span {
  color: var(--text-tertiary);
  font-size: 11px;
}
.exchange-post-item-identity {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.exchange-item-detail-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(120,180,230,.2);
  background: rgba(8,14,24,.9);
}
.exchange-item-detail-icon.is-fallback {
  display: grid;
  place-items: center;
  color: #8eb7d2;
  font-weight: 800;
  font-size: 18px;
}
.exchange-topic-result-main .exchange-item-icon-grid {
  margin: 6px 0 4px;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
}
.exchange-topic-result-main .exchange-item-icon-media {
  width: 52px;
  height: 52px;
  border-radius: 10px;
}
.exchange-topic-result-main .exchange-item-icon-tile strong {
  max-width: 58px;
  font-size: 10px;
}
.exchange-topic-result {
  align-items: start;
}
.exchange-share-status {
  min-height: 16px;
  color: var(--text-tertiary);
  font-size: 11px;
}

@media (max-width: 900px) {
  .exchange-item-icon-grid {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  }
}

/* market/lp/wormhole polish */
.tools-market-type-panel {
  margin-bottom: 12px;
}
.tools-market-type-panel-head {
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
  color: var(--muted);
  font-size: 12px;
}
.tools-market-types {
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow:auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tools-market-type-row {
  width: 100%;
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--line);
  border-radius:10px;
  background: rgba(255,255,255,.03);
  color: var(--text);
  padding: 8px 10px;
  cursor:pointer;
  text-align:left;
}
.tools-market-type-row small { color: var(--muted); margin-left:auto; }
.tools-market-type-row.is-selected,
.tools-market-type-row:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: rgba(56,132,255,.12);
}
.tools-market-item-stats {
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  margin-top:6px;
  color: var(--muted);
  font-size: 12px;
}
.tools-market-item-stats b { color: var(--text); }
.tools-lp-summary-bar {
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:10px;
  color: var(--muted);
  font-size: 12px;
}
.tools-lp-reward-text b { color: #f0a35a; }
.tools-wormhole-side .tools-wormhole-filters {
  display:grid;
  gap:10px;
}
.tools-wormhole-planet-filters {
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px;
  display:flex;
  flex-wrap:wrap;
  gap:6px 10px;
  margin:0;
}
.tools-wormhole-planet-filters legend {
  width:100%;
  padding: 0 4px;
  margin-bottom:4px;
  color: var(--muted);
  font-size: 12px;
}
.tools-wormhole-planet-filters label {
  display:inline-flex;
  align-items:center;
  gap:6px;
  color: var(--text);
  font-size: 13px;
  white-space:nowrap;
  line-height:1.4;
}
.tools-wormhole-planet-filters input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
}
.tools-wormhole-table-scroll {
  overflow:auto;
  max-height: min(70vh, 820px);
}
.tools-wh-name {
  color: #ff9a4d;
  font-weight: 700;
}
.tools-wh-static {
  display:inline-flex;
  gap:4px;
  align-items:baseline;
  margin-right:8px;
  color: #5ec2ff;
}
.tools-wh-static small { color: var(--muted); }
.tools-wh-planet {
  display:inline-flex;
  margin-right:6px;
  padding: 2px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  color: var(--text);
  font-size: 12px;
}
.tools-wormhole-pager {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  margin-top:12px;
  color: var(--muted);
}
.tools-lp-corps {
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:2px;
}


.tools-wormhole-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tools-wormhole-table th,
.tools-wormhole-table td {
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--line, #243148) 88%, transparent);
  vertical-align: top;
}
.tools-wormhole-table th {
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--panel, #0f1726) 92%, #000 8%);
  z-index: 1;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.tools-wormhole-table tbody tr:hover {
  background: color-mix(in srgb, var(--hud-accent, #6ecbff) 8%, transparent);
}
.tools-market-side.tools-wormhole-side {
  min-width: 280px;
}
.tools-wormhole-filters {
  display: grid;
  gap: 10px;
}
.tools-wormhole-filters > label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.tools-wormhole-filters input,
.tools-wormhole-filters select {
  width: 100%;
}
.tools-wormhole-planet-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
.tools-wormhole-planet-filters legend {
  width: 100%;
  padding: 0 4px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}
.tools-wormhole-planet-filters label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  line-height: 1.4;
}
.tools-wormhole-planet-filters input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
}


.tools-lp-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.tools-lp-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.tools-lp-pager {
  margin-top: 12px;
}
.pvp-bounty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.pvp-bounty-share-status {
  min-height: 18px;
  margin-top: 6px;
  color: var(--hud-success, #35dc98);
  font-size: 12px;
}
.pvp-bounty-share-status.is-error {
  color: var(--hud-error, #ff6b7a);
}


.pvp-suggest-wrap { position: relative; width: 100%; }
.pvp-suggest {
  position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px);
  display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow: auto;
  padding: 6px; border-radius: 10px; border: 1px solid rgba(255, 120, 140, 0.28);
  background: rgba(10, 12, 22, 0.97); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
}
.pvp-suggest[hidden] { display: none !important; }
.pvp-suggest-item {
  display: grid; gap: 2px; width: 100%; text-align: left; border: 0; border-radius: 8px;
  background: transparent; color: var(--text, #eaf6ff); padding: 8px 10px; cursor: pointer;
}
.pvp-suggest-item:hover, .pvp-suggest-item:focus { background: rgba(255, 110, 130, 0.12); }
.pvp-suggest-item strong { font-size: 14px; }
.pvp-suggest-item span, .pvp-suggest-item.is-empty { color: var(--muted, #9db0c9); font-size: 12px; }
.pvp-suggest-item.is-empty { cursor: default; }
.pvp-bounty-actions .is-danger {
  color: var(--hud-error, #ff6b7a);
  border-color: color-mix(in srgb, var(--hud-error, #ff6b7a) 45%, transparent);
}



/* Bounty card highlight for deep-link landing */
.pvp-bounty-card.is-highlighted {
  animation: bounty-highlight 4s ease-out;
  border-color: var(--accent, #6ecbff) !important;
  box-shadow: 0 0 24px rgba(110, 203, 255, 0.4);
}
@keyframes bounty-highlight {
  0% { background: rgba(110, 203, 255, 0.15); }
  100% { background: transparent; }
}

/* Market center price history */
.tools-price-history {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.16);
}
.tools-price-history-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.tools-price-history-head span { color: var(--muted); font-size: 12px; }
.tools-price-history-chart svg {
  width: 100%;
  height: 84px;
  display: block;
  background: rgba(8,12,20,.45);
  border-radius: 10px;
}
.tools-price-history-chart-kline svg.tools-price-kline,
.tools-price-history-chart.tools-price-history-chart-kline svg {
  height: auto;
  min-height: 268px;
  background: transparent;
}
.tools-price-kline .kline-bg {
  fill: rgba(8, 12, 20, 0.72);
}
.tools-price-kline .kline-grid {
  stroke: rgba(120, 150, 190, 0.12);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.tools-price-kline .kline-axis-line {
  stroke: rgba(140, 170, 210, 0.22);
  stroke-width: 1;
}
.tools-price-kline .kline-axis {
  fill: var(--muted);
  font-size: 11px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.tools-price-kline .kline-volume-label {
  font-size: 10px;
  opacity: 0.85;
}
.tools-price-kline .kline-candle.up line,
.tools-price-kline .kline-volume.up rect {
  stroke: #2fd67b;
  fill: rgba(47, 214, 123, 0.82);
}
.tools-price-kline .kline-candle.up rect {
  fill: rgba(47, 214, 123, 0.88);
  stroke: #2fd67b;
}
.tools-price-kline .kline-candle.down line,
.tools-price-kline .kline-volume.down rect {
  stroke: #ff5d73;
  fill: rgba(255, 93, 115, 0.78);
}
.tools-price-kline .kline-candle.down rect {
  fill: rgba(255, 93, 115, 0.88);
  stroke: #ff5d73;
}
.tools-price-kline .kline-candle line {
  stroke-width: 1.4;
}
.tools-price-kline .kline-candle rect {
  stroke-width: 1;
}
.tools-price-kline .kline-buy-line {
  stroke: var(--hud-gold);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: 0.95;
}
.tools-price-kline .kline-buy-dot {
  fill: var(--hud-gold);
}
.tools-price-history-legend {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}
.tools-price-history-legend .sell::before,
.tools-price-history-legend .sell-k::before,
.tools-price-history-legend .buy::before,
.tools-price-history-legend .volume::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
}
.tools-price-history-legend .sell::before { background: var(--accent); }
.tools-price-history-legend .sell-k::before {
  border-radius: 2px;
  background: linear-gradient(180deg, #2fd67b 0 50%, #ff5d73 50% 100%);
}
.tools-price-history-legend .buy::before { background: var(--hud-gold); }
.tools-price-history-legend .volume::before {
  border-radius: 2px;
  background: rgba(140, 170, 210, 0.45);
}
.tools-wh-suitability,
.tools-wh-effect { font-size: 12px; line-height: 1.45; }
.tools-wh-effect { color: var(--muted); max-width: 220px; }

/* ===== KM 详情页（自 killmail-detail.mjs 内联样式迁入，类名均为 km- 前缀） ===== */
.km-report-shell{padding:18px 28px 34px;max-width:1500px;margin:0 auto}
.km-report-title{display:flex;align-items:baseline;gap:16px;margin:4px 0 16px}
.km-report-title h1{margin:0;font-family:var(--font-display);font-size:42px;line-height:1;font-weight:900;color:var(--text-primary);letter-spacing:0}
.km-source-pill{display:inline-flex;align-items:center;gap:8px;padding:5px 10px;border:1px solid rgba(0,180,255,.36);border-radius:999px;background:rgba(0,180,255,.08);color:var(--hud-accent);font-size:13px;font-weight:800}
.km-source-pill span{color:var(--text-tertiary);font-family:var(--font-mono);font-weight:700}
.km-hero-grid{display:grid;grid-template-columns:minmax(340px,440px) minmax(520px,1fr);gap:28px;align-items:start}
.km-left-stack{display:flex;flex-direction:column;gap:16px}
.km-victim-card{background:var(--panel-2);border:1px solid var(--panel-border);border-radius:8px;padding:24px;box-shadow:0 20px 60px color-mix(in srgb,var(--text-primary) 12%,transparent)}
.km-victim-top{display:grid;grid-template-columns:128px 1fr;gap:18px;align-items:center;margin-bottom:22px}
.km-portrait{width:128px;height:128px;background:var(--hud-input-bg);border:1px solid var(--panel-border);overflow:hidden;display:grid;place-items:center;color:var(--text-tertiary);font:700 13px var(--font-mono)}
.km-portrait img{width:100%;height:100%;object-fit:cover;display:block}
.km-victim-name{font-size:18px;font-weight:800;color:var(--hud-accent);margin:5px 0 8px;line-height:1.2}
.km-id-link{color:var(--hud-accent);font-family:var(--font-mono);text-decoration:underline;text-underline-offset:3px}
.km-stat-row{display:grid;grid-template-columns:116px 1fr;gap:12px;padding:8px 0;color:var(--text-secondary);font-size:17px;line-height:1.25}
.km-stat-row span:first-child{color:var(--text-tertiary);font-weight:800}
.km-stat-row strong{color:var(--text-primary);font-weight:800}
.km-stat-row a{color:var(--hud-accent);text-decoration:underline;text-underline-offset:3px}
.km-fitting-stage{min-height:620px;position:relative;padding:12px 0 0}
.km-fit-wheel{position:relative;width:min(620px,70vw);aspect-ratio:1;margin:0 auto 14px;border-radius:50%;background:radial-gradient(circle at center,rgba(170,28,20,.28) 0 31%,rgba(10,27,29,.94) 32% 66%,transparent 67%);border:10px solid rgba(210,215,218,.72);box-shadow:inset 0 0 0 4px rgba(255,255,255,.12),0 0 46px rgba(0,0,0,.55)}
.km-fit-wheel:before{content:"";position:absolute;inset:17%;border-radius:50%;border:6px solid rgba(230,230,230,.55);box-shadow:0 0 0 1px rgba(255,255,255,.12)}
.km-fit-wheel:after{content:"";position:absolute;left:50%;bottom:-10px;width:72px;height:54px;transform:translateX(-50%);background:rgba(12,23,26,.96);border-left:7px solid rgba(210,215,218,.68);border-right:7px solid rgba(210,215,218,.68);clip-path:polygon(0 0,100% 0,72% 100%,28% 100%);z-index:1}
.km-ship-render{position:absolute;inset:27%;border-radius:50%;overflow:hidden;z-index:2;background:radial-gradient(circle,rgba(140,35,30,.42),rgba(8,8,10,.72));display:grid;place-items:center;color:var(--text-tertiary);font:800 18px var(--font-mono)}
.km-ship-render img{width:116%;height:116%;object-fit:contain;filter:drop-shadow(0 12px 18px rgba(0,0,0,.65))}
.km-slot{--x:50%;--y:50%;position:absolute;left:var(--x);top:var(--y);width:54px;height:54px;transform:translate(-50%,-50%) rotate(var(--rot));z-index:4;border:2px solid rgba(220,226,230,.55);background:rgba(8,12,14,.92);display:grid;place-items:center;box-shadow:0 6px 18px rgba(0,0,0,.5)}
.km-slot img{width:42px;height:42px;object-fit:contain;transform:rotate(calc(-1 * var(--rot)))}
.km-slot[data-fallback]:before{content:attr(data-fallback);font:800 10px var(--font-mono);color:var(--text-tertiary);transform:rotate(calc(-1 * var(--rot)))}
.km-slot-state{position:absolute;left:-6px;bottom:-6px;width:18px;height:18px;border-radius:50%;background:#c8322a;border:2px solid rgba(0,0,0,.75);transform:rotate(calc(-1 * var(--rot)))}
.km-slot-state:before,.km-slot-state:after{content:"";position:absolute;left:8px;top:3px;width:2px;height:12px;background:#111;border-radius:2px}
.km-slot-state:before{transform:rotate(45deg)}.km-slot-state:after{transform:rotate(-45deg)}
.km-slot.dropped .km-slot-state{background:#2ed36f}.km-slot.dropped .km-slot-state:before{left:6px;top:2px;width:4px;height:10px;border:solid #06120a;border-width:0 3px 3px 0;background:transparent;transform:rotate(45deg)}.km-slot.dropped .km-slot-state:after{display:none}
.km-slot-region{position:absolute;z-index:3;transform:translate(-50%,-50%);padding:3px 8px;border:1px solid color-mix(in srgb,var(--hud-accent) 32%,transparent);border-radius:999px;background:rgba(5,12,18,.82);color:var(--text-tertiary);font:800 10px var(--font-mono);letter-spacing:.08em;pointer-events:none}
.km-slot-region.high{left:50%;top:3%}.km-slot-region.mid{left:94%;top:51%}.km-slot-region.low{left:6%;top:51%}.km-slot-region.rig{left:69%;top:93%}.km-slot-region.subsystem{left:31%;top:93%}
.km-estimate{border-top:1px solid rgba(255,255,255,.12);padding-top:22px;margin-top:10px}
.km-section-title{display:flex;align-items:baseline;gap:16px;margin:0 0 12px}
.km-section-title h2{margin:0;font-family:var(--font-display);font-size:34px;line-height:1;font-weight:900;color:var(--text-primary);letter-spacing:0}
.km-section-title a{color:var(--hud-accent);font-size:18px;font-weight:800;text-decoration:underline;text-underline-offset:4px}
.km-fit-table{display:grid;gap:16px;grid-template-columns:repeat(2,minmax(0,1fr))}
.km-fit-group{background:var(--panel-2);border:1px solid var(--panel-border);border-radius:8px;overflow:hidden}
.km-fit-group-head{display:grid;grid-template-columns:1fr 90px 130px;gap:10px;padding:8px 12px;background:var(--hud-brand-a06);color:var(--text-primary);font-size:13px;font-weight:800}
.km-fit-row{display:grid;grid-template-columns:32px 1fr 90px 130px;gap:10px;align-items:center;padding:7px 12px;border-top:1px solid var(--line);font-size:12px;color:var(--text-secondary)}
.km-fit-row img{width:28px;height:28px;object-fit:contain;background:var(--hud-input-bg);border:1px solid var(--panel-border)}
.km-fit-row .name{color:var(--text-primary);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.km-fit-row .qty,.km-fit-row .price{font-family:var(--font-mono);text-align:right}
.km-fit-row.dropped{background:color-mix(in srgb,var(--hud-success) 12%,transparent)}.km-fit-row.destroyed{background:color-mix(in srgb,var(--hud-error) 8%,transparent)}
.km-attackers-card{padding:22px 24px}
.km-attackers-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:12px}
.km-attackers-list{display:flex;flex-direction:column;gap:8px;max-height:520px;overflow:auto}
.km-attacker-row{display:grid;grid-template-columns:26px 1fr;gap:10px;padding:11px 12px;border-radius:8px;background:var(--hud-brand-a03);border:1px solid var(--line);border-left:2px solid transparent}
.km-attacker-row.final{background:rgba(255,149,0,.08);border-left-color:var(--hud-gold)}
.km-attacker-rank{font-family:var(--font-mono);font-size:13px;color:var(--text-tertiary);text-align:center;padding-top:2px}
.km-attacker-name{display:flex;align-items:center;gap:7px;flex-wrap:wrap;font-size:14px;font-weight:800;color:var(--text-primary)}
.km-final-badge{padding:2px 7px;border-radius:4px;background:var(--hud-gold);color:#000;font-size:11px;font-weight:900}
.km-attacker-meta{font-size:12px;color:var(--text-tertiary);margin-top:4px;display:flex;gap:8px;flex-wrap:wrap;line-height:1.4}
.km-damage-line{margin-top:8px;display:grid;grid-template-columns:1fr auto auto;gap:8px;align-items:center}
.km-damage-track{height:7px;background:var(--hud-brand-a10);border-radius:999px;overflow:hidden}
.km-damage-fill{height:100%;border-radius:999px;background:var(--hud-accent)}
.km-attacker-row.final .km-damage-fill{background:var(--hud-gold)}
.km-damage-value{font-family:var(--font-mono);font-size:12px;color:var(--text-secondary)}
.km-damage-pct{font-family:var(--font-mono);font-size:11px;color:var(--text-tertiary)}
@media (max-width:980px){.km-report-shell{padding:14px}.km-report-title{flex-wrap:wrap}.km-report-title h1{font-size:32px}.km-hero-grid{grid-template-columns:1fr}.km-fit-wheel{width:min(92vw,560px)}.km-fit-table{grid-template-columns:1fr}.km-victim-top{grid-template-columns:96px 1fr}.km-portrait{width:96px;height:96px}.km-stat-row{grid-template-columns:88px 1fr;font-size:14px}}

/* 开明任务台的最终窄屏覆盖必须位于所有历史响应式规则之后。 */
@media (max-width: 520px) {
  .floating-chat:not(.is-closed),
  .assistant-rail.is-expanded {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .floating-chat:not(.is-closed) {
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
  }
  .assistant-open .assistant-launcher {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);
  }
  .assistant-rail.is-expanded .assistant-body {
    display: flex;
  }
  .assistant-rail.is-expanded .assistant-inspector {
    display: none;
  }
  .assistant-live-status {
    grid-template-columns: 8px minmax(0, 1fr);
  }
  .assistant-live-status small {
    grid-column: 2;
  }
  .assistant-icon-btn {
    width: 44px;
    height: 44px;
  }
  .ask-box {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .ask-upload-btn,
  .ask-send-btn {
    width: 44px;
    height: 44px;
  }
  .ask-privacy-row .ask-disclaimer {
    display: none;
  }
}
