/* ============================================================
   DELTA OPS — 样式表
   军事战术风格 UI
   ============================================================ */

:root {
  --bg-dark: #0a0e12;
  --bg-panel: rgba(14, 19, 24, 0.92);
  --bg-panel-solid: #0e1318;
  --accent: #00ff88;
  --accent-dim: #00b35f;
  --accent-glow: rgba(0, 255, 136, 0.35);
  --danger: #ff3b30;
  --warn: #ffaa00;
  --text: #e6edf3;
  --text-dim: #8b98a5;
  --text-dark: #4a5560;
  --border: rgba(0, 255, 136, 0.18);
  --border-dim: rgba(255, 255, 255, 0.08);
  --font-main: 'Segoe UI', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text);
  font-family: var(--font-main);
  cursor: default;
}

body.in-game { cursor: none; }

/* ===== 画面容器 ===== */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 10;
}

.screen.active { display: flex; }

.screen.overlay {
  z-index: 100;
  background: rgba(5, 8, 11, 0.88);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

/* ===== 加载画面 ===== */
#loading-screen {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #131a21 0%, #05080b 100%);
}

.loading-inner {
  text-align: center;
  width: min(420px, 80vw);
}

.logo-mark {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--text);
  text-shadow: 0 0 40px var(--accent-glow);
  line-height: 1;
}

.logo-mark span {
  color: var(--accent);
  margin-left: 6px;
}

.logo-mark.big {
  /* 按视口高度缩放：窗口再矮也不会把标题顶出屏幕 */
  font-size: clamp(30px, min(6.4vw, 8.2vh), 74px);
  letter-spacing: clamp(5px, 1vw, 10px);
  line-height: 1.14;
  padding-top: 2px;
}

.loading-bar-wrap {
  margin: 40px 0 16px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  box-shadow: 0 0 16px var(--accent-glow);
  transition: width 0.3s ease;
}

.loading-text {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 2px;
  font-family: var(--font-mono);
}

/* ===== 主菜单 ===== */
#main-menu {
  align-items: center;
  justify-content: center;
  /* 主界面不做滚动：所有尺寸都用 vh/clamp 自适应，保证一屏放得下 */
  overflow: hidden;
  height: 100vh;
  padding: clamp(10px, 2vh, 28px) 16px;
  background: #05080b;
}

.menu-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 255, 136, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(0, 100, 255, 0.05) 0%, transparent 60%),
    linear-gradient(180deg, #070b0f 0%, #05080b 100%);
}

.menu-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

.menu-content {
  position: relative;
  z-index: 1;
  text-align: center;
  width: min(560px, 90vw);
  margin: auto;        /* 配合 flex-start 实现「能居中就居中，放不下就滚动」 */
}

.lang-switcher-wrap {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 30;
}
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 18px;
  background: rgba(10,14,18,0.72);
  color: #e6edf3;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: border-color 0.2s, background 0.2s;
}
.lang-switcher:hover, .lang-switcher-wrap.open .lang-switcher {
  border-color: rgba(0,255,136,0.55);
  background: rgba(18,26,34,0.92);
}
.lang-globe { font-size: 15px; line-height: 1; }
.lang-current { font-family: var(--font-sans, "Segoe UI", sans-serif); white-space: nowrap; }
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  max-height: 220px;
  overflow-y: auto;
  background: rgba(12,16,22,0.96);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.55);
  padding: 4px;
  backdrop-filter: blur(6px);
}
.lang-switcher-wrap.open .lang-menu { display: block; }
.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  margin: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #c9d4df;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.lang-option:hover { background: rgba(255,255,255,0.07); color: #fff; }
.lang-option.active { background: rgba(0,255,136,0.12); color: #00ff88; }
.lang-option .lang-check { opacity: 0; font-size: 12px; }
.lang-option.active .lang-check { opacity: 1; }

.menu-subtitle {
  margin-top: clamp(4px, 1vh, 10px);
  font-size: clamp(10px, 1.35vh, 13px);
  letter-spacing: clamp(3px, 0.55vw, 7px);
  color: var(--text-dim);
  text-transform: uppercase;
}

.menu-nav {
  margin-top: clamp(8px, 2vh, 26px);
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.85vh, 9px);
}

.menu-btn {
  position: relative;
  background: rgba(18, 24, 30, 0.7);
  border: 1px solid var(--border-dim);
  border-left: 3px solid transparent;
  color: var(--text);
  padding: clamp(5px, 1.25vh, 13px) clamp(14px, 2vw, 22px);
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: var(--font-main);
  overflow: hidden;
}

.menu-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent-glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.18s;
}

.menu-btn:hover {
  border-left-color: var(--accent);
  border-color: var(--border);
  background: rgba(22, 30, 38, 0.9);
  transform: translateX(4px);
}

.menu-btn:hover::before { opacity: 0.12; }

.menu-btn.primary {
  border-left-color: var(--accent);
  background: rgba(0, 255, 136, 0.08);
}

.menu-btn.primary .btn-label { color: var(--accent); }

.menu-btn.danger:hover {
  border-left-color: var(--danger);
  background: rgba(255, 59, 48, 0.08);
}

.btn-label {
  display: block;
  font-size: clamp(12px, 1.72vh, 17px);
  font-weight: 600;
  letter-spacing: 2px;
  position: relative;
}

.btn-desc {
  display: block;
  font-size: clamp(9px, 1.2vh, 11.5px);
  color: var(--text-dim);
  margin-top: clamp(1px, 0.4vh, 3px);
  letter-spacing: 0.5px;
  position: relative;
}

.menu-footer {
  margin-top: 40px;
  font-size: 12px;
  color: var(--text-dark);
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

/* ===== 面板 ===== */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 255, 136, 0.05) inset;
  width: min(760px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.panel.wide { width: min(1080px, 94vw); }
.panel.small { width: min(380px, 90vw); }

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

.panel-header h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--text);
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border-dim);
  color: var(--text-dim);
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.panel-body {
  padding: 22px 26px;
  overflow-y: auto;
  flex: 1;
}

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 26px;
  border-top: 1px solid var(--border-dim);
}

/* 滚动条 */
.panel-body::-webkit-scrollbar { width: 8px; }
.panel-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
.panel-body::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 136, 0.25);
  border-radius: 0;
}
.panel-body::-webkit-scrollbar-thumb:hover { background: rgba(0, 255, 136, 0.45); }

/* ===== 好友面板 ===== */
#friends-panel {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 200;
  background: rgba(5, 8, 11, 0.92);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}
#friends-panel.active { display: flex; }

.friends-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 255, 136, 0.05) inset;
  width: min(900px, 94vw);
  height: min(720px, 90vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.friends-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-dim);
}
.friends-header h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text);
}
.friends-header .btn-close {
  background: transparent;
  border: 1px solid var(--border-dim);
  color: var(--text-dim);
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.friends-header .btn-close:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.friends-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-dim);
  background: rgba(0, 0, 0, 0.2);
}
.friends-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  padding: 12px 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-main);
}
.friends-tab:hover {
  color: var(--text);
  background: rgba(0, 255, 136, 0.05);
}
.friends-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(0, 255, 136, 0.1);
}

.friends-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.friend-row, .request-row, .search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  transition: all 0.15s;
}
.friend-row:hover, .request-row:hover, .search-row:hover {
  border-color: var(--border);
  background: rgba(0, 255, 136, 0.04);
}
.friend-row.online .friend-status::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  margin-right: 8px;
}
.friend-row .friend-status { display: inline-block; width: 8px; }
.friend-name { flex: 1; font-size: 14px; color: var(--text); }
.friend-name .already-friend { color: var(--accent); font-size: 12px; }
.search-name { flex: 1; font-size: 14px; color: var(--text); }
.search-name .online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 8px;
  box-shadow: 0 0 6px var(--accent);
}

.friend-actions, .request-actions, .search-actions {
  display: flex;
  gap: 6px;
}

.friends-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 20px;
  font-size: 14px;
}

