/* ============================================================
   三角洲行动 · 随机配装 — 视觉样式
   深色军事 HUD 风格：玻璃拟态 + 战术网格 + 琥珀高光
   ============================================================ */

@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  --bg: #0a1628;
  --bg-2: #0d1f35;
  --panel: rgba(13, 31, 53, 0.92);
  --panel-solid: #132846;
  --panel2: #162f50;
  --field: #0d1a30;
  --border: rgba(80, 130, 180, 0.3);
  --border-strong: rgba(120, 170, 220, 0.5);
  --text: #e0ecf5;
  --muted: #8aafc4;
  --accent: #3ea6ff;
  --accent2: #1e7ad4;
  --accent-soft: rgba(62, 166, 255, 0.14);
  --green: #3ecf8e;
  --red: #f25c5c;
  --blue: #5fb3f2;
  --purple: #b48bf0;
  --cyan: #53d6d0;
  --yellow: #e8c84f;
  --pink: #f08fc0;

  --font-num: "Bahnschrift", "DIN Alternate", "Rajdhani", "Segoe UI", system-ui, sans-serif;

  --radius: 16px;
  --radius-sm: 12px;
  --shadow-panel: 0 12px 36px rgba(0, 0, 0, 0.38);
  --glow-accent: 0 6px 24px rgba(62, 166, 255, 0.28);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 620px at 88% -12%, rgba(62, 166, 255, 0.12), transparent 60%),
    radial-gradient(940px 560px at -12% 16%, rgba(95, 179, 242, 0.09), transparent 60%),
    radial-gradient(820px 540px at 55% 112%, rgba(83, 214, 208, 0.07), transparent 62%),
    radial-gradient(120% 92% at 50% 42%, transparent 52%, rgba(5, 12, 25, 0.6) 100%),
    linear-gradient(180deg, #0d1a30 0%, #0a1628 42%, #071020 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans SC", system-ui, sans-serif;
  min-height: 100vh;
  padding: 0 16px 48px;
  position: relative;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- 背景：战术网格（边缘淡出） ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 92% 72% at 50% 0%, #000 32%, transparent 78%);
  mask-image: radial-gradient(ellipse 92% 72% at 50% 0%, #000 32%, transparent 78%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- 背景：颗粒质感 ---------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

/* 粒子背景层（tsParticles） */
#tsparticles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ---------- 全局：滚动条 / 选中 / 焦点 ---------- */
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #24344c, #172335);
  border-radius: 99px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #31445f, #1d2c42);
}

::selection {
  background: rgba(247, 169, 29, 0.3);
  color: #fff;
}

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

/* ---------- 线性 SVG 图标 ---------- */
.ic {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -0.15em;
}

/* 徽标图标：金色底上的白色靶心 */
.emblem .ic {
  width: 36px;
  height: 36px;
  color: #fff;
  stroke-width: 2.4;
  vertical-align: baseline;
}

/* 锁定按钮内的图标 */
.lock-btn .ic {
  width: 1.15em;
  height: 1.15em;
  vertical-align: baseline;
}

/* 标签 / 简报图标：金色描边，与文字留间距 */
.control-label .ic,
.m-label .ic {
  margin-right: 6px;
  vertical-align: -0.16em;
  color: var(--accent);
}

/* 卡片槽位图标：金色描边（靠 flex gap 留间距） */
.slot-label .ic {
  color: var(--accent);
}

/* 操作按钮内的图标与文字间距 */
.actions .ic {
  margin-right: 8px;
  vertical-align: -0.15em;
}

/* ---------- 真实装备图片（腾讯官方素材） ---------- */
.item-img {
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
}
.weapon-img {
  width: 96px;
  height: 56px;
}
.gear-img {
  width: 46px;
  height: 46px;
}
.ammo-img {
  width: 40px;
  height: 40px;
}

/* ---------- 顶部导航栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -16px;
  padding: 10px 22px;
  background: linear-gradient(180deg, rgba(10, 16, 26, 0.94), rgba(7, 11, 18, 0.82));
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

/* 顶部细高光条 */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(247, 169, 29, 0.5), transparent);
  opacity: 0.7;
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-brand {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#mode-switch button {
  padding: 7px 16px;
  font-size: 13px;
}

/* ---------- 联机房间状态栏 ---------- */
.room-bar {
  margin: 0 -16px;
  padding: 10px 22px;
  background: linear-gradient(90deg, rgba(247, 169, 29, 0.13), rgba(13, 20, 31, 0.9) 55%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.room-bar b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-num);
}

#room-id {
  color: var(--accent);
  font-size: 16px;
  letter-spacing: 2px;
}

#room-role {
  color: var(--accent);
}

