/* ===== 设计变量 ===== */
:root {
  /* 深色主题（默认） */
  --bg-primary: #0b0f17;
  --bg-secondary: #111723;
  --bg-tertiary: #18202e;
  --bg-elevated: #1c2535;
  --bg-hover: rgba(148, 163, 184, 0.08);

  --border-primary: #232c3b;
  --border-secondary: #334155;
  --border-accent: #3b82f6;

  --text-primary: #e8edf5;
  --text-secondary: #9aa8bc;
  --text-muted: #6b7a90;

  --accent-primary: #4f8ff7;
  --accent-hover: #3b7bec;
  --accent-soft: rgba(79, 143, 247, 0.12);
  --accent-ring: rgba(79, 143, 247, 0.35);

  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;

  --sell-color: #f87171;
  --buy-color: #34d399;
  --sell-soft: rgba(248, 113, 113, 0.1);
  --buy-soft: rgba(52, 211, 153, 0.1);
  --violet: #a78bfa;


  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.25);
  --shadow-md: 0 4px 12px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 12px 32px rgb(0 0 0 / 0.4);

  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  --header-h: 56px;
  --sidebar-w: 320px;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f3f7;
  --bg-elevated: #ffffff;
  --bg-hover: rgba(15, 23, 42, 0.05);

  --border-primary: #e3e8ef;
  --border-secondary: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #7b8798;

  --accent-primary: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --accent-ring: rgba(37, 99, 235, 0.3);

  --sell-color: #dc2626;
  --buy-color: #059669;
  --sell-soft: rgba(220, 38, 38, 0.06);
  --buy-soft: rgba(5, 150, 105, 0.07);
  --violet: #7c3aed;


  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06);
  --shadow-md: 0 4px 12px rgb(15 23 42 / 0.08);
  --shadow-lg: 0 12px 32px rgb(15 23 42 / 0.14);

  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button { cursor: pointer; user-select: none; }
button:disabled { cursor: not-allowed; opacity: 0.6; }

a { color: var(--accent-primary); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

kbd {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 0.35em;
  border: 1px solid var(--border-secondary);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75em;
  line-height: 1.5;
  text-align: center;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
}

mark {
  background: rgba(250, 204, 21, 0.28);
  color: inherit;
  border-radius: 2px;
}

.num { text-align: right; font-variant-numeric: tabular-nums; }
.up { color: var(--buy-color); }
.down { color: var(--sell-color); }

/* [hidden] 必须永远生效：类选择器的 display:flex/grid 会盖过浏览器内置规则 */
[hidden] { display: none !important; }

/* ===== 应用外壳：固定视口高度，各区域内部滚动 ===== */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-primary);
}

/* ===== 头部导航 ===== */
.app-header {
  height: var(--header-h);
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  padding: 0 var(--spacing-md);
  gap: var(--spacing-lg);
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  background: #0d1219;
  flex-shrink: 0;
}

.brand-icon img { width: 100%; height: 100%; display: block; }

.header-nav { display: flex; gap: 4px; flex: 1; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: color var(--transition-fast), background var(--transition-fast);
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-btn svg { width: 17px; height: 17px; flex: none; }
.nav-btn span { white-space: nowrap; }
.nav-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-btn.active { color: var(--accent-primary); background: var(--accent-soft); }

.header-actions { display: flex; align-items: center; gap: var(--spacing-sm); }

.server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

.server-status.offline .status-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); animation: none; }

@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: color var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
}

.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.icon-btn.api-link { width: auto; gap: 4px; padding: 0 10px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; text-decoration: none; border: 1px solid var(--border-primary); height: 30px; }
.icon-btn.api-link svg { width: 15px; height: 15px; }
.icon-btn.api-link:hover { color: var(--accent-primary); border-color: var(--accent-primary); }
@media (max-width: 768px) { .icon-btn.api-link { padding: 0 8px; } .icon-btn.api-link span { display: none; } }

.menu-btn { display: none; }

#themeToggle .icon-sun { display: none; }
[data-theme="light"] #themeToggle .icon-sun { display: block; }
[data-theme="light"] #themeToggle .icon-moon { display: none; }

/* ===== 主体布局 ===== */
.app-body {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
  background: var(--bg-primary);
}

.view-container {
  flex: 1;
  min-width: 0;
  display: flex;
  position: relative;
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--transition-base), border-color var(--transition-base);
}

/* 收起时真正让出宽度，而不是平移后留下空白 */
.sidebar.collapsed { width: 0; border-right-color: transparent; }
.sidebar.collapsed > * { visibility: hidden; }

.sidebar-header {
  padding: 12px;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: calc(var(--sidebar-w) - 1px);
}

.search-box {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 0 10px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box:focus-within { border-color: var(--border-accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.search-box:focus-within .search-kbd { display: none; }

.search-icon { width: 17px; height: 17px; color: var(--text-muted); flex-shrink: 0; }

.search-box input { flex: 1; min-width: 0; font-size: 0.875rem; height: 100%; }
.search-box input:focus-visible, .input-group input:focus-visible, .region-select:focus-visible { outline: none; }
.search-box input::placeholder { color: var(--text-muted); }

.collapse-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: color var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
}

.collapse-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.collapse-btn svg { width: 18px; height: 18px; }

.sidebar-tabs {
  display: flex;
  padding: 8px 12px;
  gap: 4px;
  min-width: calc(var(--sidebar-w) - 1px);
}

.tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.tab-btn.active { color: var(--accent-primary); background: var(--accent-soft); font-weight: 600; }

.tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.6875rem;
  line-height: 18px;
  font-weight: 600;
}

.sidebar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 8px;
  border-bottom: 1px solid var(--border-primary);
  min-width: calc(var(--sidebar-w) - 1px);
}

.sidebar-hint { font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.link-btn {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
}

.link-btn:hover { color: var(--accent-primary); background: var(--accent-soft); }

.sidebar-content {
  flex: 1;
  min-height: 0;
  position: relative;
  min-width: calc(var(--sidebar-w) - 1px);
}

.tab-pane {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: none;
}

.tab-pane.active { display: block; }

/* 目录树 */
.catalog-tree, .item-list { padding: 8px; }

.category-header {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.category-header:hover { color: var(--text-primary); background: var(--bg-hover); }

.category-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--transition-base);
}

.category.expanded > .category-header { color: var(--text-primary); }
.category.expanded > .category-header .category-chevron { transform: rotate(90deg); }

.category-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.category-count {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--bg-tertiary);
}

.category-items {
  display: none;
  margin-left: 14px;
  padding-left: 6px;
  border-left: 1px solid var(--border-primary);
}

.category.expanded > .category-items { display: block; }

.item-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  text-align: left;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.item-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

.item-btn.active,
.mini-item.active {
  color: var(--accent-primary);
  background: var(--accent-soft);
  font-weight: 600;
}

.item-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.search-summary { padding: 4px 8px 8px; font-size: 0.75rem; color: var(--text-muted); }

.search-hit { min-height: 44px; }
.search-hit img, .mini-item img { flex-shrink: 0; border-radius: 4px; background: var(--bg-tertiary); }
img.broken { opacity: 0; }

.hit-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.item-sub { font-size: 0.6875rem; color: var(--text-muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mini-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.mini-item:hover { background: var(--bg-hover); color: var(--text-primary); }

.mini-remove {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}

.mini-remove svg { width: 14px; height: 14px; }
.mini-item:hover .mini-remove, .mini-remove:focus-visible { opacity: 1; }
.mini-remove:hover { color: var(--danger); background: var(--sell-soft); }

.clear-recent { display: block; margin: 8px auto; }

/* 骨架屏 */
.skeleton-list { display: flex; flex-direction: column; gap: 10px; padding: 8px; }
.skeleton-list i {
  display: block;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.skeleton-list i:nth-child(odd) { width: 70%; }
.skeleton-list i:nth-child(3n) { width: 85%; }

@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* 移动端抽屉遮罩 */
.sidebar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 80;
  animation: fade-in var(--transition-base);
}

@keyframes fade-in { from { opacity: 0; } }

/* 侧栏收起后的展开把手（相对 .view-container 定位，不随内容滚动） */
.sidebar-reopen {
  position: absolute;
  top: 12px;
  left: 0;
  width: 22px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

.sidebar-reopen:hover { color: var(--accent-primary); width: 26px; }
.sidebar-reopen svg { width: 16px; height: 16px; }

/* ===== 主内容区域 ===== */
.main-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

/* 空状态 */
.empty-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: var(--spacing-xl) var(--spacing-md);
  text-align: center;
}

.empty-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--accent-primary);
  background: var(--accent-soft);
  margin-bottom: var(--spacing-lg);
}

.empty-icon { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent-primary) 6%, transparent), 0 10px 40px color-mix(in srgb, var(--accent-primary) 25%, transparent); }
.empty-icon svg { width: 34px; height: 34px; }
.empty-view h2 { font-size: 1.375rem; font-weight: 600; margin-bottom: 6px; }
.empty-view > p { color: var(--text-secondary); font-size: 0.875rem; }

.quick-picks { margin-top: var(--spacing-xl); max-width: 720px; width: 100%; }
.quick-title { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 10px; }
.quick-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px 0 8px;
  border: 1px solid var(--border-primary);
  border-radius: 999px;
  background: var(--bg-secondary);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.quick-chip img { border-radius: 4px; }
.quick-chip:hover { border-color: var(--accent-primary); color: var(--accent-primary); transform: translateY(-1px); }

/* 详情视图 */
.detail-view {
  padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-xl);
  max-width: 1480px;
  margin: 0 auto;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.item-info { display: flex; align-items: center; gap: var(--spacing-md); flex: 1; min-width: 0; }

.item-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  overflow: hidden;
  flex-shrink: 0;
}

.item-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-icon img.broken { visibility: hidden; }

.item-meta { flex: 1; min-width: 0; }

.item-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.item-breadcrumb .sep { opacity: 0.6; }

.detail-header h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 6px;
}

#itemName { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fav-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.fav-btn svg { width: 20px; height: 20px; fill: none; }
.fav-btn:hover { color: #f5b301; background: var(--bg-hover); }
.fav-btn.active { color: #f5b301; }
.fav-btn.active svg { fill: currentColor; }
.fav-btn:active { transform: scale(0.88); }

.item-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.tag-copy { transition: color var(--transition-fast), background var(--transition-fast); }
.tag-copy:hover { color: var(--accent-primary); background: var(--accent-soft); }

.detail-actions { display: flex; gap: var(--spacing-sm); align-items: center; flex-shrink: 0; }

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrap > svg {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.region-select {
  height: 38px;
  padding: 0 34px 0 32px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  min-width: 170px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237b8798' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.region-select:hover { border-color: var(--border-secondary); }
.region-select:focus { border-color: var(--border-accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.region-select option { background: var(--bg-secondary); color: var(--text-primary); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}

.btn:hover:not(:disabled) { background: var(--bg-tertiary); border-color: var(--border-secondary); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--sell-soft); border-color: var(--danger); }

.btn-block { width: 100%; }

.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 指标卡片：市场统计 / 资产估值共用 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: var(--spacing-lg);
}

.stat-card,
.valuation-card {
  --tone: var(--accent-primary);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
  padding: 16px 18px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

button.stat-card:hover {
  border-color: color-mix(in srgb, var(--tone) 50%, var(--border-primary));
  box-shadow: var(--shadow-md);
}

.stat-card.sell, .valuation-card.is-sell { --tone: var(--sell-color); }
.stat-card.buy, .valuation-card.is-buy { --tone: var(--buy-color); }
.tone-amber { --tone: var(--warning); }
.tone-violet, .valuation-card.is-total { --tone: var(--violet); }
.valuation-card.is-order { --tone: var(--warning); }

.stat-label,
.valuation-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.stat-label::before,
.valuation-label::before {
  content: '';
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 2px;
  background: var(--tone);
}

.stat-value,
.valuation-value {
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.valuation-value { font-size: 1.3rem; }

.unit {
  margin-left: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-muted);
}

.stat-card.sell .stat-value, .valuation-card.is-sell .valuation-value { color: var(--sell-color); }
.stat-card.buy .stat-value, .valuation-card.is-buy .valuation-value { color: var(--buy-color); }

/* 数值与说明之间用细分隔线，卡片结构更清楚 */
.stat-meta,
.valuation-detail {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-primary);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.stat-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 卡片里的迷你图：成交量柱 / 均价走势线 */
/* 放在标签行右侧，不与数值和说明文字重叠 */
.sparkline {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30%;
  max-width: 96px;
  height: 22px;
  opacity: 0.9;
  overflow: visible;
  pointer-events: none;
}
.sparkline .spark-line { fill: none; stroke: var(--tone); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.sparkline .spark-area { fill: color-mix(in srgb, var(--tone) 16%, transparent); stroke: none; }
.sparkline .spark-bar { fill: color-mix(in srgb, var(--tone) 45%, transparent); }
.sparkline .spark-bar.last { fill: var(--tone); }

/* 加载态：数值骨架 + 表格淡出，保留布局不跳动 */
.is-loading .sparkline { opacity: 0.2; }
.is-loading .stat-value {
  color: transparent !important;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  max-width: 70%;
}

.is-loading .tabs-content { opacity: 0.45; pointer-events: none; transition: opacity var(--transition-base); }

/* 内容标签页 */
.content-tabs {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tabs-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-primary);
  padding: 0 12px;
  gap: 4px;
  min-height: 48px;
  flex-wrap: wrap;
}

.tab-link {
  position: relative;
  height: 48px;
  padding: 0 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.tab-link:hover { color: var(--text-primary); }
.tab-link.active { color: var(--accent-primary); }

.tab-link.active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-primary);
}

.tabs-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 6px 0; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.toggle input {
  appearance: none;
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: var(--border-secondary);
  position: relative;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.toggle input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--transition-fast);
}

.toggle input:checked { background: var(--accent-primary); }
.toggle input:checked::after { transform: translateX(14px); }
.toggle input:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }

.segmented {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
}

.segmented button {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.segmented button:hover { color: var(--text-primary); }
.segmented button.active { background: var(--bg-secondary); color: var(--text-primary); box-shadow: var(--shadow-sm); font-weight: 600; }

.tabs-content { padding: var(--spacing-md); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fade-in var(--transition-base); }

/* 订单区域 */
.orders-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-md);
}

.orders-section {
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-width: 0;
}

.orders-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.sell-orders .orders-header { background: var(--sell-soft); }
.buy-orders .orders-header { background: var(--buy-soft); }

.orders-header h3 { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; font-weight: 600; }

.dot { width: 8px; height: 8px; border-radius: 50%; }
.sell-dot { background: var(--sell-color); }
.buy-dot { background: var(--buy-color); }

.count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  padding: 0 7px;
  border-radius: 9px;
  background: var(--bg-tertiary);
}

.orders-subtitle { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }

.orders-table {
  height: min(520px, calc(100dvh - 360px));
  min-height: 280px;
  overflow: auto;
}

/* 表格样式 */
table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }

thead th {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 2;
  text-align: left;
  padding: 8px 12px;
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-primary);
  white-space: nowrap;
}

thead th.num { text-align: right; }

th.sortable { cursor: pointer; user-select: none; transition: color var(--transition-fast); }
th.sortable:hover { color: var(--text-primary); }
th.sortable::after { content: '⇅'; margin-left: 4px; opacity: 0.35; font-size: 0.7rem; }
th.sortable.sorted { color: var(--accent-primary); }
th.sortable.sorted[data-dir="asc"]::after { content: '↑'; opacity: 1; }
th.sortable.sorted[data-dir="desc"]::after { content: '↓'; opacity: 1; }

td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-primary);
  white-space: nowrap;
}

tbody tr { transition: background var(--transition-fast); }
tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }

td.muted { color: var(--text-secondary); }

.orders-table tbody tr[data-price] { cursor: copy; }
.orders-table td.price { font-weight: 600; }
.sell-orders td.price { color: var(--sell-color); }
.buy-orders td.price { color: var(--buy-color); }
.sell-orders tr.best { background: var(--sell-soft); }
.buy-orders tr.best { background: var(--buy-soft); }
.sell-orders tr.best td:first-child { box-shadow: inset 3px 0 0 var(--sell-color); }
.buy-orders tr.best td:first-child { box-shadow: inset 3px 0 0 var(--buy-color); }

td.loc {
  max-width: 0;
  width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}

.loc-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 0.6875rem;
  line-height: 18px;
  color: var(--accent-primary);
  background: var(--accent-soft);
  vertical-align: 1px;
}
.loc-badge.is-player { color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }

.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: var(--spacing-xl) 0;
}

/* 历史数据表格 */
.history-table {
  max-height: calc(100dvh - 320px);
  min-height: 300px;
  overflow: auto;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
}

/* 图表容器 */
.chart-container { height: clamp(320px, calc(100dvh - 380px), 560px); position: relative; }

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== 个人中心 ===== */
.profile-scroll { flex: 1; min-width: 0; overflow-y: auto; }

.profile-container {
  padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-xl);
  max-width: 1240px;
  margin: 0 auto;
}

.profile-sidebar { --sidebar-w: 280px; }
.profile-sidebar-header { justify-content: space-between; min-height: 63px; }
.profile-sidebar-title { color: var(--text-primary); font-size: 0.9375rem; font-weight: 600; padding-left: 4px; }
.profile-sidebar-content { overflow-y: auto; }
.profile-nav { display: flex; flex-direction: column; gap: 2px; padding: 10px; }

.profile-nav-btn, .profile-nav-station {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-align: left;
  font-size: 0.875rem;
  transition: color var(--transition-fast), background var(--transition-fast);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-nav-btn:hover, .profile-nav-station:hover { color: var(--text-primary); background: var(--bg-hover); }
.profile-nav-btn.active, .profile-nav-station.active { color: var(--accent-primary); background: var(--accent-soft); font-weight: 600; }
.profile-nav-group { margin: 6px 0 4px; padding: 6px 0; border-top: 1px solid var(--border-primary); border-bottom: 1px solid var(--border-primary); }

/* 「空间站资产」分组：与市场目录树一致的折叠交互 */
.profile-nav-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.profile-nav-group-title:hover { color: var(--text-primary); background: var(--bg-hover); }
.profile-nav-group-title > span:first-of-type { flex: 1; }
.profile-nav-group.expanded > .profile-nav-group-title { color: var(--text-primary); }
.profile-nav-group.expanded > .profile-nav-group-title .category-chevron { transform: rotate(90deg); }

.profile-station-list {
  display: none;
  margin: 2px 0 0 14px;
  padding-left: 6px;
  border-left: 1px solid var(--border-primary);
}
.profile-nav-group.expanded > .profile-station-list { display: block; }

.profile-nav-station {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 10px;
  font-size: 0.8125rem;
  white-space: normal;
}
.station-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.station-meta { font-size: 0.6875rem; color: var(--text-muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.profile-nav-empty { display: block; padding: 4px 10px 6px; color: var(--text-muted); font-size: 0.75rem; }

.profile-accounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--spacing-md);
}
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  max-width: 220px;
  padding: 0 12px 0 5px;
  border-radius: 999px;
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.account-chip img { width: 24px; height: 24px; border-radius: 50%; flex: none; }
.account-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chip:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.account-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.account-chip.active { border-color: var(--accent-primary); background: var(--accent-soft); color: var(--text-primary); font-weight: 600; cursor: default; }
.account-add { padding-left: 10px; border-style: dashed; }
.account-add svg { width: 14px; height: 14px; flex: none; }

.profile-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
}

.profile-icon {
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--accent-primary);
  margin-bottom: var(--spacing-lg);
  background: var(--accent-soft);
}

.profile-icon svg { width: 42px; height: 42px; }
.profile-empty h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.profile-empty p { color: var(--text-secondary); margin-bottom: var(--spacing-lg); font-size: 0.9375rem; max-width: 400px; }

/* 角色主视觉卡片 */
.profile-header {
  overflow: hidden;
  margin-bottom: var(--spacing-md);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
}

.profile-hero-main {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  padding: 22px 24px 18px;
}

.avatar-ring {
  flex-shrink: 0;
  padding: 2px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
}

.profile-avatar {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  object-fit: cover;
}

.profile-info { flex: 1; min-width: 0; }
.profile-info h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.profile-info p { color: var(--text-secondary); font-size: 0.875rem; margin-top: 2px; }
.profile-info p:empty { display: none; }
.profile-actions { display: flex; gap: var(--spacing-sm); }

.profile-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.profile-chips:empty { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chip svg { width: 13px; height: 13px; flex-shrink: 0; }
.chip img { width: 16px; height: 16px; margin-left: -4px; flex-shrink: 0; border-radius: 50%; background: #0d1219; }
.chip img.broken { display: none; }
.chip.sec-high { color: var(--buy-color); border-color: color-mix(in srgb, var(--buy-color) 35%, transparent); }
.chip.sec-low { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.chip.sec-null { color: var(--sell-color); border-color: color-mix(in srgb, var(--sell-color) 35%, transparent); }

/* 头部的关键数字 */
.profile-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border-primary);
}

.hero-stat { padding: 12px 24px; min-width: 0; }
.hero-stat + .hero-stat { border-left: 1px solid var(--border-primary); }
.hero-stat-label { display: block; font-size: 0.75rem; color: var(--text-muted); }
.hero-stat-value {
  display: block;
  margin-top: 2px;
  font-size: 1.125rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-stat-sub { margin-left: 4px; font-size: 0.75rem; font-weight: 500; color: var(--text-muted); }

.profile-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-primary);
  overflow-x: auto;
  scrollbar-width: none;
}

/* 桌面端侧栏已提供同样的导航，展开时隐藏重复的标签条 */
@media (min-width: 769px) {
  .profile-sidebar:not(.collapsed) ~ .profile-scroll .profile-tabs { display: none; }
}

.profile-tabs .tab-link { white-space: nowrap; }

/* 内容直接放在页面背景上，避免卡片套卡片 */
.profile-data { min-height: 360px; }

.profile-data > .text-muted:not(.valuation-note),
.profile-data > .loading-block {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
}

.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 300px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-secondary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ===== 骨架屏：加载时按最终布局显示占位块 ===== */
.sk,
.kb-bars.sk-bars i.sk {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--text-muted) 14%, transparent) 25%,
    color-mix(in srgb, var(--text-muted) 26%, transparent) 37%,
    color-mix(in srgb, var(--text-muted) 14%, transparent) 63%);
  background-size: 400% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}
@keyframes sk-shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.sk-line { height: 12px; max-width: 100%; }
.sk-line.sm { height: 9px; }
.sk-line.lg { height: 22px; margin: 6px 0 4px; }
.sk-line.xl { height: 24px; margin: 4px 0; }
.sk-img { flex-shrink: 0; border-radius: 8px; }
.sk-card { gap: 8px; pointer-events: none; }
.sk-card::before { display: none; }
.sk-static { pointer-events: none; }
.sk-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.sk-col-narrow { flex: 0 0 18%; }
.sk-right { align-items: flex-end; }
.sk-list {
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  overflow: hidden;
}
.sk-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; }
.sk-row + .sk-row { border-top: 1px solid var(--border-primary); }
.sk-value { flex-shrink: 0; }
.sk-board { border: 0; background: none; }
.sk-board .sk-row { padding: 6px; gap: 10px; border: 0; }
.sk-rank { width: 18px; height: 14px; flex-shrink: 0; }
.sk-toolbar { display: flex; gap: 8px; margin: 18px 0 12px; }
.sk-pill { height: 30px; border-radius: 8px; }
.sk-title { margin: 22px 0 12px; }
.kb-bars.sk-bars i.sk { opacity: 1; border-radius: 2px 2px 0 0; }
.kb-top-card.sk-static .kb-top-text { gap: 7px; }
.sk-legend { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.sk-legend .sk-row { padding: 0; gap: 10px; border: 0; }
.map-loading .sk-map { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, rgba(79, 143, 247, 0.07), transparent 60%); animation: sk-pulse 1.6s ease-in-out infinite; }
@keyframes sk-pulse { 50% { opacity: 0.35; } }
@media (max-width: 640px) {
  .sk-col-narrow { display: none; }
}

/* 角色信息：分组 + 图标卡片 */
.info-section + .info-section { margin-top: var(--spacing-lg); }
.info-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.info-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border-primary); }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

.info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
}
.info-card.wide { grid-column: span 2; }

.info-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--accent-primary);
  background: var(--accent-soft);
}
.info-icon svg { width: 18px; height: 18px; }

/* 游戏内图标：EVE 图标按深色底设计，两种主题都用深色衬底 */
.info-icon.game {
  width: 40px;
  height: 40px;
  padding: 0;
  overflow: hidden;
  background: #0d1219;
  border: 1px solid var(--border-primary);
}
.info-icon.game img { width: 100%; height: 100%; object-fit: cover; display: block; }
.info-icon.game img.broken { visibility: hidden; }

