: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);
  --bg-2: var(--hud-deep-2);
  --bg-glow-1: var(--hud-brand-a06);
  --bg-glow-2: var(--hud-brand-a03);
  --grid-line: var(--hud-brand-a03);
  --panel: var(--hud-panel-bg);
  --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);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  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;
}

/* 隐约网格线，营造星图坐标感 */
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;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1500px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.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,
.floating-chat {
  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.01em;
}

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;
}

.assistant-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 39;
  width: 64px;
  height: 56px;
  border: 1px solid var(--line-red);
  border-radius: 999px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(185, 21, 46, 0.95), rgba(18, 22, 31, 0.98));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  font-weight: 900;
  cursor: pointer;
}

.floating-chat {
  position: fixed;
  right: 22px;
  bottom: 88px;
  z-index: 40;
  width: min(420px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 132px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.floating-chat.is-closed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
}

.chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 67, 91, 0.08);
}

.chat-close {
  flex: none;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 0 9px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
  cursor: pointer;
}

.chat-log {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  overflow: auto;
}

.message {
  display: grid;
  gap: 6px;
  max-width: 92%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.message.user {
  justify-self: end;
  border-color: rgba(99, 214, 232, 0.35);
  background: rgba(99, 214, 232, 0.09);
}

.message.pending {
  opacity: 0.72;
}

.message strong {
  font-size: 14px;
}

.message p {
  color: var(--soft);
  font-size: 14px;
}

.message small {
  color: var(--muted);
  line-height: 1.5;
}

.message-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.message-actions a {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}

.ask-box {
  padding: 12px;
  border-top: 1px solid var(--line);
}
.ask-box .ask-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ask-box input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
  outline: none;
}
.ask-box input:focus { border-color: var(--cyan); }
.ask-box button,
.prompt-row button {
  min-height: 42px;
  border: 1px solid var(--line-red);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(185, 21, 46, 0.42);
  cursor: pointer;
}

.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-images {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 0 8px 0;
  grid-column: 1 / -1;
}
.ask-images:empty { display: none; }
.ask-image-preview {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--line);
  background: rgba(0,0,0,0.3);
  flex-shrink: 0;
}
.ask-image-preview:hover { border-color: var(--accent); }
.ask-image-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.ask-image-remove {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 14px;
  line-height: 18px;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.ask-image-preview:hover .ask-image-remove { opacity: 1; }

/* 输入行：输入框 + 上传按钮 + 发送按钮 */
.ask-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  grid-column: 1 / -1;
}
.ask-input-row input {
  flex: 1;
  min-width: 0;
}
.ask-upload-btn {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 20px;
  font-weight: 300;
  transition: border-color 0.15s, color 0.15s;
  line-height: 1;
}
.ask-upload-btn:hover { border-color: var(--accent); color: var(--accent); }

/* 工具页 tabs */
.tools-tabs {
  display: flex;
  gap: 0;
  margin-top: 8px;
  border-bottom: 1px solid var(--line);
}
.tools-tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tools-tab:hover { color: var(--soft); }
.tools-tab.active {
  color: var(--accent);
  border-bottom-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,
  .floating-chat {
    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;
  }

  .chat-log {
    max-height: 430px;
  }

  .floating-chat {
    right: 10px;
    bottom: 76px;
    width: calc(100vw - 20px);
    height: min(560px, calc(100vh - 104px));
  }

  .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.8rem 1.6rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
  letter-spacing: 0.02em;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.ws-tab:hover { color: var(--soft); }
.ws-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  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;
}

/* ============ 跑马灯 ============ */
.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 8s 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;
}
@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 {
  background: var(--hud-panel-bg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  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(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hud-brand-a12);
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}
.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-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: var(--hud-accent);
  background: var(--hud-brand-a12);
}
.nav-bar .nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- 按钮 --- */
.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;
}
.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.015em;
  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) {
  .v2-grid-3 { grid-template-columns: 1fr; }
  .v2-grid-main-sidebar { grid-template-columns: 1fr; }
  .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-input-row { flex-wrap: wrap; }
  .hero-command-send { width: 100%; }
  .hero-command-panel { max-width: 100%; }
  .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: 480px) {
  .hero-stats-side {
    flex-direction: column;
  }
  .hero-command-chips { gap: 6px; }
  .hud-chip { font-size: 12px; padding: 6px 10px; }
}
