/* =====================================================
   GameGuide — 主样式文件
   配色: 深色主题 + 亮色强调
   ===================================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:    #6c63ff;
  --primary-dk: #4f46e5;
  --accent:     #f4a261;
  --bg:         #0f1117;
  --bg-card:    #1a1d27;
  --bg-card-hv: #222639;
  --border:     #2a2d3e;
  --text:       #e2e8f0;
  --text-muted: #94a3b8;
  --text-link:  #818cf8;
  --success:    #22c55e;
  --tag-mobile: #6c63ff;
  --tag-pc:     #00b4d8;
  --tag-console:#e63946;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 4px 20px rgba(0,0,0,.45);
  --font:       'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --max-w:      1200px;
  --header-h:   64px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--primary); }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* --- Utilities --- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.accent { color: var(--primary); }

/* ===================== HEADER ===================== */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(15,17,23,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.header-inner {
  display: flex; align-items: center; gap: 24px;
  height: 100%;
}

.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1.25rem;
  color: var(--text) !important;
  white-space: nowrap;
}
.logo-icon { font-size: 1.5rem; font-family: 'Segoe UI Emoji','Apple Color Emoji','Noto Color Emoji','Twemoji Mozilla',sans-serif; }
.logo-text { color: var(--text); }

/* Navigation */
.main-nav { flex: 1; }
.main-nav > ul { display: flex; gap: 4px; align-items: center; }
.main-nav a {
  display: block; padding: 8px 14px;
  color: var(--text-muted); font-size: .95rem; font-weight: 500;
  border-radius: 6px; transition: all .2s;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--text); background: rgba(108,99,255,.15);
}
.main-nav a.active { color: var(--primary); }

/* Dropdown */
.has-dropdown { position: relative; }
.dropdown {
  display: none; position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px; min-width: 160px;
  box-shadow: var(--shadow); z-index: 100;
}
.dropdown li a { padding: 8px 12px; border-radius: 6px; font-size: .9rem; }
.has-dropdown:hover .dropdown { display: block; }

/* Header Actions */
.header-actions { display: flex; align-items: center; gap: 12px; }
.search-box {
  display: flex; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; transition: border-color .2s;
}
.search-box:focus-within { border-color: var(--primary); }
.search-box input {
  background: none; border: none; outline: none;
  padding: 8px 12px; color: var(--text); font-size: .9rem;
  width: 200px; font-family: var(--font);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box button {
  background: none; border: none; cursor: pointer;
  padding: 8px 12px; color: var(--text-muted); font-size: 1rem;
  transition: color .2s;
}
.search-box button:hover { color: var(--primary); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); font-size: 1.4rem; }

/* ===================== HERO ===================== */
.hero {
  background: linear-gradient(135deg, #0f1117 0%, #1a1d3a 50%, #0f1117 100%);
  border-bottom: 1px solid var(--border);
  padding: 72px 0 60px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 50%, rgba(108,99,255,.12) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 48px; }
.hero-text { flex: 1; max-width: 560px; }
.hero-text h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; line-height: 1.2; margin-bottom: 20px; }
.hero-text p { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 32px; max-width: 480px; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; padding: 12px 28px; border-radius: 8px; font-weight: 600; font-size: .95rem; transition: all .2s; cursor: pointer; border: none; font-family: var(--font); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(108,99,255,.4); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Hero Stats */
.hero-stats { display: flex; flex-direction: column; gap: 16px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 28px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  min-width: 140px;
}
.stat-num { font-size: 2rem; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-label { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }

/* ===================== AD UNITS ===================== */
.ad-unit { margin: 24px 0; }
.ad-banner { text-align: center; }
.ad-placeholder {
  background: var(--bg-card); border: 1px dashed var(--border);
  color: var(--text-muted); font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); height: 90px;
}
.ad-placeholder-square { height: 250px; }
.ad-inline .ad-placeholder { height: 80px; }

/* ===================== CATEGORIES ===================== */
.section-title {
  font-size: 1.6rem; font-weight: 700; margin-bottom: 32px;
  position: relative; padding-bottom: 12px;
}
.section-title::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 48px; height: 3px; background: var(--primary); border-radius: 2px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.category-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; transition: all .25s; color: var(--text) !important;
  position: relative; overflow: hidden;
}
.category-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--cat-color, var(--primary));
}
.category-card:hover {
  border-color: var(--cat-color, var(--primary));
  transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.3);
  background: var(--bg-card-hv);
}
.cat-icon { font-size: 2rem; }
.cat-name { font-weight: 600; font-size: .95rem; }
.cat-count { font-size: .8rem; color: var(--text-muted); }

