:root {
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;
  --navbar-height: 60px;
  --sidebar-width: 240px;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
}

body.dark-mode {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* Navbar */
.navbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--navbar-height);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.navbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar-brand:hover { text-decoration: none; color: var(--accent); }
.navbar-brand .logo-icon { font-size: 1.5rem; }
.navbar-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}
.navbar-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.navbar-links a:hover { color: var(--text); text-decoration: none; }
.navbar-links a.active { color: var(--accent); }
.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.navbar-user {
  position: relative;
}
.navbar-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  padding: 4px 8px;
  border-radius: var(--radius);
}
.navbar-user-btn:hover { background: var(--bg-tertiary); }

/* Search bar in navbar */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 6px 16px;
  gap: 8px;
  width: 280px;
  transition: border-color 0.2s, width 0.3s;
}
.search-bar:focus-within {
  border-color: var(--accent);
  width: 320px;
}
.search-bar input {
  border: none;
  background: none;
  outline: none;
  color: var(--text);
  font-size: 0.9rem;
  width: 100%;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); font-size: 0.9rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); color: white; }
.btn-secondary { background: var(--bg-tertiary); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-secondary); }
.btn-small { padding: 6px 12px; font-size: 0.8rem; }
.btn-large { padding: 14px 28px; font-size: 1rem; }
.btn-icon { padding: 8px; min-width: 36px; }
.btn-ghost { background: none; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text); }
.btn-follow { min-width: 100px; }
.btn-follow.following { background: var(--bg-tertiary); color: var(--text); }

/* Avatar */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-tertiary);
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 80px; height: 80px; }
.avatar-xl { width: 120px; height: 120px; }
.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-weight: 700;
  border-radius: 50%;
}

/* Hero */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}
.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  line-height: 1.1;
}
.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Post Grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

/* Post Card */
.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.post-card a { color: inherit; text-decoration: none; }
.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-tertiary);
}
.post-card-content { padding: 20px; }
.post-card-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-excerpt {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.post-card-author {
  display: flex;
  align-items: center;
  gap: 8px;
}
.post-card-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Post List (alternative layout) */
.post-list { display: flex; flex-direction: column; gap: 16px; margin: 32px 0; }
.post-list-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.2s;
}
.post-list-item:hover { transform: translateX(4px); }
.post-list-item a { color: inherit; text-decoration: none; }
.post-list-image {
  width: 200px;
  min-height: 140px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}
.post-list-content { flex: 1; }
.post-list-content h3 { font-size: 1.15rem; margin-bottom: 6px; }

/* Article (single post view) */
.article { padding: 40px 0 60px; }
.article-header {
  text-align: center;
  margin-bottom: 40px;
}
.article-header h1 {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 20px;
}
.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.article-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.article-cover {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
}
.article-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text);
}
.article-content h1 { font-size: 2rem; margin: 2em 0 0.5em; }
.article-content h2 { font-size: 1.6rem; margin: 1.8em 0 0.5em; }
.article-content h3 { font-size: 1.3rem; margin: 1.5em 0 0.5em; }
.article-content p { margin-bottom: 1.2em; }
.article-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 24px;
  margin: 1.5em 0;
  background: var(--bg-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-secondary);
}
.article-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 0.9rem;
  line-height: 1.6;
}
.article-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}
.article-content p code, .article-content li code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
}
.article-content ul, .article-content ol {
  margin: 1em 0;
  padding-left: 1.5em;
}
.article-content li { margin-bottom: 0.5em; }
.article-content img {
  border-radius: var(--radius);
  margin: 1em 0;
}
.article-content figure {
  margin: 1.5em 0;
  text-align: center;
}
.article-content figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.article-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}
.article-content a { text-decoration: underline; }

.article-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 40px 0;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.article-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all 0.2s;
}
.article-action-btn:hover {
  background: var(--bg-secondary);
  color: var(--text);
}
.article-action-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.05);
}
.article-action-btn.liked {
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

/* Tags */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
}
.tag:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  text-decoration: none;
}

/* Comments */
.comments-section {
  margin-top: 48px;
}
.comments-section h2 {
  font-size: 1.5rem;
  margin-bottom: 24px;
}
.comment {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.comment-author {
  font-weight: 600;
  font-size: 0.9rem;
}
.comment-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.comment-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
}
.comment-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.comment-form {
  margin-bottom: 32px;
}
.comment-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.comment-form textarea:focus { border-color: var(--accent); }
.comment-form .btn { margin-top: 8px; }
.reply-indent { margin-left: 48px; }

/* Forms */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--accent); }
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Auth pages */
.auth-page {
  min-height: calc(100vh - var(--navbar-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}
.auth-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.auth-card .btn { width: 100%; margin-top: 8px; }
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
body.dark-mode .alert-error { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }
body.dark-mode .alert-success { background: #052e16; color: #86efac; border-color: #166534; }

/* Dashboard */
.dashboard-layout {
  display: flex;
  min-height: calc(100vh - var(--navbar-height));
}
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  flex-shrink: 0;
}
.sidebar-nav {
  list-style: none;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}
.sidebar-nav a:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}
.sidebar-nav a.active {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
  border-right: 3px solid var(--accent);
}
.sidebar-nav .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.dashboard-content {
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
}
.dashboard-header {
  margin-bottom: 32px;
}
.dashboard-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
}
.dashboard-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Stat cards */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.stat-card-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
}