.info-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.info-text span { font-size: 0.75rem; color: var(--text-muted); }
.info-text strong { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); line-height: 1.35; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.table-scroll {
  overflow-x: auto;
  margin-top: 12px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
}
.pc-mini-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.pc-mini-table th {
  position: static;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--bg-tertiary);
}
.pc-mini-table td { padding: 9px 14px; border-bottom: 1px solid var(--border-primary); font-variant-numeric: tabular-nums; }
.pc-mini-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-tertiary) 40%, transparent); }
.pc-mini-table tbody tr:hover td { background: var(--bg-hover); }
.pc-mini-table tr:last-child td { border-bottom: none; }
.orders-mini td:nth-child(5), .orders-mini td:nth-child(6), .orders-mini th:nth-child(5), .orders-mini th:nth-child(6),
.wallet-mini td:nth-child(4), .wallet-mini th:nth-child(4) { text-align: right; }

.pill { display: inline-block; padding: 0 8px; border-radius: 9px; font-size: 0.75rem; line-height: 20px; }
.pill.buy { color: var(--buy-color); background: var(--buy-soft); }
.pill.sell { color: var(--sell-color); background: var(--sell-soft); }

.valuation-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 4px; }
.valuation-note { margin: 10px 2px 0; line-height: 1.6; font-size: 0.8125rem; color: var(--text-muted); }
.asset-table th:nth-child(2), .asset-table th:nth-child(3), .asset-table th:nth-child(4),
.asset-table td:nth-child(2), .asset-table td:nth-child(3), .asset-table td:nth-child(4) { text-align: right; }
.asset-table td:nth-child(5), .asset-table td:nth-child(6), .asset-table th:nth-child(5), .asset-table th:nth-child(6) { text-align: right; }
.asset-table td:last-child { color: var(--text-secondary); }
.more-row td { text-align: center; color: var(--text-muted); font-size: 0.75rem; }
.pill:not(.buy):not(.sell) { color: var(--text-secondary); background: var(--bg-tertiary); }

.valuation-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.valuation-toolbar .region-select { min-width: 200px; }
.toolbar-spacer { flex: 1; }

.asset-view-title {
  min-width: 0;
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-ghost { border-color: transparent; background: transparent; padding: 0 10px 0 6px; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { color: var(--accent-primary); background: var(--accent-soft); border-color: transparent; }

.station-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.valuation-grid.wallet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* 资产总估值：空间站汇总表 */
.station-summary td:nth-child(n+2), .station-summary th:nth-child(n+2) { text-align: right; }
.station-summary-row { cursor: pointer; transition: background var(--transition-fast); }
.station-summary-row:hover { background: var(--accent-soft); }
.station-summary-row:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: -2px; }
.station-link { color: var(--accent-primary); font-weight: 500; }
.station-summary-row:hover .station-link { text-decoration: underline; }
.station-summary td:first-child { white-space: normal; }

.share-bar {
  display: inline-block;
  width: 64px;
  height: 6px;
  margin-right: 8px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  overflow: hidden;
  vertical-align: middle;
}
.share-bar i { display: block; height: 100%; background: var(--accent-primary); border-radius: 3px; }

.station-filter { max-width: 320px; margin-top: 4px; }

/* ===== 合同查询 ===== */
.contract-toolbar { margin-bottom: 4px; }
.seg-count { margin-left: 2px; font-size: 0.6875rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.segmented button.active .seg-count { color: var(--accent-primary); }

.plain-select {
  height: 34px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237b8798' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none;
  font-size: 0.8125rem;
  color: var(--text-primary);
  cursor: pointer;
}
.plain-select:focus { border-color: var(--border-accent); }
.plain-select option { background: var(--bg-secondary); }

/* 合同类别与状态标签 */
.pill.type-item_exchange { color: var(--accent-primary); background: var(--accent-soft); }
.pill.type-auction { color: var(--violet); background: color-mix(in srgb, var(--violet) 12%, transparent); }
.pill.type-courier { color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.pill.type-loan, .pill.type-unknown { color: var(--text-secondary); background: var(--bg-tertiary); }
.pill.status-outstanding { color: var(--accent-primary); background: var(--accent-soft); }
.pill.status-in_progress { color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.pill.status-finished { color: var(--buy-color); background: var(--buy-soft); }
.pill.status-expired, .pill.status-closed { color: var(--text-muted); background: var(--bg-tertiary); }

.contract-row { cursor: pointer; }
.contract-row:hover td { background: var(--accent-soft) !important; }
.contract-row:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: -2px; }
.contract-table td { vertical-align: middle; }
.contract-title { white-space: normal; min-width: 180px; }
.contract-title strong { display: block; font-weight: 500; }
.type-inline { display: none; margin-right: 6px; vertical-align: 1px; }
@media (max-width: 768px) { .type-inline { display: inline-block; } }
.cell-sub { display: block; font-size: 0.6875rem; color: var(--text-muted); font-weight: 400; }
.contract-table td.num strong { font-weight: 600; }
.contract-loc { white-space: normal; color: var(--text-secondary); min-width: 160px; }
.route-arrow { color: var(--warning); font-weight: 600; }

/* 合同详情 */
.verdict {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid;
}
.verdict.good { color: var(--buy-color); border-color: color-mix(in srgb, var(--buy-color) 40%, transparent); background: var(--buy-soft); }
.verdict.ok { color: var(--accent-primary); border-color: var(--accent-ring); background: var(--accent-soft); }
.verdict.bad { color: var(--sell-color); border-color: color-mix(in srgb, var(--sell-color) 40%, transparent); background: var(--sell-soft); }

.contract-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.asset-view-title .pill { vertical-align: 2px; margin-right: 4px; }

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0;
  margin-top: 12px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  overflow: hidden;
}
.kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-primary);
  border-right: 1px solid var(--border-primary);
  min-width: 0;
}
.kv span { font-size: 0.75rem; color: var(--text-muted); }
.kv strong { font-size: 0.875rem; font-weight: 500; overflow-wrap: anywhere; }

