/* ============================================================
   CS2 道具投掷点位 · 全局样式
   风格：深色军事战术 + CS2 橙红点缀
   ============================================================ */

:root {
  --bg: #0a0e12;
  --bg-deep: #070a0d;
  --panel: rgba(18, 24, 32, 0.82);
  --panel-solid: #141a21;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(245, 166, 35, 0.35);

  --accent: #f5a623;          /* CS2 橙 */
  --accent-red: #e63946;      /* 点缀红 */
  --text: #e8e8e8;
  --text-dim: #8a919c;
  --text-faint: #5a6169;

  --font-en: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;

  --radius: 4px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

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

html, body { min-height: 100%; }

body {
  font-family: var(--font-en), 'Microsoft YaHei', 'PingFang SC', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
}

/* 战术背景图：低透明度叠加在深色底上 */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(10, 14, 18, 0.78), rgba(7, 10, 13, 0.92)),
    url('../assets/bg.png') center / cover no-repeat;
}

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

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(rgba(7, 10, 13, 0.95), rgba(10, 14, 18, 0.85));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand-logo { width: 40px; height: 40px; }

.brand-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-sub {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
}

/* ---------- 面板 ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 24px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-title-en {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
}

/* ---------- 地图选择区 ---------- */
.maps-section { padding-bottom: 16px; }

.map-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.map-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  user-select: none;
}

.map-tab:hover { border-color: var(--border-strong); transform: translateY(-1px); }

.map-tab.active {
  border-color: var(--accent);
  background: rgba(245, 166, 35, 0.12);
}

/* 地图缩略图（有图显示，无图显示占位字母） */
.map-thumb {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(45deg, #20262d 0, #20262d 6px, #1a2027 6px, #1a2027 12px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.map-thumb::before {
  content: attr(data-letter);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-faint);
}

.map-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-tab-info { min-width: 0; }

.map-tab-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.1;
  white-space: nowrap;
}

.map-tab-cn {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.2;
}

.map-tab-count {
  margin-left: auto;
  flex: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(245, 166, 35, 0.12);
  border-radius: 10px;
  padding: 2px 8px;
}