.room-btn {
  background: var(--field);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.room-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.room-btn.danger:hover {
  color: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 12px rgba(242, 92, 92, 0.25);
}

.net-status {
  font-size: 12px;
  color: var(--muted);
}
.net-status.ok { color: var(--green); }
.net-status.warn { color: var(--accent); }
.net-status.no { color: var(--red); }

/* ---------- 头部 ---------- */
.hero {
  text-align: center;
  padding: 44px 16px 22px;
}

.hero-inner {
  animation: heroIn 0.6s var(--ease) both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.emblem {
  position: relative;
  width: 74px;
  height: 74px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent 42%),
    linear-gradient(135deg, #ffc44d, var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -6px 14px rgba(0, 0, 0, 0.25),
    0 14px 40px rgba(247, 169, 29, 0.42),
    0 0 70px rgba(247, 169, 29, 0.22);
  transform: rotate(-4deg);
  animation: emblemIn 0.6s var(--ease) both, emblemPulse 3.4s ease-in-out 0.6s infinite;
}

/* 徽标外圈 */
.emblem::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 25px;
  border: 1px solid rgba(247, 169, 29, 0.4);
  box-shadow: 0 0 0 4px rgba(247, 169, 29, 0.08);
  pointer-events: none;
}

@keyframes emblemIn {
  from { opacity: 0; transform: rotate(-14deg) scale(0.7); }
  to { opacity: 1; transform: rotate(-4deg) scale(1); }
}

@keyframes emblemPulse {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -6px 14px rgba(0, 0, 0, 0.25), 0 14px 40px rgba(247, 169, 29, 0.42), 0 0 70px rgba(247, 169, 29, 0.22); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -6px 14px rgba(0, 0, 0, 0.25), 0 16px 48px rgba(247, 169, 29, 0.55), 0 0 90px rgba(247, 169, 29, 0.3); }
}

.hero h1 {
  font-size: 31px;
  letter-spacing: 3px;
  font-weight: 800;
  line-height: 1.2;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #ffc44d, var(--accent) 45%, var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .sub {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 2px;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hero .sub::before,
.hero .sub::after {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong));
}

.hero .sub::after {
  background: linear-gradient(90deg, var(--border-strong), transparent);
}

/* ---------- 布局 ---------- */
main {
  max-width: 1120px;
  margin: 0 auto;
}

.panel {
  background: linear-gradient(180deg, rgba(23, 33, 48, 0.88), rgba(13, 19, 29, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), var(--shadow-panel);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ---------- 控制面板 ---------- */
.controls {
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 26px;
  align-items: flex-end;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 1px;
  font-weight: 600;
  text-transform: uppercase;
}

.segmented {
  display: inline-flex;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.4);
}

.segmented.wrap {
  flex-wrap: wrap;
}

.segmented button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 15px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.12s;
  white-space: nowrap;
}

.segmented button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.segmented button:active {
  transform: scale(0.97);
}

.segmented button.active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent 55%),
    linear-gradient(135deg, #ffb43a, var(--accent2));
  color: #1f1203;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 14px rgba(247, 169, 29, 0.36);
}

.segmented button.disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.toggle-row {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-row button {
  background: var(--field);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.12s;
}

.toggle-row button:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.toggle-row button.active {
  background: rgba(242, 92, 92, 0.14);
  color: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 12px rgba(242, 92, 92, 0.22), inset 0 0 12px rgba(242, 92, 92, 0.08);
}

/* ---------- 装备价值锁 ---------- */
.value-cap-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#value-cap-toggle {
  background: var(--field);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.12s;
}

#value-cap-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}

#value-cap-toggle.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(247, 169, 29, 0.25);
}

#value-cap-input {
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  width: 170px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

#value-cap-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(247, 169, 29, 0.15);
}

#value-cap-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- 操作按钮 ---------- */
.actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

button.primary,
button.ghost {
  border: none;
  border-radius: 12px;
  padding: 13px 26px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.22s, filter 0.22s, border-color 0.22s, background 0.22s;
  position: relative;
}

button.primary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(135deg, #ffb43a, var(--accent2));
  color: #201304;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 26px rgba(247, 169, 29, 0.32);
  overflow: hidden;
}

/* 按钮扫光 */
button.primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s var(--ease);
  pointer-events: none;
}

button.primary:hover {
  filter: brightness(1.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 32px rgba(247, 169, 29, 0.45);
}

button.primary:hover::after {
  left: 140%;
}

button.ghost {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
}

button.ghost:hover {
  border-color: var(--accent);
  background: #162234;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

button.primary:active,
button.primary.pressed,
button.ghost:active,
button.ghost.pressed {
  transform: translateY(1px) scale(0.98);
  filter: brightness(0.95);
}

/* ---------- 任务简报 ---------- */
.mission {
  margin-top: 20px;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 30px;
  align-items: center;
  animation: fadeUp 0.4s var(--ease) both;
  position: relative;
  overflow: hidden;
}

/* 简报左侧金色高光条 */
.mission::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), transparent);
}