.requests-section {
  margin-bottom: 24px;
}
.requests-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 12px;
  letter-spacing: 1px;
}
.request-row.incoming { border-left: 3px solid var(--accent); }
.request-row.outgoing { border-left: 3px solid var(--warn); }
.request-name { flex: 1; font-size: 14px; color: var(--text); }
.request-time { font-size: 12px; color: var(--text-dark); margin: 0 16px; white-space: nowrap; }
.pending { color: var(--warn); font-size: 12px; }

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.search-box input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-dim);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-main);
  border-radius: 4px;
}
.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.search-box input::placeholder { color: var(--text-dark); }

/* 好友聊天侧边栏 */
.friends-chat-sidebar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  background: var(--bg-panel-solid);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10;
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.5);
}
.friends-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-dim);
}
.chat-friend-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.friends-chat-header .btn-close.small {
  width: 26px;
  height: 26px;
  font-size: 14px;
}
.friends-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.friend-chat-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 85%;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  border: 1px solid var(--border-dim);
}
.friend-chat-line.self {
  align-self: flex-end;
  background: rgba(0, 255, 136, 0.15);
  border-color: var(--accent-dim);
}
.chat-time {
  font-size: 10px;
  color: var(--text-dark);
  align-self: flex-end;
}
.chat-from {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}
.friend-chat-line.self .chat-from { color: var(--text); }
.chat-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  word-wrap: break-word;
}
.friends-chat-input-wrap {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-dim);
}
.friends-chat-input-wrap input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-dim);
  color: var(--text);
  padding: 10px 14px;
  font-size: 13px;
  font-family: var(--font-main);
  border-radius: 4px;
}
.friends-chat-input-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ===== 设置标签页 ===== */
.settings-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-dim);
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-main);
  letter-spacing: 1px;
  transition: all 0.15s;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== 设置项 ===== */
.setting-group {
  display: flex;
  flex-direction: column;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.setting-name {
  font-size: 14px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.setting-name small {
  font-size: 11px;
  color: var(--text-dark);
  font-weight: 400;
}

.setting-value {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
  justify-content: flex-end;
}

.setting-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-dim);
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font-main);
  cursor: pointer;
  min-width: 180px;
  transition: border-color 0.15s;
}

.setting-select:hover,
.setting-select:focus {
  border-color: var(--accent-dim);
  outline: none;
}

.setting-select option {
  background: #0e1318;
  color: var(--text);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 140px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
  border-radius: 50%;
}

.setting-value em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  min-width: 52px;
  text-align: right;
}

input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 42px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-dim);
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}

input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-dim);
  transition: all 0.2s;
}

input[type="checkbox"]:checked {
  background: rgba(0, 255, 136, 0.2);
  border-color: var(--accent-dim);
}

input[type="checkbox"]:checked::after {
  left: 22px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

input[type="color"] {
  width: 42px;
  height: 26px;
  border: 1px solid var(--border-dim);
  background: transparent;
  cursor: pointer;
  padding: 2px;
}

/* ===== 按键绑定 ===== */
.keybinds {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-dim);
}

.keybinds h3 {
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 14px;
  font-weight: 500;
}

.keybind-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-dim);
}

kbd {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-dim);
  border-bottom-width: 2px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  margin-left: 4px;
  min-width: 24px;
  text-align: center;
}

/* ===== 按钮 ===== */
.btn-primary, .btn-ghost {
  padding: 11px 26px;
  font-size: 13px;
  font-family: var(--font-main);
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid;
}

.btn-primary {
  background: rgba(0, 255, 136, 0.1);
  border-color: var(--accent-dim);
  color: var(--accent);
}

.btn-primary:hover {
  background: rgba(0, 255, 136, 0.2);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary.big {
  padding: 15px 48px;
  font-size: 15px;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-dim);
  color: var(--text-dim);
}

.btn-ghost:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

/* ===== 游戏画面 ===== */
#game-screen {
  background: #000;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  font-family: var(--font-mono);
}

/* --- 顶部状态 --- */
.hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 18px 26px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.hud-timer {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timer-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.timer-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
  line-height: 1;
}

.hud-timer.urgent .timer-value {
  color: var(--danger);
  animation: pulse-danger 1s infinite;
}

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

.hud-objective {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-align: center;
  padding: 6px 20px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-dim);
}

.hud-extract {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-dim);
}

.extract-dot {
  width: 7px;
  height: 7px;
  background: var(--text-dark);
  border-radius: 50%;
  display: block;
}

.hud-extract.active { border-color: var(--accent-dim); color: var(--accent); }
.hud-extract.active .extract-dot {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse-danger 1.2s infinite;
}

/* --- 准星（随散布实时开合） --- */
#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  --gap: 6px;
  --len: 8px;
  --thick: 2px;
  --ch-color: #00ff88;
  opacity: 0.95;
  pointer-events: none;
}

#crosshair > div {
  position: absolute;
  background: var(--ch-color);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.45);
}

.ch-top {
  width: var(--thick);
  height: var(--len);
  left: calc(var(--thick) / -2);
  top: calc(-1 * (var(--gap) + var(--len)));
}

.ch-bottom {
  width: var(--thick);
  height: var(--len);
  left: calc(var(--thick) / -2);
  top: var(--gap);
}

.ch-left {
  width: var(--len);
  height: var(--thick);
  top: calc(var(--thick) / -2);
  left: calc(-1 * (var(--gap) + var(--len)));
}

.ch-right {
  width: var(--len);
  height: var(--thick);
  top: calc(var(--thick) / -2);
  left: var(--gap);
}

.ch-dot {
  width: 2px;
  height: 2px;
  left: -1px;
  top: -1px;
  border-radius: 50%;
}

/* 开镜：弹道 100% 命中中心 → 准星收拢成一个精确点 */
#crosshair.ads-exact .ch-top,
#crosshair.ads-exact .ch-bottom,
#crosshair.ads-exact .ch-left,
#crosshair.ads-exact .ch-right {
  opacity: 0;
}

#crosshair.ads-exact .ch-dot {
  width: 4px;
  height: 4px;
  left: -2px;
  top: -2px;
}

#crosshair.scope-hidden,
#crosshair.pip-hidden {
  opacity: 0;
}

/* --- 画中画瞄具（M14）：圆形镜内放大，镜外保持 1 倍视野 --- */
#pip-scope {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 31;
  display: flex;
  align-items: center;
  justify-content: center;
}

#pip-scope.active { opacity: 1; }

/* 镜筒外圈：只有一圈暗边，不做黑遮罩，四周环境照常可见 */
#pip-scope .pip-ring {
  position: absolute;
  width: 62vh;
  height: 62vh;
  border-radius: 50%;
  border: 3px solid rgba(10, 12, 10, 0.85);
  box-shadow:
    0 0 0 2px rgba(120, 140, 120, 0.25),
    inset 0 0 40px 8px rgba(0, 0, 0, 0.42),
    inset 0 0 6px 2px rgba(160, 255, 190, 0.10);
  box-sizing: border-box;
}

/* 十字线放在圆内，用 overflow:hidden 裁掉圆外的部分 */
#pip-scope .pip-cross-h,
#pip-scope .pip-cross-v {
  position: absolute;
  background: rgba(12, 16, 12, 0.72);
  z-index: 2;
}

#pip-scope .pip-cross-h {
  width: 62vh;
  height: 1.5px;
  border-radius: 50%;
  clip-path: inset(0 0 0 0);
  background:
    linear-gradient(90deg,
      transparent 0%, rgba(12,16,12,0.72) 6%,
      rgba(12,16,12,0.72) 94%, transparent 100%);
  height: 1.5px;
}

#pip-scope .pip-cross-v {
  height: 62vh;
  width: 1.5px;
  background:
    linear-gradient(180deg,
      transparent 0%, rgba(12,16,12,0.72) 6%,
      rgba(12,16,12,0.72) 94%, transparent 100%);
}

/* 中心点：细十字交叉处的小红点，方便精确点射 */
#pip-scope .pip-dot {
  position: absolute;
  z-index: 3;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(214, 68, 54, 0.95);
  box-shadow: 0 0 4px rgba(255, 80, 60, 0.9);
}

