/* ============================================================
   VALORANT 枪械图鉴 —— 暗色无畏契约风格
   ============================================================ */
:root {
  --bg: #0f1923;
  --bg2: #141f2c;
  --panel: #1b2735;
  --panel2: #223142;
  --line: rgba(236, 232, 225, 0.12);
  --text: #ece8e1;
  --muted: #8b9bb4;
  --accent: #ff4655;
  --accent2: #ff6e7d;
  --gold: #ffd76a;
  --green: #5eead4;
  --radius: 14px;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

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

/* hidden 属性必须始终生效，不能被任何 display 规则覆盖 */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a3a4d; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

button { font-family: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 25, 35, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand-mark { width: 26px; height: auto; filter: drop-shadow(0 0 8px rgba(255, 70, 85, 0.5)); }
.brand-text { font-weight: 900; letter-spacing: 0.06em; font-size: 17px; line-height: 1.1; }
.brand-text em {
  display: block;
  font-style: normal;
  font-family: "Rajdhani", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.42em;
  color: var(--accent);
}

.search-box {
  flex: 0 1 430px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 70, 85, 0.18);
}
.search-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  padding: 10px 0;
}
.search-box input::placeholder { color: var(--muted); }
.search-box input::-webkit-search-cancel-button { display: none; }
.clear-search {
  background: var(--panel2);
  border: none;
  color: var(--muted);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  flex-shrink: 0;
}
.clear-search:hover { color: #fff; background: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 64px 0 52px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 70% 90% at 50% -20%, rgba(255, 70, 85, 0.16), transparent 70%),
    linear-gradient(rgba(236, 232, 225, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 232, 225, 0.028) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
}
.hero-kicker {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 0.5em;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 8px;
}
.hero h1 {
  font-size: 58px;
  font-weight: 900;
  letter-spacing: 0.1em;
  line-height: 1.15;
}
.hero h1 span { color: var(--accent); text-shadow: 0 0 30px rgba(255, 70, 85, 0.45); }
.hero-sub { color: var(--muted); margin-top: 10px; font-size: 14px; letter-spacing: 0.04em; }
.hero-stats { display: flex; justify-content: center; gap: 56px; margin-top: 30px; flex-wrap: wrap; }
.hs-item b {
  display: block;
  font-family: "Rajdhani", sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.hs-item span { font-size: 12px; color: var(--muted); letter-spacing: 0.24em; }

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 26px 0 18px;
}
.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.tab:hover { color: var(--text); border-color: rgba(255, 70, 85, 0.55); }
.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 18px rgba(255, 70, 85, 0.35);
}
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.sort-label { font-size: 13px; color: var(--muted); }
#sortSelect {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
}
#sortSelect:hover { border-color: var(--accent); }
.result-count { font-size: 13px; color: var(--muted); }

/* ---------- 布局 ---------- */
.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
  padding-bottom: 40px;
}

