* { box-sizing: border-box; }
:root {
  --bg: #f4f6fb;
  --text: #1b2333;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --border: #e3e7f1;
  --card-bg: #ffffff;
  --panel-bg: #ffffff;
  --list-bg: #f7f9ff;
  --muted: #5b667c;
  --muted-2: #7a869d;
  --accent: #2a6bff;
  --accent-hover: #1c57dc;
  --accent-soft: #f3f7ff;
  --pill-bg: #eef2ff;
  --meta-bg: #f0f4ff;
  --ghost-bg: #ffffff;
  --hero-grad-1: rgba(42, 107, 255, 0.12);
  --hero-grad-2: rgba(88, 210, 255, 0.06);
}
body.theme-dark {
  --bg: #141a24;
  --text: #e7edf8;
  --nav-bg: rgba(20, 26, 36, 0.9);
  --border: #253047;
  --card-bg: #1b2230;
  --panel-bg: #1b2230;
  --list-bg: #20293a;
  --muted: #a1acc2;
  --muted-2: #8f99ad;
  --accent: #4c8dff;
  --accent-hover: #3a78e9;
  --accent-soft: #1d2940;
  --pill-bg: #222f46;
  --meta-bg: #202c44;
  --ghost-bg: #1b2230;
  --hero-grad-1: rgba(76, 141, 255, 0.18);
  --hero-grad-2: rgba(120, 210, 255, 0.08);
}
body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }

.container {
  max-width: 1150px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-left { display: flex; align-items: center; gap: 12px; }
.logo { width: 32px; height: 32px; }
.brand { font-weight: 700; letter-spacing: 0.3px; }
.brand-link { color: inherit; text-decoration: none; }
.brand-link:hover { text-decoration: underline; }
.nav-right { display: flex; gap: 10px; }
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--panel-bg);
}
.avatar.small {
  width: 40px;
  height: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border: 1px solid var(--accent);
  transition: all 0.2s ease;
}
.btn:hover { transform: translateY(-1px); background: var(--accent-hover); }
.btn.ghost {
  background: var(--ghost-bg);
  color: var(--accent);
  border: 1px solid var(--border);
}
.btn.small { padding: 8px 12px; font-size: 0.9rem; }
.theme-toggle { cursor: pointer; }
.theme-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--border) inset;
  display: inline-block;
}

.hero {
  background: linear-gradient(135deg, var(--hero-grad-1), var(--hero-grad-2));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: stretch;
}
.hero h1 { margin: 8px 0 10px; font-size: 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.muted { color: var(--muted); }

.grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 10px;
}
.card-link {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(20, 26, 36, 0.12);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-head.with-avatar {
  gap: 12px;
}
.badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--accent);
  color: #fff;
}
.tag {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  color: var(--accent);
  background: var(--accent-soft);
}

.section-title {
  margin: 28px 0 12px;
  font-size: 1.3rem;
  font-weight: 700;
}
.breadcrumbs {
  color: var(--muted-2);
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.meta-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--meta-bg);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--accent);
}
.meta-chip.views {
  font-size: 0.95rem;
  padding: 6px 12px;
  font-weight: 600;
}
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.comment {
  background: var(--list-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.comment-body {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  align-items: start;
}
.comment-info {
  border-right: 2px solid rgba(255, 255, 255, 0.06);
  padding-right: 12px;
}
.comment-text {
  padding-right: 6px;
}
.comment + .comment { margin-top: 10px; }
.comment-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.comment-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.comment-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.comment-user-role {
  font-size: 0.75rem;
  color: var(--muted-2);
  font-weight: 400;
}
.comment-time { color: var(--muted-2); font-size: 0.8rem; }
.content-box {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.content-box img {
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  margin-top: 10px;
}
.text-h2 {
  font-size: 1.4rem;
  font-weight: 700;
}
.text-h3 {
  font-size: 1.2rem;
  font-weight: 700;
}
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.editor-toolbar button,
.editor-toolbar select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: var(--text);
  cursor: pointer;
}
.editor-area {
  min-height: 220px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
}
.editor-area:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.form-row {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.form-row input,
.form-row select,
.form-row textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: var(--text);
  font-family: inherit;
}
.post-meta {
  margin-top: 12px;
  text-align: right;
  color: var(--muted-2);
  font-size: 0.85rem;
}
.post-footer {
  margin-top: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.post-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.post-meta {
  margin: 0;
  line-height: 1.2;
}
.author-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 120px;
}
.reactions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.reaction-btn {
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}
.reaction-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(42, 107, 255, 0.2);
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal.open { display: flex; }
.modal-card {
  width: min(520px, 100%);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.modal-title { font-weight: 700; }
.help {
  color: var(--muted-2);
  font-size: 0.85rem;
}
.split {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}
.list { display: grid; gap: 12px; }
.list-item {
  background: var(--list-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--pill-bg);
  color: var(--accent);
}
.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.stat {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.stat-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.stat.large {
  padding: 22px;
}
.stat.large .muted {
  font-size: 1rem;
}
.stat.large strong {
  font-size: 1.2rem;
}
.stat.large .avatar {
  width: 56px;
  height: 56px;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  text-align: center;
  color: var(--muted-2);
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hub-layout { grid-template-columns: 1fr; }
}