/* --- 狙击镜开镜视野（十字交叉准星） --- */
#scope-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: 30;
  background: radial-gradient(circle at center,
      transparent 0%,
      transparent 36%,
      rgba(0, 0, 0, 0.35) 40%,
      rgba(0, 0, 0, 0.9) 46%,
      #000 52%);
}

#scope-overlay.active {
  opacity: 1;
}

#scope-overlay .scope-h,
#scope-overlay .scope-v {
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(8, 10, 8, 0.42);
  box-shadow: 0 0 1px rgba(255, 255, 255, 0.25);
}

#scope-overlay .scope-h {
  width: 40vh;
  height: 1px;
  transform: translate(-50%, -50%);
}

#scope-overlay .scope-v {
  width: 1px;
  height: 40vh;
  transform: translate(-50%, -50%);
}

#scope-overlay .scope-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 46, 36, 1);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(255, 46, 36, 0.95), 0 0 16px rgba(255, 46, 36, 0.45);
}

/* 十字线两端加粗刻度 */
#scope-overlay .scope-h::before,
#scope-overlay .scope-h::after {
  content: '';
  position: absolute;
  top: -1px;
  width: 8%;
  height: 3px;
  background: rgba(10, 12, 10, 0.92);
}

#scope-overlay .scope-h::before { left: 18%; }
#scope-overlay .scope-h::after { right: 18%; }

#scope-overlay .scope-v::before,
#scope-overlay .scope-v::after {
  content: '';
  position: absolute;
  left: -1px;
  height: 8%;
  width: 3px;
  background: rgba(10, 12, 10, 0.92);
}

#scope-overlay .scope-v::before { top: 18%; }
#scope-overlay .scope-v::after { bottom: 18%; }

/* 镜内放大倍率档位指示（滚轮切换时高亮当前档） */
#scope-overlay .scope-zoom {
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  font-family: var(--font-mono, Consolas, monospace);
  font-size: 13px;
  letter-spacing: 1px;
  pointer-events: none;
}

#scope-overlay .scope-zoom .sz-tier {
  color: rgba(150, 160, 150, 0.4);
  transition: color 0.12s ease, text-shadow 0.12s ease;
}

#scope-overlay .scope-zoom .sz-tier.on {
  color: #ff5a4d;
  text-shadow: 0 0 6px rgba(255, 46, 36, 0.7);
}

/* 准星样式变体 */
#crosshair.crosshair-dot .ch-top,
#crosshair.crosshair-dot .ch-bottom,
#crosshair.crosshair-dot .ch-left,
#crosshair.crosshair-dot .ch-right { display: none; }

#crosshair.crosshair-dot .ch-dot {
  width: 4px;
  height: 4px;
  left: calc(50% - 2px);
  top: calc(50% - 2px);
}

#crosshair.crosshair-circle .ch-top,
#crosshair.crosshair-circle .ch-bottom,
#crosshair.crosshair-circle .ch-left,
#crosshair.crosshair-circle .ch-right { display: none; }

#crosshair.crosshair-circle::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 2px solid var(--ch-color, #00ff88);
  border-radius: 50%;
}

/* --- 地图卡片：随机模式下显示勾选框 --- */
.map-card .map-check {
  display: none;
}

.map-card.random-mode .map-check {
  display: block;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 14px;
  height: 14px;
  border: 1px solid var(--accent-dim, #2a5);
  border-radius: 3px;
  background: rgba(10, 16, 20, 0.7);
  pointer-events: none;
}

.map-card.random-mode.selected .map-check {
  background: var(--accent, #00ff88);
  box-shadow: 0 0 6px rgba(0, 255, 136, 0.6);
}

/* 随机模式下的卡片需要定位上下文 */
.map-card {
  position: relative;
}

/* ============================================================
 * 霰弹枪准星（crosshair-shotgun）：
 *   一个空心圆环，不填充颜色，半径 = 弹丸锥在屏幕上的投影。
 *   圆环的宽高/位置由 hud.js 每帧写入内联样式；
 *   非霰弹枪时必须 display:none（否则内联宽高会残留成大方块）。
 * ============================================================ */
#sg-ring {
  display: none;
}

#crosshair.crosshair-shotgun .ch-dot {
  display: none;
}

/* 持霰弹枪时隐藏十字的四条线（用圆环取代十字）；
   其它枪械这些线必须照常显示 —— 它们是腰射散布范围的可视化 */
#crosshair.crosshair-shotgun .ch-top,
#crosshair.crosshair-shotgun .ch-bottom,
#crosshair.crosshair-shotgun .ch-left,
#crosshair.crosshair-shotgun .ch-right {
  display: none;
}

#crosshair.crosshair-shotgun #sg-ring {
  display: block;
  position: absolute;
  background: transparent;
  border: 2px solid var(--ch-color, #00ff88);
  border-radius: 50%;
  box-sizing: border-box;
  box-shadow:
    0 0 3px rgba(0, 0, 0, 0.85),
    0 0 8px rgba(0, 0, 0, 0.45),
    inset 0 0 5px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition: width 0.06s linear, height 0.06s linear,
              left 0.06s linear, top 0.06s linear;
}

/* --- 命中提示 --- */
#hitmarker {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1.4);
  width: 32px;
  height: 32px;
  opacity: 0;
  transition: opacity 0.1s, transform 0.1s;
}

#hitmarker::before, #hitmarker::after {
  content: '';
  position: absolute;
  width: 11px;
  height: 2px;
  background: #fff;
  box-shadow: 0 0 4px rgba(0,0,0,0.8);
}

#hitmarker::before {
  top: 4px; left: 0;
  transform: rotate(45deg);
}

#hitmarker::after {
  top: 4px; right: 0;
  transform: rotate(-45deg);
}

#hitmarker.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

#hitmarker.kill::before, #hitmarker.kill::after {
  background: var(--danger);
  height: 3px;
  width: 15px;
}

/* --- 生命/护甲 --- */
.hud-bottom-left {
  position: absolute;
  left: 26px;
  bottom: 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 220px;
}

.vitals {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vital-bar {
  position: relative;
  height: 22px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-dim);
  overflow: hidden;
}

.vital-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  transform-origin: left;
  transition: transform 0.2s ease;
}