/* ---------- 枪械卡片网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 16px;
}
.weapon-card {
  position: relative;
  background: linear-gradient(180deg, var(--panel), #16202d);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.weapon-card:hover {
  transform: translateY(-4px);
  border-color: var(--cat, var(--accent));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.badge-cat {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: var(--cat, var(--accent));
  color: #0f1923;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
}
.badge-pop {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(15, 25, 35, 0.82);
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
}
.card-img-wrap {
  position: relative;
  height: 152px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 65%, rgba(255, 255, 255, 0.06), transparent 72%);
}
.card-img-wrap img {
  max-height: 118px;
  max-width: 82%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
  transition: transform 0.25s ease;
}
.weapon-card:hover .card-img-wrap img { transform: scale(1.08); }
.card-radar {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 80px;
  background: rgba(15, 25, 35, 0.84);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px;
}
.card-radar svg { display: block; width: 100%; height: auto; }
.card-name {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  padding: 10px 10px 2px;
}
.card-name span {
  display: block;
  font-family: "Rajdhani", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 12px;
}
.card-price { font-family: "Rajdhani", "Noto Sans SC", sans-serif; font-weight: 700; font-size: 16px; color: var(--accent); }
.card-price.free { color: var(--green); }
.card-score { color: var(--muted); font-size: 12px; flex: 1; white-space: nowrap; }
.btn-compare {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-compare:hover { border-color: var(--accent); color: #fff; }
.btn-compare.added {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-icon { font-size: 44px; margin-bottom: 12px; }
.empty p { margin-bottom: 16px; }

/* ---------- 侧栏 / 排行榜 ---------- */
.sidebar { position: sticky; top: 82px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.panel h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.h2-badge {
  font-family: "Rajdhani", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid rgba(255, 70, 85, 0.5);
  border-radius: 6px;
  padding: 1px 8px;
  letter-spacing: 0.08em;
}
.panel-note { font-size: 12px; color: var(--muted); margin: 6px 0 12px; }
.lb-list { list-style: none; }
.lb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lb-item:hover { background: var(--panel2); }
.lb-rank {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  font-size: 19px;
  width: 26px;
  text-align: center;
  color: var(--muted);
  flex-shrink: 0;
}
.lb-rank.r1 { color: #ffd76a; text-shadow: 0 0 12px rgba(255, 215, 106, 0.5); }
.lb-rank.r2 { color: #cfd8e3; }
.lb-rank.r3 { color: #e09b6a; }
.lb-img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)); flex-shrink: 0; }
.lb-main { flex: 1; min-width: 0; }
.lb-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-en { margin-left: 6px; font-family: "Rajdhani", sans-serif; font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }
.lb-bar { margin-top: 5px; height: 4px; background: rgba(236, 232, 225, 0.08); border-radius: 2px; overflow: hidden; }
.lb-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff9f4b);
  border-radius: 2px;
}
.lb-meta { text-align: right; flex-shrink: 0; line-height: 1.2; }
.lb-meta b { display: block; font-family: "Rajdhani", sans-serif; font-size: 17px; color: var(--gold); }
.lb-meta span { font-size: 10px; color: var(--muted); letter-spacing: 0.12em; }

.tip-list { list-style: none; margin-top: 8px; }
.tip-list li { font-size: 13px; color: var(--muted); padding: 5px 0 5px 18px; position: relative; }
.tip-list li::before { content: "›"; position: absolute; left: 4px; color: var(--accent); }
.tip-list em { color: var(--text); font-style: normal; font-weight: 600; }

