* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #9b59b6; --primary-light: #bb6bd9; --secondary: #6c5ce7; --accent: #a29bfe;
  --dark: #0a0a15; --card: rgba(255,255,255,0.04); --card-border: rgba(255,255,255,0.08);
  --white: #fff; --muted: #b4b0c5; --green: #2ecc71;
  --gradient-hero: linear-gradient(135deg, #0a0a15 0%, #1a0a25 25%, #150a20 50%, #0a0a15 100%);
  --gradient-purple: linear-gradient(135deg, #9b59b6, #6c5ce7);
  --shadow-light: 0 5px 20px rgba(155,89,182,0.3); --glow: 0 0 30px rgba(155,89,182,0.5);
  --header-h: 68px; --sidebar-w: 290px;
}
html { scroll-behavior: smooth; }
body { font-family: 'Poppins', sans-serif; background: var(--gradient-hero); background-attachment: fixed; color: var(--white); min-height: 100vh; line-height: 1.6; padding-top: var(--header-h); }
.grad { background: linear-gradient(135deg, var(--primary-light), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
a { color: inherit; text-decoration: none; }

/* ===== Header (identisch zu Shop/Main) ===== */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(10,10,21,0.85); backdrop-filter: blur(20px); border-bottom: 1px solid var(--card-border); }
.navbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; max-width: 1280px; margin: 0 auto; padding: 12px 24px; gap: 12px; }
.nav-left { grid-column: 1; justify-self: start; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: #fff; white-space: nowrap; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; }
.nav-links { grid-column: 2; justify-self: center; display: flex; align-items: center; gap: 6px; }
.nav-link { color: var(--white); font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 25px; transition: all .25s; white-space: nowrap; cursor: pointer; }
.nav-link:hover { background: rgba(255,255,255,0.1); }
.nav-link.active { background: rgba(155,89,182,0.18); color: #fff; }
.nav-link.shop-btn { background: var(--gradient-purple); box-shadow: var(--shadow-light); }
.nav-link.shop-btn:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.nav-dropdown { position: relative; }
.nav-dropdown .nav-link i { font-size: 10px; margin-left: 4px; transition: transform .3s; }
.nav-dropdown.active .nav-link i { transform: rotate(180deg); }
.dropdown-menu { position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%) translateY(10px); background: rgba(20,10,30,0.97); backdrop-filter: blur(20px); border-radius: 14px; border: 1px solid rgba(155,89,182,0.3); padding: 8px; min-width: 180px; opacity: 0; visibility: hidden; transition: all .3s; z-index: 1001; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.nav-dropdown.active .dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dropdown-menu a { display: flex; align-items: center; gap: 10px; padding: 11px 16px; color: #fff; font-size: 13px; font-weight: 500; border-radius: 10px; transition: all .25s; }
.dropdown-menu a:hover { background: var(--gradient-purple); transform: translateX(4px); }
.dropdown-menu a i { color: var(--primary-light); }

/* ===== Layout ===== */
.wiki-layout { display: flex; min-height: calc(100vh - var(--header-h)); }
.sidebar { position: fixed; top: var(--header-h); left: 0; bottom: 0; width: var(--sidebar-w); overflow-y: auto; padding: 18px 14px 50px; border-right: 1px solid var(--card-border); background: rgba(12,10,20,0.5); }
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-search { position: relative; margin-bottom: 18px; }
.sidebar-search > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
#search { width: 100%; background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 11px 14px 11px 36px; color: var(--white); font-family: inherit; font-size: 0.9rem; outline: none; transition: border-color .2s; }
#search:focus { border-color: var(--primary); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: rgba(18,14,28,0.98); backdrop-filter: blur(18px); border: 1px solid var(--card-border); border-radius: 14px; overflow: hidden; max-height: 60vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,0.55); display: none; z-index: 120; }
.search-results.open { display: block; }
.search-results a { display: block; padding: 11px 14px; color: var(--white); border-bottom: 1px solid rgba(255,255,255,0.05); }
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--gradient-purple); }
.search-results .sr-cat { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.search-results a:hover .sr-cat { color: rgba(255,255,255,0.85); }
.search-results .sr-empty { padding: 14px; color: var(--muted); font-size: 0.88rem; }

.cat-group { margin-bottom: 16px; }
.cat-title { display: flex; align-items: center; gap: 9px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); padding: 6px 12px; margin-bottom: 4px; }
.cat-title .ico { font-size: 1rem; }
.nav-page { display: block; padding: 8px 12px 8px 33px; border-radius: 9px; color: #cfc9dc; font-size: 0.9rem; transition: all .15s; cursor: pointer; }
.nav-page:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-page.active { background: var(--gradient-purple); color: #fff; font-weight: 600; }

.content { flex: 1; margin-left: var(--sidebar-w); padding: 36px 48px 90px; max-width: 920px; }
.chapters-toggle { display: none; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--card-border); color: #fff; font-family: inherit; font-weight: 600; font-size: 0.9rem; padding: 10px 16px; border-radius: 12px; cursor: pointer; margin-bottom: 20px; }
.loading { color: var(--muted); padding: 40px 0; }

/* ===== Artikel ===== */
.article .crumb { font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; }
.article h1 { font-size: 2.1rem; font-weight: 800; margin: 0 0 6px; line-height: 1.2; }
.article .page-meta { color: var(--muted); font-size: 0.82rem; margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--card-border); }
.article h2 { font-size: 1.5rem; font-weight: 700; margin: 34px 0 12px; }
.article h3 { font-size: 1.2rem; font-weight: 700; margin: 26px 0 10px; }
.article h4 { font-size: 1.04rem; font-weight: 700; margin: 22px 0 8px; color: var(--primary-light); }
.article p { margin: 0 0 14px; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 24px; }
.article li { margin: 6px 0; }
.article a { color: var(--primary-light); border-bottom: 1px solid rgba(187,107,217,0.4); }
.article a:hover { border-bottom-color: var(--primary-light); }
.article code { background: rgba(155,89,182,0.16); border: 1px solid rgba(155,89,182,0.28); color: #e7d6f5; padding: 2px 7px; border-radius: 6px; font-family: 'Consolas', monospace; font-size: 0.88em; }
.article pre { background: rgba(0,0,0,0.35); border: 1px solid var(--card-border); border-radius: 12px; padding: 16px; overflow-x: auto; margin: 0 0 18px; }
.article pre code { background: none; border: none; padding: 0; }
.article blockquote { background: rgba(155,89,182,0.08); border-left: 3px solid var(--primary); border-radius: 0 10px 10px 0; padding: 12px 18px; margin: 0 0 18px; color: #d8d3e8; }
.article img { max-width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--card-border); margin: 10px 0; display: block; }
.article figure { margin: 0 0 18px; }
.article figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 6px; text-align: center; }
.article table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 0.9rem; }
.article th, .article td { border: 1px solid var(--card-border); padding: 9px 12px; text-align: left; }
.article th { background: rgba(155,89,182,0.12); }
.article hr { border: none; border-top: 1px solid var(--card-border); margin: 26px 0; }

.page-nav { display: flex; justify-content: space-between; gap: 14px; margin-top: 50px; flex-wrap: wrap; }
.page-nav a { flex: 1; min-width: 200px; background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 14px 18px; color: var(--white); transition: all .2s; }
.page-nav a:hover { border-color: var(--primary); transform: translateY(-2px); }
.page-nav .pn-label { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.page-nav .pn-title { font-weight: 600; margin-top: 3px; }
.page-nav .next { text-align: right; }

/* ===== Mobile ===== */
.overlay { display: none; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(0,0,0,0.55); z-index: 90; }
.overlay.open { display: block; }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .brand span b { display: inline; }
  .nav-links { grid-column: 1 / -1; position: absolute; top: 100%; left: 12px; right: 12px; flex-direction: column; align-items: stretch; gap: 4px; background: rgba(20,10,30,0.98); backdrop-filter: blur(20px); border: 1px solid var(--card-border); border-radius: 16px; padding: 10px; display: none; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
  .nav-links.open { display: flex; }
  .nav-link { padding: 12px 16px; }
  .nav-dropdown .dropdown-menu { position: static; transform: none; opacity: 1; visibility: visible; box-shadow: none; background: rgba(255,255,255,0.03); border: none; display: none; }
  .nav-dropdown.active .dropdown-menu { display: block; transform: none; }
  .sidebar { transform: translateX(-100%); transition: transform .25s; z-index: 95; width: 84%; max-width: 320px; background: rgba(12,10,20,0.99); }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; padding: 22px 18px 80px; }
  .chapters-toggle { display: inline-flex; }
}
@media (max-width: 560px) {
  .article h1 { font-size: 1.7rem; }
  .navbar { padding: 10px 16px; }
  .brand span { font-size: 1rem; }
}

/* ===== Footer ===== */
.wiki-footer { margin-top: 50px; padding-top: 22px; border-top: 1px solid var(--card-border); display: flex; flex-wrap: wrap; align-items: center; gap: 18px; font-size: 0.85rem; color: var(--muted); }
.wiki-footer a { color: var(--muted); transition: color .2s; }
.wiki-footer a:hover { color: var(--primary-light); }