.item-cell { display: inline-flex; align-items: center; gap: 8px; }
.item-cell img { border-radius: 4px; background: #0d1219; flex-shrink: 0; }
.contract-items td:nth-child(3) { text-align: center; }
.contract-items th:nth-child(3) { text-align: center; }
.contract-items td:nth-child(7), .contract-items th:nth-child(7) { text-align: right; }
.bid-table td:nth-child(2), .bid-table th:nth-child(2) { text-align: right; }
.section-gap { margin-top: var(--spacing-lg); }
.muted-cell { color: var(--text-muted); }

/* ===== 星图 ===== */
.map-sidebar { --sidebar-w: 300px; }
.map-sidebar-content { overflow-y: auto; padding: 4px 0 16px; }

.map-panel { padding: 12px 14px; border-bottom: 1px solid var(--border-primary); }
.map-panel h4 { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.map-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.map-panel-head h4 { margin: 0; }
.icon-btn.small { width: 28px; height: 28px; }
.icon-btn.small svg { width: 15px; height: 15px; }

.layer-list { display: flex; flex-direction: column; }
.layer-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.layer-group-title { margin: 8px 0 6px; font-size: 0.6875rem; color: var(--text-muted); }
.layer-group-title:first-child { margin-top: 0; }
.layer-hint { margin-top: 10px; padding: 7px 9px; border-radius: var(--radius-sm); background: var(--bg-tertiary); font-size: 0.75rem; line-height: 1.5; color: var(--text-secondary); }
.layer-btn {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.layer-btn:hover { color: var(--text-primary); border-color: var(--border-secondary); }
.layer-btn.active { color: var(--accent-primary); border-color: var(--accent-primary); background: var(--accent-soft); font-weight: 600; }

.map-legend { display: flex; flex-direction: column; gap: 1px; max-height: 360px; overflow-y: auto; margin: 0 -6px; }
.legend-group { padding: 8px 6px 4px; font-size: 0.6875rem; color: var(--text-muted); }
.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-align: left;
}
.legend-row:hover { background: var(--bg-hover); color: var(--text-primary); }
.legend-row.active { background: var(--accent-soft); color: var(--accent-primary); }
.legend-row i { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend-row img { border-radius: 4px; background: #0d1219; flex-shrink: 0; }
.legend-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-label small { display: block; font-size: 0.6875rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
.legend-count { font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.legend-empty { padding: 6px; font-size: 0.8125rem; color: var(--text-muted); }
.legend-clear { margin: 6px 6px 0; align-self: flex-start; }
.legend-steps { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 6px 4px; font-size: 0.6875rem; color: var(--text-muted); }
.legend-steps span { display: inline-flex; align-items: center; gap: 4px; }
.legend-steps i { width: 14px; height: 10px; border-radius: 2px; }

.map-search-results { padding: 6px; border-bottom: 1px solid var(--border-primary); max-height: 320px; overflow-y: auto; }
.map-result {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  text-align: left;
  color: var(--text-secondary);
}
.map-result:hover { background: var(--bg-hover); color: var(--text-primary); }
.map-result i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.result-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.result-sub { font-size: 0.6875rem; color: var(--text-muted); white-space: nowrap; }
.result-kind { font-size: 0.6875rem; padding: 0 6px; border-radius: 4px; color: var(--accent-primary); background: var(--accent-soft); }

.route-form { display: grid; grid-template-columns: 1fr; gap: 6px; position: relative; }
.route-field { position: relative; }
.route-field input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  font-size: 0.8125rem;
}
.route-field input:focus { border-color: var(--border-accent); }
.route-swap { position: absolute; right: 4px; top: 25px; z-index: 2; background: var(--bg-secondary); border: 1px solid var(--border-primary); font-size: 0.875rem; }
.route-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  padding: 4px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
}
.route-actions { display: flex; gap: 6px; }
.route-actions .plain-select { flex: 1; min-width: 0; }
.route-actions .btn { height: 34px; padding: 0 12px; }
.route-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 6px; font-size: 0.8125rem; color: var(--text-secondary); }
.route-summary strong { font-size: 1rem; color: var(--text-primary); }
.route-list { list-style: none; counter-reset: hop; max-height: 300px; overflow-y: auto; margin: 0 -6px; }
.route-list li { counter-increment: hop; }
.route-list button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-align: left;
}
.route-list button::before { content: counter(hop); min-width: 20px; font-size: 0.6875rem; color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.route-list button:hover { background: var(--bg-hover); color: var(--text-primary); }
.route-list i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.route-list span { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.sec-hi { color: var(--buy-color); }
.sec-lo { color: var(--warning); }
.sec-null { color: var(--sell-color); }
.sec-hi-bg { background: var(--buy-color); }
.sec-lo-bg { background: var(--warning); }
.sec-null-bg { background: var(--sell-color); }

.map-updated { padding: 10px 14px 0; font-size: 0.6875rem; color: var(--text-muted); }

/* 星图画布区域：与游戏一致，始终为深色 */
.map-stage { position: relative; flex: 1; min-width: 0; overflow: hidden; background: #05080d; }
.map-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.map-stage #mapLabels { pointer-events: none; }
.map-stage canvas.dragging { cursor: grabbing; }
.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #9aa8bc;
  font-size: 0.875rem;
  z-index: 3;
}
.map-tooltip {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 10px;
  border: 1px solid #2a3446;
  border-radius: var(--radius-md);
  background: rgba(13, 18, 27, 0.94);
  color: #e8edf5;
  font-size: 0.8125rem;
  pointer-events: none;
  white-space: nowrap;
}
.map-tooltip span { font-size: 0.6875rem; color: #9aa8bc; }

.map-zoom {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  border: 1px solid #2a3446;
  border-radius: var(--radius-md);
  background: rgba(13, 18, 27, 0.9);
  overflow: hidden;
}
.map-zoom button { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; color: #c9d3e0; font-size: 1.125rem; }
.map-zoom button + button { border-top: 1px solid #2a3446; }
.map-zoom button:hover { background: rgba(79, 143, 247, 0.18); color: #fff; }
.map-zoom button[hidden] + button { border-top: none; }
.map-zoom svg { width: 16px; height: 16px; }
.map-hint { position: absolute; left: 16px; bottom: 14px; z-index: 2; font-size: 0.6875rem; color: rgba(201, 211, 224, 0.55); pointer-events: none; }
.map-stage .sidebar-reopen { z-index: 5; }

/* 星系 / 星域详情面板 */
.map-info {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  width: 340px;
  max-height: calc(100% - 240px);   /* 为右下角缩放按钮留出空间，避免遮挡 */
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-lg);
}
.map-info-head { display: flex; align-items: flex-start; gap: 12px; }
.map-info-star { border-radius: 8px; background: #0d1219; flex-shrink: 0; }
.map-info-title { flex: 1; min-width: 0; }
.map-info-title h3 { display: flex; align-items: center; gap: 8px; font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
.map-info-title p { margin-top: 2px; font-size: 0.75rem; color: var(--text-muted); }
.map-info-title .link-btn { padding: 0; font-size: 0.75rem; color: var(--accent-primary); }
.map-info-close { width: 28px; height: 28px; border-radius: var(--radius-sm); font-size: 1.25rem; line-height: 1; color: var(--text-muted); }
.map-info-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.sec-badge { padding: 0 6px; border: 1px solid; border-radius: 4px; font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.map-owner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
}
.map-owner img { border-radius: 6px; background: #0d1219; }
.map-owner > i { width: 32px; height: 32px; border-radius: 6px; background: var(--bg-hover); }
.map-owner span { display: block; font-size: 0.6875rem; color: var(--text-muted); }
.map-owner strong { font-size: 0.875rem; font-weight: 600; }

.map-status { margin-top: 8px; padding: 6px 10px; border-radius: var(--radius-sm); font-size: 0.75rem; }
.map-status.incursion { color: #b45cff; background: rgba(180, 92, 255, 0.12); }
.map-status.fw { color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.map-status.adm { color: var(--buy-color); background: var(--buy-soft); }
.map-status.campaign { color: #ff6b3d; background: rgba(255, 107, 61, 0.12); }
.map-status.mine { color: var(--accent-primary); background: var(--accent-soft); }

.map-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.map-stat { padding: 8px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); text-align: center; }
.map-stat span { display: block; font-size: 0.6875rem; color: var(--text-muted); white-space: nowrap; }
.map-stat strong { font-size: 1rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.map-info-note { margin-top: 8px; font-size: 0.75rem; color: var(--text-muted); }

.map-stations { margin-top: 10px; font-size: 0.8125rem; }
.map-stations summary { cursor: pointer; color: var(--text-secondary); font-size: 0.75rem; }
.map-stations ul { list-style: none; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.map-stations li { padding: 5px 8px; border-radius: var(--radius-sm); background: var(--bg-tertiary); line-height: 1.4; }
.map-agents .agent-group { margin-top: 8px; font-size: 0.6875rem; color: var(--text-muted); }
.map-agents .agent-row { display: flex; gap: 8px; align-items: flex-start; }
.map-agents .agent-row.focus { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-primary); }
.map-agents .agent-row img { width: 32px; height: 32px; border-radius: 4px; flex: none; }
.map-agents .agent-row div { display: flex; flex-direction: column; min-width: 0; }
.map-agents .agent-row .link-btn { align-self: flex-start; padding: 0; font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); text-align: left; }
.map-agents .agent-row small, .map-agents .agent-row span { font-size: 0.6875rem; color: var(--text-muted); }
.map-agents .agent-row em { font-style: normal; font-size: 0.6875rem; font-weight: 600; }
.map-agents .agent-ok { color: var(--success, #22c55e); }
.map-agents .agent-no { color: var(--danger, #ef4444); }

.map-neighbors { margin-top: 12px; }
.map-neighbors > span { display: block; margin-bottom: 6px; font-size: 0.75rem; color: var(--text-muted); }
.map-neighbors > div { display: flex; flex-wrap: wrap; gap: 6px; }
.nbr-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--border-primary);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.nbr-chip:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.nbr-chip i { width: 7px; height: 7px; border-radius: 50%; }
.nbr-chip small { font-size: 0.625rem; color: var(--text-muted); }

.map-info-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.map-info-actions .btn { height: 32px; padding: 0 12px; font-size: 0.8125rem; }

.sec-bar { display: flex; height: 8px; margin-top: 14px; border-radius: 4px; overflow: hidden; background: var(--bg-tertiary); }
.sec-bar i { display: block; height: 100%; }
.region-owners { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.region-owner { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; }
.region-owner img { border-radius: 4px; background: #0d1219; }
.region-owner > i { width: 22px; height: 22px; border-radius: 4px; background: var(--bg-tertiary); }
.region-owner span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.region-owner b { font-weight: 600; font-size: 0.75rem; color: var(--text-muted); }
.region-desc { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-primary); font-size: 0.8125rem; line-height: 1.7; color: var(--text-secondary); white-space: pre-line; }

/* ===== 击杀记录（zKillboard）===== */
.kb-empty { padding: var(--spacing-lg) 0; text-align: center; }
.kb-table td { vertical-align: middle; }
.kb-row { cursor: pointer; }
.kb-row:hover td { background: var(--accent-soft) !important; }
.kb-row:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: -2px; }
.kb-ship { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.kb-ship img { border-radius: 6px; background: #0d1219; flex-shrink: 0; }
.kb-ship strong, .kb-party strong, .kb-loc strong { display: block; font-weight: 500; white-space: nowrap; }
.kb-party, .kb-loc { white-space: normal; min-width: 120px; }
.kb-table td.num strong { font-weight: 650; }

.kb-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 18px;
  vertical-align: 1px;
}
.kb-tag.solo { color: var(--violet); background: color-mix(in srgb, var(--violet) 14%, transparent); }
.kb-tag.npc { color: var(--text-secondary); background: var(--bg-tertiary); }
.kb-tag.awox { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.kb-tag.final { color: var(--sell-color); background: var(--sell-soft); }

/* 星图详情面板中的击杀列表 */
.map-kills { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-primary); }
.map-kills-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 0.75rem; color: var(--text-muted); }
.map-kills-head a { font-size: 0.75rem; }
.map-kill-list { display: flex; flex-direction: column; gap: 2px; }
.kb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px;
  border-radius: var(--radius-sm);
  text-align: left;
}
.kb-item:hover { background: var(--bg-hover); }
.kb-item img { border-radius: 5px; background: #0d1219; flex-shrink: 0; }
.kb-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kb-item-text strong { font-size: 0.8125rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-item-text small, .kb-item-meta small { font-size: 0.6875rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-item-meta { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.kb-item-meta b { font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* 击杀详情弹窗 */
.modal-content.kill-content { max-width: 980px; }
.kill-content .modal-body { padding: 18px 20px 20px; }
.kb-head { display: grid; grid-template-columns: 128px 1fr auto; gap: 18px; align-items: start; }
.kb-ship-render { width: 128px; height: 128px; border-radius: var(--radius-lg); overflow: hidden; background: #0d1219; border: 1px solid var(--border-primary); }
.kb-ship-render img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kb-victim-line { display: flex; align-items: center; gap: 12px; }
.kb-victim h4 { font-size: 1.125rem; font-weight: 700; }
.kb-victim p { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 2px; font-size: 0.8125rem; color: var(--text-secondary); }
.kb-victim p img { border-radius: 3px; background: #0d1219; }
.kb-avatar { border-radius: 50%; background: #0d1219; flex-shrink: 0; object-fit: cover; }
.kb-avatar.lg { border-radius: 10px; }
.kb-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin-top: 12px; font-size: 0.8125rem; }
.kb-facts em { display: block; font-style: normal; font-size: 0.6875rem; color: var(--text-muted); }
.kb-facts small { color: var(--text-muted); }
.kb-tags { margin-top: 8px; }
.kb-tags .kb-tag:first-child { margin-left: 0; }
.kb-values { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 200px; }
.kb-total { text-align: right; }
.kb-total span { display: block; font-size: 0.75rem; color: var(--text-muted); }
.kb-total strong { font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kb-total small { margin-left: 4px; font-size: 0.75rem; font-weight: 500; color: var(--text-muted); }
.kb-split { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 0.8125rem; }
.kb-dropped { color: var(--buy-color); }
.kb-destroyed { color: var(--sell-color); }
.kb-tabs { margin: 18px 0 10px; }

.kb-pane { display: flex; flex-direction: column; gap: 10px; }
.kb-fit-group { border: 1px solid var(--border-primary); border-radius: var(--radius-md); overflow: hidden; }
.kb-fit-group h5 {
  display: flex;
  justify-content: space-between;
  padding: 7px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
}
.kb-fit-group h5 span { color: var(--text-muted); font-weight: 400; }
.kb-fit-item { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 8px; font-size: 0.8125rem; border-top: 1px solid var(--border-primary); }
.kb-fit-item.is-dropped { background: var(--buy-soft); }
.kb-fit-item img { border-radius: 4px; background: #0d1219; flex-shrink: 0; }
.kb-fit-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-fit-qty { display: flex; gap: 8px; font-size: 0.75rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kb-fit-value { width: 80px; text-align: right; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.kb-attacker { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); }
.kb-attacker.final { border-color: color-mix(in srgb, var(--sell-color) 45%, var(--border-primary)); }
.kb-attacker-main { flex: 1; min-width: 0; }
.kb-attacker-main strong { display: block; font-size: 0.875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-attacker-main small { display: block; font-size: 0.75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-dmg { height: 4px; margin-top: 5px; border-radius: 2px; background: var(--bg-tertiary); overflow: hidden; }
.kb-dmg i { display: block; height: 100%; background: var(--sell-color); }
.kb-attacker-gear { display: flex; gap: 4px; }
.kb-attacker-gear img { border-radius: 4px; background: #0d1219; }
.kb-attacker-dmg { min-width: 70px; text-align: right; }
.kb-attacker-dmg b { display: block; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.kb-attacker-dmg small { font-size: 0.6875rem; color: var(--text-muted); }

/* 舰船常用装配 */
.kb-common { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.kb-common section { padding: 10px 12px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); background: var(--bg-secondary); }
.kb-common h5 { margin-bottom: 6px; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.kb-common-row { display: grid; grid-template-columns: 22px 1fr 60px 36px; align-items: center; gap: 8px; padding: 3px 0; font-size: 0.8125rem; }
.kb-common-row img { border-radius: 4px; background: #0d1219; }
.kb-common-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-common-row i { height: 5px; border-radius: 3px; background: var(--bg-tertiary); position: relative; overflow: hidden; }
.kb-common-row i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--accent-primary); border-radius: 3px; }
.kb-common-row b { text-align: right; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.info-section-title small { font-weight: 400; color: var(--text-muted); }

@media (max-width: 768px) {
  .kb-head { grid-template-columns: 72px 1fr; }
  .kb-ship-render { width: 72px; height: 72px; }
  .kb-values { grid-column: 1 / -1; align-items: stretch; }
  .kb-total, .kb-split { text-align: left; align-items: flex-start; }
  .kb-facts { grid-template-columns: 1fr; }
  .kb-table th:nth-child(n+4):not(:last-child), .kb-table td:nth-child(n+4):not(:last-child) { display: none; }
  .kb-fit-value { display: none; }
}

/* ===== 击杀记录页 ===== */
.kb-scroll { flex: 1; min-width: 0; overflow-y: auto; }
.kb-wrap { max-width: 1480px; margin: 0 auto; padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-xl); }
.kb-topbar { display: flex; align-items: center; gap: 16px; margin-bottom: var(--spacing-md); flex-wrap: wrap; }
.kb-search { position: relative; flex: 1; max-width: 560px; height: 40px; background: var(--bg-secondary); }
.kb-status { font-size: 0.75rem; color: var(--text-muted); }
.kb-status b { color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.kb-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 460px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
}
.kb-suggest-group { padding: 8px 8px 4px; font-size: 0.6875rem; color: var(--text-muted); }
.kb-suggest-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: var(--radius-sm); text-align: left; font-size: 0.8125rem; }
.kb-suggest-item:hover, .kb-suggest-item:focus-visible { background: var(--bg-hover); }
.kb-suggest-item img { border-radius: 4px; background: #0d1219; flex-shrink: 0; }
.kb-suggest-item > i { width: 8px; height: 8px; margin: 0 7px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.kb-suggest-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-suggest-item small { font-size: 0.6875rem; color: var(--text-muted); white-space: nowrap; }

.kb-section { margin-top: var(--spacing-lg); }
.kb-section-title { margin-bottom: 10px; font-size: 0.9375rem; font-weight: 600; }

.kb-summary { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; }
.kb-summary-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kb-region-value .kb-link { color: inherit; }
.kb-hours { padding: 14px 16px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); box-shadow: var(--shadow-sm); }
.kb-hours-head { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 10px; }
.kb-bars { display: flex; align-items: flex-end; gap: 3px; height: 74px; }
.kb-bars i { flex: 1; min-width: 0; border-radius: 2px 2px 0 0; background: var(--sell-color); opacity: 0.75; }
.kb-bars i:hover { opacity: 1; }

.kb-top { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.kb-top-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: border-color var(--transition-fast);
}
.kb-top-card:hover { border-color: color-mix(in srgb, var(--sell-color) 50%, var(--border-primary)); }
.kb-top-card img { border-radius: 8px; background: #0d1219; flex-shrink: 0; }
.kb-top-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.kb-top-text strong { font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-top-text small { font-size: 0.75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-top-card > b { font-size: 1rem; color: var(--sell-color); font-variant-numeric: tabular-nums; white-space: nowrap; }

.kb-columns { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.kb-feed-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.kb-feed-head .kb-section-title, .kb-feed-head .info-section-title { margin: 0; }
.kb-feed-head .info-section-title::after { display: none; }
.kb-filters { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.kb-filter-hint { font-size: 0.75rem; color: var(--text-muted); }
.kb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 4px 0 10px;
  border: 1px solid var(--accent-primary);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-primary);
  font-size: 0.8125rem;
}
.kb-chip img { border-radius: 3px; }
.kb-chip button { width: 20px; height: 20px; border-radius: 50%; font-size: 0.9375rem; line-height: 1; color: inherit; }
.kb-chip button:hover { background: var(--accent-ring); }
.kb-more { display: block; margin: 12px auto 0; }
.kb-link { color: inherit; cursor: pointer; }
.kb-link:hover { color: var(--accent-primary); text-decoration: underline; }
.cell-sub .kb-link { color: var(--text-muted); }

.kb-board { position: sticky; top: 0; padding: 14px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); box-shadow: var(--shadow-sm); margin-top: var(--spacing-lg); }
.kb-board .kb-section-title { margin-bottom: 12px; }
.kb-board-controls { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.kb-board-controls .segmented { display: flex; }
.kb-board-controls .segmented button { flex: 1; }
.kb-board-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.kb-board-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-sm); color: var(--text-primary); }
.kb-board-row:hover { background: var(--bg-hover); }
.kb-board-row img { border-radius: 6px; background: #0d1219; flex-shrink: 0; }
.kb-rank { width: 20px; text-align: center; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.kb-rank.top { color: var(--warning); }
.kb-board-name { flex: 1; min-width: 0; font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-board-value { display: flex; flex-direction: column; align-items: flex-end; }
.kb-board-value b { font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.kb-board-value small { font-size: 0.6875rem; color: var(--text-muted); }

/* 人物 / 军团 / 联盟 */
.kb-entity-head { display: flex; align-items: center; gap: 16px; margin-bottom: var(--spacing-lg); padding: 18px 20px; border: 1px solid var(--border-primary); border-radius: var(--radius-xl); background: var(--bg-secondary); box-shadow: var(--shadow-sm); }
.kb-entity-head > img { border-radius: 12px; background: #0d1219; flex-shrink: 0; }
.kb-entity-head > div { flex: 1; min-width: 0; }
.kb-entity-kind { font-size: 0.75rem; color: var(--text-muted); }
.kb-entity-head h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.25; }
.kb-entity-head p { margin-top: 2px; font-size: 0.8125rem; color: var(--text-secondary); }
.kb-members td:first-child { white-space: normal; }
.kb-member { display: inline-flex; align-items: center; gap: 8px; }
.kb-member img { border-radius: 4px; background: #0d1219; }
.kb-members th.sortable::after { content: '⇅'; }
.kb-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: var(--spacing-lg); }
.kb-mini-panel { padding: 10px 12px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); background: var(--bg-secondary); }
.kb-mini-panel h5 { margin-bottom: 6px; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.kb-mini-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 0.8125rem; }
.kb-mini-row img { border-radius: 4px; background: #0d1219; }
.kb-mini-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-mini-row b { font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.kb-value-note { font-size: 0.6875rem; color: var(--text-muted); }

@media (max-width: 1100px) {
  .kb-columns { grid-template-columns: 1fr; }
  .kb-board { position: static; }
  .kb-summary { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .kb-wrap { padding: var(--spacing-md); }
  .kb-summary-cards { grid-template-columns: 1fr 1fr; }
  .kb-summary-cards > :first-child { grid-column: 1 / -1; }
  .kb-entity-head { flex-wrap: wrap; }
}

/* 快捷键帮助 */
.modal-content.shortcut-content { max-width: 680px; }
.shortcut-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px 24px; }
.shortcut-body h4 { margin-bottom: 8px; font-size: 0.8125rem; color: var(--text-secondary); }
.shortcut-body dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; font-size: 0.8125rem; }
.shortcut-body dt { white-space: nowrap; color: var(--text-secondary); }
.shortcut-body dd { color: var(--text-primary); }

/* ===== Toast ===== */
.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 0.8125rem;
  transform: translateY(12px);
  opacity: 0;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.toast svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--accent-primary); }
.toast.success svg { color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.error svg { color: var(--danger); }
.toast span { overflow-wrap: anywhere; }
.toast.show { transform: none; opacity: 1; }

/* ===== 模态框 ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  animation: fade-in var(--transition-base);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modal-in 220ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-primary);
}

.modal-header h3 { font-size: 1.0625rem; font-weight: 600; }

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body { padding: 20px; overflow-y: auto; }

.steps { list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 20px; }
.steps li { counter-increment: step; position: relative; padding-left: 38px; }

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-primary);
  font-size: 0.8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-title { font-weight: 600; font-size: 0.9375rem; line-height: 26px; }
.step-desc { color: var(--text-muted); font-size: 0.8125rem; margin: 2px 0 10px; }
.step-desc a { color: var(--accent-primary); }

.auth-link-box { margin-top: 10px; }

.input-group { display: flex; gap: 8px; }

.input-group input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-group input:focus { border-color: var(--border-accent); box-shadow: 0 0 0 3px var(--accent-ring); }

.status-msg { min-height: 20px; margin-top: 16px; font-size: 0.8125rem; color: var(--text-muted); }
.status-msg:empty { display: none; }
.status-msg.success { color: var(--success); }
.status-msg.error { color: var(--danger); }

.text-muted { color: var(--text-secondary); font-size: 0.875rem; }

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--spacing-xl) var(--spacing-md);
  text-align: center;
  color: var(--text-muted);
}

.empty-state svg { width: 40px; height: 40px; opacity: 0.45; fill: none; }
.empty-state p { font-size: 0.875rem; }
.empty-state .hint { font-size: 0.75rem; opacity: 0.8; }
.empty-state .btn { margin-top: 8px; }

/* ===== 响应式 ===== */
@media (max-width: 1280px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .station-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .valuation-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 导航有 11 个入口：窄一些的屏幕先收紧间距、隐藏品牌名，再只保留图标（悬停显示名称） */
@media (max-width: 1560px) {
  .nav-btn { padding: 0 8px; }
  .header-nav { gap: 2px; }
}
@media (max-width: 1480px) {
  .header-brand .brand-name { display: none; }
}
@media (max-width: 1340px) {
  .nav-btn span { display: none; }
}
@media (max-width: 1100px) {
  .nav-btn span { display: none; }
  .orders-container { grid-template-columns: 1fr; }
  .orders-table { height: auto; max-height: 420px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: min(86vw, 340px); }

  .app-header { padding: 0 8px; gap: 8px; }
  .menu-btn { display: flex; }
  .header-brand .brand-name { display: none; }
  .nav-btn { padding: 0 10px; }
  #shortcutHelpBtn { display: none; }   /* 手机没有键盘快捷键，给导航让出空间 */
  .server-status { padding: 0 10px; }
  .server-status .status-text { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }

  /* 两个视图的侧栏都变为左侧抽屉 */
  #sidebar, #profileSidebar, #mapSidebar, #fitSidebar, #indSidebar, #lpSidebar, #courierSidebar, #guideSidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 90;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-lg);
  }

  #sidebar.collapsed > *, #profileSidebar.collapsed > *, #mapSidebar.collapsed > *, #fitSidebar.collapsed > *, #indSidebar.collapsed > *, #lpSidebar.collapsed > *, #courierSidebar.collapsed > *, #guideSidebar.collapsed > * { visibility: visible; }
  #sidebar.drawer-open, #profileSidebar.drawer-open, #mapSidebar.drawer-open, #fitSidebar.drawer-open, #indSidebar.drawer-open, #lpSidebar.drawer-open, #courierSidebar.drawer-open, #guideSidebar.drawer-open { transform: none; }
  /* 导航入口多，放不下时横向滑动，不撑宽页面 */
  .header-nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .header-nav::-webkit-scrollbar { display: none; }
  .nav-btn { flex: none; }
  .map-info { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 58%; }
  .map-hint { display: none; }
  .map-zoom { right: 10px; bottom: auto; top: 10px; }
  .sidebar-reopen { display: none !important; }
  .profile-sidebar-content, .profile-sidebar-header { min-width: 0; }

  .detail-view, .profile-container { padding: var(--spacing-md); }

  .detail-header { flex-direction: column; align-items: stretch; gap: var(--spacing-md); }
  .detail-actions { width: 100%; }
  .select-wrap { flex: 1; }
  .region-select { width: 100%; min-width: 0; }
  .item-icon { width: 52px; height: 52px; }
  .detail-header h1 { font-size: 1.25rem; }

  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stats-grid > :last-child { grid-column: 1 / -1; }
  .stat-card { padding: 10px 12px; }
  .stat-value { font-size: 1.125rem; }

  .tabs-header { padding: 0 6px; }
  .tabs-tools { width: 100%; margin-left: 0; padding: 0 6px 8px; }
  .tabs-content { padding: 10px; }
  .col-date { display: none; }
  td, thead th { padding: 7px 8px; }

  .profile-hero-main { flex-wrap: wrap; padding: var(--spacing-md); gap: var(--spacing-md); }
  .profile-avatar { width: 64px; height: 64px; }
  .profile-actions { width: 100%; }
  .profile-actions .btn { flex: 1; }
  .profile-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stat { padding: 10px var(--spacing-md); }
  .hero-stat:nth-child(3) { border-left: none; }
  .hero-stat:nth-child(n+3) { border-top: 1px solid var(--border-primary); }
  .info-card.wide { grid-column: auto; }
  .stats-grid .stat-card:not(:last-child) .sparkline { display: none; } /* 两列小卡片放不下 */
  .valuation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .station-filter { max-width: none; }
  /* 工具栏：第一行 返回 + 标题，第二行 估价市场 + 刷新 */
  .asset-view-title { flex: 1 1 0; }
  .valuation-toolbar .toolbar-spacer { flex-basis: 100%; height: 0; }
  .valuation-toolbar .select-wrap { flex: 1; }
  .valuation-toolbar .region-select { min-width: 0; width: 100%; }
  .share-bar { display: none; }
  /* 合同列表在手机上只保留 合同（含类别标签）/ 状态 / 金额 */
  .contract-table th:nth-child(1), .contract-table td:nth-child(1),
  .contract-table th:nth-child(4), .contract-table td:nth-child(4),
  .contract-table th:nth-child(6), .contract-table td:nth-child(6),
  .contract-table th:nth-child(7), .contract-table td:nth-child(7) { display: none; }
  .contract-title { min-width: 0; }
  .contract-types { flex-wrap: wrap; }

  .toast-stack { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .toast { max-width: none; }
}

@media (max-width: 480px) {
  .header-brand { display: none; }
  .nav-btn { padding: 0 7px; }
  .api-link span { display: none; }
  /* 窄屏顶栏放不下时，服务器状态只保留状态点（悬停可看在线人数） */
  .server-status { padding: 0 9px; }
  .server-status .status-text { display: none; }
  .header-nav { gap: 2px; }
}

@media (max-width: 420px) {
  .nav-btn span { display: none; }
  .valuation-grid { grid-template-columns: 1fr; }
  .valuation-grid.station-grid,
  .valuation-grid.contract-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--border-secondary) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-secondary); border-radius: 4px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--text-muted); }

::selection { background: var(--accent-ring); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* 30 天以前的记录（实时查询自 zKillboard）分隔行与说明 */
.kb-table tr.kb-divider td {
  padding: 10px 12px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}
.kb-note { margin: var(--spacing-md) 0 0; font-size: 12px; text-align: center; }

/* 人物 / 军团 / 联盟：最近 30 天活跃地区 */
.kb-activity { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.kb-share-row { display: grid; grid-template-columns: minmax(90px, 1.2fr) 2fr auto 36px; align-items: center; gap: 8px; padding: 4px 0; font-size: 0.8125rem; }
.kb-share-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-share-bar { height: 6px; border-radius: 3px; background: var(--bg-tertiary); overflow: hidden; }
.kb-share-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent-primary); }
.kb-share-row b { font-size: 0.75rem; font-variant-numeric: tabular-nums; text-align: right; }
.kb-share-row small, .kb-mini-row span small { font-size: 0.6875rem; color: var(--text-muted); }
.kb-share-row small { text-align: right; }

/* 人物：历史军团 */
.kb-history { padding: 4px 12px; }
.kb-history-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 72px; align-items: center; gap: 10px; padding: 7px 0; font-size: 0.8125rem; }
.kb-history-row + .kb-history-row { border-top: 1px solid var(--border-primary); }
.kb-history-row img { border-radius: 4px; background: #0d1219; }
.kb-history-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.kb-history-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.kb-history-row.current .kb-history-name strong::after { content: '当前'; margin-left: 6px; padding: 1px 6px; border-radius: 4px; font-size: 0.6875rem; font-weight: 500; color: var(--accent-primary); background: color-mix(in srgb, var(--accent-primary) 14%, transparent); }
.kb-history-date { color: var(--text-muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.kb-history-row > b { text-align: right; font-size: 0.75rem; color: var(--text-secondary); font-weight: 500; }
@media (max-width: 640px) {
  .kb-history-row { grid-template-columns: 28px minmax(0, 1fr) 64px; }
  .kb-history-date { grid-column: 2 / 4; grid-row: 2; }
}

/* 星图：旗舰跳跃规划 */
.route-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.route-head h4 { margin: 0; }
.route-mode button { height: 24px; padding: 0 8px; font-size: 0.75rem; }
.jump-options { display: grid; gap: 6px; }
.jump-skills { display: grid; gap: 4px; }
.jump-skills label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.75rem; color: var(--text-secondary); }
.jump-skills .plain-select { width: 76px; height: 28px; flex: none; }
.jump-range { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }
.jump-range strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.jump-check { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-secondary); cursor: pointer; }
.jump-check input { accent-color: var(--accent-primary); }
.jump-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.jump-summary div { padding: 8px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); background: var(--bg-secondary); text-align: center; }
.jump-summary strong { display: block; font-size: 1rem; font-variant-numeric: tabular-nums; }
.jump-summary span { font-size: 0.6875rem; color: var(--text-muted); }
.jump-note { margin-top: 6px; font-size: 0.75rem; color: var(--text-secondary); line-height: 1.5; }
.jump-note.warn { color: var(--warning, #f2b134); }
.jump-list li { padding-bottom: 2px; }
.jump-list li.is-gate button { opacity: 0.75; }
.jump-list li.is-gate button::before { content: '门'; }
.jump-leg { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 0 6px 4px 34px; font-size: 0.6875rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.jump-station { margin-left: 6px; padding: 0 4px; border-radius: 3px; font-size: 0.625rem; font-style: normal; color: var(--accent-primary); background: color-mix(in srgb, var(--accent-primary) 14%, transparent); }
.jump-list button span { margin-left: auto; }
.jump-foot { margin-top: 8px; font-size: 0.6875rem; color: var(--text-muted); line-height: 1.5; }
.jump-list { counter-reset: hop -1; }
.jump-list li.is-gate { counter-increment: none; }
.jump-skills .plain-select.jump-dock-select { width: auto; min-width: 0; max-width: 190px; flex: 1 1 auto; }
.jump-station.is-nodock { color: var(--warning, #f2b134); background: color-mix(in srgb, var(--warning, #f2b134) 14%, transparent); }
.jump-station.is-structure { color: var(--success, #30c88a); background: color-mix(in srgb, var(--success, #30c88a) 14%, transparent); }
.jump-range .warn { color: var(--warning, #f2b134); }
/* 可停靠的玩家建筑：显示游戏内名称 */
.jump-docks { display: flex; flex-direction: column; gap: 1px; padding: 0 6px 3px 34px; font-size: 0.6875rem; line-height: 1.45; }
.jump-dock { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-secondary); }
.jump-dock b { margin-right: 5px; font-weight: 500; color: var(--success, #30c88a); }
.jump-dock-more { color: var(--text-muted); cursor: help; }

/* ===== 手机端适配 ===== */
.mobile-only { display: none !important; }
.empty-search { margin: 4px auto 0; height: 44px; padding: 0 22px; }
.empty-search svg { width: 18px; height: 18px; }

/* 窄屏网格列可收缩到 0，避免宽表格把整列撑出屏幕 */
@media (max-width: 1100px) {
  .kb-columns, .kb-summary { grid-template-columns: minmax(0, 1fr); }
}

/* 触屏：去掉点按高亮与双击缩放延迟；快捷键按钮没有意义 */
button, a, [role="button"], .kb-row, .map-result { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (hover: none) and (pointer: coarse) {
  #shortcutHelpBtn, .search-kbd { display: none; }
}

@media (max-width: 768px) {
  .mobile-only { display: revert !important; }
  .empty-search.mobile-only { display: inline-flex !important; }
  .desktop-only { display: none !important; }

  /* 刘海屏 / 底部手势条安全区 */
  .app-header { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  .main-content, .kb-scroll, .profile-scroll, .map-sidebar-content, .profile-sidebar-content { padding-bottom: env(safe-area-inset-bottom); }

  /* iOS 输入框字号小于 16px 时聚焦会自动放大页面 */
  input[type="search"], input[type="text"], input[type="number"], textarea { font-size: 16px; }

  /* 抽屉略宽，便于手指操作 */
  #sidebar, #profileSidebar, #mapSidebar, #fitSidebar { width: min(88vw, 340px); }

  /* 弹窗改为全屏 */
  .modal { padding: 0; align-items: stretch; }
  .modal-content, .modal-content.kill-content, .modal-content.shortcut-content {
    max-width: none; max-height: none; height: 100%; border-radius: 0; border: 0;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  }
  .modal-header { position: sticky; top: 0; z-index: 2; background: var(--bg-secondary); }
  .modal-body { flex: 1; padding: 16px; }

  /* 击杀页顶部：搜索框占满一行，状态换到下一行 */
  .kb-topbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .kb-search { max-width: none; }
  .kb-wrap { padding: var(--spacing-md) 12px var(--spacing-lg); }

  /* 成员表：横向滚动时名称列固定 */
  /* 斑马纹是半透明背景，固定列必须用不透明底色，否则滚过的数字会透出来 */
  .kb-members th:first-child, .kb-members td:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg-secondary) !important; box-shadow: 1px 0 0 var(--border-primary); }
  .kb-members td:first-child { min-width: 140px; max-width: 160px; }

  /* 星图信息面板不超过半屏，露出被选中的星系 */
  .map-info { max-height: 50%; }
}

/* 击杀列表在手机上改为卡片：舰船 + 价值 / 受害者 / 最后一击 + 地点 */
@media (max-width: 640px) {
  .kb-table thead { display: none; }
  .kb-table, .kb-table tbody { display: block; }
  .kb-table tr.kb-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "side side" "ship value" "victim victim" "final loc";
    gap: 4px 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-primary);
  }
  .kb-table tr.kb-row td { display: block !important; padding: 0; border: 0; min-width: 0; background: none !important; }
  .kb-table tr.kb-row:nth-child(even) { background: color-mix(in srgb, var(--bg-tertiary) 40%, transparent); }
  .kb-table td.kb-side { grid-area: side; }
  .kb-table td.kb-side:empty { display: none !important; }
  .kb-table tr.kb-row td.kb-ship { grid-area: ship; display: flex !important; align-items: center; gap: 10px; }
  .kb-table td.kb-value { grid-area: value; text-align: right; }
  .kb-table td.kb-victim-cell { grid-area: victim; }
  .kb-table td.kb-final-cell { grid-area: final; }
  .kb-table td.kb-loc { grid-area: loc; text-align: right; }
  .kb-table td.kb-final-cell strong, .kb-table td.kb-loc strong { font-size: 0.75rem; font-weight: 500; }
  .kb-table td .cell-sub { white-space: normal; }
  .kb-table tr.kb-divider { display: block; }
  .kb-table tr.kb-divider td { display: block; }
  .table-scroll:has(> .kb-table) { overflow-x: visible; }
}

/* 星图：实时击杀弹幕与开关 */
.kill-danmaku { position: absolute; inset: 0 0 auto 0; height: 140px; z-index: 3; overflow: hidden; pointer-events: none; }
.danmaku-item {
  position: absolute; left: 0; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 3px;
  white-space: nowrap; font-size: 0.75rem; color: #dbe3ee; pointer-events: auto; cursor: pointer;
  border: 1px solid rgba(255, 82, 64, 0.35); border-radius: 13px; background: rgba(13, 18, 27, 0.78);
  animation: danmaku-move linear forwards; will-change: transform;
}
.danmaku-item:hover { animation-play-state: paused; border-color: rgba(255, 82, 64, 0.8); background: rgba(13, 18, 27, 0.95); z-index: 1; }
.danmaku-item img { border-radius: 50%; background: #0d1219; }
.danmaku-item b { font-weight: 600; color: #fff; }
.danmaku-item span { color: #9fb0c6; }
.danmaku-item em { font-style: normal; color: #9fb0c6; }
.danmaku-item em i { font-style: normal; font-weight: 600; }
.danmaku-item strong { color: #ff7a6b; font-variant-numeric: tabular-nums; }
.danmaku-item.big { border-color: rgba(255, 196, 0, 0.6); }
.danmaku-item.big strong { color: #ffc400; }
.danmaku-item.huge { height: 30px; font-size: 0.8125rem; border-color: #ffc400; background: rgba(60, 44, 0, 0.85); box-shadow: 0 0 12px rgba(255, 196, 0, 0.35); }
.danmaku-item.huge strong { color: #ffd84d; }
/* 弹幕悬停详情 */
.kill-tip {
  position: absolute; z-index: 6; width: 290px; padding: 10px 12px; pointer-events: none;
  font-size: 0.75rem; color: #dbe3ee; border: 1px solid rgba(255, 82, 64, 0.45); border-radius: 10px;
  background: rgba(13, 18, 27, 0.96); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.kill-tip[hidden] { display: none; }
.kill-tip-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.kill-tip-head img { border-radius: 6px; background: #0d1219; flex-shrink: 0; }
.kill-tip-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kill-tip-head b { font-size: 0.875rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kill-tip-head small, .kill-tip-party small { color: #9fb0c6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kill-tip-head strong { color: #ff7a6b; font-size: 0.875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kill-tip-head strong span { margin-left: 2px; font-size: 0.625rem; font-weight: 400; color: #9fb0c6; }
.kill-tip-label { margin-top: 6px; font-size: 0.6875rem; color: #7f8ea3; }
.kill-tip-party { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.kill-tip-party img, .kill-tip-blank { width: 28px; height: 28px; border-radius: 4px; background: #1a2230; flex-shrink: 0; }
.kill-tip-party > div { min-width: 0; display: flex; flex-direction: column; }
.kill-tip-party b { font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kill-tip-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; color: #9fb0c6; }
.kill-tip-foot i { padding: 0 5px; border-radius: 3px; font-style: normal; font-size: 0.6875rem; color: #ffc400; background: rgba(255, 196, 0, 0.14); }
.kill-tip-time { margin-left: auto; }
.kill-tip-hint { margin-top: 6px; font-size: 0.6875rem; color: #6f7d91; }
@keyframes danmaku-move { from { transform: translateX(var(--from)); } to { transform: translateX(var(--to)); } }
/* 减少动态效果：不滚动，改为右上角静止显示几秒 */
.danmaku-item.static { left: auto; right: 64px; animation: none !important; }
.map-zoom .live-toggle.active { color: #ffc400; }
.map-zoom .live-toggle.active svg { fill: rgba(255, 196, 0, 0.25); }
@media (max-width: 768px) {
  .kill-danmaku { height: 110px; }
  .danmaku-item { font-size: 0.6875rem; height: 24px; }
  .danmaku-item span { display: none; }   /* 手机上省略受害者，缩短弹幕 */
}

/* 星图侧栏：分区折叠 */
.map-panel.collapsible { padding-top: 8px; padding-bottom: 8px; }
.map-panel.collapsible > .map-panel-head { margin: 0 -6px; }
.map-panel.collapsible.expanded > .map-panel-head { margin-bottom: 6px; }
.map-panel-toggle {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: var(--radius-md);
  color: var(--text-muted); text-align: left; transition: color var(--transition-fast), background var(--transition-fast);
}
.map-panel-toggle:hover { color: var(--text-primary); background: var(--bg-hover); }
.map-panel-toggle h4 { margin: 0; color: inherit; }
.map-panel.expanded > .map-panel-head .map-panel-toggle { color: var(--text-secondary); }
.map-panel.expanded > .map-panel-head .category-chevron { transform: rotate(90deg); }
.map-panel-summary { flex: 1; min-width: 0; margin-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }
.map-panel.expanded .map-panel-summary { display: none; }
.map-panel.collapsible > .map-panel-body { display: none; }
.map-panel.collapsible.expanded > .map-panel-body { display: block; animation: fade-in var(--transition-base); }
.map-panel-head.route-head { justify-content: space-between; }

/* ===== 会战：全站提醒卡片 ===== */
.battle-alerts { position: fixed; top: calc(var(--header-h) + 12px); right: 16px; z-index: 1500; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.battle-alert {
  padding: 12px 14px; border: 1px solid rgba(180, 108, 255, 0.55); border-radius: var(--radius-lg);
  background: var(--bg-secondary); box-shadow: var(--shadow-lg), 0 0 0 3px rgba(180, 108, 255, 0.12);
  animation: modal-in 220ms cubic-bezier(0.2, 0.9, 0.3, 1.2); font-size: 0.8125rem;
}
.battle-alert-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.battle-alert-head strong { color: #b46cff; }
.battle-alert-head > span:not(.battle-icon) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.battle-close { width: 24px; height: 24px; border-radius: 6px; color: var(--text-muted); font-size: 1.1rem; }
.battle-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.battle-alert p { color: var(--text-secondary); line-height: 1.5; }
.battle-alert p b { color: var(--text-primary); }
.battle-sides { margin-top: 2px; font-weight: 500; }
.battle-sides i { margin: 0 4px; font-style: normal; color: #b46cff; }
.battle-actions { display: flex; gap: 8px; margin-top: 10px; }
.battle-actions .btn { height: 30px; padding: 0 12px; font-size: 0.75rem; }
.battle-icon { width: 16px; height: 16px; flex-shrink: 0; color: #b46cff; }

/* ===== 会战：击杀记录页 ===== */
.kb-battles { margin-bottom: var(--spacing-lg); padding: 14px 16px; border: 1px solid rgba(180, 108, 255, 0.4); border-radius: var(--radius-lg); background: color-mix(in srgb, #b46cff 6%, var(--bg-secondary)); }
.kb-battles.is-empty { padding: 10px 16px; border-color: var(--border-primary); background: var(--bg-secondary); }
.kb-battles-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kb-battles-head .kb-section-title { margin: 0; display: flex; align-items: center; gap: 6px; }
.kb-battles-head .kb-section-title b { color: #b46cff; }
.kb-battles-head .text-muted { font-size: 0.75rem; }
.kb-battles-head .link-btn { margin-left: auto; }
.kb-battle-settings { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-primary); font-size: 0.8125rem; color: var(--text-secondary); }
.kb-battle-settings label { display: flex; align-items: center; gap: 8px; }
.kb-battle-settings .plain-select { height: 30px; width: auto; }
.kb-battle-settings .text-muted { flex-basis: 100%; font-size: 0.75rem; }
.kb-battle-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 10px; margin-top: 12px; }
.kb-battle { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); background: var(--bg-secondary); }
.kb-battle-main { display: flex; flex-direction: column; gap: 2px; }
.kb-battle-main strong { font-size: 0.9375rem; }
.kb-battle-main .text-muted { font-size: 0.75rem; }
.kb-battle-stats { display: flex; gap: 16px; font-size: 0.8125rem; color: var(--text-secondary); }
.kb-battle-stats b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.kb-battle-sides { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-battle-side { display: inline-flex; flex-direction: column; padding: 4px 8px; border-radius: var(--radius-sm); background: var(--bg-tertiary); font-size: 0.75rem; }
.kb-battle-side small { color: var(--text-muted); font-size: 0.6875rem; }
.kb-battle-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.kb-battle-actions .link-btn { margin-right: auto; font-size: 0.75rem; }
.kb-battle-actions .btn { height: 28px; padding: 0 10px; font-size: 0.75rem; }
@media (max-width: 768px) {
  .battle-alerts { top: calc(var(--header-h) + 8px); right: 8px; width: calc(100vw - 16px); }
}

/* ===== 模拟装配 ===== */
.fit-sidebar { --sidebar-w: 320px; }
.fit-tabs { display: flex; margin: 10px 12px 6px; min-width: calc(var(--sidebar-w) - 25px); }
.fit-tabs button { flex: 1; padding: 0 4px; }
.fit-browser { overflow-y: auto; padding: 2px 0 16px; }
.fit-only { display: flex; align-items: center; gap: 6px; padding: 6px 14px 8px; font-size: 0.75rem; color: var(--text-secondary); cursor: pointer; }
.fit-only input { accent-color: var(--accent-primary); }
.fit-slot-filter { display: flex; align-items: center; justify-content: space-between; margin: 0 12px 6px; padding: 6px 10px; border-radius: var(--radius-sm); font-size: 0.75rem; color: var(--accent-primary); background: var(--accent-soft); }
.fit-group-head {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 12px; text-align: left;
  font-size: 0.8125rem; color: var(--text-primary);
}
.fit-group-head:hover { background: var(--bg-hover); }
.fit-group-head span { margin-left: auto; font-size: 0.6875rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.fit-group-head .category-chevron { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted); transition: transform var(--transition-fast); }
.fit-group.open > .fit-group-head .category-chevron { transform: rotate(90deg); }
.fit-group-head.is-static { color: var(--text-muted); font-size: 0.75rem; }
.fit-list { display: flex; flex-direction: column; padding: 2px 0 4px calc(var(--depth, 0) * 12px); }
.fit-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 12px 5px 16px; text-align: left; font-size: 0.8125rem; color: var(--text-primary); }
.fit-item:hover { background: var(--accent-soft); }
.fit-item img { border-radius: 4px; background: #0d1219; flex-shrink: 0; }
.fit-item-name { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.fit-item-name, .fit-item-name small { white-space: nowrap; text-overflow: ellipsis; }
.fit-item-name small { font-size: 0.6875rem; color: var(--text-muted); overflow: hidden; }
.fit-meta { flex-shrink: 0; padding: 0 5px; border-radius: 4px; font-size: 0.625rem; font-style: normal; line-height: 16px; color: var(--text-secondary); background: var(--bg-tertiary); }
.fit-meta.is-t2 { color: #e8b04a; background: rgba(232, 176, 74, 0.14); }
.fit-meta.is-t3 { color: #4fb3d9; background: rgba(79, 179, 217, 0.14); }
.fit-meta.is-faction { color: #5fbf5f; background: rgba(95, 191, 95, 0.14); }
.fit-meta.is-deadspace, .fit-meta.is-abyssal { color: #4f8ff7; background: rgba(79, 143, 247, 0.14); }
.fit-meta.is-officer { color: #c47ae0; background: rgba(196, 122, 224, 0.14); }
.fit-meta.is-story { color: #d97b4f; background: rgba(217, 123, 79, 0.14); }

.fit-scroll { flex: 1; min-width: 0; overflow-y: auto; position: relative; }
.fit-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; max-width: 1320px; margin: 0 auto; padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-xl); align-items: start; }
.fit-wrap:has(> .fit-stats[hidden]) { grid-template-columns: minmax(0, 1fr); }
.fit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
.fit-sk-cards { grid-template-columns: 1fr 1fr !important; }

.fit-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 80px 20px; text-align: center; color: var(--text-muted); }
.fit-empty svg { width: 56px; height: 56px; color: var(--border-secondary); }
.fit-empty h3 { font-size: 1.0625rem; color: var(--text-primary); font-weight: 600; }
.fit-empty p { font-size: 0.8125rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }

.fit-head { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); box-shadow: var(--shadow-sm); }
.fit-ship-img { border-radius: 10px; background: #0d1219; flex-shrink: 0; }
.fit-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fit-ship-group { font-size: 0.75rem; color: var(--text-muted); }
.fit-head-main h2 { font-size: 1.25rem; font-weight: 650; line-height: 1.25; }
.fit-name { margin-top: 4px; height: 30px; padding: 0 10px; border: 1px solid var(--border-primary); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); font-size: 0.8125rem; max-width: 320px; }
.fit-name:focus { outline: none; border-color: var(--border-accent); }
.fit-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.fit-actions .plain-select { max-width: 240px; }
.fit-action-row { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.fit-action-row .btn { height: 28px; padding: 0 8px; font-size: 0.75rem; }
.fit-action-row .btn.danger { color: var(--danger); }

.fit-skillbar { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; font-size: 0.8125rem; color: var(--text-secondary); flex-wrap: wrap; }
.fit-skillbar .segmented button:disabled { opacity: 0.5; cursor: not-allowed; }
.fit-missing { padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); cursor: help; }
.fit-ok { padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.fit-problems { margin-top: 10px; padding: 8px 12px; border-radius: var(--radius-md); border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border-primary)); background: color-mix(in srgb, var(--danger) 6%, var(--bg-secondary)); }
.fit-problems p { font-size: 0.8125rem; line-height: 1.6; }
.fit-problems p.is-error { color: var(--danger); }
.fit-problems p.is-warn { color: var(--warning); }

.fit-slots { margin-top: 14px; }
.fit-slots h4 { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); }
.fit-slots h4 span { margin-left: auto; font-size: 0.75rem; font-weight: 400; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.fit-slot {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; margin-bottom: 4px;
  border: 1px solid var(--border-primary); border-radius: var(--radius-md); background: var(--bg-secondary); cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.fit-slot:hover { border-color: var(--border-secondary); }
.fit-slot.is-selected { border-color: var(--accent-primary); box-shadow: 0 0 0 1px var(--accent-primary) inset; }
.fit-slot.is-error { border-color: color-mix(in srgb, var(--danger) 55%, var(--border-primary)); background: color-mix(in srgb, var(--danger) 5%, var(--bg-secondary)); }
.fit-slot.is-offline .fit-slot-name, .fit-slot.is-offline img { opacity: 0.5; }
.fit-slot.is-empty { border-style: dashed; color: var(--text-muted); font-size: 0.8125rem; background: transparent; }
.fit-slot.is-empty:hover { color: var(--accent-primary); border-color: var(--accent-primary); background: var(--accent-soft); }
.fit-slot.is-extra { border-color: var(--danger); color: var(--danger); }
.fit-slot-icon { width: 28px; height: 28px; border-radius: 6px; background: var(--bg-tertiary); flex-shrink: 0; }
.fit-slot img { border-radius: 6px; background: #0d1219; flex-shrink: 0; }
.fit-slot-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 0.875rem; color: var(--text-primary); overflow: hidden; }
.fit-slot-name, .fit-slot-name small { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.fit-slot-name small { font-size: 0.6875rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.fit-state-btn { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; }
.fit-state-btn i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--text-muted); }
.fit-state-btn.is-online i { border-color: var(--success); }
.fit-state-btn.is-active i { border-color: var(--success); background: var(--success); }
.fit-state-btn.is-overload i { border-color: var(--danger); background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.fit-state-btn:hover { background: var(--bg-hover); }
.fit-state-btn.is-static { visibility: hidden; }
.fit-charge { display: inline-flex; align-items: center; gap: 4px; max-width: 42%; height: 26px; padding: 0 4px 0 3px; border-radius: 6px; font-size: 0.75rem; color: var(--text-secondary); background: var(--bg-tertiary); white-space: nowrap; overflow: hidden; }
.fit-charge img { border-radius: 4px; }
.fit-charge button { width: 18px; height: 18px; border-radius: 4px; color: var(--text-muted); }
.fit-charge button:hover { color: var(--danger); background: var(--bg-hover); }
.fit-charge.is-empty { padding: 0 8px; color: var(--accent-primary); background: var(--accent-soft); }
.fit-remove { width: 26px; height: 26px; flex-shrink: 0; border-radius: 6px; font-size: 1.05rem; color: var(--text-muted); }
.fit-remove:hover { color: var(--danger); background: var(--sell-soft); }
.fit-stepper { display: inline-flex; align-items: center; border-radius: 6px; background: var(--bg-tertiary); font-variant-numeric: tabular-nums; }
.fit-stepper button { width: 24px; height: 24px; color: var(--text-secondary); }
.fit-stepper button:hover { color: var(--accent-primary); }
.fit-stepper b { min-width: 18px; text-align: center; font-size: 0.75rem; }
.fit-stepper.is-active b { color: var(--success); }
.fit-drone, .fit-drone:hover { cursor: default; }
.fit-skill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.fit-skill-list span { padding: 3px 8px; border-radius: 6px; font-size: 0.75rem; color: var(--text-secondary); background: var(--bg-tertiary); }
.fit-skill-list b { color: var(--warning); font-weight: 600; }

.fit-stats { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; }
.fit-stat-block { padding: 12px 14px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); box-shadow: var(--shadow-sm); }
.fit-stat-block h4 { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; font-size: 0.8125rem; font-weight: 600; }
.fit-stat-block h4 b { font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.fit-stat-block h4 b.good { color: var(--success); }
.fit-stat-block h4 b.bad, .fit-kv b.bad { color: var(--danger); }
.fit-kv { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 0.8125rem; color: var(--text-secondary); }
.fit-kv b { font-weight: 500; color: var(--text-primary); font-variant-numeric: tabular-nums; text-align: right; }
.fit-bar { position: relative; margin-bottom: 8px; }
.fit-bar-head { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 3px; }
.fit-bar-head b { font-weight: 500; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.fit-bar::after { content: ''; display: block; height: 6px; border-radius: 3px; background: var(--bg-tertiary); }
.fit-bar i { position: absolute; left: 0; bottom: 0; height: 6px; border-radius: 3px; background: var(--accent-primary); transition: width var(--transition-base); z-index: 1; }
.fit-bar.is-over i { background: var(--danger); }
.fit-bar.is-over .fit-bar-head b { color: var(--danger); }
.fit-dmg { display: flex; height: 6px; margin-top: 6px; border-radius: 3px; overflow: hidden; gap: 1px; }
.fit-dmg i.is-em, .fit-resist .is-em { --c: #4f8ff7; }
.fit-dmg i.is-th, .fit-resist .is-th { --c: #ef6b4e; }
.fit-dmg i.is-ki, .fit-resist .is-ki { --c: #9aa8bc; }
.fit-dmg i.is-ex, .fit-resist .is-ex { --c: #e8b04a; }
.fit-dmg i { background: var(--c); }
.fit-resist { width: 100%; border-collapse: collapse; font-size: 0.75rem; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.fit-resist th { font-weight: 500; color: var(--text-muted); padding: 2px 3px; text-align: center; }
.fit-resist thead th { color: var(--c, var(--text-muted)); }
.fit-resist tbody th { text-align: left; color: var(--text-secondary); white-space: nowrap; }
.fit-resist td { padding: 3px; text-align: center; color: var(--text-primary); background: linear-gradient(to right, color-mix(in srgb, var(--c, var(--accent-primary)) 22%, transparent) var(--r), transparent var(--r)); border: 1px solid var(--bg-secondary); }
.fit-resist td:nth-of-type(1) { --c: #4f8ff7; }
.fit-resist td:nth-of-type(2) { --c: #ef6b4e; }
.fit-resist td:nth-of-type(3) { --c: #9aa8bc; }
.fit-resist td:nth-of-type(4) { --c: #e8b04a; }
.fit-resist td.hp { background: none; text-align: right; color: var(--text-secondary); }
.fit-hint { font-size: 0.6875rem; color: var(--text-muted); margin-top: 4px; }
.fit-import-text { width: 100%; padding: 10px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); background: var(--bg-primary); color: var(--text-primary); font-family: var(--font-mono); font-size: 0.8125rem; resize: vertical; }
.fit-import-text:focus { outline: none; border-color: var(--border-accent); }
.fit-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

@media (max-width: 1100px) {
  .fit-wrap { grid-template-columns: minmax(0, 1fr); }
  .fit-stats { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
@media (max-width: 768px) {
  .fit-wrap { padding: var(--spacing-md) 12px var(--spacing-lg); gap: 14px; }
  .fit-head { flex-wrap: wrap; gap: 12px; padding: 12px; }
  .fit-ship-img { width: 64px; height: 64px; }
  .fit-actions { width: 100%; align-items: stretch; }
  .fit-actions .plain-select { max-width: none; }
  .fit-action-row { justify-content: flex-start; }
  .fit-name { max-width: none; }
  .fit-stats { grid-template-columns: 1fr; }
  .fit-charge { max-width: 38%; }
  .fit-slot { gap: 8px; padding: 6px 8px; }
}
@media (max-width: 400px) {
  .app-header { gap: 4px; }
  .nav-btn { padding: 0 8px; }
}

/* 游戏装配（ESI）弹窗 */
.fit-esi-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 0.8125rem; }
.fit-esi-search { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); background: var(--bg-primary); color: var(--text-primary); font-size: 0.8125rem; }
.fit-esi-search:focus { outline: none; border-color: var(--border-accent); }
.fit-esi-list { max-height: min(60vh, 520px); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.fit-esi-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-md); }
.fit-esi-row:hover { background: var(--bg-hover, rgba(127, 127, 127, 0.08)); }
.fit-esi-row img { border-radius: 4px; flex-shrink: 0; }
.fit-esi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fit-esi-main b { font-weight: 600; font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fit-esi-main span { font-size: 0.75rem; color: var(--text-muted); }
.fit-esi-row .btn { padding: 4px 10px; font-size: 0.75rem; }
.fit-esi-empty { padding: 32px 12px; text-align: center; color: var(--text-muted); font-size: 0.8125rem; }
.fit-esi-note { margin-top: 10px; font-size: 0.75rem; }

/* ===== 会战档次：小型（紫）/ 中型（橙）/ 大型（红），用动画强弱区分 ===== */
.tier-small { --tier: 180, 108, 255; }
.tier-medium { --tier: 255, 150, 50; }
.tier-large { --tier: 255, 64, 64; }
.battle-alert.tier-small, .battle-alert.tier-medium, .battle-alert.tier-large { border-color: rgba(var(--tier), 0.6); box-shadow: var(--shadow-lg), 0 0 0 3px rgba(var(--tier), 0.14); }
.battle-alert[class*="tier-"] .battle-alert-head strong, .battle-alert[class*="tier-"] .battle-icon, .battle-alert[class*="tier-"] .battle-sides i { color: rgb(var(--tier)); }
.battle-alert.tier-medium { animation: modal-in 220ms cubic-bezier(0.2, 0.9, 0.3, 1.2), tier-glow 2s ease-in-out 220ms infinite; }
.battle-alert.tier-large { animation: tier-shake 480ms ease-out, tier-glow-strong 1s ease-in-out 480ms infinite; }
.battle-alert.tier-large .battle-icon { animation: tier-icon 1s ease-in-out infinite; }

.kb-tier-badge { display: inline-flex; align-items: center; gap: 5px; margin-right: 8px; padding: 1px 8px 1px 6px; border-radius: 999px; font-size: 0.6875rem; font-weight: 600; vertical-align: 2px; color: rgb(var(--tier)); background: rgba(var(--tier), 0.14); }
.kb-tier-badge i, .kb-tier-chip i { width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--tier)); }
.kb-battle.tier-small .kb-tier-badge i { animation: tier-dot 3s ease-in-out infinite; }
.kb-battle.tier-medium .kb-tier-badge i { animation: tier-dot 1.6s ease-in-out infinite; }
.kb-battle.tier-large .kb-tier-badge i { animation: tier-dot 0.8s ease-in-out infinite; }
.kb-battle[class*="tier-"] { border-color: rgba(var(--tier), 0.35); border-left: 3px solid rgb(var(--tier)); }
.kb-battle.tier-medium { animation: tier-glow 2.4s ease-in-out infinite; }
.kb-battle.tier-large { animation: tier-glow-strong 1.2s ease-in-out infinite; }
.kb-battle-rule { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.kb-tier-chip { display: inline-flex; align-items: center; gap: 4px; color: rgb(var(--tier)); font-weight: 600; }
.kb-battle-notify { margin-left: auto; font-size: 0.75rem; color: var(--text-secondary); }

@keyframes tier-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--tier), 0); } 50% { box-shadow: 0 0 0 3px rgba(var(--tier), 0.18), 0 0 16px rgba(var(--tier), 0.25); } }
@keyframes tier-glow-strong { 0%, 100% { box-shadow: 0 0 0 1px rgba(var(--tier), 0.25), 0 0 6px rgba(var(--tier), 0.2); } 50% { box-shadow: 0 0 0 4px rgba(var(--tier), 0.3), 0 0 26px rgba(var(--tier), 0.45); } }
@keyframes tier-shake { 0% { transform: translateX(24px) scale(0.96); opacity: 0; } 35% { transform: translateX(-6px); opacity: 1; } 55% { transform: translateX(4px); } 75% { transform: translateX(-2px); } 100% { transform: none; } }
@keyframes tier-icon { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
@keyframes tier-dot { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--tier), 0.6); } 50% { box-shadow: 0 0 0 4px rgba(var(--tier), 0); } }
@media (prefers-reduced-motion: reduce) {
  .battle-alert[class*="tier-"], .battle-alert .battle-icon, .kb-battle[class*="tier-"], .kb-tier-badge i { animation: none !important; }
}

/* ===== 战场统计 ===== */
:root { --br-a: #4f8ff7; --br-b: #f0524f; }
.kb-br-entry { height: 40px; gap: 6px; }
.kb-br-entry svg { width: 16px; height: 16px; }
.kb-br-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 12px; }
.kb-br-head { align-items: center; }
.kb-br-back { height: 36px; padding: 0 14px 0 10px; gap: 6px; border: 1px solid var(--border-accent); border-radius: 999px; background: color-mix(in srgb, var(--accent-primary) 12%, transparent); color: var(--accent-primary); font-size: 0.8125rem; font-weight: 600; text-decoration: none; margin-right: 6px; transition: background var(--transition-fast), transform var(--transition-fast); }
.kb-br-back svg { width: 16px; height: 16px; transition: transform var(--transition-fast); }
.kb-br-back:hover { background: var(--accent-primary); color: #fff; }
.kb-br-back:hover svg { transform: translateX(-3px); }
.kb-back-btn { display: inline-flex; align-items: center; margin-bottom: 14px; }
.kb-br-head h2 { font-size: 1.25rem; font-weight: 700; }
.kb-br-head .text-muted { font-size: 0.8125rem; }
.kb-br-form { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); margin-bottom: var(--spacing-lg); }
.kb-br-row { display: grid; grid-template-columns: 88px 1fr; gap: 12px; align-items: start; }
.kb-br-label { padding-top: 8px; font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); display: flex; flex-direction: column; }
.kb-br-label small { font-weight: 400; color: var(--text-muted); font-size: 0.6875rem; }
.kb-br-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kb-br-search { position: relative; flex: none; width: 100%; max-width: 360px; height: 36px; background: var(--bg-primary); }
.kb-br-picked { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.8125rem; }
.kb-br-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--bg-tertiary); font-weight: 600; }
.kb-br-chip b { font-weight: 600; }
.kb-br-chip button { width: 20px; height: 20px; border-radius: 50%; color: var(--text-muted); }
.kb-br-chip button:hover { background: var(--bg-hover); color: var(--text-primary); }
.kb-br-near-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 0.8125rem; }
.kb-br-near-head .text-muted { font-size: 0.75rem; }
.kb-br-near { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 10px; max-height: 220px; overflow-y: auto; padding: 4px 0; }
.kb-br-near-item { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: var(--radius-sm); font-size: 0.8125rem; cursor: pointer; }
.kb-br-near-item:hover { background: var(--bg-hover); }
.kb-br-near-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-br-near-item small { color: var(--text-muted); font-size: 0.6875rem; }
.kb-br-time { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 0.8125rem; color: var(--text-secondary); }
.kb-br-time input { height: 34px; padding: 0 8px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); background: var(--bg-primary); color: var(--text-primary); font: inherit; color-scheme: light dark; }
.kb-br-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-muted); }
.kb-br-quick button { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border-primary); color: var(--text-secondary); }
.kb-br-quick button:hover, .kb-br-quick button.active { border-color: var(--accent-primary); color: var(--accent-primary); }
.kb-br-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding-left: 100px; }
.kb-br-actions .text-muted { font-size: 0.75rem; }
.kb-br-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px; color: var(--text-muted); font-size: 0.875rem; }

.kb-br-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 12px; }
.kb-br-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kb-br-title strong { font-size: 1.0625rem; }
.kb-br-title .text-muted { font-size: 0.75rem; }
.kb-br-tools { display: flex; gap: 8px; }
.kb-br-tools .btn { height: 32px; font-size: 0.8125rem; }

.side-a { --side: var(--br-a); }
.side-b { --side: var(--br-b); }
.kb-br-side-name { font-size: 1rem; font-weight: 700; color: var(--side); display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.kb-br-badge { font-style: normal; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: var(--side); color: #fff; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }
.kb-br-side-name small { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }
.kb-br-ratio { position: relative; overflow: hidden; padding: 18px 20px 16px; margin-bottom: 12px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg);
  background: linear-gradient(100deg, color-mix(in srgb, var(--br-a) 11%, var(--bg-secondary)) 0%, var(--bg-secondary) 38%, var(--bg-secondary) 62%, color-mix(in srgb, var(--br-b) 11%, var(--bg-secondary)) 100%); }
.kb-br-ratio-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.kb-br-ratio-side.side-b { text-align: right; }
.kb-br-ratio-side.side-b .kb-br-side-name { justify-content: flex-end; }
.kb-br-ratio-side .kb-br-side-name { margin-bottom: 6px; }
.kb-br-ratio-isk { font-size: 2.25rem; font-weight: 800; line-height: 1.1; color: var(--side); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kb-br-ratio-isk small { display: block; font-size: 0.75rem; font-weight: 400; color: var(--text-muted); letter-spacing: 0; margin-top: 2px; }
.kb-br-ratio-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.kb-br-ratio-label { font-size: 0.75rem; color: var(--text-muted); letter-spacing: 0.2em; }
.kb-br-ratio-num { display: flex; align-items: baseline; gap: 10px; font-size: 3.25rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kb-br-ratio-num .a { color: var(--br-a); }
.kb-br-ratio-num .b { color: var(--br-b); }
.kb-br-ratio-num i { font-style: normal; font-weight: 400; font-size: 2.25rem; color: var(--text-muted); transform: translateY(-4px); }
.kb-br-verdict { margin-top: 4px; padding: 3px 12px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; background: var(--bg-tertiary); color: var(--text-secondary); }
.kb-br-verdict.win-a { background: color-mix(in srgb, var(--br-a) 16%, transparent); color: var(--br-a); }
.kb-br-verdict.win-b { background: color-mix(in srgb, var(--br-b) 16%, transparent); color: var(--br-b); }
.kb-br-share { display: flex; height: 26px; margin-top: 16px; border-radius: 8px; overflow: hidden; background: var(--bg-tertiary); gap: 2px; }
.kb-br-share i { font-style: normal; display: flex; align-items: center; min-width: 0; transition: width 400ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.kb-br-share i.a { background: linear-gradient(90deg, color-mix(in srgb, var(--br-a) 75%, #000), var(--br-a)); justify-content: flex-start; }
.kb-br-share i.b { background: linear-gradient(90deg, var(--br-b), color-mix(in srgb, var(--br-b) 75%, #000)); justify-content: flex-end; }
.kb-br-share span { padding: 0 10px; color: #fff; font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.kb-br-share-note { display: flex; justify-content: space-between; margin-top: 6px; font-size: 0.75rem; color: var(--text-muted); }
.kb-br-share-note b { color: var(--text-primary); }
.kb-br-cmps { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border-primary); }
.kb-br-cmp { display: grid; grid-template-columns: 96px 1fr 96px; align-items: center; gap: 12px; }
.kb-br-cmp > b { font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.kb-br-cmp > b.a { color: var(--br-a); text-align: right; }
.kb-br-cmp > b.b { color: var(--br-b); }
.kb-br-cmp-bar { position: relative; display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: visible; }
.kb-br-cmp-bar i { height: 100%; transition: width 400ms; }
.kb-br-cmp-bar i.a { background: color-mix(in srgb, var(--br-a) 70%, transparent); border-radius: 999px 0 0 999px; }
.kb-br-cmp-bar i.b { background: color-mix(in srgb, var(--br-b) 70%, transparent); border-radius: 0 999px 999px 0; }
.kb-br-cmp-bar span { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 0.6875rem; color: var(--text-muted); white-space: nowrap; }
.kb-br-cmp { padding-top: 12px; }

.kb-br-chart { padding: 14px 16px 10px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); margin-bottom: 12px; }
.kb-br-chart-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 8px; }
.kb-br-chart-head h4 { font-size: 0.875rem; font-weight: 600; }
.kb-br-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-right: auto; font-size: 0.75rem; color: var(--text-muted); }
.kb-br-legend span { display: inline-flex; align-items: center; gap: 6px; }
.kb-br-legend i { width: 10px; height: 10px; border-radius: 3px; }
.kb-br-legend .a i { background: var(--br-a); }
.kb-br-legend .b i { background: var(--br-b); }
.kb-br-legend b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.kb-br-chart-head .segmented button { font-size: 0.75rem; }
.kb-br-plot { position: relative; width: 100%; }
.kb-br-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.kb-br-plot svg * { pointer-events: none; }
.kb-br-plot .hit { fill: transparent; pointer-events: all; cursor: crosshair; }
.kb-br-plot .grid { stroke: var(--border-primary); stroke-width: 1; stroke-dasharray: 3 4; }
.kb-br-plot .grid.base { stroke: var(--border-secondary); stroke-dasharray: none; }
.kb-br-plot .ax { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.kb-br-plot .ax.side { font-size: 10.5px; font-weight: 600; }
.kb-br-plot .ax.side.a { fill: var(--br-a); }
.kb-br-plot .ax.side.b { fill: var(--br-b); }
.kb-br-plot .ln { fill: none; stroke-width: 2.25; stroke-linejoin: round; }
.kb-br-plot .ln.a { stroke: var(--br-a); }
.kb-br-plot .ln.b { stroke: var(--br-b); }
.kb-br-plot .bar.a { fill: var(--br-a); }
.kb-br-plot .bar.b { fill: var(--br-b); }
.kb-br-plot .mk { stroke: var(--bg-secondary); stroke-width: 2; pointer-events: all; cursor: pointer; transition: r 120ms; }
.kb-br-plot .mk:hover { r: 7; }
.kb-br-plot .mk.a { fill: var(--br-a); }
.kb-br-plot .mk.b { fill: var(--br-b); }
.kb-br-plot .cross { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 2 3; }
.kb-br-tip { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--radius-md); background: var(--bg-elevated, var(--bg-secondary)); border: 1px solid var(--border-primary); box-shadow: var(--shadow-lg); font-size: 0.75rem; white-space: nowrap; pointer-events: none; }
.kb-br-tip b { font-weight: 600; margin-bottom: 2px; }
.kb-br-tip .a { color: var(--br-a); }
.kb-br-tip .b { color: var(--br-b); }

.kb-br-switch { display: none; margin-bottom: 10px; }
.kb-br-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kb-br-col { min-width: 0; padding: 12px 14px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); }
.kb-br-col h4 { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 6px; font-size: 0.8125rem; font-weight: 600; }
.kb-br-col.side-a, .kb-br-col.side-b { background: linear-gradient(180deg, color-mix(in srgb, var(--side) 7%, var(--bg-secondary)) 0, var(--bg-secondary) 140px); }
.kb-br-col h4:first-child { margin-top: 0; }
.kb-br-col-title { font-size: 0.875rem !important; color: var(--side); }
.kb-br-col-title .kb-br-badge { width: 20px; height: 20px; font-size: 0.6875rem; }
.kb-br-col h4 span { margin-left: auto; font-weight: 400; font-size: 0.75rem; color: var(--text-muted); }
.kb-br-third { margin-top: 12px; }
.kb-br-third h4 span { margin-left: 8px; }
.kb-br-parties { display: flex; flex-direction: column; gap: 2px; }
.kb-br-third .kb-br-parties { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 2px 12px; }
.kb-br-party { display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-radius: var(--radius-sm); }
.kb-br-party:hover { background: var(--bg-hover); }
.kb-br-party img { border-radius: 4px; flex-shrink: 0; }
.kb-br-party-main { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 0.8125rem; }
.kb-br-party-main .kb-link { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-br-party-main small { font-size: 0.6875rem; color: var(--text-muted); }
.kb-br-move { display: flex; gap: 4px; }
.kb-br-move button { width: 26px; height: 24px; border-radius: 6px; border: 1px solid var(--border-primary); font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }
.kb-br-move button:hover { color: var(--text-primary); background: var(--bg-hover); }
.kb-br-move button.m-a { color: var(--br-a); border-color: color-mix(in srgb, var(--br-a) 45%, transparent); }
.kb-br-move button.m-b { color: var(--br-b); border-color: color-mix(in srgb, var(--br-b) 45%, transparent); }
.kb-br-move button.m-a:hover { background: color-mix(in srgb, var(--br-a) 14%, transparent); }
.kb-br-move button.m-b:hover { background: color-mix(in srgb, var(--br-b) 14%, transparent); }
.kb-br-table { max-height: 360px; overflow-y: auto; }
.kb-br-table table { width: 100%; }
.kb-br-table td { padding: 4px 6px; font-size: 0.8125rem; vertical-align: middle; }
.kb-br-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kb-br-table td.lost { color: var(--sell-color); font-weight: 600; }
.kb-br-table td small { display: block; font-size: 0.6875rem; color: var(--text-muted); }
.kb-br-ship { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kb-br-ship img { border-radius: 3px; flex-shrink: 0; }
.kb-br-ship span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-br-losses tr { cursor: pointer; }
.kb-br-losses tr:hover { background: var(--bg-hover); }
.kb-br-none { font-size: 0.75rem; padding: 6px; }

@media (max-width: 900px) {
  .kb-br-ratio-isk { font-size: 1.75rem; }
  .kb-br-ratio-num { font-size: 2.5rem; }
  .kb-br-switch { display: inline-flex; }
  .kb-br-cols { grid-template-columns: 1fr; }
  .kb-br-cols[data-view="A"] .kb-br-col.side-b, .kb-br-cols[data-view="B"] .kb-br-col.side-a { display: none; }
}
@media (max-width: 600px) {
  .kb-br-row { grid-template-columns: 1fr; gap: 4px; }
  .kb-br-label { padding-top: 0; flex-direction: row; gap: 6px; align-items: baseline; }
  .kb-br-actions { padding-left: 0; }
  .kb-br-ratio { padding: 14px; }
  .kb-br-ratio-top { grid-template-columns: 1fr 1fr; gap: 12px 8px; }
  .kb-br-ratio-mid { grid-column: 1 / -1; grid-row: 1; }
  .kb-br-ratio-isk { font-size: 1.375rem; }
  .kb-br-ratio-side .kb-br-side-name small { display: none; }
  .kb-br-cmp { grid-template-columns: 64px 1fr 64px; gap: 8px; }
  .kb-br-cmp > b { font-size: 0.8125rem; }
  .kb-br-entry { height: 36px; }
}
.kb-br-tools .btn svg { width: 15px; height: 15px; }
.kb-br-tools .btn-primary { gap: 6px; }
.kb-br-image-modal .modal-content { max-width: 760px; width: calc(100vw - 32px); }
.kb-br-image-preview { max-height: min(68vh, 900px); overflow-y: auto; border-radius: var(--radius-md); background: #0b0f17; }
.kb-br-image-preview img { display: block; width: 100%; height: auto; }
.kb-br-image-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.kb-br-image-actions .text-muted { margin-right: auto; font-size: 0.75rem; }

/* ===== 行星工业规划 ===== */
.pi-loading { padding: 48px 0; text-align: center; color: var(--text-muted); font-size: 0.875rem; }
.pi-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: var(--spacing-md); }
.pi-head h2 { font-size: 1.25rem; font-weight: 700; }
.pi-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: var(--spacing-lg); align-items: start; }
.pi-form { position: sticky; top: 0; display: flex; flex-direction: column; gap: 18px; padding: 16px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); }
.pi-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pi-field > label { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); }
.pi-field .segmented { display: flex; }
.pi-field .segmented button { flex: 1; padding: 0 6px; }
.pi-input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); background: var(--bg-tertiary); color: var(--text-primary); font: inherit; font-size: 0.8125rem; }
.pi-input:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-ring); }
.pi-search { position: relative; height: 36px; background: var(--bg-tertiary); flex: none; }
.pi-inline { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--text-secondary); }
.pi-inline > span:first-child { flex: none; width: 56px; }
.pi-inline .segmented { flex: 1; }
.pi-tax { width: 80px; flex: none; }
.pi-checks { display: flex; gap: 6px; flex-wrap: wrap; }
.pi-check { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border-primary); border-radius: 999px; font-size: 0.75rem; cursor: pointer; user-select: none; }
.pi-check input { accent-color: var(--accent-primary); margin: 0; }
.pi-check.sec-high span { color: var(--buy-color); }
.pi-check.sec-low span { color: var(--warning); }
.pi-check.sec-null span { color: var(--sell-color); }
.pi-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pi-num { display: flex; flex-direction: column; gap: 4px; font-size: 0.6875rem; color: var(--text-muted); }
.pi-hint { font-size: 0.6875rem; color: var(--text-muted); line-height: 1.5; }
.pi-go { height: 42px; font-size: 0.9375rem; font-weight: 600; gap: 8px; }
.pi-go svg { width: 18px; height: 18px; }

.pi-result { display: flex; flex-direction: column; gap: var(--spacing-md); min-width: 0; }
.pi-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 72px 16px; border: 1px dashed var(--border-secondary); border-radius: var(--radius-lg); color: var(--text-muted); text-align: center; font-size: 0.875rem; }
.pi-empty svg { width: 56px; height: 56px; opacity: 0.6; }
.pi-empty b { color: var(--text-primary); }
.pi-area { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--bg-secondary); border: 1px solid var(--border-primary); }
.pi-area-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 0.8125rem; color: var(--text-secondary); }
.pi-area-title b { font-size: 1rem; color: var(--text-primary); }
.pi-ptypes { display: flex; gap: 6px; flex-wrap: wrap; }
.pi-ptype { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--pt) 14%, transparent); font-size: 0.75rem; color: var(--text-secondary); }
.pi-ptype i, .pi-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pt); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pt) 22%, transparent); flex: none; }
.pi-ptype b { color: var(--text-primary); font-variant-numeric: tabular-nums; }

.pi-card { padding: 16px; border-radius: var(--radius-lg); background: var(--bg-secondary); border: 1px solid var(--border-primary); min-width: 0; scroll-margin-top: 12px; }
.pi-card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pi-card-head h3, .pi-detail h3 { font-size: 1rem; font-weight: 700; }
.pi-card-head .text-muted { font-size: 0.75rem; }
.pi-table-wrap { overflow-x: auto; max-height: 440px; overflow-y: auto; }
.pi-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.pi-table th { position: sticky; top: 0; z-index: 1; background: var(--bg-secondary); padding: 6px 8px; text-align: left; font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border-primary); }
.pi-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-primary); white-space: nowrap; }
.pi-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pi-table tbody tr { cursor: pointer; transition: background var(--transition-fast); }
.pi-table tbody tr:hover { background: var(--bg-hover); }
.pi-table tbody tr.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent-primary); }
.pi-rank { color: var(--text-muted); width: 28px; }
.pi-prod { display: flex; align-items: center; gap: 8px; }
.pi-prod img { border-radius: 4px; background: #0d1219; }
.pi-prod span { display: flex; align-items: baseline; gap: 6px; font-weight: 600; }
.pi-prod small { font-size: 0.625rem; font-weight: 600; padding: 1px 5px; border-radius: 4px; background: var(--bg-tertiary); color: var(--text-muted); }
.pi-profit { color: var(--buy-color); font-weight: 700; }

.pi-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pi-detail-head img { border-radius: var(--radius-md); background: #0d1219; }
.pi-detail-head .text-muted { font-size: 0.75rem; }
.pi-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.pi-stats > div { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg-tertiary); }
.pi-stats span { font-size: 0.6875rem; color: var(--text-muted); }
.pi-stats b { font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.pi-stats .pi-stat-main { background: color-mix(in srgb, var(--buy-color) 13%, transparent); }
.pi-stats .pi-stat-main b { color: var(--buy-color); }
.pi-detail h4 { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 8px; }
.pi-chain { display: flex; flex-direction: column; gap: 6px; }
.pi-chain-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pi-chain-row em { width: 26px; font-style: normal; font-size: 0.6875rem; font-weight: 700; color: var(--text-muted); }
.pi-chain-row span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--bg-tertiary); font-size: 0.75rem; }
.pi-chain-row span img { border-radius: 50%; }
.pi-chain-row span b { font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.pi-chain-row span small { color: var(--text-muted); font-size: 0.6875rem; }
.pi-chain-row .pi-chain-final { background: var(--accent-soft); color: var(--text-primary); font-weight: 600; }
.pi-wh { align-items: flex-start; }
.pi-wh .segmented { flex-wrap: wrap; }
.pi-chain-row .pi-chain-buy { background: transparent; box-shadow: inset 0 0 0 1px var(--border-primary); }
.pi-detail .pi-note.warn { margin: 10px 0 0; }
.pi-note { margin-top: 10px; font-size: 0.75rem; color: var(--text-muted); line-height: 1.6; }
.pi-note.warn { color: var(--warning); margin: 0 0 10px; }

.pi-chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pi-char { padding: 10px; border-radius: var(--radius-md); background: var(--bg-tertiary); }
.pi-char-head { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.8125rem; font-weight: 700; }
.pi-char-head span { font-weight: 400; font-size: 0.75rem; color: var(--text-muted); }
.pi-planet { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-top: 1px solid var(--border-primary); }
.pi-planet:first-of-type { border-top: 0; }
.pi-planet-main { flex: 1; min-width: 0; font-size: 0.8125rem; }
.pi-planet-main span { font-size: 0.75rem; font-weight: 600; }
.pi-planet-main small { display: block; font-size: 0.6875rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-role { flex: none; max-width: 48%; padding: 3px 8px; border-radius: var(--radius-sm); background: var(--bg-secondary); font-size: 0.6875rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-role:hover { color: var(--accent-primary); }

.pi-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.pi-tpl { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--radius-md); background: var(--bg-tertiary); transition: box-shadow var(--transition-base); }
.pi-tpl.flash { animation: pi-flash 1.2s ease-out; }
@keyframes pi-flash { 0%, 40% { box-shadow: 0 0 0 2px var(--accent-primary); } 100% { box-shadow: 0 0 0 2px transparent; } }
.pi-tpl-head { display: flex; align-items: flex-start; gap: 10px; }
.pi-tpl-head .pi-dot { margin-top: 5px; }
.pi-tpl-head b { display: block; font-size: 0.875rem; }
.pi-tpl-head small { display: block; margin-top: 2px; font-size: 0.6875rem; color: var(--text-muted); line-height: 1.5; }
.pi-bars { display: flex; flex-direction: column; gap: 5px; }
.pi-bar { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px; font-size: 0.6875rem; color: var(--text-muted); }
.pi-bar div { height: 6px; border-radius: 3px; background: var(--bg-secondary); overflow: hidden; }
.pi-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent-primary); }
.pi-bar b { font-weight: 500; font-variant-numeric: tabular-nums; }
.pi-tpl-actions { display: flex; gap: 8px; }
.pi-tpl-actions .btn { flex: 1; height: 32px; font-size: 0.8125rem; }
.pi-howto { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--accent-soft); font-size: 0.8125rem; line-height: 1.7; }
.pi-howto ol { margin: 4px 0 0 1.2em; color: var(--text-secondary); }
.pi-howto code { padding: 1px 5px; border-radius: 4px; background: var(--bg-secondary); font-family: var(--font-mono); font-size: 0.75rem; }
.pi-howto .pi-note { margin-top: 6px; }

@media (max-width: 1100px) {
  .pi-layout { grid-template-columns: 1fr; }
  .pi-form { position: static; }
  .pi-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .pi-hide-sm { display: none; }
  .pi-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pi-stats .pi-stat-main { grid-column: 1 / -1; }
  .pi-chars, .pi-tpls { grid-template-columns: 1fr; }
}

/* ===== 殖民地模板预览 / 编辑器（仿游戏行星界面）===== */
.pi-head .pi-editor-entry { margin-left: auto; height: 34px; gap: 6px; }
.pi-head .pi-editor-entry svg { width: 16px; height: 16px; }
.pi-tpl-preview { position: relative; display: block; width: 100%; padding: 0; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; background: #000; }
.pi-tpl-preview .pie-thumb { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; }
.pi-tpl-edit { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: rgb(5 8 13 / 0.72); color: #e8edf5; font-size: 0.6875rem; opacity: 0.85; transition: opacity var(--transition-fast), background var(--transition-fast); }
.pi-tpl-edit svg { width: 12px; height: 12px; }
.pi-tpl-preview:hover .pi-tpl-edit { opacity: 1; background: var(--accent-primary); }
.pi-tpl-edited { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; background: var(--warning); color: #111; font-size: 0.625rem; font-weight: 700; }

html.pie-open { overflow: hidden; }
.pie-modal { --pie-line: rgb(150 190 220 / 0.18); --pie-glass: rgb(8 13 20 / 0.78); --pie-text: #d8e3ee; --pie-dim: #8698ab; --pie-accent: #4fd1e8;
  position: fixed; inset: 0; z-index: 300; display: flex; background: #000; color: var(--pie-text); font-size: 13px; }
.pie-modal[hidden] { display: none; }
.pie-dialog { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; }
.pie-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #000; }
.pie-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; cursor: grab; }
.pie-hud-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; pointer-events: none; background: linear-gradient(rgb(0 0 0 / 0.55), transparent); }
.pie-title { display: flex; flex-direction: column; gap: 2px; text-shadow: 0 1px 3px #000; }
.pie-title small { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pie-accent); }
.pie-title b { font-size: 17px; font-weight: 600; letter-spacing: 0.02em; }
.pie-top-actions { display: flex; align-items: center; gap: 12px; pointer-events: auto; }
.pie-hint { font-size: 11px; color: var(--pie-dim); text-shadow: 0 1px 2px #000; }
.pie-x { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--pie-line); background: var(--pie-glass); color: var(--pie-text); }
.pie-x svg { width: 18px; height: 18px; }
.pie-x:hover { border-color: var(--pie-accent); color: #fff; }
.pie-zoom { position: absolute; right: 16px; top: 64px; display: flex; flex-direction: column; border: 1px solid var(--pie-line); background: var(--pie-glass); }
.pie-zoom button { width: 34px; height: 32px; color: var(--pie-text); font-size: 15px; }
.pie-zoom button + button { border-top: 1px solid var(--pie-line); }
.pie-zoom button:hover { background: rgb(79 209 232 / 0.15); color: #fff; }

/* 底部 HUD：资源仪表 + 建造栏 */
.pie-hud-bottom { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: stretch; max-width: calc(100% - 24px); border: 1px solid var(--pie-line); background: var(--pie-glass); backdrop-filter: blur(6px); box-shadow: 0 8px 30px rgb(0 0 0 / 0.5); }
.pie-hud-bottom::before { content: ''; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--pie-accent), transparent); opacity: 0.6; }
.pie-gauges { display: flex; flex-direction: column; justify-content: center; gap: 8px; width: 200px; padding: 10px 14px; border-right: 1px solid var(--pie-line); }
.pie-gauge > div { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; margin-bottom: 4px; }
.pie-gauge span { color: var(--pie-dim); letter-spacing: 0.08em; }
.pie-gauge b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pie-gauge small { font-weight: 400; color: var(--pie-dim); }
.pie-gauge i { display: block; height: 5px; background: rgb(255 255 255 / 0.08); }
.pie-gauge em { display: block; height: 100%; }
.pie-gauge.pg em { background: linear-gradient(90deg, #2b8fd6, #5ec8ff); box-shadow: 0 0 8px #5ec8ff88; }
.pie-gauge.cpu em { background: linear-gradient(90deg, #2fae7a, #6ef0b0); box-shadow: 0 0 8px #6ef0b088; }
.pie-gauge.over b { color: #ff6b6b; }
.pie-gauge.over em { background: #ff5a5a; box-shadow: 0 0 8px #ff5a5a; }
.pie-build { display: flex; gap: 2px; padding: 6px; overflow-x: auto; }
.pie-build button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 64px; padding: 6px 6px 4px; color: var(--pie-text); font-size: 11px; white-space: nowrap; border: 1px solid transparent; }
.pie-build button img { width: 36px; height: 36px; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--k) 55%, transparent)); }
.pie-build button:hover { border-color: var(--pie-line); background: color-mix(in srgb, var(--k, #4fd1e8) 14%, transparent); }
.pie-build .pie-link-btn svg { width: 30px; height: 30px; padding: 4px; color: var(--pie-accent); }
.pie-build .pie-link-btn.active { background: rgb(79 209 232 / 0.2); border-color: var(--pie-accent); }

/* 右侧信息栏 */
.pie-side { display: flex; flex-direction: column; gap: 10px; padding: 12px; overflow-y: auto; background: linear-gradient(#0a1019, #070b12); border-left: 1px solid var(--pie-line); }
.pie-panel { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--pie-line); background: rgb(255 255 255 / 0.02); }
.pie-panel > header { display: flex; align-items: center; gap: 6px; margin: -2px 0 2px; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--pie-accent); }
.pie-panel > header em { font-style: normal; padding: 0 6px; background: #ff5a5a; color: #fff; letter-spacing: 0; font-size: 10px; }
.pie-row { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--pie-dim); min-width: 0; }
.pie-row input[type=range] { accent-color: #00e7ea; }
.pie-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pie-heads { color: #7ff3ea; font-size: 13px; }
.pie-input { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--pie-line); background: rgb(0 0 0 / 0.35); color: var(--pie-text); font: inherit; font-size: 12px; border-radius: 0; }
.pie-input:focus { outline: none; border-color: var(--pie-accent); }
.pie-input option, .pie-input optgroup { background: #0a1019; }
.pie-counts { display: flex; flex-wrap: wrap; gap: 4px; }
.pie-counts span { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border: 1px solid var(--pie-line); font-size: 11px; color: var(--pie-dim); }
.pie-counts i { width: 7px; height: 7px; border-radius: 50%; background: var(--k); box-shadow: 0 0 6px var(--k); }
.pie-sel-head { display: flex; align-items: center; gap: 10px; }
.pie-sel-head img { border-radius: 50%; background: #060a12; box-shadow: 0 0 0 1px var(--pie-line); }
.pie-sel-head b { display: block; font-size: 13px; font-weight: 600; }
.pie-sel-head small { display: block; font-size: 11px; color: var(--pie-dim); margin-top: 2px; }
.pie-io { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 11px; }
.pie-io span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 3px; background: rgb(52 211 153 / 0.1); border: 1px solid rgb(52 211 153 / 0.25); }
.pie-io span.out { background: rgb(255 170 60 / 0.1); border-color: rgb(255 170 60 / 0.3); }
.pie-io img { border-radius: 50%; }
.pie-io em { font-style: normal; color: var(--pie-dim); }
.pie-io small { width: 100%; color: var(--pie-dim); font-size: 10px; }
.pie-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12px; }
.pie-kv span { color: var(--pie-dim); }
.pie-kv b { font-weight: 500; font-variant-numeric: tabular-nums; }
.pie-sel-actions { display: flex; gap: 6px; }
.pie-btn { flex: 1; height: 32px; padding: 0 10px; border: 1px solid var(--pie-line); background: rgb(255 255 255 / 0.04); color: var(--pie-text); font-size: 12px; letter-spacing: 0.04em; }
.pie-btn:hover { border-color: var(--pie-accent); background: rgb(79 209 232 / 0.1); }
.pie-btn.primary { background: linear-gradient(#1d6f86, #155568); border-color: #3fb7d1; color: #fff; font-weight: 600; }
.pie-btn.primary:hover { background: linear-gradient(#2483a0, #186178); }
.pie-btn.danger { color: #ff8a8a; }
.pie-btn.danger:hover { border-color: #ff6b6b; background: rgb(255 90 90 / 0.1); }
.pie-tip { padding: 10px 12px; border: 1px dashed var(--pie-line); font-size: 12px; color: var(--pie-dim); line-height: 1.6; }
.pie-problems { display: flex; flex-direction: column; gap: 4px; padding: 0; list-style: none; }
.pie-problems li { padding: 6px 9px; border-left: 2px solid #ff5a5a; background: rgb(255 90 90 / 0.08); color: #ffb0b0; font-size: 12px; line-height: 1.5; }
.pie-problems li[data-pie-goto], .pie-problems li[data-pie-goto-link] { cursor: pointer; }
.pie-problems li:hover { background: rgb(255 90 90 / 0.15); }
.pie-ok { padding: 6px 9px; border-left: 2px solid #34d399; background: rgb(52 211 153 / 0.08); color: #8af0c4; font-size: 12px; }
.pie-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: auto; padding-top: 4px; }
.pie-actions .pie-btn { height: 34px; }
.pie-actions .wide { grid-column: 1 / -1; height: 38px; }

@media (max-width: 900px) {
  .pie-dialog { grid-template-columns: 1fr; grid-template-rows: minmax(320px, 60%) 1fr; }
  .pie-side { border-left: 0; border-top: 1px solid var(--pie-line); }
  .pie-hint { display: none; }
  .pie-hud-bottom { left: 8px; right: 8px; bottom: 8px; transform: none; max-width: none; flex-direction: column; }
  .pie-gauges { width: auto; flex-direction: row; gap: 12px; padding: 6px 10px; border-right: 0; border-bottom: 1px solid var(--pie-line); }
  .pie-gauge { flex: 1; }
  .pie-build button { min-width: 52px; padding: 4px; font-size: 10px; }
  .pie-build button img { width: 30px; height: 30px; }
  .pie-zoom { top: 58px; right: 10px; }
}
/* 会战提醒自动消失时淡出 */
.battle-alert { transition: opacity 280ms ease, transform 280ms ease; }
.battle-alert.leaving { opacity: 0; transform: translateX(16px); animation: none; }

/* ===== 个人中心 · 技能 ===== */
.sk-cards { margin-bottom: var(--spacing-md); }
.sk-cards .unit { margin-left: 4px; font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.sk-note { margin-bottom: var(--spacing-md); }
.sk-queue { margin-bottom: var(--spacing-md); padding: 12px 14px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); }
.sk-queue h3 { font-size: 0.875rem; margin-bottom: 8px; }
.sk-queue ol { display: flex; flex-direction: column; gap: 2px; list-style: none; padding: 0; max-height: 260px; overflow-y: auto; }
.sk-queue li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 0.8125rem; }
.sk-queue li.active { background: var(--accent-soft); }
.sk-q-name b { margin-left: 4px; color: var(--accent-primary); }
.sk-q-time { color: var(--text-muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.sk-q-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--bg-tertiary); overflow: hidden; }
.sk-q-bar em { display: block; height: 100%; background: var(--accent-primary); }
.sk-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.sk-search { position: relative; flex: 1; min-width: 200px; max-width: 360px; height: 36px; background: var(--bg-secondary); }
.sk-legend { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; flex: none; white-space: nowrap; font-size: 0.6875rem; color: var(--text-muted); }
.sk-legend i, .sk-boxes i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--border-secondary); background: transparent; }
.sk-legend i { margin-left: 6px; }
.sk-legend i.on, .sk-boxes i.on { background: var(--accent-primary); border-color: var(--accent-primary); }
.sk-legend i.limited, .sk-boxes i.limited { background: var(--warning); border-color: var(--warning); opacity: 0.6; }
.sk-legend i.queued, .sk-boxes i.queued { border-color: var(--accent-primary); background: repeating-linear-gradient(45deg, var(--accent-soft) 0 2px, transparent 2px 4px); }
.sk-groups { display: flex; flex-direction: column; gap: 8px; }
.sk-group { border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); overflow: hidden; }
.sk-group summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 120px auto; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; font-size: 0.875rem; }
.sk-group summary::-webkit-details-marker { display: none; }
.sk-group summary:hover { background: var(--bg-hover); }
.sk-g-name { font-weight: 600; }
.sk-g-name::before { content: '▸'; display: inline-block; margin-right: 8px; color: var(--text-muted); transition: transform var(--transition-fast); }
.sk-group[open] .sk-g-name::before { transform: rotate(90deg); }
.sk-g-count, .sk-g-sp { font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sk-g-bar { height: 5px; border-radius: 3px; background: var(--bg-tertiary); overflow: hidden; }
.sk-g-bar em { display: block; height: 100%; background: var(--accent-primary); }
.sk-rows { border-top: 1px solid var(--border-primary); }
.sk-row { display: grid; grid-template-columns: minmax(0, 1fr) 40px auto 150px; align-items: center; gap: 12px; padding: 6px 14px; font-size: 0.8125rem; border-top: 1px solid var(--border-primary); }
.sk-row:first-child { border-top: 0; }
.sk-row:hover { background: var(--bg-hover); }
.sk-row.untrained { color: var(--text-muted); }
.sk-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-name small { margin-left: 8px; font-size: 0.6875rem; color: var(--text-muted); }
.sk-rank { font-size: 0.75rem; color: var(--text-muted); text-align: right; }
.sk-boxes { display: inline-flex; gap: 3px; }
.sk-sp { text-align: right; font-variant-numeric: tabular-nums; }
.sk-sp small { color: var(--text-muted); }
@media (max-width: 768px) {
  .sk-group summary { grid-template-columns: minmax(0, 1fr) auto auto; }
  .sk-g-bar { display: none; }
  .sk-row { grid-template-columns: minmax(0, 1fr) auto; }
  .sk-rank, .sk-sp { display: none; }
  .sk-name small { display: none; }
  .sk-legend { margin-left: 0; }
}

/* ===== 制造 ===== */
.ind-tabs { display: inline-flex; margin-bottom: var(--spacing-md); }
.ind-tabs button { padding: 0 16px; height: 34px; }
.ind-settings { margin-bottom: var(--spacing-md); padding: 0; }
.ind-settings > summary { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 16px; cursor: pointer; list-style: none; font-size: 0.875rem; }
.ind-settings > summary::-webkit-details-marker { display: none; }
.ind-settings > summary::before { content: '▸'; color: var(--text-muted); transition: transform var(--transition-fast); }
.ind-settings[open] > summary::before { transform: rotate(90deg); }
.ind-settings > summary .text-muted { font-size: 0.75rem; }
.ind-set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px 20px; padding: 4px 16px 16px; border-top: 1px solid var(--border-primary); padding-top: 14px; }
.ind-set-grid .segmented { flex-wrap: wrap; }
.ind-search-row { margin-bottom: var(--spacing-md); }
.ind-search { position: relative; max-width: 640px; height: 42px; background: var(--bg-secondary); }
.ind-search .kb-suggest-item img { border-radius: 4px; }
#indCalc { display: flex; flex-direction: column; gap: var(--spacing-md); }
#indBody > .pi-card + .pi-card { margin-top: var(--spacing-md); }
.ind-prod-head h3 small { font-size: 0.75rem; font-weight: 400; }
.ind-market { margin-left: auto; height: 32px; }
.ind-inputs { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ind-inputs .pi-num { width: 110px; }
.ind-invent { align-self: center; }
.ind-stats { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ind-stats b small { font-size: 0.6875rem; color: var(--text-muted); font-weight: 400; }
.ind-stat-loss { background: color-mix(in srgb, var(--sell-color) 13%, transparent) !important; }
.ind-stat-loss b { color: var(--sell-color); }
.ind-breakdown { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.8125rem; color: var(--text-secondary); }
.ind-breakdown b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ind-breakdown small { color: var(--text-muted); font-size: 0.6875rem; }
.ind-mats tr.is-build td { background: color-mix(in srgb, var(--accent-primary) 6%, transparent); }
.ind-build-btn { display: inline-flex; flex-direction: column; align-items: center; min-width: 56px; padding: 2px 8px; border: 1px solid var(--border-secondary); border-radius: var(--radius-sm); font-size: 0.75rem; color: var(--text-secondary); line-height: 1.3; }
.ind-build-btn small { font-size: 0.625rem; color: var(--text-muted); }
.ind-build-btn.on { border-color: var(--accent-primary); background: var(--accent-soft); color: var(--accent-primary); }
.ind-build-btn:hover { border-color: var(--accent-primary); }
.ind-inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 20px; }
.ind-inv-dec { grid-column: 1 / -1; max-width: 560px; }
.ind-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.8125rem; align-content: start; }
.ind-kv span { color: var(--text-muted); }
.ind-kv b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ind-hl { color: var(--accent-primary) !important; font-weight: 700; }
.ind-scope { margin-left: auto; }
.ind-copy { margin-left: auto; height: 30px; font-size: 0.75rem; }
.pi-table td.up, .pi-table .up { color: var(--buy-color); }
.pi-table .down { color: var(--sell-color); }
.pi-table tbody tr[data-ind-sys-pick], .pi-table tbody tr[data-ind-pick] { cursor: pointer; }
.pi-table tbody tr.active { background: var(--accent-soft); }
.ind-rank-filters { display: flex; flex-direction: column; gap: 10px; }
.ind-rank-filters .pi-inline > span:first-child { width: 36px; }
.ind-rank-filters .segmented { flex-wrap: wrap; }
.ind-rank-row { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; }
.ind-rank-row .pi-inline { flex: none; }
.ind-refine { margin-left: 8px; height: 28px; font-size: 0.75rem; }
.ind-rank-wrap { max-height: 70vh; }
.ind-status { padding: 1px 8px; border-radius: 999px; font-size: 0.6875rem; background: var(--bg-tertiary); color: var(--text-secondary); }
.ind-status.active { background: var(--accent-soft); color: var(--accent-primary); }
.ind-status.ready { background: color-mix(in srgb, var(--buy-color) 15%, transparent); color: var(--buy-color); }
@media (max-width: 1100px) { .ind-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 768px) {
  .ind-tabs { display: flex; }
  .ind-tabs button { flex: 1; padding: 0 6px; }
  .ind-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ind-scope, .ind-copy { margin-left: 0; }
}

/* 制造：侧栏 */
.ind-sidebar { --sidebar-w: 300px; }
.ind-scroll { position: relative; }
.ind-side { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 16px; overflow-y: auto; }
.ind-side-nav { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border-primary); }
.ind-side-nav .profile-nav-btn { display: flex; align-items: center; gap: 10px; }
.ind-side-nav svg { width: 16px; height: 16px; flex: none; opacity: 0.8; }
.ind-side-tabs { min-width: 0; padding: 2px 0 4px; }
.ind-side .empty-state { padding: 24px 8px; }
.ind-side .clear-recent { align-self: center; margin-top: 8px; }
.ind-side-section { display: flex; flex-direction: column; gap: 1px; padding-top: 6px; }
.ind-side-section > h4 { display: flex; align-items: baseline; gap: 6px; padding: 4px 8px; font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.04em; }
.ind-side-section > h4 small { font-weight: 400; }
.ind-side-empty { padding: 8px; font-size: 0.75rem; color: var(--text-muted); }
.ind-side-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 8px; border-radius: var(--radius-sm); text-align: left; font-size: 0.8125rem; color: var(--text-secondary); }
.ind-side-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.ind-side-item.active { background: var(--accent-soft); color: var(--accent-primary); font-weight: 600; }
.ind-side-item img { border-radius: 4px; background: #0d1219; flex: none; }
.ind-side-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ind-side-item small { flex: none; padding: 0 5px; border-radius: 4px; background: var(--bg-tertiary); font-size: 0.625rem; color: var(--text-muted); font-weight: 600; }
.ind-side-cat > summary, .ind-side-group > summary { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; list-style: none; font-size: 0.8125rem; }
.ind-side-cat > summary::-webkit-details-marker, .ind-side-group > summary::-webkit-details-marker { display: none; }
.ind-side-cat > summary { font-weight: 600; color: var(--text-primary); }
.ind-side-cat > summary::before, .ind-side-group > summary::before { content: '▸'; font-size: 0.6875rem; color: var(--text-muted); transition: transform var(--transition-fast); }
.ind-side-cat[open] > summary::before, .ind-side-group[open] > summary::before { transform: rotate(90deg); }
.ind-side-cat > summary small, .ind-side-group > summary small { margin-left: auto; font-size: 0.6875rem; color: var(--text-muted); font-weight: 400; }
.ind-side-cat > summary:hover, .ind-side-group > summary:hover { background: var(--bg-hover); }
.ind-side-group { margin-left: 12px; }
.ind-side-group > summary { color: var(--text-secondary); }
.ind-side-items { margin-left: 12px; }
.ind-tabs-mobile { display: none; }
@media (max-width: 768px) { .ind-tabs-mobile { display: flex; } }

/* 制造：蓝图价格 */
.ind-bp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.ind-bp-col { padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg-tertiary); min-width: 0; }
.ind-bp-col h4 { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.ind-bp-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ind-bp-col li { display: flex; flex-direction: column; font-size: 0.75rem; color: var(--text-muted); }
.ind-bp-col li b { font-size: 0.9375rem; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ind-bp-col li b small { font-size: 0.6875rem; color: var(--text-muted); font-weight: 400; }
.ind-bp-price { font-size: 1.0625rem; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; }
.ind-bp-price small { font-size: 0.6875rem; font-weight: 400; color: var(--text-muted); }
.ind-bp-col .text-muted { font-size: 0.75rem; }
.ind-bp-mode { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.8125rem; }
.ind-bp-mode > span:first-child { font-weight: 600; color: var(--text-secondary); }
.ind-tag-bpc { background: color-mix(in srgb, var(--warning) 18%, transparent) !important; color: var(--warning) !important; }
@media (max-width: 768px) { .ind-bp { grid-template-columns: 1fr; } }

/* ===== 装配：智能装配 / 击杀记录装配 ===== */
.fit-plan-row .fit-plan-btn { border-color: color-mix(in srgb, var(--accent-primary) 45%, var(--border-primary)); color: var(--accent-primary); font-weight: 600; }
.fit-plan-row .fit-plan-btn:hover { background: var(--accent-soft); }
.fa-modal[hidden] { display: none; }
.fa-content { max-width: 1120px; height: min(820px, 92vh); }
.fk-content { max-width: 880px; height: min(820px, 92vh); }
.fa-modal .modal-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.fa-body { flex-direction: row !important; gap: 16px; }
.fa-form { width: 360px; flex: none; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding-right: 6px; }
.fa-form > * { flex: none; }
.fa-ship { display: flex; align-items: center; gap: 10px; font-size: 0.9375rem; }
.fa-ship img { border-radius: 6px; }
.fa-role { padding: 1px 8px; border-radius: 999px; font-size: 0.6875rem; font-weight: 600; color: var(--accent-primary); background: var(--accent-soft); }
.fa-bonus { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 0.6875rem; }
.fa-bonus > span { color: var(--text-muted); margin-right: 2px; }
.fa-bonus em { font-style: normal; padding: 1px 7px; border-radius: 999px; background: var(--bg-tertiary); color: var(--text-secondary); }
.fa-stats b small { font-size: 0.6875rem; font-weight: 400; color: var(--text-muted); }
.fa-field { display: flex; flex-direction: column; gap: 6px; }
.fa-field > label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.fa-field > label small { font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.fa-sec { display: flex; flex-direction: column; gap: 12px; padding: 12px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); }
.fa-sec > h4 { margin: 0; font-size: 0.8125rem; font-weight: 700; color: var(--text-primary); }
.fa-sec > h4 small { font-weight: 400; font-size: 0.6875rem; color: var(--text-muted); margin-left: 6px; }
.fa-hint { margin: 0; font-size: 0.71875rem; line-height: 1.5; color: var(--text-muted); }
.fa-hint b { color: var(--accent-primary); font-weight: 600; }
.fa-note { margin: 0; font-size: 0.75rem; line-height: 1.6; color: var(--text-secondary); }
.fa-checks .pi-check span { display: flex; flex-direction: column; gap: 1px; }
.fa-checks .pi-check small { font-size: 0.6875rem; color: var(--text-muted); }
.fa-unit { position: relative; }
.fa-unit .fa-input { padding-right: 72px; }
.fa-unit span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 0.75rem; color: var(--text-muted); pointer-events: none; }
.fa-field .segmented { display: flex; flex-wrap: wrap; }
.fa-field .segmented button { flex: 1 1 auto; min-width: 0; padding: 0 6px; white-space: nowrap; }
.fa-goals { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fa-goal { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); text-align: left; }
.fa-goal b { font-size: 0.8125rem; }
.fa-goal small { font-size: 0.6875rem; color: var(--text-muted); line-height: 1.4; }
.fa-goal:hover { border-color: var(--border-secondary); }
.fa-goal.active { border-color: var(--accent-primary); background: var(--accent-soft); }
.fa-goal.active b { color: var(--accent-primary); }
.fa-opts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.fa-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); text-align: center; min-width: 0; }
.fa-opt b { font-size: 0.78125rem; white-space: nowrap; }
.fa-opt small { font-size: 0.625rem; line-height: 1.3; color: var(--text-muted); }
.fa-opt:hover { border-color: var(--border-secondary); }
.fa-opt.active { border-color: var(--accent-primary); background: var(--accent-soft); }
.fa-opt.active b { color: var(--accent-primary); }
.fa-aim { margin: 0; padding: 8px 10px; border-radius: var(--radius-md); background: var(--bg-tertiary); font-size: 0.71875rem; line-height: 1.6; color: var(--text-secondary); }
.fa-aim b { color: var(--accent-primary); }
.fa-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fa-num { display: flex; flex-direction: column; gap: 3px; font-size: 0.6875rem; color: var(--text-muted); }
.fa-num input, .fa-input { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--border-primary); border-radius: var(--radius-sm); background: var(--bg-tertiary); color: var(--text-primary); font: inherit; font-size: 0.8125rem; }
.fa-num input:focus, .fa-input:focus { outline: none; border-color: var(--accent-primary); }
.fa-go { height: 40px; font-weight: 600; margin-top: 4px; position: sticky; bottom: 0; box-shadow: 0 -10px 12px var(--bg-secondary); }
.fa-checks { display: flex; flex-direction: column; gap: 6px; }
.fa-checks .pi-check { border-radius: var(--radius-md); padding: 7px 10px; }
.fa-results > .fa-empty:only-child { flex: 1; max-height: 420px; }
.fa-results { flex: 1; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.fa-empty { display: flex; align-items: center; justify-content: center; min-height: 200px; color: var(--text-muted); font-size: 0.875rem; border: 1px dashed var(--border-secondary); border-radius: var(--radius-lg); padding: 16px; text-align: center; }
.fa-progress { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 24px; border: 1px dashed var(--border-secondary); border-radius: var(--radius-lg); font-size: 0.875rem; }
.fa-progress i { display: block; width: 100%; height: 6px; border-radius: 3px; background: var(--bg-tertiary); overflow: hidden; }
.fa-progress em { display: block; height: 100%; width: 0; background: var(--accent-primary); transition: width 200ms; }
.fa-meta { font-size: 0.75rem; color: var(--text-muted); }
.fa-result { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-tertiary); }
.fa-result.best { border-color: color-mix(in srgb, var(--accent-primary) 50%, var(--border-primary)); }
.fa-result-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fa-result-head > b { font-size: 0.9375rem; }
.fa-result-head .btn { margin-left: auto; height: 30px; padding: 0 14px; }
.fa-result-head .link-btn + .btn { margin-left: 0; }
.fa-result-head .link-btn { margin-left: auto; }
.fa-unmet { padding: 1px 8px; border-radius: 999px; font-size: 0.6875rem; background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.fa-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 6px; }
.fa-stats > div { display: flex; flex-direction: column; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--bg-secondary); }
.fa-stats span { font-size: 0.6875rem; color: var(--text-muted); }
.fa-stats b { font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.fa-stats b.good { color: var(--buy-color); }
.fa-stats b.bad { color: var(--sell-color); }
.fa-slot { display: grid; grid-template-columns: 48px 1fr; gap: 8px; align-items: start; font-size: 0.75rem; }
.fa-slot > span { padding-top: 3px; color: var(--text-muted); }
.fa-slot > div { display: flex; flex-wrap: wrap; gap: 4px; }
.fa-slot em { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 2px; border-radius: 999px; background: var(--bg-secondary); font-style: normal; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fa-slot em img { border-radius: 50%; flex: none; }
.fa-slot em b { color: var(--accent-primary); }
.fk-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; font-size: 0.75rem; }
.fk-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 768px) {
  .fa-body { flex-direction: column !important; overflow-y: auto !important; }
  .fa-form { width: auto; overflow: visible; }
  .fa-results { overflow: visible; }
  .fa-content, .fk-content { height: 96vh; }
}
.fit-bulk { display: inline-flex; gap: 2px; margin-left: auto; }
.fit-bulk .link-btn { font-size: 0.75rem; }
.fit-bulk .link-btn.danger { color: var(--sell-color); }
.fit-bulk .link-btn.danger:hover { background: var(--sell-soft); }

/* 装备状态：文字按钮 + 超载开关 + 整行状态 */
.fit-state-pill { flex: none; min-width: 52px; height: 24px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border-secondary); font-size: 0.6875rem; font-weight: 600; color: var(--text-secondary); background: var(--bg-tertiary); transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast); }
.fit-state-pill.s-active { background: color-mix(in srgb, var(--success) 18%, transparent); border-color: color-mix(in srgb, var(--success) 60%, transparent); color: var(--success); }
.fit-state-pill.s-online { background: transparent; color: var(--text-muted); }
.fit-state-pill.s-off { background: var(--bg-tertiary); color: var(--text-muted); border-style: dashed; }
.fit-state-pill.s-offline { background: transparent; color: var(--text-muted); border-style: dashed; opacity: 0.8; }
.fit-state-pill.s-overload { background: color-mix(in srgb, #ff7a1a 22%, transparent); border-color: #ff7a1a; color: #ff9a4a; }
.fit-state-pill:hover { border-color: var(--accent-primary); }
.fit-ol-btn { flex: none; display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border-primary); font-size: 0.6875rem; color: var(--text-muted); }
.fit-ol-btn svg { width: 12px; height: 12px; }
.fit-ol-btn:hover { color: #ff9a4a; border-color: #ff9a4a; }
.fit-ol-btn.on { background: #ff7a1a; border-color: #ff7a1a; color: #fff; box-shadow: 0 0 10px color-mix(in srgb, #ff7a1a 60%, transparent); }
.fit-slot.is-active { background: color-mix(in srgb, var(--success) 6%, var(--bg-secondary)); }
.fit-slot.is-overload { background: color-mix(in srgb, #ff7a1a 10%, var(--bg-secondary)); border-color: color-mix(in srgb, #ff7a1a 35%, var(--border-primary)); }
.fit-slot.is-off .fit-slot-name, .fit-slot.is-off > img { opacity: 0.6; }
.fit-slot.is-offline { background: transparent; border-style: dashed; }
.fit-slot.is-offline .fit-slot-name, .fit-slot.is-offline > img { opacity: 0.4; }
@media (max-width: 768px) { .fit-ol-btn { padding: 0 6px; font-size: 0; gap: 0; } .fit-ol-btn svg { width: 13px; height: 13px; } .fit-state-pill { min-width: 44px; padding: 0 6px; } }

/* ===== LP 商店 ===== */
#lpBody > .pi-card + .pi-card { margin-top: var(--spacing-md); }
.lp-store-head { display: flex; align-items: center; gap: 14px; }
.lp-store-head img { border-radius: 8px; background: #0d1219; flex: none; }
.lp-store-head h3 { font-size: 1.125rem; font-weight: 700; }
.lp-store-head p { margin-top: 2px; font-size: 0.8125rem; }
.lp-store-head b { color: var(--accent-primary); }
.lp-search { flex: 1 1 200px; max-width: 280px; }
.lp-search input { width: 100%; }
.lp-tax { width: 110px; }
.lp-faction { width: auto; min-width: 140px; }
.lp-table-wrap { max-height: none; }
.lp-table td:nth-child(2) { white-space: normal; min-width: 200px; }
.lp-table .pi-prod small { white-space: nowrap; }
.lp-corps { margin: 2px 0 0 36px; font-size: 0.6875rem; color: var(--text-muted); }
.pi-table tbody tr.lp-detail-row { cursor: default; background: var(--bg-tertiary); }
.pi-table tbody tr.lp-detail-row:hover { background: var(--bg-tertiary); }
.lp-detail-row > td { white-space: normal; padding: 12px; }
.lp-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.lp-detail h4 { margin-bottom: 6px; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.lp-lines { display: flex; flex-direction: column; gap: 4px; list-style: none; padding: 0; margin: 0; }
.lp-lines li { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; }
.lp-lines li img { border-radius: 4px; background: #0d1219; flex: none; }
.lp-lines li span { flex: 1; min-width: 0; }
.lp-lines li b { font-variant-numeric: tabular-nums; font-weight: 600; }
.lp-corp-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 140px; overflow-y: auto; }
.lp-corp-list .chip { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-primary); background: var(--bg-secondary); font-size: 0.75rem; color: var(--text-secondary); cursor: pointer; }
.lp-corp-list .chip:hover { color: var(--accent-primary); border-color: var(--accent-primary); }
.lp-mine-summary { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.lp-mine-summary > div { display: flex; flex-direction: column; gap: 2px; }
.lp-mine-summary span { font-size: 0.75rem; }
.lp-mine-summary b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.lp-mine-summary .btn { margin-left: auto; }
@media (max-width: 1280px) { .lp-hide-md { display: none; } }
@media (max-width: 768px) {
  .lp-hide-sm { display: none; }
  .lp-search { max-width: none; }
  .lp-table td:nth-child(2) { min-width: 150px; }
  .lp-corps { margin-left: 0; }
}

/* ===== 服务器切换（顶栏）===== */
.server-switch { position: relative; }
button.server-status { border: 0; font: inherit; cursor: pointer; transition: background 0.15s, color 0.15s; }
button.server-status:hover, button.server-status[aria-expanded="true"] { background: var(--bg-hover); color: var(--text-primary); }
button.server-status:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.server-status .server-name { font-weight: 600; color: var(--text-primary); }
.server-status .server-caret { width: 12px; height: 12px; margin-left: -2px; opacity: 0.7; flex-shrink: 0; }
:root[data-server="serenity"] .server-status .server-name { color: var(--warning); }
.server-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1200;
  min-width: 200px;
  padding: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.server-menu button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 12px 8px 30px;
  position: relative;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.server-menu button b { font-size: 0.875rem; font-weight: 600; }
.server-menu button small { font-size: 0.75rem; color: var(--text-muted); }
.server-menu button:hover, .server-menu button:focus-visible { background: var(--bg-tertiary); outline: none; }
.server-menu button[aria-checked="true"]::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent-primary);
}
.server-unsupported { min-height: 50vh; }
@media (max-width: 480px) {
  .server-status .server-caret { display: none; }
}
.server-unsupported-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.server-unsupported-actions .btn { margin-top: 0; }

/* ===== 合同估价 ===== */
.ap-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: var(--spacing-md); }
.ap-head h2 { font-size: 1.25rem; font-weight: 700; }
.ap-head span { font-size: 0.8125rem; }
.ap-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: var(--spacing-lg); align-items: start; }
.ap-form { position: sticky; top: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); }
.ap-input { width: 100%; min-height: 320px; resize: vertical; padding: 10px 12px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); background: var(--bg-primary); color: var(--text-primary); font: 0.8125rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; }
.ap-input:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-soft); }
.ap-controls { display: flex; gap: 8px; align-items: center; }
.ap-controls .select-wrap { flex: 1; min-width: 0; }
.ap-controls .region-select { width: 100%; }
.ap-empty { padding: 72px 16px; border: 1px dashed var(--border-secondary); border-radius: var(--radius-lg); color: var(--text-muted); text-align: center; font-size: 0.875rem; }
.ap-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ap-stats > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--bg-secondary); border: 1px solid var(--border-primary); min-width: 0; }
.ap-stats span { font-size: 0.75rem; color: var(--text-muted); }
.ap-stats b { font-size: 1.25rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ap-stats small { font-size: 0.6875rem; color: var(--text-muted); }
.ap-stats .ap-stat-sell b { color: var(--sell-color); }
.ap-stats .ap-stat-buy b { color: var(--buy-color); }
.ap-notes { margin: 0 0 12px; padding: 10px 14px 10px 28px; border-radius: var(--radius-md); background: var(--bg-tertiary); font-size: 0.75rem; line-height: 1.7; color: var(--text-secondary); }
.ap-notes b { color: var(--text-primary); }
.ap-warn { color: var(--warning); }
.ap-table-wrap { overflow-x: auto; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); }
.ap-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.ap-table th { padding: 8px 10px; text-align: left; font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border-primary); white-space: nowrap; }
.ap-table th button { font: inherit; color: inherit; }
.ap-table th button.active { color: var(--text-primary); }
.ap-table th button.active::after { content: ' ↓'; }
.ap-table td { padding: 6px 10px; border-bottom: 1px solid var(--border-primary); white-space: nowrap; }
.ap-table tfoot td { border-bottom: 0; font-weight: 600; }
.ap-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ap-table td small { display: block; font-size: 0.6875rem; color: var(--warning); font-weight: 400; }
.ap-item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ap-item img { border-radius: 4px; flex: none; }
.ap-item a { color: var(--text-primary); text-decoration: none; white-space: normal; }
.ap-item a:hover { color: var(--accent-primary); }
.ap-item > span { display: flex; flex-direction: column; min-width: 0; }
.ap-item .ap-unit { display: none; font-size: 0.6875rem; color: var(--text-muted); white-space: nowrap; }
.ap-sell { color: var(--sell-color); }
.ap-buy { color: var(--buy-color); }
.ap-strong { font-weight: 600; }
.ap-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 0.75rem; }
.ap-tabs { display: flex; margin-bottom: 12px; }
.ap-tabs button { flex: 1; }
.ap-tabs button:disabled { opacity: 0.5; cursor: not-allowed; }
.ap-rp-hint { display: block; width: 100%; margin: -4px 0 12px; padding: 8px 12px; border: 1px dashed var(--border-secondary); border-radius: var(--radius-md); font-size: 0.75rem; color: var(--text-secondary); text-align: left; }
.ap-rp-hint:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.ap-rp-hint b { color: var(--buy-color); }
.ap-rp { border-top: 1px solid var(--border-primary); padding-top: 10px; }
.ap-rp summary { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; cursor: pointer; font-size: 0.8125rem; font-weight: 600; list-style: none; }
.ap-rp summary::-webkit-details-marker { display: none; }
.ap-rp summary::before { content: '▸'; color: var(--text-muted); margin-right: -2px; }
.ap-rp[open] summary::before { content: '▾'; }
.ap-rp summary span { flex: 1; }
.ap-rp summary small { font-weight: 400; color: var(--buy-color); font-variant-numeric: tabular-nums; }
.ap-rp-body { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ap-rp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.75rem; color: var(--text-muted); }
.ap-rp-row > span { flex: none; white-space: nowrap; }
.ap-seg { display: flex; flex: 1; max-width: 240px; }
.ap-seg button { flex: 1; padding: 0 4px; white-space: nowrap; }
.ap-seg button:disabled { opacity: 0.4; cursor: not-allowed; }
.ap-rp .cr-fields label > span { width: auto; flex: 1; }
.ap-rp .cr-fields .cr-input { width: 96px; flex: none; }
.ap-char { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.8125rem; }
.ap-lv-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; font-size: 0.75rem; color: var(--text-muted); }
.ap-lv-list span { display: flex; justify-content: space-between; gap: 6px; min-width: 0; }
.ap-lv-list b { color: var(--text-primary); }
.valuation-net { display: block; margin-top: 2px; color: var(--text-muted); }
.valuation-net b { color: var(--text-secondary); font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-gear { width: 12px; height: 12px; margin-left: 4px; vertical-align: -1px; opacity: 0.6; }
#spreadCard { cursor: pointer; text-align: left; }
#spreadValue.down { color: var(--sell-color); }
.tf-modal { max-width: 440px; }
.tf-modal .cr-fields label > span { width: auto; flex: 1; }
.tf-modal .cr-fields .cr-input { width: 120px; flex: none; }
.tf-modal .modal-body { display: flex; flex-direction: column; gap: 16px; }
.tf-sec { display: flex; flex-direction: column; gap: 8px; }
.tf-sec h4 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; font-size: 0.875rem; }
.tf-sec h4 small { font-weight: 400; font-size: 0.75rem; color: var(--text-muted); }
.tf-sec + .tf-sec { padding-top: 14px; border-top: 1px solid var(--border-primary); }
.ap-settings { display: flex; flex-direction: column; gap: 10px; }
.ap-lv-group { margin-top: 2px; font-size: 0.6875rem; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.04em; }
.ap-fee { display: flex; gap: 16px; padding: 8px 10px; border-radius: var(--radius-md); background: var(--bg-tertiary); font-size: 0.75rem; color: var(--text-muted); }
.ap-fee b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ap-table tfoot .ap-net td { padding-top: 0; font-weight: 400; font-size: 0.75rem; }
.ap-stats small em:not([class]) { color: var(--text-secondary); }
.ap-rp-tip { margin: 0; font-size: 0.6875rem; line-height: 1.6; color: var(--text-muted); }
.ap-sub { margin: 16px 0 8px; font-size: 0.875rem; font-weight: 600; }
.ap-tag { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 0.6875rem; background: var(--bg-tertiary); color: var(--text-muted); }
.ap-tag-rp { background: color-mix(in srgb, var(--buy-color) 15%, transparent); color: var(--buy-color); }
.ap-tag-sell { background: color-mix(in srgb, var(--sell-color) 15%, transparent); color: var(--sell-color); }
.ap-stats em { font-style: normal; font-weight: 600; }
.ap-up { color: var(--buy-color); }
.ap-down { color: var(--sell-color); }
@media (max-width: 1100px) {
  .ap-layout { grid-template-columns: minmax(0, 1fr); }
  .ap-form { position: static; }
  .ap-input { min-height: 180px; }
}
@media (max-width: 768px) {
  .ap-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ap-stats > div:last-child { grid-column: 1 / -1; }
  .ap-hide-sm { display: none; }
  .ap-item .ap-unit { display: block; }
  .ap-table td:first-child { min-width: 150px; }
  .ap-table td, .ap-table th { padding: 6px; }
}
.loc-region-btn { flex-shrink: 0; }
@media (max-width: 768px) { .loc-region-btn span { display: none; } .loc-region-btn { padding: 0 10px; } }
.struct-note { margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius-md); background: var(--bg-tertiary); font-size: 0.75rem; color: var(--text-secondary); line-height: 1.6; }
.struct-note.warn { color: var(--warning); }

/* 市场订单：距角色跳数（绑定 ESI 且能读到位置时显示） */
.orders-table .col-jumps { display: none; color: var(--text-secondary); }
.has-jumps .orders-table .col-jumps { display: table-cell; }
.orders-table td.col-jumps.is-here { color: var(--success, var(--buy-color)); font-weight: 600; }
@media (max-width: 768px) {
  /* 手机上显示跳数时，隐藏类型标签与总额，给地点名称留位置 */
  .has-jumps .orders-table .loc-badge, .has-jumps .orders-table .col-total { display: none; }
  .has-jumps .orders-table td, .has-jumps .orders-table thead th { padding-left: 6px; padding-right: 6px; }
  .orders-table .col-jumps { padding-left: 2px; }
  .orders-table .jumps-unit { display: none; }   /* 只显示数字，表头已写「跳数」 */
}
.fit-esi-ship-only { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; color: var(--text-secondary); cursor: pointer; }
.fit-esi-ship-only[hidden] { display: none; }

/* ===== 快递合同 ===== */
.cr-sidebar { --sidebar-w: 300px; }
.cr-side { gap: 2px; }
.cr-side-sec { gap: 6px; padding: 8px 0 10px; border-bottom: 1px solid var(--border-primary); }
.cr-side-sec > h4 { padding: 2px 2px 0; }
.cr-side-sec > h4 small { margin-left: auto; }
.cr-seg { display: flex; }
.cr-seg button { flex: 1; padding: 0 4px; white-space: nowrap; }
.cr-input { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--border-primary); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); font-size: 0.8125rem; }
.cr-input:focus { outline: none; border-color: var(--border-accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.cr-origin { display: flex; gap: 6px; }
.cr-origin .btn { flex: none; height: 32px; padding: 0 8px; font-size: 0.75rem; }
.cr-hint { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }
.cr-warn { color: var(--warning); }
.cr-fields { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.cr-fields label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.8125rem; color: var(--text-secondary); }
.cr-fields label > span { display: flex; align-items: center; gap: 6px; width: 150px; font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.cr-fields .cr-input { text-align: right; }
.cr-check { display: flex; align-items: center; gap: 6px; padding: 4px 2px 0; font-size: 0.8125rem; color: var(--text-secondary); cursor: pointer; }
.cr-reset { align-self: flex-start; margin-top: 4px; font-size: 0.8125rem; }
.cr-help { padding: 10px 2px; font-size: 0.75rem; color: var(--text-secondary); line-height: 1.6; }
.cr-help summary { cursor: pointer; font-weight: 600; color: var(--text-muted); }
.cr-help p { margin-top: 6px; }

.cr-head { align-items: center; }
.cr-refresh { margin-left: auto; height: 32px; gap: 6px; }
.cr-refresh svg { width: 15px; height: 15px; }
.cr-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; font-size: 0.8125rem; color: var(--text-secondary); }
.cr-count b { color: var(--text-primary); }
.cr-sort { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.cr-sort select { height: 30px; padding: 0 6px; border: 1px solid var(--border-primary); border-radius: var(--radius-sm); background: var(--bg-secondary); color: var(--text-primary); font-size: 0.8125rem; }
.cr-empty { padding: 48px 16px; }
.cr-more { display: block; margin: 12px auto 0; }

.cr-table { border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); overflow: hidden; }
.cr-row { display: grid; grid-template-columns: 52px minmax(240px, 1fr) 124px 70px 100px 80px 80px 80px 48px; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border-bottom: 1px solid var(--border-primary); text-align: left; font-size: 0.8125rem; color: var(--text-primary); transition: background var(--transition-fast); }
.cr-row:last-child { border-bottom: 0; }
button.cr-row:hover { background: var(--bg-hover); }
button.cr-row:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: -2px; }
.cr-row-head { position: sticky; top: 0; z-index: 1; padding-top: 6px; padding-bottom: 6px; background: var(--bg-secondary); font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); }
.cr-row-head button { font: inherit; color: inherit; }
.cr-row-head button:hover, .cr-row-head button.active { color: var(--accent-primary); }
.cr-row-head .cr-c2, .cr-row-head .cr-c3, .cr-row-head .cr-c4, .cr-row-head .cr-c5, .cr-row-head .cr-c6 { text-align: right; }
.cr-row .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cr-row .cr-c2 small { display: block; font-size: 0.6875rem; color: var(--text-muted); }
.cr-unit { font-size: 0.6875rem; color: var(--text-muted); }
.cr-reward { font-weight: 600; color: var(--buy-color); }
.cr-route { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cr-loc { display: flex; align-items: baseline; gap: 5px; min-width: 0; flex: 0 1 auto; }
.cr-loc b { font-weight: 600; white-space: nowrap; }
.cr-loc small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.6875rem; color: var(--text-muted); }
.cr-arrow { flex: none; color: var(--text-muted); }
.cr-sec { flex: none; font-style: normal; font-size: 0.6875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cr-tag { flex: none; padding: 0 4px; border: 1px solid var(--border-secondary); border-radius: 3px; font-style: normal; font-size: 0.625rem; color: var(--text-secondary); }
.cr-score { --h: calc(var(--p) * 1.2); display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 22px; padding: 0 6px; border-radius: 11px; font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums;
  color: hsl(var(--h) 65% 62%); background: hsl(var(--h) 70% 45% / 0.16); }
[data-theme="light"] .cr-score { color: hsl(var(--h) 70% 36%); }
.cr-risk { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 0.6875rem; font-weight: 600; white-space: nowrap; }
.risk-low { color: var(--buy-color); background: var(--buy-soft); }
.risk-mid { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.risk-high { color: var(--sell-color); background: var(--sell-soft); }

.modal-content.cr-modal { max-width: 780px; }
.cr-modal .modal-body { padding: 16px 20px 20px; }
.cr-detail { display: flex; flex-direction: column; gap: 16px; }
.cr-ends { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
.cr-ends-arrow { font-size: 1.25rem; color: var(--text-muted); }
.cr-end { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 12px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); background: var(--bg-tertiary); }
.cr-end-label { font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); }
.cr-end-sys { display: flex; align-items: baseline; gap: 6px; font-size: 1rem; font-weight: 700; }
.cr-end-sys small { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }
.cr-end-name { display: flex; align-items: baseline; gap: 4px; font-size: 0.75rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.cr-link { font: inherit; color: var(--text-primary); }
.cr-link:hover { color: var(--accent-primary); text-decoration: underline; }
.cr-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.cr-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 8px 10px; border-radius: var(--radius-md); background: var(--bg-tertiary); }
.cr-stat > span { font-size: 0.6875rem; color: var(--text-muted); }
.cr-stat > b { font-size: 0.9375rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cr-stat small { display: block; font-size: 0.6875rem; font-weight: 400; color: var(--text-muted); }
.cr-section h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.8125rem; font-weight: 700; }
.cr-section h4 small { font-weight: 400; color: var(--text-muted); }
.cr-hops { display: flex; gap: 2px; height: 10px; }
.cr-hop { flex: 1; min-width: 3px; border-radius: 2px; }
.cr-hop-names { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: 0.75rem; color: var(--text-secondary); }
.cr-hop-name { display: inline-flex; align-items: center; gap: 4px; }
.cr-hop-name i { width: 6px; height: 6px; border-radius: 50%; }
.cr-factors { display: flex; flex-direction: column; gap: 4px; list-style: none; font-size: 0.8125rem; }
.cr-factors li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 10px; border-radius: var(--radius-sm); background: var(--bg-tertiary); }
.cr-factors b { flex: none; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.cr-parts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; font-size: 0.6875rem; color: var(--text-muted); }
.cr-parts span { display: flex; flex-direction: column-reverse; gap: 4px; }
.cr-parts i { display: block; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent-primary) calc(var(--p) * 1%), var(--bg-tertiary) 0); }
.cr-actions { display: flex; align-items: flex-start; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border-primary); }
.cr-action-main { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

@media (max-width: 768px) {
  .cr-sidebar { --sidebar-w: min(320px, 86vw); }
  .cr-row-head { display: none; }
  .cr-row { grid-template-columns: 40px repeat(4, minmax(0, 1fr)); grid-template-areas: "s r r r r" "k j v w c" ". h h h h"; gap: 4px 8px; padding: 10px; }
  .cr-c8 { grid-area: h; }
  .cr-c0 { grid-area: s; } .cr-c1 { grid-area: r; } .cr-c2 { grid-area: j; } .cr-c3 { grid-area: v; } .cr-c4 { grid-area: w; } .cr-c5 { grid-area: c; } .cr-c7 { grid-area: k; }
  .cr-c6 { display: none; }
  .cr-row .num { text-align: left; font-size: 0.75rem; }
  .cr-row .cr-c2 small { display: inline; margin-left: 4px; }
  .cr-c5::before { content: '抵 '; font-size: 0.6875rem; color: var(--text-muted); }
  .cr-route { flex-wrap: wrap; gap: 2px 6px; }
  .cr-loc small { display: none; }
  .cr-score { min-width: 32px; padding: 0 4px; }
  .cr-ends { grid-template-columns: minmax(0, 1fr); }
  .cr-ends-arrow { display: none; }
  .cr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cr-modal .modal-body { padding: 12px 14px 16px; }
  .cr-actions { flex-direction: column; align-items: stretch; }
  .cr-action-main .btn { align-self: stretch; }
}

/* 快递推荐用船 */
.cr-shipcell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cr-shipcell img { flex: none; border-radius: 4px; }
.cr-shipcell span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cr-shipcell b { font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.cr-shipcell small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.6875rem; color: var(--text-muted); }
.cr-noship { font-size: 0.75rem; color: var(--sell-color); }
.cr-noship-text { font-size: 0.8125rem; color: var(--sell-color); }
.cr-ship { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg-tertiary); }
.cr-ship > img { border-radius: var(--radius-sm); }
.cr-ship-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cr-ship-name { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.cr-ship-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.75rem; color: var(--text-muted); }
.cr-ship-stats b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.cr-ship-why { display: flex; flex-direction: column; gap: 3px; padding-left: 16px; font-size: 0.75rem; color: var(--text-secondary); line-height: 1.5; }
.cr-fit { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.cr-fit-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 0.8125rem; }
.cr-fit-row > span { padding-top: 3px; font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); }
.cr-fit-row > div { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.cr-mod { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 3px; border: 1px solid var(--border-primary); border-radius: var(--radius-sm); background: var(--bg-secondary); }
.cr-mod img { border-radius: 3px; }
.cr-mod b { font-weight: 600; color: var(--accent-primary); }
.cr-jump { margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--border-secondary); border-radius: var(--radius-md); font-size: 0.8125rem; }
.cr-jump h5 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 6px; font-size: 0.8125rem; font-weight: 700; }
.cr-jump h5 small { font-weight: 400; color: var(--text-muted); }
.cr-jump ol { display: flex; flex-direction: column; gap: 4px; padding-left: 18px; line-height: 1.6; }
.cr-jump ol small { color: var(--text-muted); }
.cr-jump .cr-sec { margin-right: 3px; }
.cr-jump .cr-hint { margin-top: 6px; }
.cr-fit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.cr-alts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-muted); }
.cr-alt { display: inline-flex; align-items: center; gap: 4px; color: var(--text-secondary); }
.cr-alt small { color: var(--text-muted); }
.cr-alt img { border-radius: 3px; }
@media (max-width: 768px) {
  .cr-shipcell span { flex-direction: row; gap: 6px; align-items: baseline; }
  .cr-shipcell img { width: 18px; height: 18px; }
  .cr-ship { grid-template-columns: 44px minmax(0, 1fr); padding: 10px; }
  .cr-ship > img { width: 44px; height: 44px; }
  .cr-fit-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* 智能植入体 */
.fit-slots h4 span .link-btn + .link-btn { margin-left: 10px; }
.fa-imp-content { max-width: 760px; }
.fa-imps { display: flex; flex-direction: column; gap: 4px; }
.fa-imp-row { display: grid; grid-template-columns: 22px 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--radius-sm); background: var(--bg-secondary); font-size: 0.8125rem; }
.fa-imp-slot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-tertiary); font-size: 0.6875rem; font-weight: 700; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.fa-imp-row img { border-radius: 4px; }
.fa-imp-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.fa-imp-name small { font-size: 0.6875rem; color: var(--buy-color); }
.fa-imp-cost { font-size: 0.75rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fa-stats small.up { color: var(--buy-color); font-weight: 600; }
.fa-note-inline { font-size: 0.71875rem; color: var(--text-muted); }
.fa-imp-total { align-self: center; font-size: 0.71875rem; color: var(--text-muted); }
.fa-imp-foot { margin-top: 4px; }

/* ===== 击杀 · 完整排行榜 ===== */
.kb-board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.kb-board-head .kb-section-title { margin-bottom: 0; }
.kb-board-more { flex: none; font-size: 0.75rem; color: var(--accent-primary); white-space: nowrap; }
.kb-board-more:hover { text-decoration: underline; }
.kb-rank-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.kb-rank-head h2 { font-size: 1.25rem; font-weight: 700; }
.kb-rank-head span { font-size: 0.8125rem; }
.kb-rank-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.kb-rank-filter { flex: 1; min-width: 180px; max-width: 280px; margin-left: auto; }
.kb-rank-cards { margin-bottom: 12px; }
.kb-rank-first { font-size: 1.125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-rank-wrap { border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); }
.kb-rank-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.kb-rank-table th { padding: 8px 10px; text-align: left; font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border-primary); white-space: nowrap; }
.kb-rank-table th.num { text-align: right; }
.kb-rank-table th button { font: inherit; color: inherit; }
.kb-rank-table th button.active { color: var(--text-primary); }
.kb-rank-table th button.desc::after { content: ' ↓'; }
.kb-rank-table th button.asc::after { content: ' ↑'; }
.kb-rank-table td { padding: 7px 10px; border-bottom: 1px solid var(--border-primary); vertical-align: middle; }
.kb-rank-table tbody tr:last-child td { border-bottom: 0; }
.kb-rank-table tbody tr:hover { background: var(--bg-hover); }
.kb-rank-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kb-rank-table td.num b { display: block; font-weight: 600; }
.kb-rank-table td.num small { display: block; font-size: 0.6875rem; color: var(--text-muted); }
.kb-rank-table .kb-rank-no { width: 36px; text-align: center; }
.kb-rank-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kb-rank-who img { border-radius: 6px; background: #0d1219; flex: none; }
.kb-rank-who > span { display: flex; flex-direction: column; min-width: 0; }
.kb-rank-who > span > a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-rank-who small { font-size: 0.6875rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-eff { display: inline-block; width: 48px; height: 4px; margin-right: 6px; vertical-align: middle; border-radius: 2px; background: color-mix(in srgb, var(--sell-color) 35%, transparent); overflow: hidden; }
.kb-eff i { display: block; height: 100%; background: var(--buy-color); }
.kb-rank-ships { white-space: nowrap; }
.kb-rank-ships img { border-radius: 4px; margin-right: 3px; vertical-align: middle; background: #0d1219; }
.kb-rank-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 0.75rem; }
.kb-pager-size, .kb-pager-jump { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.kb-pager-size select, .kb-pager-jump input { height: 28px; padding: 0 6px; border: 1px solid var(--border-primary); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); font-size: 0.75rem; }
.kb-pager-jump input { width: 64px; text-align: center; }
#kbRankBody.is-loading .kb-rank-wrap { opacity: 0.5; pointer-events: none; transition: opacity var(--transition-fast); }
.kb-pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; margin: 14px 0 4px; }
.kb-pager > button { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--border-primary); border-radius: var(--radius-sm); background: var(--bg-secondary); color: var(--text-secondary); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.kb-pager > button:hover:not(:disabled) { border-color: var(--accent-primary); color: var(--accent-primary); }
.kb-pager > button.active { border-color: var(--accent-primary); background: var(--accent-primary); color: #fff; font-weight: 600; }
.kb-pager > button:disabled { opacity: 0.4; cursor: not-allowed; }
.kb-pager-gap { padding: 0 4px; color: var(--text-muted); }
.kb-pager-jump { margin-left: 8px; }
@media (max-width: 768px) {
  .kb-rank-controls .segmented { flex: 1 1 100%; display: flex; }
  .kb-rank-controls .segmented button { flex: 1; }
  .kb-rank-filter { max-width: none; margin-left: 0; flex-basis: 100%; }
  .kb-hide-sm { display: none; }
  .kb-rank-table td, .kb-rank-table th { padding: 6px; }
  .kb-pager > button { min-width: 30px; height: 30px; padding: 0 6px; }
  .kb-pager-jump { flex-basis: 100%; justify-content: center; margin: 6px 0 0; }
  .kb-rank-who { max-width: 150px; }
  .kb-rank-who img { width: 26px; height: 26px; }
}

/* 个人中心 · 交易记录 */
.trade-table th button { font: inherit; color: inherit; }
.trade-table th button.active { color: var(--text-primary); }
.trade-table th button.active::after { content: ' ↓'; }
.trade-table .cell-sub { display: block; font-size: 0.6875rem; color: var(--text-muted); }
.trade-item { display: inline-flex; align-items: center; gap: 6px; padding: 0; font-size: 0.8125rem; color: var(--text-primary); text-align: left; }
.trade-item:hover { color: var(--accent-primary); }
.trade-item img { width: 20px; height: 20px; border-radius: 3px; flex: none; }
.trade-loc { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-filter { width: 200px; margin: 0; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.tf-modal .cr-fields .cr-input[data-tf-hub], .ap-rp .cr-fields .cr-input[data-tf-hub] { width: 260px; max-width: 70%; text-align: left; }

/* 绑定框 · 额外权限 */
.scope-groups { margin: 4px 0 10px; font-size: 0.8125rem; }
.scope-groups summary { cursor: pointer; color: var(--text-secondary); }
.scope-group-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.scope-group { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--bg-tertiary); cursor: pointer; }
.scope-group.focus { box-shadow: inset 0 0 0 1px var(--accent-primary); }
.scope-group input { margin-top: 3px; }
.scope-group span { display: flex; flex-direction: column; }
.scope-group small { color: var(--text-muted); font-size: 0.75rem; }
.scope-needed p { max-width: 520px; }
.map-agents .agent-row { position: relative; }
.map-agents .agent-dest { margin-left: auto; align-self: center; flex: none; font-size: 0.6875rem; padding: 2px 6px; border-radius: 4px; color: var(--accent-primary); background: var(--accent-soft); }
.map-agents .agent-dest:hover { filter: brightness(1.1); }

/* 个人中心 · 克隆 / 军团 */
.clone-implants { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.clone-card { padding: 10px 12px; border: 1px solid var(--border-primary); border-radius: var(--radius-md, 8px); margin-bottom: 8px; background: var(--bg-secondary); }
.clone-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; font-size: 0.8125rem; }
.clone-head span { color: var(--text-secondary); }
.clone-head .link-btn { margin-left: auto; color: var(--accent-primary); }
.corp-roles { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.8125rem; color: var(--text-secondary); }
.warn-text { color: var(--warning, #f59e0b); }

/* 技能页 · 属性 */
.sk-attrs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; font-size: 0.8125rem; }
.sk-attrs > span:not(.sk-remap) { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--bg-tertiary); }
.sk-attrs em { font-style: normal; color: var(--text-muted); font-size: 0.75rem; }
.sk-attrs b { font-variant-numeric: tabular-nums; }
.sk-remap { color: var(--text-muted); font-size: 0.75rem; }
.sk-sp .sk-eta { display: block; color: var(--text-muted); }

/* 行星工业 · 我的殖民地 */
.pi-colonies { margin-bottom: 16px; }
.pi-colonies-entry.active { color: var(--accent-primary); border-color: var(--accent-primary); }
.col-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.col-card { padding: 12px 14px; border: 1px solid var(--border-primary); border-radius: var(--radius-md, 8px); background: var(--bg-secondary); font-size: 0.8125rem; }
.col-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.col-head .link-btn { margin-left: auto; color: var(--accent-primary); padding: 0; }
.col-sec { margin-top: 8px; }
.col-sec h5 { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.col-sec h5 small { font-weight: 400; }
.col-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.col-list li { display: flex; align-items: center; gap: 6px; }
.col-list li img { border-radius: 3px; flex: none; }
.col-list li small { color: var(--text-muted); font-size: 0.6875rem; }
.col-list li b { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.col-foot { margin-top: 8px; font-size: 0.6875rem; color: var(--text-muted); }
@media (max-width: 768px) { .col-grid { grid-template-columns: 1fr; } }

/* 击杀详情 · 保险 */
.kb-insurance { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 0.75rem; color: var(--text-secondary); }
.kb-insurance b { color: var(--text-primary); }
.fit-note { font-size: 0.6875rem; color: var(--text-muted); margin-top: 4px; }

/* 突变装备属性 */
.dyn-btn { cursor: pointer; color: var(--accent-primary); background: var(--accent-soft); border: none; font-size: 0.6875rem; }
.dyn-modal { max-width: 620px; }
.dyn-meta { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 10px; }
.dyn-more { margin-top: 10px; font-size: 0.8125rem; }
.dyn-more summary { cursor: pointer; color: var(--text-muted); }

/* 快递页 · 拍卖模式 */
.cr-mode { margin-left: 4px; }
#courierView.au-mode .cr-sidebar { display: none; }
.au-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.au-search { width: 220px; margin: 0; }
.au-row { cursor: pointer; }
.au-row:hover td { background: var(--bg-hover); }
.au-table th button { font: inherit; color: inherit; }
.au-table th button.active { color: var(--text-primary); }
.au-table th button.active::after { content: ' ↓'; }
.au-table .cell-sub { display: block; font-size: 0.6875rem; color: var(--text-muted); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-more { display: flex; justify-content: center; margin: 10px 0; }
.au-modal { max-width: 720px; }

/* 战争页 */
#killModal { z-index: 1010; }
.war-page .pi-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.fw-card { padding: 12px 14px; border: 1px solid var(--border-primary); border-radius: var(--radius-md, 8px); background: var(--bg-secondary); }
.fw-card-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.fw-card-head img { border-radius: 6px; }
.fw-card-head div { display: flex; flex-direction: column; }
.fw-card-head small { color: var(--text-muted); font-size: 0.75rem; }
.fw-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fw-stats span { display: flex; flex-direction: column; font-size: 0.8125rem; }
.fw-stats em { font-style: normal; font-size: 0.6875rem; color: var(--text-muted); }
.fw-stats b { font-variant-numeric: tabular-nums; }
.fw-stats small { font-size: 0.6875rem; color: var(--warning, #f59e0b); }
.fw-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fw-board-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fw-board { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 0.8125rem; }
.fw-board li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 4px; }
.fw-board li:nth-child(odd) { background: var(--bg-tertiary); }
.fw-board img { border-radius: 4px; flex: none; }
.fw-rank { width: 20px; text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.fw-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; padding: 0; color: var(--text-primary); }
.fw-board small { color: var(--text-muted); font-size: 0.6875rem; white-space: nowrap; }
.fw-board b { font-variant-numeric: tabular-nums; }
.fw-bar { width: 80px; height: 6px; border-radius: 3px; background: var(--bg-hover); overflow: hidden; flex: none; }
.fw-bar em { display: block; height: 100%; background: var(--danger); }
.war-party { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.war-party img { border-radius: 4px; }
.war-vs { color: var(--text-muted); font-size: 0.75rem; }
.war-table .cell-sub { display: block; font-size: 0.6875rem; color: var(--text-muted); }
.war-modal { max-width: 960px; }
@media (max-width: 900px) { .fw-cols { grid-template-columns: 1fr; } }

/* 击杀预警 */
.ka-bell { position: relative; }
.ka-bell .ka-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); opacity: 0; }
.ka-bell.on .ka-dot { opacity: 1; background: var(--success); box-shadow: 0 0 0 2px var(--bg-primary); }
.ka-modal { max-width: 520px; }
.ka-modal .modal-body { display: flex; flex-direction: column; gap: 8px; }
.ka-opt { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg-tertiary); cursor: pointer; font-size: 0.8125rem; }
.ka-opt input[type="checkbox"] { margin-top: 3px; }
.ka-opt span { display: flex; flex-direction: column; flex: 1; }
.ka-opt small { color: var(--text-muted); font-size: 0.75rem; }
.ka-range { align-items: center; }
.ka-range input { width: 64px; text-align: center; }
.ka-status { font-size: 0.8125rem; color: var(--text-muted); padding: 6px 10px; border-left: 3px solid var(--border-primary); }
.ka-status.on { color: var(--success); border-left-color: var(--success); }
.ka-note { font-size: 0.75rem; color: var(--text-muted); }
.ka-warn { font-size: 0.8125rem; color: var(--warning, #f59e0b); }
.ka-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ka-h { font-size: 0.8125rem; margin-top: 6px; }
.ka-history { list-style: none; display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; font-size: 0.8125rem; }
.ka-history li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 4px; background: var(--bg-tertiary); }
.ka-history li[data-ka-open] { cursor: pointer; }
.ka-history li span:nth-child(2) { flex: 1; min-width: 0; }
.ka-history small { color: var(--text-muted); white-space: nowrap; }
.ka-badge { flex: none; font-size: 0.6875rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; color: #fff; background: var(--danger); }
.ka-layer { position: fixed; inset: 0; pointer-events: none; z-index: 1100; }
.ka-flash { position: absolute; inset: 0; opacity: 0; box-shadow: inset 0 0 0 4px rgba(239, 68, 68, 0.9), inset 0 0 120px 30px rgba(239, 68, 68, 0.55); }
.ka-flash.on { animation: ka-flash 0.6s ease-in-out 5; }
@keyframes ka-flash { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
.ka-cards { position: absolute; top: 66px; right: 16px; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.ka-card { pointer-events: auto; padding: 10px 12px; border-radius: 10px; background: var(--bg-secondary); border: 1px solid var(--danger); box-shadow: 0 8px 28px rgba(239, 68, 68, 0.35); animation: ka-in 0.25s ease-out, ka-pulse 1.2s ease-in-out 3; }
.ka-card[data-ka-kill] { cursor: pointer; }
.ka-card.here { background: color-mix(in srgb, var(--danger) 14%, var(--bg-secondary)); }
.ka-head { display: flex; align-items: center; gap: 8px; color: var(--danger); }
.ka-close { margin-left: auto; font-size: 18px; line-height: 1; color: var(--text-muted); padding: 0 4px; }
.ka-body { margin-top: 4px; font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.ka-meta { margin-top: 2px; font-size: 0.75rem; color: var(--text-muted); }
@keyframes ka-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ka-pulse { 0%, 100% { box-shadow: 0 8px 28px rgba(239, 68, 68, 0.35); } 50% { box-shadow: 0 8px 36px rgba(239, 68, 68, 0.85); } }
@media (prefers-reduced-motion: reduce) { .ka-flash.on, .ka-card { animation: none; } .ka-flash.on { opacity: 0.6; } }

/* 击杀预警 · 人物关注 */
.ka-watch-add { display: flex; gap: 6px; }
.ka-watch-add input { flex: 1; min-width: 0; text-align: left; }
.ka-watch-add select { width: 110px; }
.ka-watch { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 0.8125rem; }
.ka-watch li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 4px; background: var(--bg-tertiary); }
.ka-watch li img { border-radius: 4px; }
.ka-watch li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ka-watch li select { width: 110px; }
.ka-badge.kill { background: var(--success); }
.ka-badge.loss { background: var(--danger); }
.ka-card.watch { border-color: var(--accent-primary); box-shadow: 0 8px 28px color-mix(in srgb, var(--accent-primary) 35%, transparent); }
.ka-card.watch .ka-head { color: var(--accent-primary); }

/* 势力战争 · 刷新倒计时 */
.fw-refresh { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-bottom: 14px; padding: 10px 14px; border: 1px solid var(--border-primary); border-radius: var(--radius-md, 8px); background: var(--bg-secondary); font-size: 0.8125rem; }
.fw-refresh > svg { width: 18px; height: 18px; color: var(--accent-primary); flex: none; }
.fw-cd-item { display: inline-flex; align-items: baseline; gap: 8px; }
.fw-cd-item em { font-style: normal; color: var(--text-secondary); }
.fw-cd-item b { font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--accent-primary); min-width: 4.2em; }
.fw-cd-item small, .fw-cd-note { color: var(--text-muted); font-size: 0.6875rem; }
.fw-cd-note { margin-left: auto; }
.fw-refresh.flash { animation: fw-flash 1.6s ease-out; }
@keyframes fw-flash { 0% { box-shadow: 0 0 0 3px var(--accent-ring); } 100% { box-shadow: none; } }
@media (max-width: 768px) { .fw-cd-note { margin-left: 0; } }

/* LP 商店 · 复制采购清单 */
.lp-buy h4 small { font-weight: 400; color: var(--text-muted); font-size: 0.75rem; margin-left: 6px; }
.lp-times { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--text-secondary); margin-right: 10px; }
.lp-times input { width: 90px; }
.lp-buy .link-btn { color: var(--accent-primary); }
.lp-buy-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* 模拟装配 · 深渊装备自定义属性 */
.fit-mut-tag { font-style: normal; font-size: 0.625rem; font-weight: 700; margin-left: 6px; padding: 0 5px; border-radius: 4px; color: #fff; background: #8b5cf6; vertical-align: 1px; }
.fit-mut-tag.warn { background: var(--warning, #f59e0b); }
.fit-mut-btn { flex: none; font-size: 0.6875rem; padding: 2px 7px; border-radius: 4px; color: #8b5cf6; border: 1px solid color-mix(in srgb, #8b5cf6 45%, transparent); background: transparent; }
.fit-mut-btn:hover, .fit-mut-btn.on { background: color-mix(in srgb, #8b5cf6 14%, transparent); }
.mut-modal { max-width: 760px; }
.mut-modal .modal-body { display: flex; flex-direction: column; gap: 10px; }
.mut-field { display: flex; align-items: center; gap: 10px; font-size: 0.8125rem; }
.mut-field span { width: 70px; color: var(--text-secondary); flex: none; }
.mut-field select { flex: 1; text-align: left; }
.mut-note { font-size: 0.75rem; color: var(--text-muted); }
.mut-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.mut-table td { vertical-align: middle; }
.mut-table td small { display: block; font-size: 0.6875rem; color: var(--text-muted); }
.mut-slider { min-width: 220px; }
.mut-slider input[type="range"] { width: 100%; accent-color: #8b5cf6; }
.mut-table input[type="number"] { width: 110px; }
.mut-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.fit-slot-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 教程 ===== */
.guide-sidebar { --sidebar-w: 260px; }
.guide-sidebar .ind-side-item:disabled { opacity: 0.45; cursor: default; }
.guide-side-filters { gap: 8px; padding: 10px 0 0; margin-top: 6px; border-top: 1px solid var(--border-primary); }
.guide-side-filters > h4 { padding-bottom: 0; }
.guide-seg { display: flex; margin: 0 8px; }
.guide-seg button { flex: 1; padding: 4px 6px; }
.guide-side-filters .ind-side-empty { line-height: 1.5; }
.guide-sub { font-size: 0.8125rem; }
.guide-section { margin-bottom: var(--spacing-xl); }
.guide-section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px; }
.guide-section-head h3 { font-size: 1.0625rem; font-weight: 700; }
.guide-section-head .text-muted { font-size: 0.8125rem; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.guide-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); color: inherit; text-decoration: none; transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast); }
.guide-card:hover { border-color: var(--accent-primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.guide-card:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.guide-card-head { display: flex; align-items: center; gap: 6px; }
.guide-card-head > svg { width: 14px; height: 14px; margin-left: auto; color: var(--text-muted); }
.guide-card:hover .guide-card-head > svg { color: var(--accent-primary); }
.guide-kind, .guide-lang { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 0.6875rem; font-weight: 600; }
.guide-kind svg { width: 12px; height: 12px; }
.guide-kind.video { background: var(--sell-soft); color: var(--sell-color); }
.guide-kind.text { background: var(--accent-soft); color: var(--accent-primary); }
.guide-lang { background: var(--bg-tertiary); color: var(--text-secondary); }
.guide-lang.zh { background: var(--buy-soft); color: var(--buy-color); }
.guide-lang.tr { background: rgba(167, 139, 250, 0.14); color: var(--violet); }
.guide-title { font-size: 0.9375rem; line-height: 1.4; }
.guide-title-en { display: block; margin-top: 2px; font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }
.guide-desc { flex: 1; font-size: 0.8125rem; line-height: 1.55; color: var(--text-secondary); }
.guide-src { font-size: 0.75rem; color: var(--text-muted); }

/* 阅读器 */
.guide-reader-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: var(--spacing-md); }
.guide-back { display: inline-flex; align-items: center; gap: 4px; padding-left: 6px; }
.guide-back svg { width: 16px; height: 16px; }
.guide-doc-title { font-size: 1.5rem; font-weight: 700; line-height: 1.35; }
.guide-doc-title .guide-title-en { font-size: 0.9375rem; margin-top: 4px; }
.guide-doc-meta { margin: 6px 0 var(--spacing-lg); font-size: 0.8125rem; color: var(--text-muted); }
.guide-doc-meta a { display: inline-flex; align-items: center; gap: 3px; color: var(--accent-primary); }
.guide-doc-meta a svg { width: 12px; height: 12px; }
.guide-article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: var(--spacing-xl); align-items: start; }
.guide-article-layout.no-toc { grid-template-columns: minmax(0, 1fr); }
.guide-article { max-width: 820px; font-size: 0.9375rem; line-height: 1.8; color: var(--text-primary); }
.guide-article h2 { margin: 1.8em 0 0.6em; padding-bottom: 6px; border-bottom: 1px solid var(--border-primary); font-size: 1.25rem; font-weight: 700; line-height: 1.4; scroll-margin-top: 12px; }
.guide-article h3 { margin: 1.5em 0 0.5em; font-size: 1.0625rem; font-weight: 700; scroll-margin-top: 12px; }
.guide-article h4 { margin: 1.2em 0 0.4em; font-size: 0.9375rem; font-weight: 700; color: var(--text-secondary); }
.guide-article h2 .guide-en, .guide-article h3 .guide-en, .guide-article h4 .guide-en { display: block; margin-top: 2px; font-size: 0.8125rem; font-weight: 400; }
.guide-article > :first-child { margin-top: 0; }
.guide-article p { margin: 0 0 0.9em; }
.guide-article ul, .guide-article ol { margin: 0 0 1em; padding-left: 1.5em; }
.guide-article ul ul, .guide-article ol ul { margin: 0.3em 0 0.3em; }
.guide-article li { margin: 0.25em 0; }
.guide-article a { color: var(--accent-primary); text-decoration: none; }
.guide-article a:hover { text-decoration: underline; }
.guide-article code { padding: 1px 5px; border-radius: 4px; background: var(--bg-tertiary); font-family: var(--font-mono); font-size: 0.85em; }
.guide-en { color: var(--text-muted); font-size: 0.875em; line-height: 1.65; }
p.guide-en { margin-top: -0.55em; }
li > .guide-en, td > .guide-en, th > .guide-en, figcaption > .guide-en { margin-top: 2px; }
.guide-note { margin: 0 0 1em; padding: 10px 14px; border-left: 3px solid var(--accent-primary); border-radius: var(--radius-sm); background: var(--accent-soft); }
.guide-note p:last-child { margin-bottom: 0; }
.guide-table-wrap { margin: 0 0 1.2em; }
.guide-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; line-height: 1.55; }
.guide-table th, .guide-table td { padding: 6px 10px; border: 1px solid var(--border-primary); text-align: left; vertical-align: top; }
.guide-table th { background: var(--bg-tertiary); font-weight: 600; }
.guide-fig { margin: 0 0 1.2em; }
.guide-fig img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-md); border: 1px solid var(--border-primary); background: var(--bg-tertiary); }
.guide-fig figcaption { margin-top: 6px; font-size: 0.8125rem; color: var(--text-secondary); }
.guide-toc { position: sticky; top: 0; display: flex; flex-direction: column; gap: 1px; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; padding: 12px; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); }
.guide-toc h4 { padding: 0 6px 6px; font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.guide-toc button { padding: 4px 6px; border-radius: var(--radius-sm); text-align: left; font-size: 0.8125rem; line-height: 1.4; color: var(--text-secondary); }
.guide-toc button.h3 { padding-left: 18px; font-size: 0.75rem; }
.guide-toc button:hover { background: var(--bg-hover); color: var(--text-primary); }

/* 视频 + 字幕 */
.guide-video { position: relative; max-width: 960px; aspect-ratio: 16 / 9; margin-bottom: var(--spacing-md); border-radius: var(--radius-lg); overflow: hidden; background: #000; }
.guide-video iframe, .guide-video #guideYt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.guide-cap { position: absolute; left: 50%; bottom: 13%; transform: translateX(-50%); width: max-content; max-width: 88%; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; text-align: center; }
.guide-cap span { padding: 2px 10px; border-radius: 4px; background: rgba(0, 0, 0, 0.72); color: #fff; font-size: clamp(0.875rem, 2.2vw, 1.25rem); line-height: 1.45; text-shadow: 0 1px 2px #000; }
.guide-cap .guide-cap-en { font-size: clamp(0.75rem, 1.6vw, 0.9375rem); color: #d6dbe4; }
.guide-cap:empty { display: none; }
.guide-yt-fail { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; color: #cfd6e2; font-size: 0.875rem; line-height: 1.6; text-align: center; }
.guide-yt-fail a { color: #8db7ff; }
.guide-transcript-head { display: flex; align-items: center; gap: 12px; max-width: 960px; margin-bottom: 8px; }
.guide-transcript-head h3 { font-size: 1rem; font-weight: 700; }
.guide-follow { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--text-secondary); cursor: pointer; }
.guide-transcript { position: relative; max-width: 960px; max-height: 420px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; border: 1px solid var(--border-primary); border-radius: var(--radius-lg); background: var(--bg-secondary); }
.guide-transcript li { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 0.875rem; line-height: 1.6; cursor: pointer; }
.guide-transcript li:hover { background: var(--bg-hover); }
.guide-transcript li.active { background: var(--accent-soft); }
.guide-transcript li.active > div { color: var(--accent-primary); font-weight: 600; }
.guide-transcript time { padding-top: 1px; font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.guide-transcript .guide-en { display: block; font-weight: 400; }
@media (max-width: 1100px) {
  .guide-article-layout { grid-template-columns: minmax(0, 1fr); }
  .guide-toc { display: none; }
}
@media (max-width: 640px) {
  .guide-grid { grid-template-columns: 1fr; }
  .guide-doc-title { font-size: 1.25rem; }
  .guide-reader-bar .segmented { width: 100%; }
  .guide-reader-bar .segmented button { flex: 1; }
  .guide-reader-bar .toolbar-spacer { display: none; }
  .guide-cap { bottom: 16%; }
}