/* ---------- 点位区头部 ---------- */
.spots-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.type-filters { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-btn {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.filter-btn:hover { color: var(--text); border-color: var(--text-faint); }

.filter-btn.active {
  color: #1a1206;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

/* ---------- 点位卡片网格 ---------- */
.spots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.spot-card {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.15s;
}

.spot-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

/* 图片区：有图显示，无图/加载失败显示占位 */
.spot-img {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(45deg, #20262d 0, #20262d 10px, #1a2027 10px, #1a2027 20px),
    var(--panel-solid);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.spot-img::before {
  content: '点位图待添加';
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--text-faint);
}

.spot-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 图片可点击预览 */
.spot-img, .spot-img img { cursor: zoom-in; }
.map-thumb { cursor: pointer; }
.map-thumb img { cursor: zoom-in; }

/* 多图数量角标 */
.img-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  color: #1a1206;
  background: rgba(245, 166, 35, 0.9);
  border-radius: 3px;
  padding: 2px 7px;
}

/* 点位缩略图条 */
.spot-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  overflow-x: auto;
}

.spot-thumb {
  flex: none;
  width: 52px;
  height: 38px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: zoom-in;
  transition: border-color 0.15s;
}

.spot-thumb:hover { border-color: var(--text-faint); }
.spot-thumb.active { border-color: var(--accent); }

/* 道具类型徽章 */
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #0b0d10;
  border-radius: 3px;
  padding: 3px 8px;
  line-height: 1.3;
}

.badge.smoke    { background: #9aa3ad; }
.badge.flash    { background: #e8e39a; }
.badge.he       { background: #f0843a; }
.badge.molotov  { background: #e63946; }
.badge.decoy    { background: #4aa3c8; }

.spot-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; }

.spot-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.spot-cn {
  font-size: 13px;
  color: var(--text-dim);
}

.spot-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.spot-desc:empty { display: none; }

/* ---------- 空状态 ---------- */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state .empty-icon {
  font-size: 40px;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 48px;
  padding: 20px 0 28px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  letter-spacing: 1px;
  border-top: 1px solid var(--border);
}

/* ---------- 灯箱（点击预览原图） ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 8, 11, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lb-fade 0.15s ease;
}
.lightbox[hidden] { display: none; }

@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }

.lb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 88vw;
  max-height: 88vh;
}

.lb-stage img {
  max-width: 88vw;
  max-height: 82vh;
  object-fit: contain;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #000;
}

.lb-caption {
  margin-top: 12px;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--text);
  text-align: center;
}
.lb-caption:empty { display: none; }

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  font-size: 28px;
  line-height: 1;
  color: var(--text);
  background: rgba(18, 24, 32, 0.7);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  background: rgba(18, 24, 32, 0.95);
}

.lb-close { top: 20px; right: 24px; }
.lb-prev  { left: 24px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 24px; top: 50%; transform: translateY(-50%); }

.lb-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-dim);
}
.lb-counter:empty { display: none; }

body.no-scroll { overflow: hidden; }

/* ---------- 添加点位 ---------- */
.spots-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.add-btn {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #1a1206;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.add-btn:hover { background: #ffb52e; transform: translateY(-1px); }

.spots-actions-btns { display: flex; gap: 10px; align-items: center; }

.btn-secondary {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn-secondary:hover {
  background: rgba(245, 166, 35, 0.1);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* 点位搜索栏 */
.search-wrap {
  position: relative;
  margin-top: 16px;
  max-width: 420px;
}

.search-bar {
  width: 100%;
  font-family: var(--font-en), 'Microsoft YaHei', 'PingFang SC', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #0d1218;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 9px 34px 9px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.search-bar:focus { border-color: var(--border-strong); }
.search-bar::placeholder { color: var(--text-faint); }

.search-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  font-size: 16px;
  line-height: 1;
  color: var(--text-dim);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50%;
}
.search-clear:hover { color: var(--accent); background: rgba(255, 255, 255, 0.06); }
.search-clear[hidden] { display: none; }

/* 模态框 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(5, 8, 11, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: lb-fade 0.15s ease;
}
.modal[hidden] { display: none; }

.modal-dialog {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.modal-close {
  width: 32px;
  height: 32px;
  font-size: 22px;
  line-height: 1;
  color: var(--text-dim);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}
.modal-close:hover { color: var(--accent); background: rgba(255, 255, 255, 0.06); }

.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 13px; color: var(--text-dim); letter-spacing: 0.5px; }

.form-row input,
.form-row select,
.form-row textarea {
  font-family: var(--font-en), 'Microsoft YaHei', 'PingFang SC', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #0d1218;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 9px 11px;
  outline: none;
  transition: border-color 0.15s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: var(--border-strong); }
.form-row textarea { resize: vertical; }
.form-row input[type="file"] { padding: 7px; color: var(--text-dim); }

.img-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.img-preview-item {
  position: relative;
  width: 72px;
  height: 54px;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.img-preview-item img { width: 100%; height: 100%; object-fit: cover; }

/* 预览图移除按钮 */
.pv-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 1;
  color: #fff;
  background: rgba(230, 57, 70, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pv-del:hover { background: #e63946; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.btn-primary, .btn-ghost {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 4px;
  padding: 9px 20px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary { color: #1a1206; background: var(--accent); border: 1px solid var(--accent); }
.btn-primary:hover { background: #ffb52e; }
.btn-ghost { color: var(--text-dim); background: transparent; border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-faint); }

/* 编辑自定义点位按钮（蓝，位于删除按钮左侧） */
.spot-edit {
  position: absolute;
  top: 8px;
  right: 40px;
  z-index: 2;
  width: 26px;
  height: 26px;
  font-size: 14px;
  line-height: 1;
  color: #fff;
  background: rgba(74, 163, 200, 0.85);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.spot-edit:hover { background: #4aa3c8; }

/* 删除自定义点位按钮 */
.spot-del {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  font-size: 16px;
  line-height: 1;
  color: #fff;
  background: rgba(230, 57, 70, 0.85);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.spot-del:hover { background: #e63946; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .brand-title { font-size: 17px; }
  .brand-sub { display: none; }
  .panel { padding: 16px; }
  .map-tabs { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .spots-grid { grid-template-columns: 1fr; }
  .search-wrap { max-width: 100%; }
  .spots-head { flex-direction: column; align-items: flex-start; }
  .spots-actions { flex-direction: column; align-items: stretch; }
  .form-grid { grid-template-columns: 1fr; }
}
