/* LATEST VISION CMS - Main Stylesheet
   Lightweight, fast, supports dark/light mode
   Designed for low-end devices and slow connections
*/

/* ================== CSS Reset & Base ================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* Light mode (default) */
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --bg-elevated: #ffffff;
  --bg-muted: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-muted: #6b7280;
  --text-soft: #4b5563;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #dbeafe;
  --accent: #7c3aed;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --success: #059669;
  --success-soft: #d1fae5;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --radius: 8px;
  --radius-lg: 12px;
  --container: 1200px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --header-height: 64px;
  --transition: 0.15s ease;
  --bg-card: #ffffff;
  --bg-input: #f9fafb;
}
[data-theme="dark"] {
  --bg: #0d1117;
  --bg-soft: #161b22;
  --bg-elevated: #1c2128;
  --bg-muted: #21262d;
  --bg-card: #161b22;
  --bg-input: rgba(255,255,255,0.06);
  --border: #30363d;
  --border-strong: #484f58;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-soft: #adbac7;
  --primary: #58a6ff;
  --primary-hover: #79b8ff;
  --primary-soft: rgba(88,166,255,.15);
  --accent: #bc8cff;
  --danger: #f85149;
  --danger-soft: rgba(248,81,73,.15);
  --success: #3fb950;
  --success-soft: rgba(63,185,80,.15);
  --warning: #d29922;
  --warning-soft: rgba(210,153,34,.15);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,.3), 0 2px 4px rgba(0,0,0,.2);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.4), 0 4px 6px rgba(0,0,0,.3);
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, picture, video { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }
button { cursor: pointer; font: inherit; }
a[href], summary, select, label[for], input[type="checkbox"], input[type="radio"] { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .6; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
html { scroll-padding-top: 150px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { line-height: 1.3; font-weight: 600; color: var(--text); }
h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
p { margin-bottom: 1rem; }
time { font-size: 0.875rem; color: var(--text-muted); }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 0; top: 0; background: var(--primary); color: #fff; padding: 0.5rem 1rem; z-index: 9999; border-radius: 0 0 8px 0; }

/* ================== Layout ================== */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1rem; width: 100%; }
.container-fluid { max-width: 100%; padding: 0 1rem; }
.main-content { flex: 1; padding: 1.5rem 0; }

/* ================== Header ================== */
.site-header { position: sticky; top: 0; z-index: 90; background: var(--bg); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 76px; padding-top: .75rem; padding-bottom: .75rem; }
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo img, .site-logo { height: 36px; width: auto; max-width: 230px; object-fit: contain; }
.logo-text { font-weight: 850; font-size: 1.4rem; color: var(--primary); letter-spacing: -.04em; white-space: nowrap; }
.header-topics { border-top: 1px solid var(--border); }
.main-nav { display: flex; gap: .3rem 1rem; flex-wrap: wrap; align-items: center; min-width: 0; padding-top: .3rem; padding-bottom: .3rem; }
.nav-link { display: inline-flex; align-items: center; min-height: 40px; padding: .4rem .65rem; border-radius: 5px; color: var(--text-soft); font-weight: 600; white-space: nowrap; font-size: .875rem; }
.nav-link:hover { background: var(--bg-muted); color: var(--primary); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.header-actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; flex-shrink: 0; }
.header-actions .btn { min-height: 44px; }
.header-search { flex: 1; min-width: 100px; max-width: 440px; margin-left: auto; }
.header-search label { display: block; font-size: .68rem; font-weight: 600; margin-bottom: .2rem; color: var(--text-muted); }
.header-search-field { position: relative; }
.header-search input { padding: .65rem 2.8rem .65rem .8rem; min-height: 44px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-soft); color: var(--text); width: 100%; font-size: .875rem; }
.header-search button { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; position: absolute; right: 0; top: 0; border: 0; background: transparent; color: var(--text-soft); }
.header-search input:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.theme-toggle, .header-icon { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 7px; position: relative; color: var(--text); transition: all var(--transition); flex-shrink: 0; }
.theme-toggle:hover, .header-icon:hover { background: var(--bg-muted); }
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
.badge { position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff; font-size: 0.625rem; font-weight: 700; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.header-avatar { display: flex; }
.avatar, .avatar-placeholder { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; }
.avatar-placeholder { color: #fff; font-weight: 700; font-size: 0.875rem; }
.menu-toggle { display: none; }
.public-menu-toggle, .drawer-close { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; border: 0; border-radius: 6px; background: transparent; color: var(--text); }
.public-menu-toggle { display: none; }
.public-menu-toggle:hover, .drawer-close:hover { background: var(--bg-muted); }
.lang-switch-header { display: inline-flex; align-items: center; gap: 2px; }
.lang-switch-header a { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; min-height: 44px; font-size: .75rem; font-weight: 700; color: var(--text-soft); border-radius: 6px; }
.lang-switch-header a.active { background: var(--primary-soft); color: var(--primary); }
.header-admin-link { font-size: .8rem; font-weight: 700; padding: .5rem; }
.drawer-preferences { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: .75rem; margin-top: 1.25rem; font-size: .875rem; }
.drawer-auth { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: 1rem; }
.footer-col h2 { font-size: .95rem; margin-bottom: .75rem; }

/* ================== Buttons ================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.625rem 1.25rem; border: 1px solid transparent; border-radius: 6px; font-weight: 600; font-size: 0.9375rem; cursor: pointer; transition: all var(--transition); background: var(--bg-muted); color: var(--text); text-decoration: none; }
.btn:hover { background: var(--border); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--bg-muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.95); }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-block { width: 100%; display: flex; }
.btn-icon { background: transparent; border: 0; padding: 0.25rem; color: var(--primary); }

/* ================== Flash ================== */
.flash { padding: 0.75rem 1rem; border-radius: 6px; margin: 1rem auto; max-width: var(--container); border: 1px solid; }
.flash-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.flash code { display: block; padding: 0.5rem; background: rgba(0,0,0,.1); border-radius: 4px; margin-top: 0.5rem; word-break: break-all; }

/* ================== Breaking Bar ================== */
.breaking-bar { background: var(--danger); color: #fff; padding: 0.5rem 0; overflow: hidden; font-size: 0.875rem; }
.breaking-label { background: #fff; color: var(--danger); padding: 0.25rem 0.75rem; border-radius: 4px; margin-right: 0.75rem; font-weight: 700; font-size: 0.75rem; display: inline-block; }
.breaking-track { display: inline-flex; gap: 2rem; animation: scroll-x 30s linear infinite; }
.breaking-item { color: #fff; white-space: nowrap; }
.breaking-item:hover { color: rgba(255,255,255,.8); }
@keyframes scroll-x { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .breaking-track { animation: none; } }

/* ================== Hero Section ================== */
.hero-section { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
.hero-article { background: var(--bg-soft); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.hero-image { display: block; }
.hero-content { padding: 1.5rem; }
.hero-title { font-size: 1.75rem; margin: 0.5rem 0; }
.hero-title a { color: var(--text); }
.hero-title a:hover { color: var(--primary); }
.hero-subtitle { color: var(--text-muted); margin-bottom: 0.5rem; }
.hero-side { display: flex; flex-direction: column; gap: 1rem; }
.hero-side-item { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 0.75rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-soft); }
.hero-side-item h3 { font-size: 0.9375rem; margin-bottom: 0.25rem; }
.side-image img { width: 100px; height: 80px; object-fit: cover; border-radius: 6px; }

/* ================== Section Headers ================== */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--primary); }
.section-title { font-size: 1.25rem; font-weight: 700; }
.section-more { font-size: 0.875rem; font-weight: 600; }

/* ================== Article Cards ================== */
.newsroom-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: .5rem 0 1.5rem; }
.newsroom-heading h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; letter-spacing: -.045em; }
.newsroom-edition { margin: 0 0 .3rem; font-size: .8rem; color: var(--text-muted); }
.newsroom-heading .section-more { padding: .6rem 0; white-space: nowrap; }
.news-briefing { display: flex; align-items: flex-start; gap: 1rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: .75rem 0; margin-bottom: 1.5rem; font-size: .8rem; }
.news-briefing > strong { white-space: nowrap; color: var(--primary); }
.news-briefing > div { display: flex; flex-wrap: wrap; gap: .45rem 1.25rem; }
.news-briefing a { color: var(--text-soft); }
.news-briefing a:hover { color: var(--primary); text-decoration: underline; }
.news-lead-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 2rem; padding-bottom: 2rem; margin-bottom: 2rem; border-bottom: 1px solid var(--border); }
.news-lead { min-width: 0; }
.news-lead-image { display: block; overflow: hidden; border-radius: 8px; aspect-ratio: 16/9; margin-bottom: 1.15rem; background: var(--bg-muted); }
.news-lead-image picture, .news-lead-image img { height: 100%; width: 100%; object-fit: cover; }
.news-category { display: inline-block; margin-bottom: .45rem; font-size: .73rem; font-weight: 700; color: var(--primary); }
.news-lead h2 { font-size: clamp(1.45rem, 2.5vw, 2rem); letter-spacing: -.035em; line-height: 1.24; margin-bottom: .7rem; }
.news-lead h2 a, .news-side-story h2 a, .news-story h3 a, .popular-news-list h3 a { color: var(--text); }
.news-lead h2 a:hover, .news-side-story h2 a:hover, .news-story h3 a:hover, .popular-news-list h3 a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.news-lead-body > p { font-size: .93rem; line-height: 1.65; color: var(--text-soft); margin-bottom: .8rem; }
.news-lead-text { background: var(--bg-soft); border-radius: 8px; padding: 2rem; display: flex; align-items: center; min-height: 300px; }
.news-lead-text h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
.news-lead-side { display: flex; flex-direction: column; min-width: 0; }
.news-side-story { display: flex; align-items: flex-start; gap: 1rem; padding: 1.15rem 0; border-bottom: 1px solid var(--border); }
.news-side-story:first-child { padding-top: 0; }
.news-side-story:last-child { border-bottom: 0; padding-bottom: 0; }
.news-side-story > div { flex: 1; min-width: 0; }
.news-side-story h2 { font-size: 1.1rem; line-height: 1.4; letter-spacing: -.02em; margin-bottom: .5rem; }
.news-side-story time { font-size: .75rem; }
.news-side-image { width: 104px; flex-shrink: 0; aspect-ratio: 4/3; border-radius: 5px; overflow: hidden; }
.news-side-image picture, .news-side-image img { width: 100%; height: 100%; object-fit: cover; }
.newsroom-columns { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2.5rem; align-items: start; }
.newsroom-primary, .newsroom-sidebar { min-width: 0; }
.news-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; padding-bottom: .8rem; border-bottom: 2px solid var(--text); }
.news-section-heading h2 { font-size: 1.25rem; font-weight: 750; letter-spacing: -.02em; }
.news-section-heading > span, .news-section-heading > a { font-size: .75rem; color: var(--text-muted); }
.news-section-heading > a { color: var(--primary); padding: .35rem 0; }
.news-story { display: flex; gap: 1.5rem; align-items: flex-start; padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.news-story:first-child { padding-top: .25rem; }
.news-story-text { flex: 1; min-width: 0; }
.news-story h3 { font-size: 1.15rem; line-height: 1.42; letter-spacing: -.02em; margin-bottom: .45rem; }
.news-story p { font-size: .84rem; line-height: 1.65; margin-bottom: .55rem; color: var(--text-soft); }
.news-story-image { width: 160px; aspect-ratio: 3/2; flex-shrink: 0; border-radius: 6px; overflow: hidden; margin-top: .2rem; }
.news-story-image picture, .news-story-image img { width: 100%; height: 100%; object-fit: cover; }
.news-all-link { margin-top: 1.25rem; min-height: 44px; }
.news-side-section { margin-bottom: 2rem; }
.news-side-section > h2 { font-size: 1rem; font-weight: 750; padding-bottom: .75rem; margin-bottom: .85rem; border-bottom: 1px solid var(--border-strong); }
.popular-news-list li { display: flex; gap: 1rem; margin-bottom: 1.2rem; }
.popular-news-number { font-size: 1.4rem; line-height: 1.2; font-weight: 750; color: var(--text-muted); }
.popular-news-list h3 { font-size: .9rem; line-height: 1.5; font-weight: 650; margin-bottom: .25rem; }
.news-read-count { font-size: .72rem; color: var(--text-muted); }
.news-topic-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.news-topic-links a { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem .8rem; border: 1px solid var(--border); border-radius: 6px; color: var(--text-soft); font-size: .8rem; }
.news-topic-links a:hover { background: var(--bg-muted); border-color: var(--primary); color: var(--primary); }
.news-help-links { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: 1.5rem; }
.news-help-links a { color: var(--text-muted); font-size: .75rem; padding: .35rem 0; }
.home-community-preview { margin-top: 3rem; }
.home-community-preview .thread-card { border-radius: 0; border-width: 0 0 1px; padding-left: 0; padding-right: 0; }
.home-quick-composer { display: flex; align-items: center; gap: .9rem; width: 100%; padding: 1rem; border: 1px solid var(--border); background: var(--bg-soft); border-radius: 8px; color: var(--text-soft); font-size: .85rem; text-align: left; }
.home-quick-composer > span { flex: 1; }
.home-quick-composer strong { color: var(--primary); white-space: nowrap; }
.guest-community-invitation { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.2rem; margin-top: 1.5rem; background: var(--bg-soft); border-radius: 8px; }
.guest-community-invitation p { color: var(--text-soft); font-size: .84rem; max-width: 360px; margin: 0; }
.home-suggested-users { display: flex; flex-direction: column; gap: 1rem; }
.home-suggested-user { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.home-suggested-user > a { display: flex; align-items: center; gap: .6rem; min-width: 0; color: var(--text); font-size: .8rem; font-weight: 600; }
.home-suggested-user small { display: block; color: var(--text-muted); font-weight: 400; }
.home-suggested-user .avatar, .home-suggested-user .avatar-placeholder { flex-shrink: 0; }
.widget-block { margin: 0 0 1.5rem; color: var(--text-soft); font-size: .85rem; }
.widget-title { font-size: 1rem; margin-bottom: .85rem; padding-bottom: .7rem; border-bottom: 1px solid var(--border); }
.widget-link-list { display: flex; flex-direction: column; gap: .8rem; }
.widget-link-list a { color: var(--text); line-height: 1.5; }
.widget-link-list a:hover { color: var(--primary); text-decoration: underline; }
.widget-link-list small { display: block; margin-top: .2rem; font-size: .72rem; color: var(--text-muted); }
.widget-stat-list { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; margin-bottom: .8rem; }
.widget-stat-list dd { font-weight: 700; color: var(--text); }
.widget-header-area { padding-top: 1rem; }
.widget-footer-area { padding-bottom: 1rem; }
@media (max-width: 1100px) {
  .header-actions .lang-switch-header { display: none; }
  .header-inner { gap: 1rem; }
  .newsroom-columns { grid-template-columns: minmax(0, 1fr) 250px; gap: 1.5rem; }
  .news-lead-grid { gap: 1.5rem; }
  .news-side-image { width: 80px; }
}
@media (max-width: 900px) {
  .newsroom-columns { grid-template-columns: minmax(0, 1fr); }
  .newsroom-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1rem; }
  .news-story-image { width: 150px; }
}
@media (max-width: 640px) {
  .newsroom-heading { margin-top: 0; }
  .news-lead-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .news-lead-text { padding: 1.35rem; min-height: 260px; }
  .newsroom-sidebar { display: block; }
  .news-side-image { width: 100px; }
  .news-story { gap: .85rem; }
  .news-story-image { width: 105px; }
  .news-story h3 { font-size: 1rem; }
  .news-story p { display: none; }
  .news-story .article-meta { font-size: .7rem; gap: .3rem; }
  .news-story .article-meta time { font-size: .7rem; }
  .news-briefing { display: block; }
  .news-briefing > strong { display: block; margin-bottom: .45rem; }
}
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.article-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform var(--transition), box-shadow var(--transition); }
.article-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-image { display: block; aspect-ratio: 16/10; overflow: hidden; background: var(--bg-muted); }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.article-card:hover .card-image img { transform: scale(1.05); }
.card-body { padding: 1rem; }
.card-title { font-size: 1.0625rem; margin-bottom: 0.5rem; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary); }
.card-excerpt { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 0.75rem; }
.article-meta { display: flex; gap: 0.5rem; align-items: center; font-size: 0.8125rem; color: var(--text-muted); flex-wrap: wrap; }
.article-meta span { white-space: nowrap; }
.category-tag { display: inline-block; padding: 0.25rem 0.75rem; background: color-mix(in srgb, var(--cat-color, var(--primary)) 15%, transparent); color: var(--cat-color, var(--primary)); border-radius: 999px; font-size: 0.75rem; font-weight: 600; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.03em; }
.category-tag-small { display: inline-block; padding: 0.125rem 0.5rem; background: color-mix(in srgb, var(--cat-color, var(--primary)) 15%, transparent); color: var(--cat-color, var(--primary)); border-radius: 4px; font-size: 0.75rem; font-weight: 600; margin-bottom: 0.5rem; }

