/* =============================================
   GameGuide — 极简攻略站主题
   移动优先 · 暗色游戏风 · 轻量设计
   ============================================= */

/* ---------- CSS 变量 ---------- */
:root {
  --bg:          #0f1117;
  --bg2:         #161b27;
  --bg3:         #1e2535;
  --border:      #2a3347;
  --accent:      #4f8eff;
  --accent-dark: #3a70d4;
  --accent2:     #ff6b35;
  --text:        #e2e8f0;
  --text-muted:  #7a8aa0;
  --text-light:  #a0b0c8;
  --tag-bg:      #1e2d42;
  --card-hover:  #1a2236;
  --radius:      8px;
  --radius-sm:   5px;
  --shadow:      0 2px 12px rgba(0,0,0,.4);
  --font:        "PingFang SC","Helvetica Neue","Microsoft YaHei",sans-serif;
}

/* ---------- 重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- 公共容器 ---------- */
.g-wrap { max-width: 900px; margin: 0 auto; padding: 0 16px; }

/* =============================================
   导航栏
   ============================================= */
.g-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,17,23,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.g-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  gap: 12px;
}
.g-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.g-logo i { font-size: 1.2rem; }

/* 桌面导航 */
.g-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow: hidden;
}
.g-nav a {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.g-nav a:hover, .g-nav a.active {
  color: var(--text);
  background: var(--bg3);
}
.g-nav a.active { color: var(--accent); }

/* 头部右侧 */
.g-header-right { display: flex; align-items: center; gap: 8px; }
.g-header-search-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color .15s;
}
.g-header-search-btn:hover { color: var(--accent); }

/* 汉堡菜单（移动端） */
.g-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 6px;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
}
.g-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: .2s;
  border-radius: 1px;
}

/* 移动端抽屉菜单 */
.g-mobile-nav {
  display: none;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
}
.g-mobile-nav.open { display: block; }
.g-mobile-nav a {
  display: block;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
  color: var(--text-light);
}
.g-mobile-nav a:last-child { border-bottom: none; }
.g-mobile-nav a.active { color: var(--accent); }

/* =============================================
   搜索栏（首页顶部）
   ============================================= */
.g-search-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.g-search-form {
  display: flex;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg3);
  transition: border-color .2s;
}
.g-search-form:focus-within { border-color: var(--accent); }
.g-search-form input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 10px 14px;
  color: var(--text);
  font-size: .95rem;
}
.g-search-form input::placeholder { color: var(--text-muted); }
.g-search-form button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 0 18px;
  font-size: .9rem;
  font-weight: 600;
  transition: background .15s;
}
.g-search-form button:hover { background: var(--accent-dark); }

/* =============================================
   区块通用标题
   ============================================= */
.g-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.g-section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--accent);
  border-radius: 2px;
}
.g-section-title a {
  margin-left: auto;
  font-size: .8rem;
  font-weight: 400;
  color: var(--text-muted);
}
.g-section-title a:hover { color: var(--accent); }

/* =============================================
   分类入口
   ============================================= */
.g-cats { padding: 20px 0; }
.g-cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.g-cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-size: .82rem;
  color: var(--text-light);
  transition: background .15s, border-color .15s, color .15s;
  min-height: 70px;
}
.g-cat-item:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  color: var(--accent);
}
.g-cat-item i { font-size: 1.3rem; color: var(--accent); }
.g-cat-item img { width: 28px; height: 28px; object-fit: contain; filter: brightness(.9); }
.g-cat-name { font-size: .8rem; line-height: 1.3; }

/* 分类更多滚动（移动端横滚） */
@media (max-width: 600px) {
  .g-cat-grid {
    grid-template-columns: repeat(4, minmax(72px, 1fr));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
  }
  .g-cat-item { padding: 12px 6px; min-height: 64px; }
}

/* =============================================
   文章卡片列表
   ============================================= */
.g-articles { padding: 4px 0 24px; }
.g-article-list { display: flex; flex-direction: column; gap: 1px; }

/* 水平卡片（默认） */
.g-article-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.g-article-card:last-child { border-bottom: none; }
.g-article-card:hover .g-article-title { color: var(--accent); }

.g-article-thumb {
  flex-shrink: 0;
  width: 90px;
  height: 62px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg3);
}
.g-article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.g-article-card:hover .g-article-thumb img { transform: scale(1.05); }