/* ---------- 对比悬浮栏 ---------- */
.compare-dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(20, 31, 44, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 70, 85, 0.4);
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 24px);
  flex-wrap: wrap;
  justify-content: center;
  animation: dockIn 0.25s ease;
}
@keyframes dockIn { from { opacity: 0; transform: translateX(-50%) translateY(16px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.compare-slots { display: flex; gap: 8px; flex-wrap: wrap; }
.slot {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel2);
  border-radius: 10px;
  padding: 4px 8px;
}
.slot img { width: 30px; height: 30px; object-fit: contain; }
.slot span { font-size: 12px; color: var(--text); }
.slot button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; }
.slot button:hover { color: var(--accent); }

/* ---------- 按钮 ---------- */
.btn {
  border: none;
  cursor: pointer;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  transition: filter 0.15s ease, transform 0.1s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 20px rgba(255, 70, 85, 0.35); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: #fff; }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 11, 17, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.modal {
  position: relative;
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  animation: pop 0.22s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-detail { max-width: 880px; }
.modal-compare { max-width: 1060px; }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
}
.modal-close:hover { color: #fff; border-color: var(--accent); }

/* ---------- 详情 ---------- */
.detail-hero {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 26px;
  align-items: center;
}
.detail-img {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.07), transparent 75%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.detail-img img { max-width: 100%; max-height: 260px; object-fit: contain; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.6)); }
.detail-cat { font-size: 12px; font-weight: 700; letter-spacing: 0.26em; margin-bottom: 6px; }
.detail-info h2 { font-size: 30px; font-weight: 900; letter-spacing: 0.04em; }
.detail-info h2 span {
  font-family: "Rajdhani", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 10px;
  letter-spacing: 0.1em;
}
.detail-desc { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 10px 0 16px; }
.detail-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.badge {
  background: var(--panel2);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
}
.badge.big { font-size: 14px; font-weight: 600; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-body {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  margin-top: 26px;
}
.detail-radar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.detail-radar h3, .detail-stats h3, .detail-stats h4 { font-size: 15px; margin-bottom: 12px; letter-spacing: 0.05em; }
.detail-stats h4 { margin-top: 18px; }
.radar-big { display: flex; justify-content: center; }
.radar-big svg { width: 100%; max-width: 340px; height: auto; }
.stats-table { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.stats-table th, .stats-table td { padding: 9px 10px; font-size: 13px; border-bottom: 1px solid var(--line); text-align: left; }
.stats-table th { color: var(--muted); font-weight: 500; width: 96px; white-space: nowrap; }
.stats-table td { color: var(--text); font-family: "Rajdhani", "Noto Sans SC", sans-serif; font-weight: 600; }
.dmg-row { display: grid; grid-template-columns: 44px 56px 1fr; align-items: center; gap: 10px; margin-bottom: 10px; }
.dmg-label { font-size: 12px; color: var(--muted); }
.dmg-val { font-family: "Rajdhani", sans-serif; font-size: 17px; }
.dmg-track { height: 10px; background: rgba(236, 232, 225, 0.08); border-radius: 5px; overflow: hidden; }
.dmg-track i { display: block; height: 100%; border-radius: 5px; }

/* ---------- 对比 ---------- */
.compare h2 { font-size: 22px; margin-bottom: 18px; }
.compare h2 span { font-family: "Rajdhani", sans-serif; font-size: 13px; color: var(--muted); margin-left: 8px; letter-spacing: 0.1em; }
.compare-heads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.compare-head {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--c, var(--accent));
  border-radius: 12px;
  padding: 14px 12px 12px;
  text-align: center;
  position: relative;
}
.compare-head img { height: 64px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5)); }
.ch-name { margin-top: 6px; font-size: 14px; font-weight: 700; }
.ch-name span { display: block; font-family: "Rajdhani", sans-serif; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.1em; }
.ch-price { color: var(--accent); font-family: "Rajdhani", sans-serif; font-size: 15px; font-weight: 700; margin-top: 4px; }
.ch-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 25, 35, 0.7);
  border: 1px solid var(--line);
  color: var(--muted);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s ease;
}
.ch-remove:hover { color: #fff; border-color: var(--accent); }
.compare-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
}
.compare-chart .radar-big svg { max-width: 380px; }
.lg-row { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.lg-item { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.lg-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.compare-table { width: 100%; border-collapse: collapse; min-width: 540px; background: var(--panel); }
.compare-table th, .compare-table td {
  padding: 10px 12px;
  font-size: 13px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.compare-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel2);
  font-family: "Rajdhani", "Noto Sans SC", sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.compare-table tbody th { text-align: left; color: var(--muted); font-weight: 500; }
.compare-table tbody tr:last-child th, .compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table td.best { color: var(--gold); font-weight: 700; background: rgba(255, 215, 106, 0.08); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%) translateY(12px);
  background: #0f1923;
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 120;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 2;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 760px) {
  .hero { padding: 44px 0 38px; }
  .hero h1 { font-size: 42px; }
  .hero-stats { gap: 26px; }
  .header-inner { height: auto; padding: 10px 20px; flex-wrap: wrap; justify-content: center; }
  .search-box { flex-basis: 100%; order: 3; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-img img { max-height: 190px; }
  .detail-body { grid-template-columns: 1fr; }
  .modal { padding: 20px 16px; }
  .compare-dock { width: calc(100% - 24px); }
  .toolbar { justify-content: flex-start; }
}