.mission-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.m-label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.m-value {
  font-size: 15px;
  font-weight: 700;
}

.mission .total {
  margin-left: auto;
  text-align: right;
  padding-left: 22px;
  border-left: 1px solid var(--border);
}

.total-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--green);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #4de39f, var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(62, 207, 142, 0.35));
}

/* ---------- 配装卡片 ---------- */
.grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.player-card {
  position: relative;
  background: linear-gradient(180deg, rgba(26, 38, 55, 0.9), rgba(13, 20, 30, 0.95));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fadeUp 0.45s var(--ease) both;
  transition: transform 0.22s var(--ease), border-color 0.22s, box-shadow 0.22s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* 卡片顶部渐变条 */
.player-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(247, 169, 29, 0.65), transparent);
  opacity: 0.7;
  z-index: 2;
  transition: opacity 0.22s;
}

.player-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 34px rgba(247, 169, 29, 0.1);
}

.player-card:hover::before {
  opacity: 1;
}

/* 流光渐变边框（hover 时出现，旋转发光） */
.player-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 2px;
  background: conic-gradient(from var(--gradient-angle), var(--accent), var(--blue), var(--cyan), var(--accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  animation: rotate-border 3s linear infinite;
  animation-play-state: paused;
  pointer-events: none;
  z-index: 2;
}

.player-card:hover::after {
  opacity: 1;
  animation-play-state: running;
}

@keyframes rotate-border {
  to { --gradient-angle: 360deg; }
}

/* 滚动触发动画 */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: none;
}
.animate-on-scroll:nth-child(2) { transition-delay: 0.08s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.16s; }

.grid .player-card:nth-child(2) {
  animation-delay: 0.07s;
}

.grid .player-card:nth-child(3) {
  animation-delay: 0.14s;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(247, 169, 29, 0.13), transparent 62%);
  border-bottom: 1px solid var(--border);
}

.player-name {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 2px;
  font-weight: 700;
}

.same-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(95, 179, 242, 0.16);
  color: var(--blue);
  margin-left: 6px;
  vertical-align: 2px;
}

.player-card.you {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px rgba(95, 179, 242, 0.5), 0 16px 42px rgba(0, 0, 0, 0.45), 0 0 30px rgba(95, 179, 242, 0.15);
}

.player-card.you::before {
  background: linear-gradient(90deg, transparent, rgba(95, 179, 242, 0.8), transparent);
}

.you-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6fc0ff, var(--blue));
  color: #0b1522;
  margin-left: 6px;
  vertical-align: 2px;
}

.card-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.price-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.price-num {
  font-size: 21px;
  font-weight: 800;
  color: var(--green);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

.operator-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
}

.operator-avatar {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  border: 2px solid;
  flex-shrink: 0;
  overflow: hidden;
  background-color: #0c1420;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.operator-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: #0c1420;
}

.role-avatar-突击 {
  background: linear-gradient(135deg, rgba(242, 92, 92, 0.22), rgba(242, 92, 92, 0.08));
  color: var(--red);
  border-color: var(--red);
}

.role-avatar-侦察 {
  background: linear-gradient(135deg, rgba(95, 179, 242, 0.22), rgba(95, 179, 242, 0.08));
  color: var(--blue);
  border-color: var(--blue);
}

.role-avatar-支援 {
  background: linear-gradient(135deg, rgba(62, 207, 142, 0.22), rgba(62, 207, 142, 0.08));
  color: var(--green);
  border-color: var(--green);
}

.role-avatar-工程 {
  background: linear-gradient(135deg, rgba(247, 169, 29, 0.22), rgba(247, 169, 29, 0.08));
  color: var(--accent);
  border-color: var(--accent);
}

.operator-info {
  flex: 1;
  min-width: 0;
}

.operator-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.operator-real {
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
}

.role-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.role-突击 { background: rgba(242, 92, 92, 0.14); color: var(--red); }
.role-侦察 { background: rgba(95, 179, 242, 0.14); color: var(--blue); }
.role-支援 { background: rgba(62, 207, 142, 0.14); color: var(--green); }
.role-工程 { background: rgba(247, 169, 29, 0.14); color: var(--accent); }

.req-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  font-size: 12px;
  color: var(--muted);
}

.req-state {
  font-weight: 700;
}

.req-state.ok { color: var(--green); }
.req-state.no { color: var(--red); }

.meter {
  height: 6px;
  background: var(--field);
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 16px 4px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.meter-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #2ea06a, var(--green));
  box-shadow: 0 0 10px rgba(62, 207, 142, 0.45);
  transition: width 0.5s var(--ease);
  position: relative;
}