.health .vital-fill {
  background: linear-gradient(90deg, #0d7d4a, var(--accent));
}

.armor .vital-fill {
  background: linear-gradient(90deg, #2a5d8f, #4dabf7);
}

.vital-text {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.vital-bar.low .vital-fill {
  background: linear-gradient(90deg, #8b1a1a, var(--danger));
}
.armor-tier-label {
  color: rgba(230,237,243,0.85);
  font-weight: 600;
  font-size: 11px;
  margin-left: 1px;
  font-family: Consolas, monospace;
}

.stamina-wrap {
  position: relative;
  height: 6px;
  margin-top: 5px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 2px;
  overflow: hidden;
}

.stamina-bar { height: 100%; width: 100%; }

.stamina-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #29c46a, #7de07a);
  transform-origin: left;
  transition: transform 0.08s linear, background 0.25s linear;
  box-shadow: 0 0 6px rgba(60, 220, 130, 0.45);
}

.stamina-fill.low {
  background: linear-gradient(90deg, #d8a126, #f0c85a);
  box-shadow: 0 0 6px rgba(230, 180, 70, 0.45);
}

.stamina-fill.empty {
  background: linear-gradient(90deg, #b3261e, #e04a3a);
  box-shadow: 0 0 8px rgba(230, 70, 55, 0.6);
  animation: staminaPulse 0.9s ease-in-out infinite;
}

@keyframes staminaPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* 体力耗尽：底部条整体泛红，提示无法冲刺 */
.stamina-wrap.exhausted {
  border-color: rgba(224, 74, 58, 0.75);
  box-shadow: 0 0 8px rgba(224, 74, 58, 0.35);
}

/* --- 武器信息 --- */
.hud-bottom-right {
  position: absolute;
  right: 26px;
  bottom: 26px;
  text-align: right;
}

.weapon-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.weapon-name {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.ammo-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
}

.ammo-current {
  font-size: 44px;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 2px 12px rgba(0,0,0,0.9);
  transition: color 0.2s;
}

.ammo-current.low { color: var(--warn); }
.ammo-current.empty { color: var(--danger); }

.ammo-sep {
  font-size: 20px;
  color: var(--text-dark);
}

.ammo-reserve {
  font-size: 20px;
  color: var(--text-dim);
}

.weapon-slots {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.slot {
  width: 24px;
  height: 20px;
  border: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-dark);
}

.slot.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 255, 136, 0.08);
}

/* --- 击杀提示 --- */
#killfeed {
  position: absolute;
  right: 26px;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.kill-entry {
  font-size: 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.62);
  border-left: 2px solid var(--danger);
  padding: 5px 12px;
  letter-spacing: 1px;
  animation: slide-in-right 0.25s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-main);
}

@keyframes slide-in-right {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.kill-entry.headshot { border-left-color: var(--warn); }
.kill-entry.mine { border-left-color: var(--accent); background: rgba(0, 40, 22, 0.62); }
.kill-entry.teamkill { border-left-color: #ff3b30; background: rgba(60, 0, 0, 0.7); }

.kf-killer { color: #ff8a80; font-weight: 500; }
.kf-killer.me { color: var(--accent); }
.kf-arrow { color: var(--text-dim); font-size: 10px; }
.kf-victim { color: var(--text); }
.kill-entry.headshot .kf-victim { color: var(--warn); }

.kf-tag {
  font-size: 9px;
  padding: 1px 5px;
  border: 1px solid var(--warn);
  border-radius: 2px;
  color: var(--warn);
  font-family: var(--font-mono);
}
.kf-tag.tk { border-color: #ff3b30; color: #ff6b60; }

/* --- 中央击杀确认 --- */
#kill-banner {
  position: fixed;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%) scale(0.9);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  z-index: 60;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

#kill-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

#kill-banner .kb-main {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #fff;
  text-shadow: 0 0 12px rgba(0, 255, 136, 0.85), 0 2px 10px rgba(0, 0, 0, 0.9);
}

#kill-banner .kb-sub {
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

/* --- 击杀确认：屏幕四周瞬间渐变高亮 --- */
#kill-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 61;
  /* 四周亮、中心透明：径向渐变 + 边缘线性渐变叠加 */
  background:
    radial-gradient(ellipse 78% 72% at center, transparent 46%, rgba(0, 255, 136, 0.30) 88%, rgba(0, 255, 136, 0.46) 100%),
    linear-gradient(to bottom, rgba(0, 255, 136, 0.22), transparent 16%, transparent 84%, rgba(0, 255, 136, 0.22)),
    linear-gradient(to right, rgba(0, 255, 136, 0.18), transparent 14%, transparent 86%, rgba(0, 255, 136, 0.18));
  will-change: opacity, transform;
}

/* 爆头：更亮、偏白金色调 */
#kill-flash.hs {
  background:
    radial-gradient(ellipse 78% 72% at center, transparent 42%, rgba(255, 214, 102, 0.36) 86%, rgba(255, 236, 170, 0.58) 100%),
    linear-gradient(to bottom, rgba(255, 224, 130, 0.28), transparent 16%, transparent 84%, rgba(255, 224, 130, 0.28)),
    linear-gradient(to right, rgba(255, 210, 110, 0.22), transparent 14%, transparent 86%, rgba(255, 210, 110, 0.22));
}

#kill-flash.show {
  animation: killFlashAnim 0.42s cubic-bezier(0.15, 0.85, 0.3, 1) forwards;
}

#kill-flash.hs.show {
  animation: killFlashAnimHs 0.5s cubic-bezier(0.15, 0.85, 0.3, 1) forwards;
}

@keyframes killFlashAnim {
  0%   { opacity: 0;    transform: scale(1.04); }
  14%  { opacity: 0.95; transform: scale(1); }
  100% { opacity: 0;    transform: scale(1); }
}

@keyframes killFlashAnimHs {
  0%   { opacity: 0;    transform: scale(1.06); }
  10%  { opacity: 1;    transform: scale(1); }
  26%  { opacity: 0.55; }
  40%  { opacity: 0.85; }
  100% { opacity: 0;    transform: scale(1); }
}

/* --- 伤害红晕 --- */
#damage-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse 70% 65% at center, transparent 52%, rgba(200, 0, 0, 0.5) 100%);
  transition: opacity 0.3s;
}

#low-health-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse 62% 58% at center, transparent 55%, rgba(150, 0, 0, 0.62) 100%);
  transition: opacity 0.5s;
  mix-blend-mode: normal;
}

#low-health-overlay.active {
  opacity: 1;
  animation: heartbeat 1.4s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.85; }
}

/* --- 交互提示 --- */
#interact-prompt {
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid var(--border);
  padding: 9px 20px;
  font-size: 13px;
  letter-spacing: 1px;
}

#interact-prompt.show { display: flex; }

#interact-prompt kbd {
  background: var(--accent);
  color: #041a0d;
  border: none;
  font-weight: 700;
  padding: 3px 9px;
}

/* --- 搜刮面板 --- */
#loot-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 80vw);
  background: rgba(10, 14, 18, 0.96);
  border: 1px solid var(--border);
  display: none;
  pointer-events: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

#loot-panel.show { display: block; }

.loot-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-dim);
  font-size: 14px;
  letter-spacing: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.loot-hint {
  font-size: 11px;
  color: var(--text-dark);
  letter-spacing: 0;
}

.loot-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
}

.loot-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-dim);
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.loot-item:hover {
  border-color: var(--accent-dim);
  background: rgba(0, 255, 136, 0.07);
}

.loot-item.rare { border-color: rgba(120, 170, 255, 0.4); }
.loot-item.epic { border-color: rgba(190, 120, 255, 0.45); }
.loot-item.legendary { border-color: rgba(255, 190, 60, 0.5); }

.loot-item-name {
  font-size: 12px;
  color: var(--text);
  margin-bottom: 4px;
  font-family: var(--font-main);
}

.loot-item-value {
  font-size: 11px;
  color: var(--accent);
  font-family: var(--font-mono);
}

.loot-item.empty {
  opacity: 0.3;
  pointer-events: none;
  text-align: center;
  padding: 30px 10px;
  font-size: 12px;
  color: var(--text-dark);
}

/* --- 战术地图 --- */
/* 默认就是右上角常驻小地图；按 M 切换 .expanded 放大到屏幕中央 */
#tactical-map {
  position: absolute;
  right: 26px;
  top: 110px;
  width: 180px;
  display: block;
  pointer-events: none;
  transition: width 0.16s ease;
}

#tactical-map.show { display: block; }

#minimap-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: rgba(6, 10, 14, 0.9);
  border: 1px solid var(--border);
  display: block;
  border-radius: 2px;
}

.map-head,
.map-tip,
.map-legend { display: none; }

/* 小图态：只留一行提示，避免图例换行显得乱 */
.map-mini-hint {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.3;
  color: rgba(200, 211, 221, 0.45);
  font-family: var(--font-mono);
  text-align: center;
  letter-spacing: 0.5px;
}

/* ===== 放大态：屏幕中央 + 可点击 ===== */
#tactical-map.expanded {
  position: fixed;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  width: min(76vh, 660px);
  transform: translate(-50%, -50%);
  z-index: 70;
  pointer-events: auto;
  padding: 14px 14px 10px;
  background: rgba(7, 11, 15, 0.96);
  border: 1px solid rgba(0, 255, 136, 0.45);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(0, 255, 136, 0.08), 0 24px 70px rgba(0, 0, 0, 0.8),
    0 0 60px rgba(0, 255, 136, 0.06);
  animation: mapPop 0.16s ease-out;
}

@keyframes mapPop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#tactical-map.expanded .map-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

#tactical-map.expanded .map-title {
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
}

#tactical-map.expanded .map-sub {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

#tactical-map.expanded #minimap-canvas {
  border-color: rgba(0, 255, 136, 0.35);
  cursor: crosshair;
}

#tactical-map.expanded .map-legend {
  display: flex;
  font-size: 11px;
  gap: 14px;
}

#tactical-map.expanded .map-mini-hint { display: none; }

#tactical-map.expanded .map-tip {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  text-align: center;
  opacity: 0.75;
}