.g-article-body { flex: 1; min-width: 0; }
.g-article-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s;
}
.g-article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.g-article-meta i { margin-right: 2px; }
.g-article-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: .7rem;
  font-weight: 600;
}
.g-badge-hot  { background: rgba(255,107,53,.15); color: var(--accent2); }
.g-badge-new  { background: rgba(79,142,255,.15);  color: var(--accent); }
.g-badge-top  { background: rgba(255,200,0,.12);   color: #ffc800; }

.g-article-cate {
  display: inline-block;
  padding: 1px 7px;
  background: var(--tag-bg);
  border-radius: 3px;
  font-size: .72rem;
  color: var(--text-muted);
}

/* 无图模式 */
.g-article-card.no-img .g-article-thumb { display: none; }

/* =============================================
   分隔线 & 区块间距
   ============================================= */
.g-divider { height: 1px; background: var(--border); margin: 4px 0; }
.g-section-gap { height: 20px; }

/* =============================================
   "查看更多"按钮
   ============================================= */
.g-more-btn {
  display: block;
  text-align: center;
  margin: 18px auto 0;
  padding: 9px 28px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .85rem;
  color: var(--text-muted);
  transition: border-color .15s, color .15s;
  width: fit-content;
}
.g-more-btn:hover { border-color: var(--accent); color: var(--accent); }

/* =============================================
   列表页
   ============================================= */
.g-list-page { padding: 20px 0 30px; }

/* 内页顶部：面包屑 + 分类名 */
.g-inner-head { padding: 16px 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.g-inner-head h1 { font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.g-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: .78rem;
  color: var(--text-muted);
}
.g-breadcrumb a { color: var(--text-muted); }
.g-breadcrumb a:hover { color: var(--accent); }
.g-breadcrumb i { font-size: .65rem; }

/* 筛选/排序栏 */
.g-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.g-filter-label { font-size: .8rem; color: var(--text-muted); }
.g-filter-tag {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: .78rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: .15s;
}
.g-filter-tag:hover, .g-filter-tag.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* =============================================
   分页
   ============================================= */
.g-pagination { margin-top: 24px; display: flex; justify-content: center; }
/* LDCMS 原生分页样式覆写 */
.g-pagination .pagination { display: flex; flex-wrap: wrap; gap: 6px; }
.g-pagination .pagination li a,
.g-pagination .pagination li span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .85rem;
  transition: .15s;
}
.g-pagination .pagination li a:hover { border-color: var(--accent); color: var(--accent); }
.g-pagination .pagination li.active a,
.g-pagination .pagination li.active span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* =============================================
   详情页
   ============================================= */
/* 阅读进度条 */
.g-read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  z-index: 200;
}
.g-read-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width .1s linear;
}

.g-detail-page { padding: 16px 0 40px; }

/* 文章头 */
.g-article-header { margin-bottom: 20px; }
.g-article-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 10px;
  color: var(--text);
}
.g-article-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: .78rem;
  color: var(--text-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.g-article-info i { margin-right: 3px; }

/* 封面图 */
.g-article-cover {
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 340px;
}
.g-article-cover img { width: 100%; object-fit: cover; }

/* 摘要 */
.g-article-abstract {
  background: var(--bg2);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  margin-bottom: 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .88rem;
  color: var(--text-light);
}

/* 正文 */
.g-article-content {
  font-size: .95rem;
  line-height: 1.85;
  color: var(--text-light);
  word-break: break-word;
}
.g-article-content h2, .g-article-content h3 {
  color: var(--text);
  margin: 1.6em 0 .6em;
  font-size: 1.05rem;
}
.g-article-content h3 { font-size: .95rem; }
.g-article-content p { margin-bottom: .9em; }
.g-article-content img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: .8em 0;
}
.g-article-content a { color: var(--accent); text-decoration: underline; }
.g-article-content ul, .g-article-content ol {
  padding-left: 1.4em;
  margin-bottom: .9em;
}
.g-article-content ul { list-style: disc; }
.g-article-content ol { list-style: decimal; }
.g-article-content li { margin-bottom: .3em; }
.g-article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: .8em 0;
  font-size: .88rem;
  overflow-x: auto;
  display: block;
}
.g-article-content th, .g-article-content td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.g-article-content th { background: var(--bg3); color: var(--text); }
.g-article-content blockquote {
  border-left: 3px solid var(--border);
  padding: 8px 14px;
  color: var(--text-muted);
  margin: .8em 0;
  font-style: italic;
}
.g-article-content pre {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  overflow-x: auto;
  font-size: .85rem;
  margin: .8em 0;
}
.g-article-content code {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: .85em;
}
.g-article-content pre code { background: none; border: none; padding: 0; }

