:root {
  --bg: #0d0f14;
  --surface: #141720;
  --surface-alt: #1b1f2b;
  --border: #262b3b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #e11d48;
  --primary-hover: #be123c;
  --link: #38bdf8;
  --ok: #10b981;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --primary: #e11d48;
  --primary-hover: #be123c;
  --link: #0284c7;
  --ok: #059669;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 14px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  flex-wrap: wrap;
  padding: 6px 0;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand-logo {
  height: 32px;
  width: auto;
  display: block;
}
.search-form {
  flex: 1;
  max-width: 440px;
  display: flex;
  gap: 6px;
}
.search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--primary); }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }

/* Banner */
.banner-wrap {
  margin: 14px 0 10px;
}
.banner-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* Filter Bar */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.pill {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: all .15s;
}
.pill:hover { color: var(--text); border-color: var(--primary); }
.pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* Forum Topic Grid (Sıfır Görsel) */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.topic-grid.one-col {
  grid-template-columns: 1fr;
}
@media (max-width: 860px) {
  .topic-grid { grid-template-columns: 1fr; }
}
.topic-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: border-color .15s;
}
.topic-row:hover { border-color: var(--primary); }
.topic-meta-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.cat-tag {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
}
.res-tag { color: var(--ok); font-weight: 700; }
.topic-title {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.topic-row:hover .topic-title { color: var(--link); }
.topic-meta-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

/* Host Badges */
.host-list { display: flex; flex-wrap: wrap; gap: 4px; }
.host-badge {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}
.host-K2S { color: #fbbf24; border-color: rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .12); }
.host-RG { color: #fb7185; border-color: rgba(244, 63, 94, .45); background: rgba(244, 63, 94, .12); }
.host-TEZ { color: #38bdf8; border-color: rgba(14, 165, 233, .45); background: rgba(14, 165, 233, .12); }
.host-FB { color: #818cf8; border-color: rgba(99, 102, 241, .45); background: rgba(99, 102, 241, .12); }

/* Topic Detail Layout */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) {
  .detail-grid { grid-template-columns: 1fr; }
}
.detail-main { display: flex; flex-direction: column; gap: 14px; }
.detail-aside { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 72px; }

.media-box { overflow: hidden; padding: 0; }
.media-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.media-stage {
  aspect-ratio: 16 / 9;
  background: #07080c;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.media-stage img, .media-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.gallery-item {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 0;
  cursor: pointer;
}
.gallery-item:hover { border-color: var(--primary); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.specs-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
  .specs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.spec-cell {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.spec-label { font-size: 11px; color: var(--muted); }
.spec-val { font-size: 12px; font-weight: 700; margin-top: 2px; }

/* Download Rows */
.dl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.dl-row + .dl-row { margin-top: 8px; }
.dl-info { min-width: 0; flex: 1; }
.dl-file { font-size: 13px; font-weight: 600; word-break: break-all; }
.dl-sub { font-size: 12px; color: var(--muted); }

/* Related */
.related-item {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.related-item:last-child { border-bottom: none; padding-bottom: 0; }
.related-item:hover .related-title { color: var(--link); }
.related-title { font-size: 13px; font-weight: 600; }
.related-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Pagination & Footer */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.site-footer {
  margin-top: 28px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 0;
  font-size: 12px;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* Lightbox & Toast */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, .86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-box {
  max-width: 900px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.modal-head, .modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-foot { border-bottom: none; border-top: 1px solid var(--border); }
.modal-body { aspect-ratio: 16 / 9; background: #000; display: flex; align-items: center; justify-content: center; }
.modal-body img { max-width: 100%; max-height: 100%; object-fit: contain; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}
.hidden { display: none !important; }
.img-fallback {
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* Admin Forms */
.form-grid { display: grid; gap: 10px; }
.input, .textarea, .select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}
.alert-ok { padding: 10px 12px; border-radius: 8px; background: rgba(16,185,129,.14); border: 1px solid rgba(16,185,129,.4); color: var(--ok); font-size: 13px; }
.alert-err { padding: 10px 12px; border-radius: 8px; background: rgba(244,63,94,.14); border: 1px solid rgba(244,63,94,.4); color: #fb7185; font-size: 13px; }