.map-legend {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-main);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-item i {
  width: 6px;
  height: 6px;
  display: block;
  border-radius: 50%;
}

.dot-self { background: var(--accent); }
.dot-enemy { background: var(--danger); }
.dot-loot { background: var(--warn); }
.dot-extract { background: #4dabf7; }
.dot-mark { background: #ffd166; }
.dot-view { background: rgba(0, 255, 136, 0.35); box-shadow: 0 0 6px rgba(0, 255, 136, 0.35); }

/* --- 罗盘 --- */
.hud-compass {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 26px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 18%, black 82%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 18%, black 82%, transparent);
}

.compass-strip {
  height: 100%;
  position: relative;
  will-change: transform;
}

.compass-tick {
  position: absolute;
  top: 0;
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  transform: translateX(-50%);
  letter-spacing: 1px;
}

.compass-tick.major {
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.compass-tick::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 1px;
  height: 5px;
  background: currentColor;
  transform: translateX(-50%);
  opacity: 0.6;
}

/* --- 敌人计数 --- */
.hud-enemy-count {
  position: absolute;
  left: 26px;
  top: 26px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 2px;
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 14px;
  border: 1px solid var(--border-dim);
}

/* ===== 暂停菜单 ===== */
#pause-menu .panel {
  text-align: center;
  padding: 0;
}

#pause-menu h2 {
  padding: 26px;
  font-size: 20px;
  letter-spacing: 6px;
  border-bottom: 1px solid var(--border-dim);
}

.pause-buttons {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== 结算画面 ===== */
.result-panel {
  padding: 34px;
  text-align: center;
  width: min(620px, 92vw);
}

.result-title {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 8px;
  margin-bottom: 8px;
}

.result-title.success { color: var(--accent); text-shadow: 0 0 30px var(--accent-glow); }
.result-title.failed { color: var(--danger); text-shadow: 0 0 30px rgba(255,59,48,0.4); }

.result-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 2px;
  margin-bottom: 26px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--border-dim);
  border: 1px solid var(--border-dim);
  margin-bottom: 24px;
}

.stat-cell {
  background: var(--bg-panel-solid);
  padding: 16px 10px;
}

.stat-cell .stat-label {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-bottom: 6px;
  font-family: var(--font-main);
}

.stat-cell .stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
}

.result-loot {
  text-align: left;
  margin-bottom: 20px;
}

.result-loot h3 {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-weight: 500;
}

.loot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
}

.loot-chip {
  font-size: 11px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-dim);
  color: var(--text-dim);
  font-family: var(--font-main);
}

.loot-chip em {
  font-style: normal;
  color: var(--accent);
  margin-left: 5px;
  font-family: var(--font-mono);
}

.loot-chip.empty {
  border: none;
  background: none;
  color: var(--text-dark);
}

.result-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--border-dim);
  margin-bottom: 22px;
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 2px;
}

.total-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  text-shadow: 0 0 20px var(--accent-glow);
}

/* ===== 装备配置 ===== */
.loadout-body {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.loadout-section h3 {
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.loadout-section h3 small {
  font-size: 11px;
  color: var(--text-dark);
  letter-spacing: 0;
  font-weight: 400;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-dim);
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.item-card:hover {
  border-color: var(--accent-dim);
  background: rgba(0, 255, 136, 0.06);
}

.item-card.selected {
  border-color: var(--accent);
  background: rgba(0, 255, 136, 0.1);
  box-shadow: inset 0 0 20px rgba(0, 255, 136, 0.06);
}

.item-card .item-name {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
  font-family: var(--font-main);
}

.item-card .item-stats {
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  line-height: 1.6;
}

/* --- 地图选择 --- */
.map-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.map-card .item-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-card .map-tag {
  font-size: 10px;
  padding: 1px 6px;
  border: 1px solid var(--accent-dim);
  border-radius: 2px;
  color: var(--accent);
  font-family: var(--font-mono);
}

.map-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

/* --- 无尽模式开关 --- */
.endless-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-dim);
  cursor: pointer;
}

.endless-row:hover { border-color: var(--accent-dim); }

.endless-label {
  font-size: 12px;
  color: var(--text);
  font-family: var(--font-main);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.endless-label small {
  font-size: 10px;
  color: var(--text-dim);
}

#set-endless {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.loadout-section h3 small.warn {
  color: var(--warn);
  animation: mapWarn 0.4s ease;
}

@keyframes mapWarn {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.loadout-summary {
  display: flex;
  gap: 26px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-main);
}

.loadout-summary em {
  font-style: normal;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* ===== 行动记录 ===== */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px;
  background: var(--border-dim);
  border: 1px solid var(--border-dim);
  margin-bottom: 24px;
}

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

.record-row {
  display: grid;
  grid-template-columns: 90px 1fr 90px 90px;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.025);
  border-left: 2px solid var(--text-dark);
  font-size: 12px;
  align-items: center;
  font-family: var(--font-mono);
}

.record-row.success { border-left-color: var(--accent); }
.record-row.failed { border-left-color: var(--danger); }

.record-row .rec-date { color: var(--text-dark); font-size: 11px; }
.record-row .rec-result { color: var(--text); font-family: var(--font-main); }
.record-row .rec-kills { color: var(--text-dim); }
.record-row .rec-gain { text-align: right; color: var(--accent); }
.record-row.failed .rec-gain { color: var(--danger); }

.records-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-dark);
  font-size: 13px;
  letter-spacing: 1px;
}

/* ===== 更新公告 ===== */
.cl-current {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 1px;
  margin-left: auto;
  margin-right: 16px;
  padding: 4px 12px;
  border: 1px solid var(--accent-dim, rgba(0, 255, 136, 0.35));
  border-radius: 4px;
  background: rgba(0, 255, 136, 0.06);
}

.changelog-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 4px 2px;
}

.cl-version {
  background: rgba(255, 255, 255, 0.025);
  border-left: 3px solid var(--accent-dim, rgba(0, 255, 136, 0.4));
  border-radius: 0 6px 6px 0;
  padding: 14px 18px;
}

.cl-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-dim);
}

.cl-ver {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: bold;
  color: var(--text);
  letter-spacing: 1px;
}

.cl-tag {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(0, 255, 136, 0.08);
}

.cl-date {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dark);
}

.cl-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0;
  line-height: 1.5;
}

.cl-type {
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1;
  padding: 4px 6px;
  border: 1px solid;
  border-radius: 3px;
  letter-spacing: 1px;
  margin-top: 3px;
  font-family: var(--font-mono);
}

.cl-text {
  font-size: 12px;
  color: var(--text-dim);
  flex: 1;
}

/* ===== 全屏黑屏过渡 ===== */
#fade-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity 0.4s;
}

#fade-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ===== 提示条 ===== */
#toast-container {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: rgba(10, 14, 18, 0.94);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text);
  letter-spacing: 1px;
  animation: toast-in 0.25s ease;
  white-space: nowrap;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast.fade-out {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px); }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .hud-compass { width: 220px; }
  .hud-bottom-left { width: 160px; }
  .ammo-current { font-size: 32px; }
  .hud-top { padding: 12px 14px; }
  .hud-bottom-left, .hud-bottom-right { bottom: 14px; }
  .hud-bottom-left { left: 14px; }
  .hud-bottom-right { right: 14px; }
  #tactical-map { width: 120px; right: 14px; top: 90px; }
  #tactical-map.expanded { width: min(92vw, 520px); }
  #minimap-canvas { width: 100%; height: auto; }
  .panel { width: 96vw; max-height: 94vh; }
  .setting-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .setting-value { min-width: 0; width: 100%; justify-content: flex-start; }
}

/* ===== 性能调试 ===== */
#perf-hud {
  position: fixed;
  left: 8px;
  top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 8px;
  z-index: 300;
  pointer-events: none;
  display: none;
  line-height: 1.5;
  white-space: pre;
}

#perf-hud.show { display: block; }

/* ============================================================
   聊天系统
   ============================================================ */
#chat-log {
  position: absolute;
  left: 26px;
  bottom: 150px;
  width: 380px;
  max-height: 260px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 3px;
  pointer-events: none;
}