/* Editor */
.editor-container {
  display: flex;
  min-height: calc(100vh - var(--navbar-height));
}
.editor-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  gap: 12px;
  flex-wrap: wrap;
}
.editor-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.editor-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.editor-body {
  display: flex;
  flex: 1;
}
.editor-write, .editor-preview {
  flex: 1;
  overflow-y: auto;
}
.editor-write {
  border-right: 1px solid var(--border);
}
.editor-write textarea {
  width: 100%;
  height: 100%;
  min-height: 500px;
  border: none;
  padding: 32px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.7;
  resize: none;
  outline: none;
  background: var(--bg);
  color: var(--text);
}
.editor-preview {
  padding: 32px;
  background: var(--bg-secondary);
}
.editor-title {
  border: none;
  font-size: 2rem;
  font-weight: 700;
  padding: 32px 32px 0;
  outline: none;
  width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}
.editor-title::placeholder { color: var(--text-muted); }
.editor-meta {
  padding: 16px 32px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.editor-meta .form-group { margin: 0; }

/* Tables */
.table-container { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
table th, table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
}
table tr:hover { background: var(--bg-secondary); }

/* Explore tabs */
.explore-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.explore-tab {
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.explore-tab:hover { color: var(--text); text-decoration: none; }
.explore-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}
.empty-state h3 {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.empty-state p { font-size: 0.95rem; }

/* Blog profile */
.blog-header {
  padding: 48px 0 32px;
}
.blog-cover {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: -60px;
}
.blog-profile {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 16px;
}
.blog-info { flex: 1; }
.blog-info h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.blog-info .username {
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.blog-description {
  color: var(--text-secondary);
  margin: 12px 0;
  font-size: 0.95rem;
}
.blog-stats {
  display: flex;
  gap: 24px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.blog-stats strong { color: var(--text); }

/* Notifications */
.notification-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.notification-item:hover { background: var(--bg-secondary); }
.notification-item.unread { background: rgba(37, 99, 235, 0.04); }
.notification-content { flex: 1; font-size: 0.9rem; }
.notification-time { font-size: 0.8rem; color: var(--text-muted); }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  padding: 0 5px;
}
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 24px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-published { background: #dcfce7; color: #166534; }
.badge-draft { background: #fef3c7; color: #92400e; }
.badge-scheduled { background: #dbeafe; color: #1e40af; }
body.dark-mode .badge-published { background: #052e16; color: #86efac; }
body.dark-mode .badge-draft { background: #451a03; color: #fcd34d; }
body.dark-mode .badge-scheduled { background: #172554; color: #93c5fd; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  min-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  overflow: hidden;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}
.dropdown-item:hover {
  background: var(--bg-secondary);
  text-decoration: none;
}
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 40px 0;
}
.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
}
.pagination a:hover { background: var(--bg-secondary); text-decoration: none; }
.pagination .active { background: var(--accent); color: white; border-color: var(--accent); }

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-header h2 { font-size: 1.5rem; font-weight: 700; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 60px;
}

/* Reading time badge */
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Design options */
.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.design-option {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.design-option:hover { border-color: var(--accent); }
.design-option.selected { border-color: var(--accent); background: rgba(37, 99, 235, 0.05); }
.design-option input { display: none; }

/* Color picker */
.color-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.color-option {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.2s;
}
.color-option:hover { transform: scale(1.15); }
.color-option.selected { border-color: var(--text); }
.color-option input { display: none; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: 1.05rem; }
  .post-grid { grid-template-columns: 1fr; }
  .navbar-links { display: none; }
  .search-bar { width: 160px; }
  .search-bar:focus-within { width: 200px; }
  .sidebar { display: none; }
  .dashboard-content { padding: 20px; }
  .article-header h1 { font-size: 2rem; }
  .article-content { font-size: 1rem; }
  .editor-body { flex-direction: column; }
  .editor-write { border-right: none; border-bottom: 1px solid var(--border); }
  .editor-write textarea { min-height: 300px; }
  .editor-toolbar { padding: 8px 16px; }
  .auth-card { padding: 24px; }
  .blog-profile { flex-direction: column; align-items: flex-start; }
  .post-list-item { flex-direction: column; }
  .post-list-image { width: 100%; }
  .container, .container-narrow { padding: 0 16px; }
  .form-row { flex-direction: column; }
  .hero-actions { flex-direction: column; align-items: center; }
}

/* Mobile sidebar toggle */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 8px 0;
}
.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  list-style: none;
}
.mobile-nav-items a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 8px;
}
.mobile-nav-items a.active { color: var(--accent); }
@media (max-width: 768px) {
  .mobile-nav { display: block; }
  body { padding-bottom: 60px; }
}

/* Utility classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.w-full { width: 100%; }
.hidden { display: none; }
.relative { position: relative; }

/* Transition helpers */
.fade-in {
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* View chart */
.chart-container {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
}
.chart-bar {
  flex: 1;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.3s;
  position: relative;
}
.chart-bar:hover { opacity: 0.8; }
.chart-labels {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.chart-label {
  flex: 1;
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
}