/* ================== Article List (popular) ================== */
.article-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2rem; }
.article-list-item { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; padding: 0.75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-soft); }
.list-image img { width: 100%; height: 80px; object-fit: cover; border-radius: 6px; }
.list-body h3 { font-size: 0.9375rem; margin-bottom: 0.25rem; }

/* ================== Category Section ================== */
.categories-section { margin-bottom: 2rem; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.category-card { display: flex; flex-direction: column; align-items: center; padding: 1.5rem 1rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); transition: all var(--transition); border-top: 3px solid var(--cat-color, var(--primary)); }
.category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.category-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.category-name { font-weight: 600; }

/* ================== Community Preview ================== */
.community-preview { padding: 2rem; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--bg)), color-mix(in srgb, var(--accent) 10%, var(--bg))); border-radius: var(--radius-lg); margin-bottom: 2rem; border: 1px solid var(--border); }
.community-cta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.community-cta p { margin: 0; flex: 1; min-width: 200px; }

/* ================== Pagination ================== */
.pagination { display: flex; gap: 0.25rem; justify-content: center; margin: 2rem 0; flex-wrap: wrap; }
.pagination a { padding: 0.5rem 0.875rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 0.875rem; }
.pagination a:hover, .pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ================== Footer ================== */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 2rem 0 1rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; padding-bottom: 2rem; }
.footer-col { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col h4 { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.75rem; }
.footer-col a { color: var(--text-soft); font-size: 0.875rem; }
.footer-col a:hover { color: var(--primary); }
.footer-desc { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.5rem; }
.footer-bottom { padding-top: 1.5rem; border-top: 1px solid var(--border); text-align: center; font-size: 0.8125rem; color: var(--text-muted); }

/* ================== Article Detail ================== */
.article-detail { max-width: 800px; margin: 0 auto; }
.article-header { margin-bottom: 1.5rem; }
.article-title { font-size: 2.25rem; margin: 0.75rem 0; line-height: 1.2; }
.article-subtitle { font-size: 1.125rem; color: var(--text-muted); margin-bottom: 1rem; }
.article-meta-bar { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.author-info { display: flex; align-items: center; gap: 0.75rem; }
.author-name { font-weight: 600; }
.article-time { font-size: 0.8125rem; color: var(--text-muted); }
.article-featured-image { margin: 1.5rem 0; }
.article-featured-image img { width: 100%; border-radius: var(--radius); }
.article-featured-image figcaption { font-size: 0.8125rem; color: var(--text-muted); text-align: center; margin-top: 0.5rem; }
.article-content { font-size: 1.0625rem; line-height: 1.75; }
.article-content p { margin-bottom: 1.25rem; }
.article-content h2 { margin: 1.5rem 0 0.75rem; font-size: 1.5rem; }
.article-content h3 { margin: 1.25rem 0 0.5rem; font-size: 1.25rem; }
.article-content img { margin: 1.5rem auto; border-radius: var(--radius); max-width: 100%; }
.article-content blockquote { border-left: 4px solid var(--primary); padding: 0.5rem 1rem; background: var(--bg-soft); margin: 1rem 0; font-style: italic; }
.article-content ul, .article-content ol { margin-left: 1.5rem; margin-bottom: 1rem; }
.article-content ul li { list-style: disc; margin-bottom: 0.25rem; }
.article-content ol li { list-style: decimal; margin-bottom: 0.25rem; }
.article-content a { text-decoration: underline; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.article-content th, .article-content td { padding: 0.5rem; border: 1px solid var(--border); text-align: left; }
.article-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0; }
.tag-pill { padding: 0.25rem 0.75rem; background: var(--bg-muted); color: var(--text-soft); border-radius: 999px; font-size: 0.8125rem; font-weight: 500; }
.tag-pill:hover { background: var(--primary); color: #fff; }
.article-actions { display: flex; gap: 0.75rem; padding: 1rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 1.5rem 0; }
.action-btn { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.5rem 0.875rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); font-size: 0.875rem; transition: all var(--transition); }
.action-btn:hover { background: var(--bg-muted); color: var(--primary); }
.action-btn.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.related-section { margin-top: 2rem; }

/* ================== Comments ================== */
.comments-section { max-width: 800px; margin: 2rem auto; padding-top: 2rem; border-top: 1px solid var(--border); }
.comments-title { margin-bottom: 1rem; }
.comment-form { margin-bottom: 1.5rem; }
.comment-form textarea { width: 100%; padding: 0.75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; min-height: 80px; resize: vertical; }
.comment-form textarea:focus { outline: 2px solid var(--primary); }
.comment-form-actions { margin-top: 0.5rem; text-align: right; }
.comment-login-prompt { padding: 1rem; background: var(--bg-soft); border-radius: 8px; text-align: center; margin-bottom: 1.5rem; }
.comment-sort { margin-bottom: 1rem; }
.comment-sort select { padding: 0.375rem 0.5rem; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--text); }
.comments-list { display: flex; flex-direction: column; gap: 1rem; }
.comment-item { padding: 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.comment-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; font-size: 0.875rem; }
.comment-header .username { font-weight: 600; color: var(--text); }
.comment-content { margin: 0.5rem 0; }
.comment-actions { display: flex; gap: 1rem; font-size: 0.8125rem; }
.comment-actions button { background: transparent; border: 0; color: var(--text-muted); padding: 0.25rem 0; }
.comment-actions button:hover { color: var(--primary); }
.comments-loading { padding: 1rem; text-align: center; color: var(--text-muted); }

/* ================== Auth Pages ================== */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--bg)), color-mix(in srgb, var(--accent) 10%, var(--bg))); padding: 1rem; }
.auth-container { width: 100%; max-width: 420px; }
.auth-card { background: var(--bg); padding: 2rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.auth-logo { display: block; text-align: center; margin-bottom: 1.5rem; }
.auth-logo img { height: 48px; margin: 0 auto; }
.auth-heading { text-align: center; margin-bottom: 1.5rem; font-size: 1.5rem; }
.auth-form .form-group { margin-bottom: 1rem; }
.auth-form .form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-size: 0.875rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.875rem; color: var(--text-muted); }