/* 文章标签 */
.g-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.g-article-tags a {
  padding: 3px 10px;
  background: var(--tag-bg);
  border-radius: 3px;
  font-size: .78rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: .15s;
}
.g-article-tags a:hover { border-color: var(--accent); color: var(--accent); }

/* 互动按钮 */
.g-article-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.g-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .82rem;
  color: var(--text-muted);
  transition: .15s;
}
.g-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.g-action-btn.liked { border-color: var(--accent2); color: var(--accent2); }

/* 上一篇/下一篇 */
.g-prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.g-prevnext-link {
  display: block;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: .15s;
}
.g-prevnext-link:hover { border-color: var(--accent); }
.g-prevnext-label {
  display: block;
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.g-prevnext-title {
  display: block;
  font-size: .88rem;
  color: var(--text-light);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.g-prevnext-link.next { text-align: right; }
.g-prevnext-none {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .82rem;
  color: var(--text-muted);
}

/* 相关推荐 */
.g-related { margin-top: 28px; }
.g-related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.g-related-card {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: .15s;
}
.g-related-card:hover { border-color: var(--accent); }
.g-related-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg3);
}
.g-related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.g-related-title {
  font-size: .82rem;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 评论区 */
.g-comment-section { margin-top: 28px; }
.g-comment-form {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.g-comment-form h3 {
  font-size: .95rem;
  margin-bottom: 14px;
  color: var(--text);
}
.g-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.g-form-row.full { grid-template-columns: 1fr; }
.g-form-group { display: flex; flex-direction: column; gap: 4px; }
.g-form-group label { font-size: .78rem; color: var(--text-muted); }
.g-form-group input,
.g-form-group textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text);
  font-size: .88rem;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
.g-form-group input:focus,
.g-form-group textarea:focus { border-color: var(--accent); }
.g-form-group textarea { resize: vertical; min-height: 80px; }
.g-captcha-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.g-captcha-row input { flex: 1; }
.g-captcha-row img {
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border);
}
.g-btn-submit {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 9px 24px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  transition: background .15s;
  margin-top: 4px;
}
.g-btn-submit:hover { background: var(--accent-dark); }

/* 打分 */
.g-star-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 6px 0 10px;
}
.g-star {
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--border);
  transition: color .1s;
}
.g-star.active, .g-star:hover ~ .g-star, .g-star-rating:hover .g-star { }
.g-star.active { color: #ffc800; }
.g-rating-label { font-size: .8rem; color: var(--text-muted); margin-left: 6px; }

/* =============================================
   搜索页 / 标签页
   ============================================= */
.g-search-page { padding: 16px 0 30px; }
.g-search-page-header { margin-bottom: 16px; }
.g-search-page-header h1 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 12px;
}
.g-search-page-header h1 em {
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
}
.g-search-page-header .g-search-form { max-width: 480px; }

.g-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.g-empty-state i { font-size: 2.5rem; margin-bottom: 10px; opacity: .4; }
.g-empty-state p { font-size: .9rem; margin-top: 6px; }

/* =============================================
   页脚
   ============================================= */
.g-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.8;
}
.g-footer a { color: var(--text-muted); }
.g-footer a:hover { color: var(--accent); }
.g-footer-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 16px; margin-bottom: 8px; }

/* =============================================
   回顶部
   ============================================= */
.g-totop {
  position: fixed;
  right: 16px;
  bottom: 24px;
  width: 38px;
  height: 38px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: .9rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, background .15s;
  z-index: 90;
}
.g-totop.show { opacity: 1; pointer-events: auto; }
.g-totop:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* =============================================
   响应式
   ============================================= */
@media (max-width: 768px) {
  .g-nav { display: none; }
  .g-menu-btn { display: flex; }

  .g-article-thumb { width: 78px; height: 54px; }
  .g-article-title { font-size: .9rem; }

  .g-prev-next { grid-template-columns: 1fr; }
  .g-related-grid { grid-template-columns: 1fr; }
  .g-form-row { grid-template-columns: 1fr; }

  .g-article-header h1 { font-size: 1.15rem; }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .g-article-thumb { width: 68px; height: 48px; }
  .g-search-form button { padding: 0 12px; font-size: .82rem; }
  .g-cat-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .g-cat-item { padding: 10px 4px; min-height: 58px; }
  .g-article-header h1 { font-size: 1.05rem; }
  .g-comment-form { padding: 12px; }
}
