/* ============================================
   GODSAPEX WIKI — Premium Dark Theme
   ============================================ */

:root {
  --bg-deep:        #0a0c12;
  --bg-primary:     #0d1117;
  --bg-secondary:   #131a24;
  --bg-card:       #182030;
  --bg-card-2:     #1e2839;
  --bg-hover:      #243044;
  --border:        #2a3444;
  --border-light:  #36445a;
  --gold:          #d4a843;
  --gold-light:    #f0d060;
  --gold-dim:      rgba(212,168,67,.12);
  --text-hi:        #f0f3f8;
  --text-mid:       #c0c8d4;
  --text-low:       #7a8494;
  --accent:         #4a9eff;
  --accent-dim:     rgba(74,158,255,.12);
  --danger:         #f85149;
  --radius:         10px;
  --shadow:         0 4px 24px rgba(0,0,0,.3);
  --sidebar-w:      290px;
  --header-h:       60px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', 'Noto Sans', sans-serif;
  background: var(--bg-deep);
  color: var(--text-mid);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-light); }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ===== Header ===== */
.header {
  position: fixed; top:0; left:0; right:0; z-index:100;
  height: var(--header-h);
  background: rgba(10,12,18,.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
}
.header-logo {
  font-size: 20px; font-weight: 900; letter-spacing: 3px;
  color: var(--gold); cursor: pointer; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.header-logo img { flex-shrink: 0; }
.header-logo span { color: var(--text-hi); }
.header-actions { display: flex; align-items: center; gap: 14px; }

/* Lang switcher */
.lang-switcher {
  display: flex; border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden;
}
.lang-btn {
  padding: 5px 13px; background: transparent; border: none;
  color: var(--text-low); cursor: pointer; font-size: 12px;
  transition: all .2s; font-weight: 500;
}
.lang-btn.active { background: var(--gold); color: #0a0c12; font-weight: 700; }
.lang-btn:hover:not(.active) { background: var(--bg-hover); color: var(--text-hi); }

/* ===== Main ===== */
.main { margin-top: var(--header-h); min-height: calc(100vh - var(--header-h)); }

/* ===== Hero ===== */
.hero {
  text-align: center; padding: 70px 24px 50px;
  position: relative;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(212,168,67,.08) 0%, transparent 70%);
}
.hero::after {
  content: '';
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 200px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.hero-emblem {
  width: 64px; height: 64px; margin: 0 auto 20px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.hero-emblem img { width: 100%; height: 100%; object-fit: cover; }
.hero h1 {
  font-size: 44px; font-weight: 900; letter-spacing: 5px;
  color: var(--text-hi); margin-bottom: 10px; text-transform: uppercase;
}
.hero h1 em { color: var(--gold); font-style: normal; }
.hero p { color: var(--text-low); font-size: 16px; }

/* ===== Search ===== */
.search-wrap { max-width: 560px; margin: 28px auto 0; position: relative; }
.search-box {
  width: 100%; padding: 12px 20px 12px 44px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 50px; color: var(--text-hi); font-size: 14px;
  outline: none; transition: all .2s;
}
.search-box:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.search-box::placeholder { color: var(--text-low); }
.search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--text-low); font-size: 16px;
}

/* ===== Container ===== */
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ===== Section Title ===== */
.section-title {
  font-size: 18px; font-weight: 700; margin: 48px 0 20px;
  display: flex; align-items: center; gap: 10px;
  color: var(--text-hi);
}
.section-title::before {
  content: ''; width: 4px; height: 20px;
  background: var(--gold); border-radius: 2px;
}
.section-title .en { color: var(--text-low); font-weight: 400; font-size: 14px; }

/* ===== Category Grid ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.category-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0; cursor: pointer;
  transition: all .25s ease; position: relative; overflow: hidden;
  min-height: 160px; display: flex; flex-direction: column; justify-content: flex-end;
}
.category-card .card-bg {
  position: absolute; top: 0; left: 0; right: 0; height: 100%;
  background-size: cover; background-position: center; opacity: .35;
  transition: opacity .25s;
}
.category-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0; transition: opacity .25s; z-index: 2;
}
.category-card:hover {
  border-color: var(--gold); transform: translateY(-3px); box-shadow: var(--shadow);
}
.category-card:hover .card-bg { opacity: .55; }
.category-card:hover::before { opacity: 1; }
.category-card .card-body {
  position: relative; z-index: 1; padding: 18px;
  background: linear-gradient(180deg, transparent, rgba(13,17,23,.95));
}
.category-card .icon { font-size: 22px; margin-bottom: 6px; }
.category-card h3 { font-size: 15px; margin-bottom: 4px; color: var(--text-hi); }
.category-card p { font-size: 12px; color: var(--text-low); line-height: 1.5; }
.category-card .count {
  display: inline-block; margin-top: 8px; font-size: 11px;
  background: rgba(13,17,23,.8); padding: 2px 10px; border-radius: 20px;
  color: var(--gold); border: 1px solid rgba(212,168,67,.3);
}

/* ===== Popular ===== */
.popular-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}
.popular-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; overflow: hidden;
  transition: all .2s;
}
.popular-card:hover { border-color: var(--gold); }
.popular-card .card-img {
  width: 100%; height: 110px; background-size: cover; background-position: center;
  opacity: .55; transition: opacity .2s;
}
.popular-card:hover .card-img { opacity: .85; }
.popular-card .card-body { padding: 12px 14px; }
.popular-card .tag {
  display: inline-block; font-size: 10px; padding: 2px 8px;
  border-radius: 4px; margin-bottom: 6px; font-weight: 600;
  background: var(--gold-dim); color: var(--gold);
}
.popular-card .tag.important { background: rgba(248,81,73,.12); color: var(--danger); }
.popular-card h4 { font-size: 14px; line-height: 1.5; color: var(--text-hi); }