/* ================== Forms ================== */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.375rem; font-weight: 500; font-size: 0.875rem; }
.form-group input[type="text"], .form-group input[type="email"], .form-group input[type="password"], .form-group input[type="url"], .form-group input[type="number"], .form-group input[type="search"], .form-group select, .form-group textarea { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; transition: border-color var(--transition); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-col-3 { grid-column: span 3; }
.form-col-1 { grid-column: span 1; }
.checkbox-row { padding: 0.5rem 0; }
.checkbox { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; cursor: pointer; }
.checkbox input { width: auto; }
fieldset { border: 1px solid var(--border); padding: 1rem; border-radius: 8px; margin-bottom: 1rem; }
legend { font-weight: 600; padding: 0 0.5rem; font-size: 0.9375rem; }
.link { font-weight: 600; font-size: 0.875rem; }
.btn-block { width: 100%; }

/* ================== Profile ================== */
.profile-page { max-width: 1000px; margin: 0 auto; }
.profile-header { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; overflow: hidden; margin-bottom: 1.5rem; }
.profile-cover { height: 200px; background: linear-gradient(135deg, var(--primary), var(--accent)); background-size: cover; }
.profile-main { display: grid; grid-template-columns: 120px 1fr auto; gap: 1.5rem; padding: 1.5rem; align-items: start; }
.profile-avatar img, .profile-avatar .avatar-placeholder { width: 120px; height: 120px; border-radius: 50%; border: 4px solid var(--bg); margin-top: -60px; background: var(--bg); }
.profile-name { font-size: 1.5rem; margin-bottom: 0.25rem; }
.profile-username { color: var(--text-muted); margin-bottom: 0.75rem; }
.profile-bio { margin-bottom: 0.75rem; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.profile-stats { display: flex; gap: 1.5rem; margin-bottom: 0.75rem; }
.profile-stats strong { display: block; font-size: 1.125rem; }
.profile-stats span { font-size: 0.8125rem; color: var(--text-muted); }
.profile-socials { display: flex; gap: 0.5rem; }
.social-link { padding: 0.25rem 0.75rem; background: var(--bg-muted); border-radius: 6px; font-size: 0.8125rem; color: var(--text-soft); }
.profile-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.profile-articles { margin-top: 2rem; }
.profile-edit-page { max-width: 700px; margin: 0 auto; }
.profile-form { background: var(--bg-soft); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); }
.current-avatar { margin-top: 0.5rem; }
.settings-page { max-width: 700px; margin: 0 auto; }
.settings-form { background: var(--bg-soft); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 1.5rem; }
.api-tokens-page { max-width: 800px; margin: 0 auto; }
.token-create-form { background: var(--bg-soft); padding: 1rem; border-radius: 8px; margin-bottom: 1.5rem; border: 1px solid var(--border); }
.token-display { display: block; padding: 0.5rem; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; margin-top: 0.5rem; }

/* ================== Community / Threads ================== */
.community-page { max-width: 800px; margin: 0 auto; }
.community-header { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.feed-filters { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; overflow-x: auto; }
.feed-filters a { padding: 0.5rem 0.875rem; border-radius: 6px; color: var(--text-soft); font-weight: 500; font-size: 0.875rem; white-space: nowrap; }
.feed-filters a.active { background: var(--primary); color: #fff; }
.thread-composer { display: grid; grid-template-columns: 40px 1fr; gap: 0.75rem; padding: 1rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1.5rem; }
.composer-input textarea { width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; resize: vertical; min-height: 60px; padding: 0.25rem; }
.composer-input textarea:focus { outline: 0; }
.composer-link-input { width: 100%; padding: 0.375rem 0.5rem; border: 1px solid var(--border); border-radius: 4px; margin-top: 0.5rem; background: var(--bg); color: var(--text); font-size: 0.875rem; }
.composer-actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.composer-attach { cursor: pointer; padding: 0.375rem 0.75rem; background: var(--bg-muted); border-radius: 4px; font-size: 0.8125rem; }
.composer-attach input { display: none; }
.char-counter { flex: 1; text-align: right; font-size: 0.8125rem; color: var(--text-muted); }
.composer-login-prompt { padding: 1rem; text-align: center; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1.5rem; }
.thread-feed { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--border); }
.thread-card { display: grid; grid-template-columns: 40px 1fr; gap: 0.75rem; padding: 1rem 0.5rem; border-bottom: 1px solid var(--border); }
.thread-avatar a { display: block; }
.thread-header { display: flex; align-items: center; gap: 0.375rem; font-size: 0.875rem; flex-wrap: wrap; }
.thread-author { font-weight: 600; color: var(--text); }
.thread-author:hover { color: var(--primary); }
.thread-username, .thread-time { color: var(--text-muted); }
.thread-content { margin: 0.5rem 0; white-space: pre-wrap; word-wrap: break-word; }
.thread-link { display: block; padding: 0.5rem 0.75rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px; font-size: 0.875rem; color: var(--primary); margin: 0.5rem 0; }
.thread-media { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0.5rem 0; }
.thread-media img { width: 100%; height: auto; border-radius: 6px; }
.thread-actions { display: flex; gap: 1.5rem; margin-top: 0.5rem; }
.thread-action { display: inline-flex; align-items: center; gap: 0.25rem; background: transparent; border: 0; color: var(--text-muted); font-size: 0.8125rem; padding: 0.25rem 0; cursor: pointer; }
.thread-action:hover, .thread-action.active { color: var(--primary); }
.empty-state { text-align: center; padding: 2rem; color: var(--text-muted); }

/* ================== Forum ================== */
.forum-page, .forum-category-page, .forum-thread-page, .forum-create-page { max-width: 1000px; margin: 0 auto; }
.forum-categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.forum-category-card { display: flex; flex-direction: column; align-items: center; padding: 1.5rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); transition: all var(--transition); border-top: 3px solid var(--cat-color, var(--accent)); }
.forum-category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.forum-category-card .cat-icon { font-size: 2rem; }
.forum-category-card .cat-name { font-weight: 600; margin: 0.5rem 0 0.25rem; }
.forum-category-card .cat-count { font-size: 0.8125rem; color: var(--text-muted); }
.forum-thread-list { display: flex; flex-direction: column; gap: 0.5rem; }
.forum-thread-item { padding: 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; transition: box-shadow var(--transition); }
.forum-thread-item:hover { box-shadow: var(--shadow-sm); }
.forum-thread-item h3 { margin-bottom: 0.25rem; }
.forum-thread-item .thread-meta { font-size: 0.8125rem; color: var(--text-muted); }
.pin-badge { display: inline-block; padding: 0.125rem 0.5rem; background: var(--warning-soft); color: var(--warning); border-radius: 4px; font-size: 0.75rem; margin-right: 0.5rem; }
.forum-filters { display: flex; gap: 0.5rem; margin-bottom: 1rem; align-items: center; }
.forum-filters a { padding: 0.375rem 0.75rem; border-radius: 6px; background: var(--bg-soft); color: var(--text); font-size: 0.875rem; }
.forum-filters a.active { background: var(--primary); color: #fff; }
.forum-thread-page .thread-header { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.forum-post { display: grid; grid-template-columns: 48px 1fr; gap: 1rem; padding: 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; }
.forum-post.original-post { background: var(--bg-soft); }
.forum-post.accepted { border-color: var(--success); border-width: 2px; }
.accepted-badge { display: inline-block; padding: 0.25rem 0.75rem; background: var(--success-soft); color: var(--success); border-radius: 4px; font-size: 0.8125rem; font-weight: 600; margin-bottom: 0.5rem; }
.post-content { margin: 0.5rem 0; white-space: pre-wrap; }
.post-actions { display: flex; gap: 1rem; margin-top: 0.5rem; }
.post-action { background: transparent; border: 0; color: var(--text-muted); font-size: 0.8125rem; cursor: pointer; padding: 0.25rem 0; }
.post-action:hover { color: var(--primary); }
.reply-form { padding: 1rem; background: var(--bg-soft); border-radius: 8px; margin-bottom: 1.5rem; }
.reply-form textarea { width: 100%; min-height: 120px; padding: 0.5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; margin-bottom: 0.5rem; }
.thread-toolbar { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

/* ================== Search ================== */
.search-page { max-width: 1000px; margin: 0 auto; }
.search-form { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.search-form input, .search-form select { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.search-form input[type="search"] { flex: 1; }
.user-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.user-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.user-name { font-weight: 600; }
.user-username { font-size: 0.8125rem; color: var(--text-muted); }

/* ================== Notifications ================== */
.notifications-page { max-width: 800px; margin: 0 auto; }
.notifications-page .page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.notification-list { display: flex; flex-direction: column; gap: 0.5rem; }
.notification-item { display: grid; grid-template-columns: 36px 1fr auto; gap: 0.75rem; padding: 0.75rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.notification-item.unread { background: color-mix(in srgb, var(--primary) 5%, var(--bg)); border-color: var(--primary); }
.notif-link { color: var(--text); }
.notif-link:hover { color: var(--primary); }
.notif-text { margin: 0; font-size: 0.9375rem; }
.notif-time { font-size: 0.75rem; color: var(--text-muted); display: block; margin-top: 0.25rem; }
.notif-mark button { background: var(--primary); color: #fff; border: 0; border-radius: 50%; width: 24px; height: 24px; padding: 0; font-size: 0.625rem; cursor: pointer; }

/* ================== Error Pages ================== */
.error-page { text-align: center; padding: 4rem 1rem; max-width: 600px; margin: 0 auto; }
.error-code { font-size: 6rem; font-weight: 800; color: var(--primary); line-height: 1; }
.error-title { font-size: 1.5rem; margin: 1rem 0 0.5rem; }
.error-message { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ================== Data Tables ================== */
.data-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.data-table th, .data-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.data-table th { background: var(--bg-soft); font-weight: 600; color: var(--text-soft); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.03em; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover { background: var(--bg-soft); }
.data-table .actions { white-space: nowrap; display: flex; gap: 0.25rem; }
.status-badge { display: inline-block; padding: 0.125rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; background: var(--bg-muted); color: var(--text-soft); }
.status-badge.status-published, .status-badge.status-active, .status-badge.status-approved, .status-badge.status-resolved { background: var(--success-soft); color: var(--success); }
.status-badge.status-pending, .status-badge.status-reviewing { background: var(--warning-soft); color: var(--warning); }
.status-badge.status-rejected, .status-badge.status-banned, .status-badge.status-deleted, .status-badge.status-hidden, .status-badge.status-spam, .status-badge.status-suspended { background: var(--danger-soft); color: var(--danger); }
.role-badge { background: var(--primary-soft); color: var(--primary); padding: 0.125rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.type-badge { display: inline-block; padding: 0.125rem 0.5rem; background: var(--bg-muted); border-radius: 4px; font-size: 0.75rem; color: var(--text-soft); }
.color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 0.5rem; }
.filter-tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; overflow-x: auto; }
.filter-tabs a { padding: 0.375rem 0.75rem; border-radius: 6px; color: var(--text-soft); font-size: 0.875rem; font-weight: 500; white-space: nowrap; }
.filter-tabs a.active { background: var(--primary); color: #fff; }
.filter-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.filter-form input, .filter-form select { padding: 0.375rem 0.5rem; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--text); font: inherit; }
.inline-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.5rem; padding: 1rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 1.5rem; }

/* ================== Admin ================== */
.admin-body { background: var(--bg-soft); color: var(--text); }
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--bg); border-right: 1px solid var(--border); padding: 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-logo { padding: 0.5rem 1rem; margin-bottom: 1rem; }
.admin-logo img { height: 32px; }
.admin-nav { display: flex; flex-direction: column; gap: 0.125rem; }
.admin-nav a { padding: 0.5rem 0.75rem; border-radius: 6px; color: var(--text-soft); font-size: 0.875rem; font-weight: 500; }
.admin-nav a:hover, .admin-nav a.active { background: var(--primary); color: #fff; }
.admin-nav hr { border: 0; border-top: 1px solid var(--border); margin: 0.5rem 0; }
.admin-main { display: flex; flex-direction: column; }
.admin-header { background: var(--bg); border-bottom: 1px solid var(--border); padding: 0.75rem 1.5rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 10; }
.admin-title { flex: 1; font-size: 1.125rem; margin: 0; }
.admin-header-actions { display: flex; align-items: center; gap: 0.75rem; }
.admin-user { display: flex; align-items: center; gap: 0.5rem; color: var(--text); }
.admin-content { padding: 1.5rem; flex: 1; }
.admin-menu-toggle { display: none; background: transparent; border: 0; color: var(--text); }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.5rem; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { display: flex; flex-direction: column; align-items: center; padding: 1.5rem 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); transition: all var(--transition); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }
.dashboard-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.dashboard-section { background: var(--bg); padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); }
.dashboard-section h2 { font-size: 1rem; margin-bottom: 1rem; }
.health-list { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; font-size: 0.875rem; }
.health-list dt { color: var(--text-muted); font-weight: 500; }
.health-list dd { color: var(--text); }
.recommendations-list, .slow-queries-list { list-style: none; padding: 0; font-size: 0.8125rem; }
.recommendations-list li { padding: 0.5rem; border-radius: 4px; margin-bottom: 0.25rem; }
.recommendation-warning { background: var(--warning-soft); color: var(--warning); }
.recommendation-info { background: var(--primary-soft); color: var(--primary); }
.slow-queries-list li { font-family: monospace; padding: 0.5rem; background: var(--bg-soft); border-radius: 4px; margin-bottom: 0.25rem; overflow-x: auto; }
.report-list { font-size: 0.875rem; }
.report-list li { padding: 0.5rem; border-bottom: 1px solid var(--border); }
.cache-actions, .db-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.moderator-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.menu-items-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.menu-items-list li { display: flex; gap: 0.5rem; align-items: center; padding: 0.5rem; background: var(--bg-soft); border-radius: 4px; font-size: 0.875rem; }
.menu-items-list code { background: var(--bg-muted); padding: 0.125rem 0.5rem; border-radius: 4px; }

/* ================== Responsive ================== */
@media (max-width: 1024px) {
  .hero-section { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-sections { grid-template-columns: 1fr; }
  .article-list { grid-template-columns: 1fr; }
  .moderator-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .public-menu-toggle { display: inline-flex; }
  .header-inner { gap: .6rem; flex-wrap: wrap; padding-top: .6rem; padding-bottom: .6rem; }
  .header-search { order: 4; flex: 1 0 100%; max-width: none; margin: 0; }
  .header-search label { display: none; }
  .header-actions { gap: .45rem; }
  .header-actions .lang-switch-header, .header-admin-link { display: none; }
  .header-login { display: none; }
  .main-nav { gap: 0 .3rem; }
  .nav-link { font-size: .78rem; min-height: 38px; padding: .35rem .5rem; }
  .logo-text { font-size: 1.18rem; }
  .logo img, .site-logo { height: 30px; max-width: 175px; }
  .hero-title { font-size: 1.375rem; }
  .article-title { font-size: 1.75rem; }
  .article-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .profile-main { grid-template-columns: 80px 1fr; }
  .profile-avatar img, .profile-avatar .avatar-placeholder { width: 80px; height: 80px; }
  .profile-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; position: fixed; z-index: 1000; width: 240px; box-shadow: var(--shadow-lg); }
  .admin-sidebar.open { display: block; }
  .admin-menu-toggle { display: inline-flex; }
  .form-row { grid-template-columns: 1fr; }
  .thread-media { grid-template-columns: 1fr; }
  .search-form { flex-direction: column; }
  .community-cta { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  .hero-title { font-size: 1.25rem; }
  .article-title { font-size: 1.5rem; }
  .card-body { padding: 0.75rem; }
  .auth-card { padding: 1.5rem; }
  .comment-actions { gap: 0.5rem; flex-wrap: wrap; }
  .thread-actions { gap: 0.75rem; }
  .header-inner { gap: .3rem; }
  .logo-text { font-size: 1.05rem; }
  .header-actions .btn { padding-left: .65rem; padding-right: .65rem; }
  .header-actions .theme-toggle { width: 40px; }
}

/* Print */
@media print {
  .site-header, .site-footer, .breaking-bar, .article-actions, .comments-section, .related-section { display: none; }
  .main-content { padding: 0; }
  body { color: #000; background: #fff; }
}

/* ============================================================
   LATEST VISION CMS - SOCIAL MEDIA, CAROUSEL, VIDEO EMBEDS
   ============================================================ */

/* Multi-Image Carousel */
.thread-carousel {
  position: relative;
  width: 100%;
  max-height: 480px;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--border, #334155);
}

.carousel-track {
  width: 100%;
  min-height: 250px;
  max-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-slide {
  display: none;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
}

.carousel-slide.active {
  display: flex;
}

.carousel-img {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s, transform 0.15s;
}

.carousel-nav-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: translateY(-50%) scale(1.1);
}

.carousel-nav-btn.prev {
  left: 10px;
}

.carousel-nav-btn.next {
  right: 10px;
}

.carousel-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.carousel-dot.active {
  background: #3b82f6;
  width: 20px;
  border-radius: 10px;
}

/* Video Embeds (YouTube, etc.) */
.video-embed-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 10px;
  margin-top: 12px;
  background: #000;
  border: 1px solid var(--border, #334155);
}

.video-embed-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Inline Follow Button */
.btn-follow-inline {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--primary, #3b82f6);
  background: transparent;
  color: var(--primary, #3b82f6);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-follow-inline:hover {
  background: var(--primary, #3b82f6);
  color: #fff;
}

.btn-follow-inline.following {
  background: rgba(59, 130, 246, 0.12);
  color: var(--text-muted, #94a3b8);
  border-color: var(--border, #334155);
}

.btn-follow-inline.following:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: #ef4444;
}

/* Repost Indicator */
.repost-indicator {
  font-size: 0.82rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.repost-indicator a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

/* Hashtags & Mentions */
.hashtag {
  color: var(--primary, #3b82f6);
  text-decoration: none;
  font-weight: 500;
}
.hashtag:hover {
  text-decoration: underline;
}

.mention {
  color: #8b5cf6;
  text-decoration: none;
  font-weight: 600;
}
.mention:hover {
  text-decoration: underline;
}

/* Interactive Active Button States */
.thread-action.like-action.active svg,
.action-btn.like-btn.active svg {
  fill: #ef4444 !important;
  stroke: #ef4444 !important;
}

.thread-action.repost-action.active svg {
  stroke: #10b981 !important;
}

.thread-action.bookmark-action.active svg,
.action-btn.bookmark-btn.active svg {
  fill: #f59e0b !important;
  stroke: #f59e0b !important;
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

/* Responsive grid for hybrid layout */
@media (max-width: 900px) {
  .hybrid-layout {
    grid-template-columns: 1fr !important;
  }
  .feed-sidebar-col {
    margin-top: 24px;
  }
}