.chat-line {
  font-size: 13px;
  line-height: 1.5;
  color: #e6edf3;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px 10px;
  border-radius: 2px;
  animation: chatIn 0.2s ease;
  word-break: break-word;
  font-family: 'Microsoft YaHei', sans-serif;
}

@keyframes chatIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.chat-line .chat-who {
  color: #00ff88;
  font-weight: 600;
  margin-right: 6px;
}

.chat-line.team .chat-who { color: #4dabf7; }
.chat-line.enemy .chat-who { color: #ff6b60; }

.chat-line.system {
  color: #8b98a5;
  font-style: italic;
  background: rgba(0, 0, 0, 0.28);
}
.chat-line.system .chat-who { display: none; }

.chat-line.fade { opacity: 0.4; transition: opacity 0.6s; }

#chat-input-wrap {
  position: absolute;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%);
  width: 560px;
  max-width: 80vw;
  background: rgba(10, 14, 18, 0.96);
  border: 1px solid rgba(0, 255, 136, 0.35);
  border-radius: 3px;
  padding: 10px 14px;
  display: none;
  pointer-events: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  z-index: 60;
}

#chat-input-wrap.active { display: block; }

.chat-input-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #4a5560;
  margin-bottom: 6px;
  letter-spacing: 1px;
  font-family: Consolas, monospace;
}

#chat-channel {
  color: #00ff88;
  font-weight: 600;
}

.chat-hint { opacity: 0.6; }

#chat-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #e6edf3;
  font-size: 14px;
  font-family: 'Microsoft YaHei', sans-serif;
  padding: 4px 0;
}

#chat-input::placeholder { color: #4a5560; }

/* ============================================================
   频道选择条（聊天/语音）：仅光标可见时可点击（聊天框打开或按 · 唤出光标）
   ============================================================ */
#channel-bar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 6px 12px;
  background: rgba(10, 14, 18, 0.92);
  border: 1px solid rgba(0, 255, 136, 0.25);
  border-radius: 4px;
  font-family: Consolas, monospace;
  z-index: 59;
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.15s;
}

/* 光标模式（聊天打开或按 · 唤出光标）下高亮并可点击 */
body.cursor-mode #channel-bar { pointer-events: auto; opacity: 1; }

.chan-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chan-title {
  font-size: 10px;
  color: #4a5560;
  letter-spacing: 1px;
  margin-right: 2px;
}

.chan-btn {
  background: transparent;
  border: 1px solid #2a3540;
  color: #8b98a5;
  font-size: 11px;
  font-family: inherit;
  padding: 3px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s;
}

.chan-btn:hover { border-color: #00b35f; color: #cfe; }

.chan-btn.active {
  background: rgba(0, 255, 136, 0.14);
  border-color: #00ff88;
  color: #00ff88;
  font-weight: 600;
}

/* 聊天消息里的频道前缀 */
.chat-chan { color: #4a9; font-size: 11px; }

/* ============================================================
   治疗进度
   ============================================================ */
#heal-progress {
  position: absolute;
  left: 50%;
  bottom: 150px;
  transform: translateX(-50%);
  width: 280px;
  background: rgba(10, 14, 18, 0.94);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 3px;
  padding: 12px 14px;
  display: none;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  z-index: 55;
}

#heal-progress.active { display: flex; }

.heal-icon {
  font-size: 20px;
  color: #00ff88;
  flex-shrink: 0;
  animation: healPulse 0.9s ease-in-out infinite;
}

@keyframes healPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.92); }
}

.heal-bar-wrap {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.heal-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0d7d4a, #00ff88);
  border-radius: 3px;
  transition: width 0.08s linear;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.heal-label {
  font-size: 12px;
  color: #8b98a5;
  flex-shrink: 0;
  font-family: Consolas, monospace;
  min-width: 90px;
  text-align: right;
}

/* ============================================================
   语音指示
   ============================================================ */
#voice-indicator {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(10, 14, 18, 0.9);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 20px;
  padding: 6px 16px;
  z-index: 58;
}

#voice-indicator.active { display: flex; }

.voice-icon {
  font-size: 13px;
  line-height: 1;
}

.voice-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 14px;
}

.voice-bars span {
  width: 2px;
  height: 4px;
  background: #00ff88;
  border-radius: 1px;
  animation: voiceWave 0.7s ease-in-out infinite;
}

.voice-bars span:nth-child(2) { animation-delay: 0.15s; }
.voice-bars span:nth-child(3) { animation-delay: 0.3s; }

@keyframes voiceWave {
  0%, 100% { height: 4px; opacity: 0.5; }
  50% { height: 12px; opacity: 1; }
}

.voice-label {
  font-size: 11px;
  color: #00ff88;
  letter-spacing: 1px;
  font-family: Consolas, monospace;
}

/* ============================================================
   设置分隔符
   ============================================================ */
.settings-divider {
  font-size: 11px;
  letter-spacing: 3px;
  color: #4a5560;
  padding: 20px 0 10px;
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: Consolas, monospace;
}

.voice-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  font-size: 13px;
  color: #8b98a5;
}

.btn-ghost.small {
  padding: 6px 14px;
  font-size: 12px;
}

/* ============================================================
   击杀提示增强
   ============================================================ */
.kill-entry.teamkill {
  border-left-color: #ffaa00;
  color: #ffaa00;
}

/* ============================================================
   背包状态
   ============================================================ */
#backpack-status {
  position: absolute;
  right: 26px;
  bottom: 130px;
  width: 200px;
  background: rgba(10, 14, 18, 0.82);
  border: 1px solid rgba(0, 255, 136, 0.18);
  border-radius: 3px;
  padding: 10px 12px;
  font-family: Consolas, monospace;
  font-size: 11px;
}

.bp-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.bp-label {
  color: #4a5560;
  width: 26px;
  flex-shrink: 0;
  font-size: 10px;
}

.bp-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.bp-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.2s;
  background: linear-gradient(90deg, #0d7d4a, #00ff88);
}

.bp-fill.slots {
  background: linear-gradient(90deg, #2a6a9a, #4dabf7);
}

.bp-fill.weight.over {
  background: linear-gradient(90deg, #8b1a1a, #ff3b30);
}

.bp-val {
  color: #8b98a5;
  font-size: 10px;
  min-width: 62px;
  text-align: right;
}

.bp-val.full {
  color: #ff3b30;
  font-weight: 600;
}

.bp-value {
  color: #00ff88;
  font-size: 11px;
  text-align: right;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  letter-spacing: 0.5px;
}

/* ============================================================
   投掷物
   ============================================================ */
#throwable-status {
  position: absolute;
  right: 26px;
  bottom: 244px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 14, 18, 0.82);
  border: 1px solid rgba(255, 170, 0, 0.25);
  border-radius: 3px;
  padding: 6px 12px;
  font-family: Consolas, monospace;
  font-size: 11px;
}

#throwable-status.empty {
  opacity: 0.4;
  border-color: rgba(255, 255, 255, 0.08);
}

.th-icon {
  font-size: 13px;
  line-height: 1;
}

.th-name {
  color: #8b98a5;
  font-family: 'Microsoft YaHei', sans-serif;
}

.th-count {
  color: #ffaa00;
  font-weight: 600;
}

#throwable-status.empty .th-count {
  color: #4a5560;
}

/* ============================================================
   搜刮面板增强
   ============================================================ */
.loot-item {
  position: relative;
  overflow: hidden;
}

.loot-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.06) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.loot-item:hover::after {
  transform: translateX(100%);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* ============================================================
   近战武器提示
   ============================================================ */
.weapon-info.melee .ammo-display {
  display: none;
}

.weapon-info.melee .weapon-name::after {
  content: ' · 近战';
  color: #00ff88;
  font-size: 10px;
}

/* ============================================================
   设备配置卡片
   ============================================================ */
.sys-card {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(0, 255, 136, 0.12);
  border-radius: 3px;
  padding: 14px 16px;
  margin-bottom: 22px;
}

.sys-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sys-card-title {
  font-size: 11px;
  letter-spacing: 3px;
  color: #4a5560;
  font-family: Consolas, monospace;
}

.sys-refresh {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #8b98a5;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sys-refresh:hover {
  border-color: #00b35f;
  color: #00ff88;
  transform: rotate(90deg);
}

.sys-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
}