/* ===== Articles Group ===== */
.articles-group { margin-bottom: 28px; }
.articles-group h3 {
  font-size: 15px; margin-bottom: 10px; color: var(--gold-light);
  display: flex; align-items: center; gap: 8px;
}
.articles-list {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.articles-list a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  color: var(--text-mid); font-size: 13px; transition: all .15s;
}
.articles-list a:last-child { border-bottom: none; }
.articles-list a:hover { background: var(--bg-hover); color: var(--gold-light); padding-left: 20px; }
.articles-list a .dot { color: var(--gold); font-size: 8px; }

/* ===== Article Page ===== */
.article-layout {
  display: flex; max-width: 1280px; margin: 0 auto;
  padding: 24px; gap: 24px;
}
.article-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
}
.sidebar-cat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 8px; overflow: hidden;
}
.sidebar-cat-title {
  padding: 10px 14px; font-size: 12px; font-weight: 700;
  color: var(--text-hi); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  transition: background .15s;
}
.sidebar-cat-title:hover { background: var(--bg-hover); }
.sidebar-cat-title .arrow { font-size: 10px; color: var(--text-low); }
.sidebar-cat-items { display: none; }
.sidebar-cat-items.open { display: block; }
.sidebar-cat-items a {
  display: block; padding: 7px 14px 7px 28px; font-size: 12px;
  color: var(--text-low); border-top: 1px solid var(--border);
  transition: all .15s;
}
.sidebar-cat-items a:hover { color: var(--gold-light); background: var(--bg-hover); }
.sidebar-cat-items a.active { color: var(--gold-light); background: var(--gold-dim); border-left: 2px solid var(--gold); }

.article-content {
  flex: 1; min-width: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px 44px;
}
.breadcrumb {
  font-size: 12px; color: var(--text-low); margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-low); }
.breadcrumb a:hover { color: var(--gold); }
.article-content h1 {
  font-size: 30px; margin-bottom: 20px; color: var(--text-hi);
  font-weight: 800; line-height: 1.3;
}
.article-body { font-size: 15px; line-height: 1.85; color: var(--text-mid); overflow-x: auto; }
.article-body img { max-width: 100%; height: auto; border-radius: 6px; }
.article-body table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.article-body th, .article-body td {
  border: 1px solid var(--border); padding: 10px 14px; text-align: left; font-size: 14px; vertical-align: top;
}
.article-body th { background: var(--bg-secondary); color: var(--gold-light); font-weight: 600; }
.article-body tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.article-body td img { max-width: 100%; max-height: 900px; }
.article-body td:has(img:only-child) { text-align: center; }
.article-body ul, .article-body ol { margin: 8px 0; padding-left: 22px; }
.article-body li { margin: 4px 0; }
.article-body strong { color: var(--gold-light); }
.article-body details { margin: 16px 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.article-body summary { padding: 12px 16px; cursor: pointer; font-weight: 600; color: var(--gold); background: var(--bg-secondary); user-select: none; }
.article-body details[open] summary { border-bottom: 1px solid var(--border); }
.article-body blockquote { border-left: 3px solid var(--gold); padding: 8px 16px; margin: 14px 0; background: var(--gold-dim); border-radius: 0 6px 6px 0; }
.article-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.article-nav {
  display: flex; justify-content: space-between; margin-top: 36px;
  padding-top: 22px; border-top: 1px solid var(--border); gap: 12px;
}
.article-nav a {
  font-size: 13px; padding: 10px 18px; border: 1px solid var(--border);
  border-radius: 6px; transition: all .2s; color: var(--text-mid);
}
.article-nav a:hover { border-color: var(--gold); color: var(--gold-light); background: var(--gold-dim); }

/* ===== Loading / Error ===== */
.loading { text-align: center; padding: 80px; color: var(--text-low); font-size: 14px; }

/* ===== Footer ===== */
.footer {
  text-align: center; padding: 36px; margin-top: 48px;
  border-top: 1px solid var(--border);
  color: var(--text-low); font-size: 12px;
}
.footer a { color: var(--text-low); }
.footer a:hover { color: var(--gold); }

/* ===== Admin link ===== */
.admin-link {
  font-size: 12px; color: var(--text-low);
  padding: 5px 12px; border: 1px solid var(--border);
  border-radius: 6px; transition: all .2s;
}
.admin-link:hover { color: var(--gold); border-color: var(--gold); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .article-layout { flex-direction: column; }
  .article-sidebar { width: 100%; position: static; max-height: none; }
  .article-content { padding: 22px; }
  .hero h1 { font-size: 28px; }
  .hero-emblem { width: 48px; height: 48px; font-size: 20px; }
}
