/* ===== 杀戮尖塔2 MOD 分享站 — 暗色奇幻风格 ===== */
:root {
  --bg-deep: #0b0e14;
  --bg-card: #151a26;
  --bg-card-hover: #1b2233;
  --line: #2a3247;
  --line-glow: #3d4a6e;
  --gold: #d4af37;
  --gold-soft: #f0d47a;
  --text: #e8e6df;
  --text-dim: #9aa3b5;
  --red: #c0392b;
  --blue: #3b82f6;
  --radius: 10px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  /* 手机性能优化：由多层径向渐变改为单层轻渐变，减少 GPU 渲染负担 */
  background: linear-gradient(160deg, #10131d 0%, var(--bg-deep) 45%);
  background-color: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== 页头 ===== */
.site-header {
  border-bottom: 1px solid var(--line);
  /* 移除 backdrop-filter 毛玻璃：低端手机上它会导致滚动掉帧 */
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.logo { display: flex; align-items: center; gap: 14px; }

.logo-icon {
  font-size: 34px;
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
}

.logo-text h1 {
  font-size: 22px;
  letter-spacing: 2px;
  font-weight: 700;
}

.logo-text h1 .en {
  color: var(--gold);
  font-style: italic;
}

.subtitle {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.18s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-ghost {
  color: var(--gold-soft);
  border-color: var(--line-glow);
  background: rgba(212, 175, 55, 0.06);
}

.btn-ghost:hover {
  background: rgba(212, 175, 55, 0.16);
  border-color: var(--gold);
}

/* ===== 容器与工具栏 ===== */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 20px 40px;
}

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 26px;
}

.search-box input {
  width: 100%;
  padding: 12px 18px;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.search-box input::placeholder { color: var(--text-dim); }

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

.chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.18s ease;
}

.chip:hover { color: var(--text); border-color: var(--line-glow); }

.chip.active {
  color: #14100a;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  border-color: var(--gold);
  font-weight: 700;
}

.sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.sort-row select {
  padding: 6px 10px;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.count { margin-left: auto; }

/* ===== MOD 卡片网格 ===== */
.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.mod-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}

.mod-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.mod-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-glow);
  box-shadow: var(--shadow);
}

.mod-card.clickable { cursor: pointer; }

.mod-card.clickable .mod-title {
  color: var(--gold-soft);
  transition: color 0.18s ease;
}

.mod-card.clickable:hover .mod-title { text-decoration: underline; }

.mod-card.clickable .mod-title::after {
  content: " ›";
  opacity: 0;
  transition: opacity 0.18s ease;
}

.mod-card.clickable:hover .mod-title::after { opacity: 1; }

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

/* 封面图 */
.mod-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 2px;
}

.mod-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.mod-card:hover .mod-cover img { transform: scale(1.04); }

.mod-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.mod-title { font-size: 17px; font-weight: 700; letter-spacing: 0.5px; }

.mod-title .en-name {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 2px;
}

.badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-cat {
  color: var(--gold-soft);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
}

.badge-new {
  color: #fff;
  background: var(--red);
}

.mod-desc {
  font-size: 14px;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 4.2em;
}

.mod-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

.mod-meta span {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 6px;
}

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

.tag {
  font-size: 11px;
  color: var(--blue);
  border: 1px dashed rgba(59, 130, 246, 0.5);
  padding: 1px 8px;
  border-radius: 6px;
}

/* ===== 下载按钮区 ===== */
.download-area {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

.dl-row { display: flex; gap: 8px; align-items: center; }

.dl-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.18s ease;
  border: 1px solid transparent;
  color: #fff;
}

.dl-btn.quark {
  background: linear-gradient(135deg, #2f80ed, #1e5fc4);
}

.dl-btn.quark:hover { filter: brightness(1.15); box-shadow: 0 4px 14px rgba(47, 128, 237, 0.4); }

.dl-btn.baidu {
  background: linear-gradient(135deg, #0f63e0, #0a4bb4);
}

.dl-btn.baidu:hover { filter: brightness(1.15); box-shadow: 0 4px 14px rgba(15, 99, 224, 0.4); }

.dl-btn.disabled {
  background: #2b3142;
  color: #6b7488;
  cursor: not-allowed;
  pointer-events: none;
}

.copy-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.copy-btn:hover { color: var(--gold-soft); border-color: var(--gold); }

.extract-code {
  font-size: 12px;
  color: var(--text-dim);
  text-align: right;
}

.extract-code b { color: var(--gold-soft); margin-left: 4px; }

/* ===== 空状态 / Toast / 页脚 ===== */
.empty {
  text-align: center;
  padding: 60px 0;
  color: var(--text-dim);
  font-size: 15px;
}

.hidden { display: none !important; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: #1f2738;
  color: var(--text);
  border: 1px solid var(--line-glow);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 100;
  box-shadow: var(--shadow);
}

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

.site-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.9;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .mod-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 12px 16px; }
  .logo-text h1 { font-size: 18px; }
  .dl-row { flex-direction: column; }
  .dl-row .dl-btn { width: 100%; }
}