/* ===================== CONTENT LAYOUT ===================== */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px; padding-top: 48px; padding-bottom: 64px;
  align-items: start;
}
.main-content .section-title { margin-bottom: 24px; }

/* Article Cards */
.article-list { display: flex; flex-direction: column; gap: 20px; }
.article-card {
  display: flex; gap: 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all .25s;
}
.article-card:hover { border-color: var(--primary); box-shadow: 0 4px 20px rgba(108,99,255,.15); }
.article-thumb-link { flex-shrink: 0; }
.article-thumb {
  width: 160px; height: 120px;
  display: flex; align-items: center; justify-content: center;
}
.thumb-icon { font-size: 2.5rem; }
.article-body { padding: 18px 18px 18px 0; display: flex; flex-direction: column; justify-content: space-between; flex: 1; }
.article-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.article-meta time { font-size: .8rem; color: var(--text-muted); }
.article-body h3 { font-size: 1.05rem; line-height: 1.5; margin-bottom: 8px; }
.article-body h3 a { color: var(--text); }
.article-body h3 a:hover { color: var(--primary); }
.article-body > p { font-size: .9rem; color: var(--text-muted); flex: 1; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-footer { display: flex; align-items: center; justify-content: space-between; }
.read-time { font-size: .8rem; color: var(--text-muted); }
.read-more { font-size: .85rem; color: var(--primary); font-weight: 600; }
.read-more:hover { color: var(--accent); }

/* Tags */
.tag {
  display: inline-block; padding: 2px 10px;
  border-radius: 20px; font-size: .75rem; font-weight: 600; color: #fff;
}
.tag-mobile  { background: var(--tag-mobile); }
.tag-pc      { background: var(--tag-pc); }
.tag-console { background: var(--tag-console); }
.tag-rpg     { background: var(--accent); }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 8px; margin-top: 32px; flex-wrap: wrap; }
.page-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); font-size: .9rem; transition: all .2s;
}
.page-btn:hover, .page-btn.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.page-next { width: auto; padding: 0 16px; }
.page-ellipsis { color: var(--text-muted); }