.sys-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.sys-label {
  font-size: 10px;
  color: #4a5560;
  font-family: Consolas, monospace;
  letter-spacing: 1px;
  flex-shrink: 0;
  width: 46px;
}

.sys-value {
  font-size: 12px;
  color: #b8c4d0;
  font-family: 'Microsoft YaHei', sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.sys-value.strong {
  color: #00ff88;
  font-family: Consolas, monospace;
  font-weight: 600;
}

.sys-value.warn {
  color: #ffaa00;
}

.sys-recommend {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: #8b98a5;
  line-height: 1.7;
  display: none;
}

.sys-recommend.show {
  display: block;
}

.sys-recommend .rec-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  margin-right: 6px;
  font-family: Consolas, monospace;
  font-size: 10px;
  letter-spacing: 1px;
}

.rec-badge.good {
  background: rgba(0, 255, 136, 0.12);
  color: #00ff88;
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.rec-badge.mid {
  background: rgba(255, 170, 0, 0.12);
  color: #ffaa00;
  border: 1px solid rgba(255, 170, 0, 0.3);
}

.rec-badge.low {
  background: rgba(255, 59, 48, 0.12);
  color: #ff6b60;
  border: 1px solid rgba(255, 59, 48, 0.3);
}

.sys-apply-btn {
  margin-left: 8px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: #00ff88;
  padding: 3px 10px;
  font-size: 11px;
  border-radius: 2px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.sys-apply-btn:hover {
  background: rgba(0, 255, 136, 0.2);
}

@media (max-width: 768px) {
  .sys-grid {
    grid-template-columns: 1fr;
  }
}


/* --- 服务器门禁 / 注册登录 --- */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(10, 16, 22, 0.97), #05070a 72%);
}

.auth-panel {
  width: min(408px, 92vw);
  background: rgba(16, 22, 28, 0.96);
  border: 1px solid rgba(0, 255, 136, 0.22);
  border-left: 3px solid var(--accent);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85);
}

.auth-logo {
  font-size: 20px;
  letter-spacing: 6px;
  color: #e6edf3;
  font-family: var(--font-main);
}

.auth-logo span { color: var(--accent); }

.auth-title { font-size: 22px; letter-spacing: 3px; color: var(--text); }
.auth-title.warn { color: var(--warn); }

.auth-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.9;
}

.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; }
.auth-field input {
  background: #0a0e12;
  border: 1px solid #2a343d;
  color: #e6edf3;
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font-main);
  border-radius: 2px;
  width: 100%;
}
.auth-field input:focus { outline: none; border-color: var(--accent); }
.auth-inline { display: flex; gap: 8px; }
.auth-inline .port { width: 92px; flex: none; }

.auth-btn {
  background: rgba(0, 255, 136, 0.12);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 10px;
  font-size: 13px;
  letter-spacing: 2px;
  cursor: pointer;
  font-family: inherit;
  border-radius: 2px;
}
.auth-btn:hover { background: rgba(0, 255, 136, 0.2); }

