/* ====== 暗色主题（默认） ====== */
:root {
  --bg: #0b0e13;
  --bg-card: #141922;
  --bg-hover: #1b2230;
  --border: #263042;
  --text: #e6e9ef;
  --text-dim: #8b94a7;
  --accent: #e8a33d;
  --accent-dark: #c4862a;
  --green: #3fb27f;
  --nav-bg: rgba(11, 14, 19, .92);
  --hero-g1: rgba(232, 163, 61, .18);
  --hero-g2: #10151f;
  --cover-g1: #0d1118;
  --cover-g2: #0a0d12;
  --code-bg: #0a0d12;
  --modal-g1: #1a2233;
  --modal-g2: #0d1118;
  --btn-on-accent: #16110a;
}

/* ====== 亮色主题 ====== */
body.light {
  --bg: #f5f6f8;
  --bg-card: #ffffff;
  --bg-hover: #f0f1f4;
  --border: #e2e5ec;
  --text: #1a1d24;
  --text-dim: #6b7280;
  --accent: #d18b1f;
  --accent-dark: #b4751a;
  --green: #2da36f;
  --nav-bg: rgba(255, 255, 255, .92);
  --hero-g1: rgba(209, 139, 31, .1);
  --hero-g2: #fafbfc;
  --cover-g1: #f0f1f4;
  --cover-g2: #e4e6eb;
  --code-bg: #f0f2f5;
  --modal-g1: #ffffff;
  --modal-g2: #f5f6f8;
  --btn-on-accent: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

/* 顶部导航 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.logo { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.logo span { color: var(--accent); }
.nav a {
  margin-left: 28px; color: var(--text-dim); font-size: 15px; transition: color .2s;
}
.nav a:hover, .nav a.active { color: var(--accent); }

/* 主题切换按钮 */
.theme-toggle {
  margin-left: 20px; padding: 6px 14px; border-radius: 20px;
  background: var(--bg-hover); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; cursor: pointer;
  transition: all .2s; line-height: 1;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-card); }

/* 亮色主题微调：一些阴影和边框颜色 */
body.light .code-card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, .08); }
body.light .modal-overlay { background: rgba(0, 0, 0, .4); }
body.light .code-card--recommend { background: linear-gradient(180deg, rgba(209, 139, 31, .06), var(--bg-card)); border-color: rgba(209, 139, 31, .4); }
body.light .btn.ghost { color: var(--text); }
body.light .toast { background: rgba(0, 0, 0, .82); color: #fff; }

/* 首页横幅 */
.hero {
  padding: 72px 0 56px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% -20%, var(--hero-g1), transparent 60%),
    linear-gradient(180deg, var(--hero-g2), var(--bg));
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 38px; letter-spacing: 2px; }
.hero h1 span { color: var(--accent); }
.hero p { margin-top: 12px; color: var(--text-dim); }
.hero .btn { margin-top: 26px; }

.btn {
  display: inline-block; padding: 10px 28px; border: none; cursor: pointer;
  background: var(--accent); color: var(--btn-on-accent); font-weight: 600; font-size: 15px;
  border-radius: 4px; transition: background .2s;
}
.btn:hover { background: var(--accent-dark); }
.btn.ghost {
  background: transparent; color: var(--accent); border: 1px solid var(--accent);
}
.btn.small { padding: 5px 14px; font-size: 13px; }

/* 区块标题 */
.section { padding: 40px 0; }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.section-title h2 { font-size: 22px; }
.section-title h2::before {
  content: ""; display: inline-block; width: 4px; height: 20px;
  background: var(--accent); margin-right: 10px; vertical-align: -3px;
}
.section-title .more { color: var(--text-dim); font-size: 14px; }
.section-title .more:hover { color: var(--accent); }

/* 改枪码列表：每行一条，横向三栏布局 */
.code-grid {
  display: flex; flex-direction: column; gap: 12px;
}
.code-card {
  display: flex; align-items: stretch; gap: 20px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px 20px; transition: border-color .2s, transform .2s, box-shadow .2s;
  position: relative;
}
.code-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.code-card--recommend { border-color: rgba(232, 163, 61, .5); background: linear-gradient(180deg, rgba(232, 163, 61, .04), var(--bg-card)); }

/* 左栏：武器图 + 武器名 + 价格 */
.cc-left { flex-shrink: 0; width: 180px; display: flex; flex-direction: column; gap: 6px; }
.code-card .code-cover {
  width: 100%; height: 90px; border-radius: 6px; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(180deg, var(--cover-g1), var(--cover-g2));
  display: flex; align-items: center; justify-content: center;
}
.code-card .code-cover img { max-height: 100%; max-width: 100%; object-fit: contain; }
.code-card .weapon {
  display: flex; align-items: center; gap: 8px; justify-content: flex-start;
}
.code-card .weapon strong { font-size: 15px; }
.tag {
  font-size: 11px; color: var(--accent); border: 1px solid var(--accent-dark);
  border-radius: 3px; padding: 1px 8px;
}
.code-card .price {
  color: var(--accent); font-size: 18px; font-weight: 700; letter-spacing: .5px;
}