/* ===================== SIDEBAR ===================== */
.sidebar { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 24px; }
.widget {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.widget-title { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }

.hot-list { display: flex; flex-direction: column; gap: 12px; }
.hot-list li a {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted); font-size: .9rem; transition: color .2s;
}
.hot-list li a:hover { color: var(--text); }
.rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 4px;
  background: var(--border); font-size: .75rem; font-weight: 700;
  flex-shrink: 0;
}
.rank-1 { background: #f59e0b; color: #000; }
.rank-2 { background: #9ca3af; color: #000; }
.rank-3 { background: #b45309; color: #fff; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-link {
  padding: 4px 12px; background: var(--border); border-radius: 20px;
  font-size: .8rem; color: var(--text-muted); transition: all .2s;
}
.tag-link:hover { background: var(--primary); color: #fff; }

.sticky-ad { position: sticky; top: calc(var(--header-h) + 16px); }
.ad-placeholder[style*="300"] { height: 600px; }

/* ===================== FEATURES ===================== */
.features { background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.feature-card { text-align: center; padding: 24px 20px; }
.feature-icon { font-size: 2.5rem; display: block; margin-bottom: 16px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.feature-card p { color: var(--text-muted); font-size: .9rem; }

/* ===================== FOOTER ===================== */
.site-footer {
  background: #080a10; border-top: 1px solid var(--border);
  padding-top: 48px;
}
.footer-inner {
  display: grid; grid-template-columns: 1fr 2fr; gap: 48px;
  padding-bottom: 48px;
}
.footer-brand .logo { margin-bottom: 12px; font-size: 1.1rem; }
.footer-brand p { font-size: .9rem; color: var(--text-muted); max-width: 260px; }
.footer-links { display: grid; grid-template-columns: repeat(3,1fr); gap: 32px; }
.footer-col h4 { font-size: .95rem; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--text-muted); font-size: .875rem; transition: color .2s; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding: 20px 0; text-align: center; }
.footer-bottom p { font-size: .8rem; color: var(--text-muted); }

/* ===================== ARTICLE PAGE ===================== */
.article-page-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px; padding: 48px 0 64px;
}
.article-header { margin-bottom: 32px; }
.article-title { font-size: 2rem; font-weight: 700; line-height: 1.3; margin-bottom: 16px; }
.article-info { display: flex; align-items: center; gap: 16px; color: var(--text-muted); font-size: .85rem; flex-wrap: wrap; }
.article-toc {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 32px;
}
.article-toc h4 { margin-bottom: 12px; font-size: .95rem; }
.article-toc ol { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.article-toc a { color: var(--text-muted); font-size: .9rem; }
.article-toc a:hover { color: var(--primary); }
.article-content h2 { font-size: 1.5rem; margin: 40px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.article-content h3 { font-size: 1.15rem; margin: 28px 0 12px; color: var(--primary); }
.article-content p { margin-bottom: 16px; color: var(--text-muted); line-height: 1.8; }
.article-content ul, .article-content ol { padding-left: 24px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.article-content li { color: var(--text-muted); }
.article-content strong { color: var(--text); }
.article-content blockquote {
  border-left: 3px solid var(--primary); padding: 12px 20px;
  background: rgba(108,99,255,.08); border-radius: 0 8px 8px 0;
  margin: 24px 0; color: var(--text-muted); font-style: italic;
}
.tip-box {
  background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3);
  border-radius: var(--radius); padding: 16px 20px; margin: 24px 0;
}
.tip-box .tip-title { color: #22c55e; font-weight: 700; margin-bottom: 6px; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .content-layout { grid-template-columns: 1fr 280px; gap: 24px; }
  .article-page-layout { grid-template-columns: 1fr 280px; }
}

@media (max-width: 768px) {
  :root { --header-h: 56px; }

  .nav-toggle { display: block; }
  .main-nav {
    display: none; position: fixed;
    top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: var(--bg-card); overflow-y: auto;
    padding: 24px; z-index: 999;
  }
  .main-nav.open { display: block; }
  .main-nav > ul { flex-direction: column; gap: 0; }
  .main-nav a { padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .dropdown { display: none; position: static; box-shadow: none; border: none; padding-left: 16px; background: transparent; }
  .has-dropdown.open .dropdown { display: block; }
  .search-box input { width: 140px; }

  .hero-inner { flex-direction: column; text-align: center; }
  .hero-text p, .hero-cta { justify-content: center; }
  .hero-stats { flex-direction: row; justify-content: center; }
  .stat-card { min-width: 100px; padding: 14px 18px; }
  .stat-num { font-size: 1.5rem; }

  .content-layout,
  .article-page-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sticky-ad { position: static; }

  .article-thumb { width: 100px; height: 80px; }
  .article-body h3 { font-size: .95rem; }

  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-links { grid-template-columns: repeat(2,1fr); gap: 24px; }
  .category-grid { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 480px) {
  .article-card { flex-direction: column; }
  .article-thumb { width: 100%; height: 120px; }
  .article-body { padding: 16px; }
  .category-grid { grid-template-columns: repeat(2,1fr); }
  .footer-links { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: column; }
  .hero-cta { flex-direction: column; }
}