.meter-fill.no {
  background: linear-gradient(90deg, #b03434, var(--red));
  box-shadow: 0 0 10px rgba(242, 92, 92, 0.45);
}

.slot {
  padding: 12px 16px;
  border-top: 1px dashed rgba(92, 122, 158, 0.32);
}

.slot-label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

.not-counted {
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: rgba(95, 179, 242, 0.12);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  text-transform: none;
}

.weapon-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* ---------- 单项锁定 ---------- */
.lock-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--field);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.12s;
}

.lock-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.lock-btn.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(247, 169, 29, 0.28);
}

.lock-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.lock-btn.mini {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
}

.operator-row .lock-btn {
  margin-left: 4px;
}

.chip.locked {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(247, 169, 29, 0.06);
}

.chip.locked::before {
  background: var(--accent);
}

.weapon-name {
  font-size: 16px;
  font-weight: 700;
}

.cat-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.cat-冲锋枪 { background: rgba(83, 214, 208, 0.14); color: var(--cyan); }
.cat-突击步枪 { background: rgba(247, 169, 29, 0.14); color: var(--accent); }
.cat-战斗步枪 { background: rgba(242, 92, 92, 0.14); color: var(--red); }
.cat-精确射手步枪 { background: rgba(180, 139, 240, 0.14); color: var(--purple); }
.cat-栓动狙击 { background: rgba(95, 179, 242, 0.14); color: var(--blue); }
.cat-轻机枪 { background: rgba(62, 207, 142, 0.14); color: var(--green); }
.cat-霰弹枪 { background: rgba(232, 200, 79, 0.14); color: var(--yellow); }
.cat-手枪 { background: rgba(240, 143, 192, 0.14); color: var(--pink); }

.weapon-price,
.gear-price {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-num);
}

.gear-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.gear-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.chip {
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 9px;
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.18s;
}

.chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.chip i {
  font-style: normal;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-num);
}

.card-foot {
  padding: 11px 16px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  background: rgba(10, 16, 26, 0.5);
}

.req-status {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 8px;
}

.req-status.ok {
  background: rgba(62, 207, 142, 0.12);
  color: var(--green);
}

.req-status.no {
  background: rgba(242, 92, 92, 0.12);
  color: var(--red);
}

.hidden {
  display: none;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.kbd-hint {
  background: var(--field);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 11px;
  letter-spacing: 1px;
}

/* ---------- Toast 提示 ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(16px);
  background: linear-gradient(180deg, rgba(22, 32, 47, 0.97), rgba(12, 18, 28, 0.97));
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 60;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  max-width: min(90vw, 480px);
  text-align: center;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 创建/加入房间弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 12, 0.74);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-box {
  position: relative;
  width: min(92vw, 380px);
  background: linear-gradient(180deg, rgba(25, 36, 52, 0.97), rgba(12, 18, 28, 0.97));
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 26px 26px 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(247, 169, 29, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: modalIn 0.28s var(--ease) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.modal-box h2 {
  font-size: 18px;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
  transition: color 0.18s, transform 0.18s;
}

.modal-close:hover {
  color: var(--text);
  transform: rotate(90deg);
}

.modal-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.room-code {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 10px;
  text-align: center;
  color: var(--accent);
  background: var(--field);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 14px 0 12px;
  margin: 10px 0 18px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-num);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.4);
  text-shadow: 0 0 18px rgba(247, 169, 29, 0.45);
}

#join-room-input {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 22px;
  text-align: center;
  letter-spacing: 8px;
  padding: 10px 8px;
  outline: none;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-num);
  transition: border-color 0.18s, box-shadow 0.18s;
}

#join-room-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(247, 169, 29, 0.15);
}

#join-room-input::placeholder {
  font-size: 13px;
  letter-spacing: 1px;
  color: rgba(143, 160, 181, 0.5);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.modal-error {
  color: var(--red);
  font-size: 12px;
  min-height: 18px;
  margin: 6px 0 4px;
}

.modal-primary {
  width: 100%;
  margin-top: 4px;
}

/* 队员视图：控制面板只读，仅保留复制 */
.controls.room-member {
  pointer-events: none;
  opacity: 0.6;
}

.controls.room-member #copy-btn {
  pointer-events: auto;
  opacity: 1;
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .topbar {
    padding: 10px 14px;
  }

  .room-bar {
    padding: 10px 14px;
    gap: 10px 14px;
  }

  .topbar-inner {
    justify-content: center;
  }

  .controls {
    padding: 14px;
  }

  .control-group,
  .actions {
    width: 100%;
  }

  .segmented,
  .toggle-row {
    width: 100%;
  }

  .segmented button,
  .toggle-row button {
    flex: 1;
  }

  .actions button {
    flex: 1;
  }

  .mission .total {
    margin-left: 0;
    border-left: none;
    padding-left: 0;
    text-align: left;
  }

  .hero h1 {
    font-size: 25px;
  }
}

/* ---------- 无障碍：减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