.auth-error { color: #ff6b60; font-size: 12px; min-height: 16px; }

.auth-tip { font-size: 11px; color: var(--text-dim); }
.auth-tip a { color: var(--accent); margin-left: 6px; text-decoration: none; }
.auth-tip.dim { opacity: 0.75; }

.auth-tabs { display: flex; border-bottom: 1px solid #222c35; }
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
}
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.auth-version {
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(0, 255, 136, 0.55);
  font-family: var(--font-mono, Consolas, monospace);
  text-align: right;
}

.auth-inline-btn {
  display: flex;
  gap: 10px;
}
.auth-inline-btn .auth-btn {
  flex: 1;
}
.auth-btn.ghost {
  background: transparent;
  border-color: #384552;
  color: var(--text-dim);
}
.auth-btn.ghost:hover {
  border-color: var(--text-dim);
  color: var(--text);
}


/* 唤出光标模式（按 · 切换） */
body.in-game.cursor-mode { cursor: default; }
body.in-game.cursor-mode #game-canvas { cursor: default; }
body.in-game.cursor-mode * { cursor: auto; }
body.in-game.cursor-mode button,
body.in-game.cursor-mode .loot-item,
body.in-game.cursor-mode .slot { cursor: pointer; }


.btn-danger {
  padding: 6px 14px;
  border-radius: var(--radius, 3px);
  border: 1px solid #ff3b30;
  background: rgba(255, 59, 48, 0.12);
  color: #ff6b5f;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-danger:hover { background: rgba(255, 59, 48, 0.25); color: #fff; }

.auth-btn.danger {
  background: rgba(255, 59, 48, 0.15) !important;
  border-color: #ff3b30 !important;
  color: #ff6b5f !important;
}
.auth-btn.danger:hover { background: rgba(255, 59, 48, 0.3) !important; color: #fff !important; }


/* 帧率 / 温度（右上角，不挡视野） */
.sys-stats {
  position: fixed;
  top: 56px;
  right: 14px;
  z-index: 60;
  pointer-events: none;
  font-family: var(--font-mono, Consolas, monospace);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: rgba(0, 255, 136, 0.85);
  background: rgba(6, 10, 14, 0.35);
  border: 1px solid rgba(0, 255, 136, 0.12);
  padding: 3px 8px;
  border-radius: 3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* 静步提示 */
.walk-badge {
  position: fixed;
  left: 26px;
  bottom: 148px;
  z-index: 55;
  pointer-events: none;
  display: none;
  font-size: 12px;
  letter-spacing: 3px;
  color: #4dabf7;
  border: 1px solid rgba(77, 171, 247, 0.45);
  background: rgba(8, 14, 20, 0.55);
  padding: 2px 8px;
  border-radius: 3px;
}
body.walk-mode .walk-badge { display: block; }


/* 武器分类标签 */
.weapon-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.weapon-cat {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 3px;
  border: 1px solid #38444f;
  background: rgba(20, 27, 34, 0.8);
  color: var(--text-dim, #8b98a5);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.weapon-cat:hover { border-color: #4dabf7; color: #cfe3f5; }
.weapon-cat.active {
  border-color: var(--accent, #00ff88);
  color: #051409;
  background: var(--accent, #00ff88);
  font-weight: 600;
}


/* ===== 背包面板 ===== */
.bp-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid #2a343d;
  padding-bottom: 8px;
}
.bp-tab {
  padding: 5px 16px;
  border-radius: 3px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim, #8b98a5);
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
}
.bp-tab:hover { color: #cfe3f5; }
.bp-tab.active {
  border-color: var(--accent, #00ff88);
  color: var(--accent, #00ff88);
  background: rgba(0, 255, 136, 0.08);
}
.bp-hint {
  font-size: 12px;
  color: var(--text-dim, #8b98a5);
  margin-bottom: 8px;
}
.bp-item {
  position: relative;
}
.bp-item .bp-drop {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  border: 1px solid #ff3b30;
  background: rgba(255, 59, 48, 0.15);
  color: #ff6b5f;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
}
.bp-item:hover .bp-drop { opacity: 1; }
.bp-item .bp-drop:hover { background: rgba(255, 59, 48, 0.4); color: #fff; }
.empty-hint {
  padding: 24px;
  text-align: center;
  color: var(--text-dim, #8b98a5);
  font-size: 13px;
}


/* ===== 快捷消耗品（左下角） ===== */
.quick-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 5px 10px 5px 6px;
  background: rgba(10, 16, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 4px;
  backdrop-filter: blur(6px);
  transition: border-color .2s, background .2s;
  max-width: 200px;
}
.quick-item.empty { opacity: 0.45; }
.quick-item.active {
  border-color: rgba(0, 255, 136, 0.5);
  background: rgba(0, 255, 136, 0.08);
}
.quick-key {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #05130c;
  background: var(--accent, #00ff88);
  border-radius: 3px;
  flex-shrink: 0;
}
.quick-icon {
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}
.quick-info { display: flex; flex-direction: column; line-height: 1.15; }
.quick-name {
  font-size: 12px;
  color: #dfe8ef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quick-count {
  font-size: 11px;
  color: var(--text-dim, #8b98a5);
  font-family: var(--font-mono, Consolas, monospace);
}

/* ===== 消耗品轮盘 ===== */
.item-wheel {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 400px;
  height: 400px;
  transform: translate(-50%, -50%) scale(0.86);
  opacity: 0;
  pointer-events: none;
  z-index: 320;
  transition: opacity .14s ease, transform .14s ease;
}
.item-wheel.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
/* 轮盘打开时隐藏准星，避免和中心文字打架 */
body.wheel-open #crosshair { opacity: 0; }
#crosshair { transition: opacity .12s ease; }
/* 半透明底盘：让轮盘在明亮场景里也能看清 */
.item-wheel::before {
  content: '';
  position: absolute;
  inset: 46px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(4, 10, 8, 0.44) 0%, rgba(4, 10, 8, 0.36) 48%, rgba(4, 10, 8, 0.16) 74%, rgba(4, 10, 8, 0.02) 96%, rgba(4, 10, 8, 0) 100%);
  border: 1px solid rgba(0, 255, 136, 0.12);
  box-shadow: inset 0 0 40px rgba(0, 255, 136, 0.05), 0 8px 40px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.wheel-rings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.wheel-rings circle {
  fill: none;
  stroke: rgba(210, 235, 225, 0.22);
  stroke-width: 1.5;
}
.wheel-rings circle:nth-child(2) {
  stroke: rgba(210, 235, 225, 0.14);
  stroke-dasharray: 4 6;
}
.wheel-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  letter-spacing: 2px;
  color: rgba(238, 248, 244, 0.92);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.95), 0 2px 8px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}
.wheel-slot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92px;
  text-align: center;
  transform: translate(-50%, -50%);
  color: rgba(220, 232, 242, 0.72);
  font-size: 12px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
  transition: color .12s, transform .12s;
  animation: wheelSlotIn .16s ease-out both;
}
@keyframes wheelSlotIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.wheel-slot .ws-icon { font-size: 22px; line-height: 1.1; }
.wheel-slot .ws-name { margin-top: 2px; }
.wheel-slot .ws-count {
  font-family: var(--font-mono, Consolas, monospace);
  font-size: 11px;
  opacity: 0.8;
}
.wheel-slot.selected {
  color: #05130c;
  text-shadow: none;
}
.wheel-slot.selected .ws-name,
.wheel-slot.selected .ws-count { color: #05130c; }
.wheel-slot.selected::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100px;
  height: 100px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 255, 136, 1) 0%, rgba(0, 255, 136, 0.92) 62%, rgba(0, 255, 136, 0.55) 100%);
  box-shadow: 0 0 26px rgba(0, 255, 136, 0.45);
  border-radius: 50%;
  opacity: 0.9;
  z-index: -1;
}
.wheel-slot.disabled { opacity: 0.3; }

/* --- 登录页：局域网服务器自动发现 --- */
.auth-lan-count {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 9px;
  background: rgba(0, 255, 136, 0.16);
  color: var(--accent, #00ff88);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
}

.auth-lan-select {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border, #2a3138);
  border-radius: 3px;
  background: rgba(8, 12, 16, 0.9);
  color: var(--text, #e6edf3);
  font-family: var(--font-main);
  font-size: 12px;
  outline: none;
}

.auth-lan-select:focus { border-color: var(--accent, #00ff88); }

.auth-btn.small {
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  flex: none;
}


/* --- 枪械推荐栏（T 梯度） --- */
.tier-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.tier-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 10px;
  background: rgba(18, 24, 30, 0.55);
  border: 1px solid var(--border-dim, rgba(255,255,255,0.08));
  border-radius: 4px;
}

.tier-badge {
  flex: none;
  min-width: 40px;
  padding: 3px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: #0a0e12;
  text-align: center;
}

.tier-desc {
  flex: none;
  font-size: 11px;
  color: var(--text-dim, #8b98a5);
  min-width: 74px;
}

.tier-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.tier-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid;
  border-radius: 3px;
  background: rgba(5, 8, 11, 0.6);
  cursor: default;
}

.tier-chip b {
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #e6edf3);
}

.tier-chip i {
  font-style: normal;
  font-size: 10px;
  color: var(--text-dim, #8b98a5);
  font-family: var(--font-mono);
}

/* ============================================================
   改枪界面
   ============================================================ */
.gunsmith-panel { max-width: 920px; width: 94vw; }

#gunsmith-weapon {
  color: var(--accent, #00ff88);
  font-size: 13px;
  margin-left: 10px;
  letter-spacing: 1px;
}

/* 后坐力预览 */
.gs-recoil {
  border: 1px solid #1e2630;
  background: rgba(10, 14, 18, 0.7);
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.gs-recoil-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.gs-recoil-row:last-of-type { margin-bottom: 0; }

.gs-label {
  width: 82px;
  flex: 0 0 82px;
  font-size: 12px;
  color: #8b98a5;
  font-family: Consolas, monospace;
}

.gs-bar {
  flex: 1;
  height: 8px;
  background: #141a21;
  border: 1px solid #232c36;
  border-radius: 4px;
  overflow: hidden;
}
.gs-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #00b35f, #ffb43c 70%, #ff6b5c);
  transition: width 0.18s ease;
}

.gs-val {
  flex: 0 0 150px;
  text-align: right;
  font-family: Consolas, monospace;
  font-size: 12px;
  color: #6d7a86;
}
.gs-val em { color: #6d7a86; font-style: normal; }
.gs-val b { color: #00ff88; font-weight: 600; }

.gs-hint {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #1a222b;
  font-size: 11px;
  color: #4a5560;
}

/* 槽位 */
.gs-slots { display: flex; flex-direction: column; gap: 10px; }

.gs-slot {
  border: 1px solid #1e2630;
  border-radius: 4px;
  padding: 10px 12px;
  background: rgba(12, 17, 22, 0.6);
}

.gs-slot-title {
  font-size: 12px;
  color: #8b98a5;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-family: Consolas, monospace;
}

.gs-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.gs-opt {
  text-align: left;
  background: transparent;
  border: 1px solid #2a3540;
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  font-family: inherit;
  color: #8b98a5;
  transition: all 0.12s;
}
.gs-opt:hover { border-color: #00b35f; color: #cfe; }
.gs-opt.on {
  background: rgba(0, 255, 136, 0.12);
  border-color: #00ff88;
  color: #e6edf3;
}
.gs-opt.on .gs-opt-name { color: #00ff88; font-weight: 600; }

.gs-opt-name { display: block; font-size: 12px; margin-bottom: 3px; }
.gs-opt-val { display: block; font-size: 11px; color: #7fb8a0; font-family: Consolas, monospace; }
.gs-opt-desc { display: block; font-size: 10px; color: #5b6773; margin-top: 4px; line-height: 1.45; }

.gs-summary {
  flex: 1;
  font-size: 11px;
  color: #7d8b99;
  font-family: Consolas, monospace;
}
.gs-summary b { color: #00ff88; }

/* 武器卡片上的改枪标记 */
.item-card .gs-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0, 255, 136, 0.16);
  border: 1px solid #00b35f;
  color: #00ff88;
  font-family: Consolas, monospace;
}
.item-card { position: relative; }

/* 改枪界面：左侧数值 + 右侧弹道模拟 */
.gs-top { display: flex; gap: 14px; align-items: stretch; margin-bottom: 14px; }
.gs-top .gs-recoil { flex: 1 1 auto; margin-bottom: 0; min-width: 0; }

.gs-pattern-wrap {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

#gs-pattern {
  display: block;
  width: 380px;
  height: 300px;
  background: rgba(6, 10, 13, 0.92);
  border: 1px solid #1e2630;
  border-radius: 4px;
}

.gs-pattern-cap {
  font-size: 10px;
  color: #4a5560;
  font-family: Consolas, monospace;
  letter-spacing: 0.5px;
}

@media (max-width: 860px) {
  .gs-top { flex-direction: column; }
  #gs-pattern { width: 100%; max-width: 380px; }
}