/* 中栏：推荐角标 + 改枪码 + 关键词 */
.cc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; justify-content: center; position: relative; }
/* 详情模式：无左栏，中栏占满，顶部加 header */
.cc-body--full { justify-content: flex-start; gap: 10px; }
.cc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 8px; margin-bottom: 4px;
  border-bottom: 1px dashed var(--border);
}
.cc-header-left { display: flex; align-items: center; gap: 10px; }
.cc-header-left strong { font-size: 16px; }
.cc-header .price { font-size: 20px; font-weight: 700; letter-spacing: .5px; padding: 2px 12px; border-radius: 4px; background: rgba(232, 163, 61, .12); border: 1px solid rgba(232, 163, 61, .3); }

.rec-badge {
  position: absolute; top: -4px; left: -6px;
  background: linear-gradient(135deg, #e8a33d, #f46c2a);
  color: #1a1a1a; font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: 10px; letter-spacing: 1px;
  box-shadow: 0 0 10px rgba(244, 108, 42, .5);
  animation: recPulse 2s ease-in-out infinite;
}
.cc-body--full .rec-badge { top: 36px; }
@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(244, 108, 42, .4); }
  50% { box-shadow: 0 0 14px rgba(244, 108, 42, .8); }
}
.code-string {
  padding: 10px 14px; background: var(--code-bg);
  border: 1px dashed var(--border); border-radius: 4px;
  font-family: Consolas, monospace; font-size: 13px; color: var(--green);
  word-break: break-all;
}
.code-card .keywords { display: flex; flex-wrap: wrap; gap: 6px; }
.code-card .keywords span {
  font-size: 12px; color: var(--accent); background: rgba(232, 163, 61, .1);
  border: 1px solid rgba(232, 163, 61, .3); border-radius: 12px; padding: 1px 10px;
}

/* 右栏：浏览量 + 日期 + 操作按钮 */
.cc-right { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px; min-width: 110px; }
.cc-right .views { color: var(--text-dim); font-size: 12px; }
.cc-right .date { color: var(--text-dim); font-size: 11px; }
.card-actions { display: flex; gap: 8px; align-items: center; }

/* 响应式：窄屏退回到纵向 */
@media (max-width: 768px) {
  .code-card { flex-direction: column; gap: 12px; }
  .cc-left { width: 100%; flex-direction: row; align-items: center; gap: 12px; }
  .code-card .code-cover { width: 70px; height: 50px; }
  .cc-right { width: 100%; flex-direction: row; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
  .cc-header { flex-wrap: wrap; gap: 6px; }
  .rec-badge { position: static; margin-bottom: 4px; display: inline-block; }
  .cc-body--full .rec-badge { top: auto; }
}

/* 文章列表 */
.article-item {
  display: flex; gap: 18px; padding: 18px; margin-bottom: 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  transition: border-color .2s;
}
.article-item:hover { border-color: var(--accent); }
.article-item .cover {
  width: 200px; height: 120px; flex-shrink: 0; border-radius: 6px; overflow: hidden;
  background: var(--bg-hover); display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 13px;
}
.article-item .cover img { width: 100%; height: 100%; object-fit: cover; }
.article-item .info { flex: 1; min-width: 0; }
.article-item h3 { font-size: 18px; margin-bottom: 8px; }
.article-item h3 .top-badge {
  font-size: 12px; color: #ff5b5b; border: 1px solid #ff5b5b;
  border-radius: 3px; padding: 0 6px; margin-right: 8px; vertical-align: 2px;
}
.article-item .summary {
  color: var(--text-dim); font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-item .meta { margin-top: 12px; color: var(--text-dim); font-size: 13px; }
.article-item .meta span { margin-right: 18px; }

/* 搜索与筛选 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.filter-bar input, .filter-bar select {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  padding: 9px 14px; border-radius: 4px; font-size: 14px; outline: none;
}
.filter-bar input { flex: 1; min-width: 200px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--accent); }
.type-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.type-tabs button {
  background: var(--bg-card); color: var(--text-dim); border: 1px solid var(--border);
  padding: 6px 18px; border-radius: 20px; cursor: pointer; font-size: 14px;
}
.type-tabs button.active { background: var(--accent); color: var(--btn-on-accent); border-color: var(--accent); }

/* 文章详情 */
.article-detail { max-width: 820px; margin: 0 auto; padding: 40px 0 60px; }
.article-detail h1 { font-size: 30px; line-height: 1.4; }
.article-detail .meta { color: var(--text-dim); font-size: 14px; margin: 16px 0 28px; }
.article-detail .meta span { margin-right: 20px; }
.article-content { font-size: 16px; }
.article-content p { margin-bottom: 16px; }
.article-content img { border-radius: 6px; margin: 16px auto; }
.article-content h2, .article-content h3 { margin: 28px 0 14px; color: var(--accent); }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 10px; margin: 30px 0; }
.pagination button {
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
  padding: 7px 16px; border-radius: 4px; cursor: pointer;
}
.pagination button:disabled { opacity: .35; cursor: not-allowed; }
.pagination button:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }

.empty { text-align: center; color: var(--text-dim); padding: 60px 0; }

/* 页脚 */
.site-footer {
  border-top: 1px solid var(--border); padding: 28px 0; margin-top: 40px;
  text-align: center; color: var(--text-dim); font-size: 13px;
}

/* 复制成功提示 */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: var(--green); color: #fff; padding: 10px 26px; border-radius: 4px;
  font-size: 14px; z-index: 999; opacity: 0; transition: opacity .25s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* 枪械卡片（首页武器列表 - 参考三角洲风格） */
.weapon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.weapon-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.weapon-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.weapon-card .wc-img {
  position: relative; aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, var(--modal-g1) 0%, var(--modal-g2) 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.weapon-card .wc-img img {
  width: 100%; height: 100%; object-fit: contain; padding: 10px;
  transition: transform .35s;
}
.weapon-card:hover .wc-img img { transform: scale(1.06); }
.weapon-card .wc-placeholder {
  font-size: 36px; font-weight: 700; color: var(--text-dim);
  letter-spacing: 2px; opacity: .4;
}
.weapon-card .wc-badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--accent); color: #fff; font-size: 12px;
  padding: 2px 8px; border-radius: 10px; font-weight: 600;
  line-height: 1.6;
}
.weapon-card .wc-info {
  padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px;
}
.weapon-card .wc-info strong {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.weapon-card .wc-cat {
  font-size: 12px; color: var(--text-dim);
}

/* 点赞 */
.card-actions { display: flex; align-items: center; gap: 10px; }
.like-btn {
  background: transparent; border: 1px solid var(--border); color: #ff6b81;
  border-radius: 4px; padding: 5px 12px; font-size: 13px; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.like-btn:hover { border-color: #ff6b81; background: rgba(255, 107, 129, .08); }

/* 左侧菜单栏布局 */
.layout {
  display: flex; gap: 24px; align-items: flex-start;
  max-width: 1200px; margin: 0 auto; padding: 28px 20px 0;
}
.sidebar {
  width: 210px; flex-shrink: 0; position: sticky; top: 84px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.sidebar .side-title {
  padding: 14px 18px; font-size: 13px; letter-spacing: 2px;
  color: var(--text-dim); border-bottom: 1px solid var(--border);
}
.sidebar a {
  display: block; padding: 13px 18px; font-size: 15px;
  color: var(--text-dim); border-left: 3px solid transparent;
  transition: background .2s, color .2s;
}
.sidebar a:hover { background: var(--bg-hover); color: var(--text); }
.sidebar a.active {
  color: var(--accent); border-left-color: var(--accent); background: var(--bg-hover);
}
.content { flex: 1; min-width: 0; }
.content .section { padding-top: 0; }

/* 子栏目切换（烽火地带 / 全面战场） */
.sub-tabs { display: flex; gap: 12px; margin-bottom: 20px; }
.sub-tabs a {
  padding: 8px 22px; border-radius: 4px; font-size: 15px;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim);
}
.sub-tabs a.active { background: var(--accent); color: var(--btn-on-accent); border-color: var(--accent); font-weight: 600; }

/* 占位页 */
.placeholder {
  background: var(--bg-card); border: 1px dashed var(--border);
  border-radius: 8px; padding: 70px 20px; text-align: center;
}
.placeholder h2 { font-size: 20px; margin-bottom: 10px; }
.placeholder p { color: var(--text-dim); }

@media (max-width: 860px) {
  .layout { flex-direction: column; padding-top: 18px; }
  .sidebar { position: static; width: 100%; display: flex; overflow-x: auto; }
  .sidebar .side-title { display: none; }
  .sidebar a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .sidebar a.active { border-left: none; border-bottom-color: var(--accent); }
}

@media (max-width: 640px) {
  .hero h1 { font-size: 28px; }
  .article-item { flex-direction: column; }
  .article-item .cover { width: 100%; height: 160px; }
  .nav a { margin-left: 16px; }
}

/* ===== 武器信息条（从枪械点进来时展示一次） ===== */
.weapon-hero {
  display: flex; align-items: center; gap: 24px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px 24px; margin-bottom: 20px;
}
.weapon-hero .wh-img {
  width: 100px; height: 100px; flex-shrink: 0;
  border-radius: 8px; background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.weapon-hero .wh-img img { width: 100%; height: 100%; object-fit: contain; }
.weapon-hero .wh-img span { color: var(--text-dim); font-size: 12px; }
.weapon-hero .wh-info { flex: 1; min-width: 0; }
.weapon-hero .wh-info h3 { font-size: 22px; margin-bottom: 6px; }
.weapon-hero .wh-meta { color: var(--accent); font-size: 13px; margin-bottom: 4px; }
.weapon-hero .wh-desc { color: var(--text-dim); font-size: 13px; }
@media (max-width: 640px) {
  .weapon-hero { padding: 14px 16px; gap: 14px; }
  .weapon-hero .wh-img { width: 70px; height: 70px; }
  .weapon-hero .wh-info h3 { font-size: 18px; }
}
