:root {
  --bg: #0a0a0e;
  --bg-elev: #131318;
  --bg-card: #17171d;
  --border: #26262f;
  --text: #f5f5f7;
  --text-dim: #9a9aa5;
  --text-faint: #67676f;
  --pink: #ec1f6b;
  --pink-light: #ff5c96;
  --purple: #7b2ff7;
  --gradient: linear-gradient(90deg, #ec1f6b 0%, #7b2ff7 100%);
  --radius: 10px;
  --radius-lg: 16px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1320px; margin: 0 auto; padding: 0 32px; width: 100%; }

/* ---------- Top nav ---------- */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; flex-direction: column; line-height: 1.05; }
.brand .name-top {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
}
.brand .name-bottom {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active { color: var(--pink-light); border-bottom: 2px solid var(--pink); padding-bottom: 18px; margin-bottom: -19px; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 15px;
}
.nav-toggle {
  display: none;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 18px;
}
.mobile-menu {
  display: none;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  padding: 8px 20px 16px;
}
.mobile-menu a {
  padding: 12px 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu.open { display: flex; }

.btn {
  border: none;
  border-radius: 20px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.btn-outline {
  background: var(--pink);
}
.btn-gradient {
  background: var(--gradient);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.btn-block { width: 100%; padding: 12px; border-radius: var(--radius); font-size: 14px; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 4px 9px;
  border-radius: 5px;
  background: var(--pink);
  color: #fff;
  text-transform: uppercase;
}
.tag.tag-outline { background: rgba(236,31,107,0.12); color: var(--pink-light); }
.tag.tag-purple { background: rgba(123,47,247,0.18); color: #b48bff; }
.tag.tag-gray { background: var(--bg-elev); color: var(--text-dim); border: 1px solid var(--border); }
.tag.tag-green { background: rgba(46,196,120,0.15); color: #4fd486; }
.tag.tag-amber { background: rgba(240,166,35,0.15); color: #f0a623; }

.section-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 40px 0 18px;
}
.view-all { font-size: 13px; font-weight: 700; color: var(--pink-light); }

.meta-row {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-faint);
  align-items: center;
}

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
}
.auth-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.auth-card .sub { font-size: 13px; color: var(--text-dim); margin-bottom: 26px; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--pink);
}
.field-hint { font-size: 11px; color: var(--text-faint); margin-top: 5px; }
.auth-foot { text-align: center; font-size: 13px; color: var(--text-dim); margin-top: 20px; }
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-faint); font-size: 11px; margin: 20px 0;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.error-banner {
  background: rgba(224,60,60,0.12);
  border: 1px solid rgba(224,60,60,0.4);
  color: #ff8080;
  font-size: 12px;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 18px;
}

/* ---------- Dashboard layout ---------- */
.dash {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 76px);
}
.sidebar {
  border-right: 1px solid var(--border);
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
}
.sidebar .who {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 10px 8px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  border-radius: 8px;
  transition: background .2s;
}
.sidebar .who:hover {
  background: var(--bg-elev);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.who .name { font-size: 13px; font-weight: 700; }
.who .role { font-size: 11px; color: var(--text-faint); }
.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.side-link.active { background: rgba(236,31,107,0.12); color: var(--pink-light); }
.side-link:hover:not(.active) { background: var(--bg-elev); }
.dash-main { padding: 28px 32px; }
.dash-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.dash-head h1 { font-size: 22px; font-weight: 800; }
.dash-head .sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-card .num { font-size: 24px; font-weight: 800; }
.stat-card .lbl { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

table { width: 100%; border-collapse: collapse; }
.table-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
thead th {
  text-align: left; font-size: 11px; letter-spacing: 0.4px;
  color: var(--text-faint); text-transform: uppercase;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
tbody td { padding: 14px 18px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
.row-title { font-weight: 700; font-size: 13.5px; }
.row-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.status-pill {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px;
  display: inline-block;
}
.status-pending { background: rgba(240,166,35,0.15); color: #f0a623; }
.status-approved, .status-published { background: rgba(46,196,120,0.15); color: #4fd486; }
.status-rejected { background: rgba(224,60,60,0.15); color: #ff6b6b; }
.status-draft { background: var(--bg-elev); color: var(--text-dim); border: 1px solid var(--border); }
.action-link { font-size: 12px; font-weight: 700; color: var(--pink-light); margin-right: 12px; }
.action-link.muted { color: var(--text-dim); }

/* ---------- Homepage grids ---------- */
.hero-grid { display: grid; grid-template-columns: 2.1fr 1fr; gap: 20px; }
.quicknav-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 14px; margin-top: 20px; }
.news-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.bottom-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 16px; margin-top: 36px; }

/* ---------- Article page ---------- */
.article-hero {
  padding: 40px 0 0;
}
.breadcrumb { font-size: 12px; color: var(--text-faint); margin-bottom: 16px; }
.breadcrumb a { color: var(--text-dim); }
.article-title { font-size: 34px; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.author-row { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.author-row .avatar { width: 32px; height: 32px; font-size: 12px; }
.author-row .a-name { font-size: 13px; font-weight: 700; }
.author-row .a-meta { font-size: 12px; color: var(--text-faint); }
.article-hero-img { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24px; }
.article-hero-img img { width: 100%; height: 420px; object-fit: cover; }
.engage-bar {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin-bottom: 28px; font-size: 13px; color: var(--text-dim); font-weight: 600;
}
.engage-bar span { display: flex; align-items: center; gap: 6px; }
.article-body { font-size: 16px; color: #d6d6dc; max-width: 720px; }
.article-body p { margin-bottom: 18px; }

.related-section { max-width: 720px; margin-top: 44px; }
.related-section h2 { font-size: 18px; font-weight: 800; margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.related-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: block; }
.related-card img { height: 110px; object-fit: cover; width: 100%; }
.related-card-body { padding: 12px; }
.related-title { font-size: 12.5px; font-weight: 700; margin: 4px 0 8px; line-height: 1.35; }

.comments-section { max-width: 720px; margin-top: 40px; }
.comments-section h2 { font-size: 18px; font-weight: 800; margin-bottom: 18px; }
.comment-form { display: flex; gap: 12px; margin-bottom: 26px; }
.comment-form textarea {
  flex: 1; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 13px; color: var(--text); font-size: 13px;
  font-family: inherit; resize: none; height: 44px;
}
.comment {
  display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment .c-name { font-size: 13px; font-weight: 700; }
.comment .c-time { font-size: 11px; color: var(--text-faint); margin-left: 8px; font-weight: 400; }
.comment .c-body { font-size: 13.5px; color: var(--text-dim); margin-top: 4px; line-height: 1.55; }
.comment .c-actions { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--text-faint); font-weight: 600; }

/* ---------- Ad slots ---------- */
.ad-slot {
  border: 1px dashed var(--border);
  background: var(--bg-elev);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  margin: 0 auto;
  overflow: hidden;
}
.ad-slot .ad-label {
  position: absolute;
  top: 6px;
  font-size: 9px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.ad-slot .ad-size {
  font-size: 11px;
  color: var(--text-faint);
}
.ad-wrap { position: relative; margin: 28px 0; }
.ad-wrap.center { display: flex; justify-content: center; }
.ad-leaderboard { width: 100%; max-width: 728px; height: 90px; }
.ad-rectangle { width: 300px; height: 250px; }
.ad-skyscraper { width: 300px; height: 600px; }
.ad-infeed { width: 100%; height: 100px; grid-column: 1 / -1; }
.ad-native { width: 100%; height: 110px; }
.sidebar-ads { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .container { padding: 0 20px; }
  .news-grid { grid-template-columns: repeat(3, 1fr); }
  .quicknav-grid { grid-template-columns: repeat(4, 1fr); }
  .bottom-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .topnav { padding: 14px 18px; }
  .hero-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: 1fr; }
  .ad-skyscraper { display: none; }
  .dash { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .article-title { font-size: 24px; }
  .article-hero-img img { height: 220px; }
  .ad-leaderboard { height: 60px; }
  .dash-main { padding: 20px 18px; }
  .table-card { overflow-x: auto; }
  table { min-width: 640px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .quicknav-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .news-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .auth-card { padding: 26px 20px; }
  .engage-bar { flex-wrap: wrap; gap: 10px 16px; }
  .comment-form { flex-direction: column; }
  .comment-form button { align-self: flex-end; padding: 10px 20px; }
  .dash-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero-grid .card { padding: 22px !important; }
  .hero-grid h1 { font-size: 24px !important; }
}
