:root {
    --bg: #f6f7fb;
    --card: #fff;
    --text: #1c2434;
    --muted: #5b6577;
    --line: #e6e9f0;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(28, 36, 52, 0.06);
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    overflow-x: hidden;
}
img, video, iframe, embed, object { max-width: 100%; }
img { height: auto; display: block; }
h1, h2, h3, p { overflow-wrap: break-word; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1120px, calc(100% - 24px)); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 72px;
    flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 1.2rem; color: var(--text); }
.brand img { height: 36px; width: auto; }
.site-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-nav a { color: var(--text); font-weight: 600; }
.header-search { margin-left: auto; display: flex; gap: 8px; min-width: 0; flex: 1 1 220px; justify-content: flex-end; }
.header-search input { min-width: 0; flex: 1 1 auto; max-width: 280px; }
.header-search input, .header-search button, .btn, input, textarea, select {
    font: inherit;
}
.header-search input, input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], textarea, select {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}
.btn, .header-search button, button[type="submit"] {
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 700;
}
.btn:hover, .header-search button:hover { background: var(--primary-dark); text-decoration: none; }
.btn-secondary { background: #eef2ff; color: var(--primary-dark); }
.btn-danger { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.nav-toggle { display: none; }
.hero, .card, .article-card, .sidebar-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.home-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; padding: 32px 0 48px; }
.featured { overflow: hidden; }
.featured img { width: 100%; height: 360px; object-fit: cover; }
.featured .pad, .pad, .article-card .pad { padding: 20px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 20px; }
.article-card img { width: 100%; height: 180px; object-fit: cover; border-radius: 12px 12px 0 0; }
.meta, .eyebrow { color: var(--muted); font-size: 0.9rem; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 0.75rem; font-weight: 700; }
.badge-published { background: #dcfce7; color: #166534; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-draft { background: #e5e7eb; color: #374151; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-archived { background: #e2e8f0; color: #334155; }
.badge-spam { background: #ffe4e6; color: #9f1239; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-active { background: #dbeafe; color: #1e40af; }
.badge-suspended { background: #f1f5f9; color: #334155; }
.article-page { padding: 32px 0 64px; max-width: min(800px, 100%); }
.article-body { font-size: 1.05rem; }
.article-body h2, .article-body h3 { margin-top: 1.6em; }
.article-body img { border-radius: 10px; margin: 16px 0; }
.article-body blockquote { border-left: 4px solid var(--primary); padding-left: 16px; color: var(--muted); }
.article-body pre { background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: 10px; overflow: auto; }
.article-body iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; }
.article-body table { display: block; max-width: 100%; overflow-x: auto; }
.article-hero { width: 100%; height: auto; border-radius: var(--radius); max-height: 420px; object-fit: cover; margin: 16px 0; }
.share { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.share a, .share button { background: #eef2ff; color: #1e3a8a; border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; font-weight: 600; }
.comments { margin-top: 40px; }
.comment { border-top: 1px solid var(--line); padding: 16px 0; }
.form-stack { display: grid; gap: 12px; max-width: min(480px, 100%); }
.form-stack input, .form-stack textarea, .form-stack select, .form-stack button { max-width: 100%; }
.alert { padding: 12px 14px; border-radius: 10px; margin: 16px 0; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }
.pagination { display: flex; gap: 8px; flex-wrap: wrap; margin: 32px 0; }
.pagination a, .pagination span { padding: 8px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--text); }
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-wrap { min-height: 70vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(440px, 100%); background: #fff; padding: 28px; border-radius: 16px; box-shadow: var(--shadow); }
.auth-card h1 { margin-top: 0; }
.sidebar-card { padding: 16px; margin-bottom: 16px; }
.sidebar-card h3 { margin-top: 0; }
.popular-item { display: flex; gap: 10px; margin-bottom: 12px; color: var(--text); }
.popular-item img { width: 72px; height: 56px; object-fit: cover; border-radius: 8px; }
.breadcrumb { color: var(--muted); font-size: 0.9rem; margin-bottom: 12px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tags a { background: #eef2ff; color: #1e3a8a; border-radius: 999px; padding: 4px 10px; }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px; margin-top: 16px; }
.honeypot { position: absolute; left: -9999px; }
.error-page { display: grid; place-items: center; min-height: 100vh; }
.error-box { text-align: center; background: #fff; padding: 40px; border-radius: 16px; box-shadow: var(--shadow); }
@media (max-width: 860px) {
    .home-grid { grid-template-columns: 1fr; padding: 20px 0 36px; }
    .nav-toggle { display: inline-flex; align-items: center; margin-left: auto; }
    .site-nav { display: none; width: 100%; flex-direction: column; }
    .site-nav.is-open { display: flex; }
    .header-search { width: 100%; margin: 0; flex: 1 1 100%; justify-content: stretch; }
    .header-search input { flex: 1; min-width: 0; max-width: none; }
    .featured img { height: 200px; }
    .footer-inner { flex-direction: column; align-items: flex-start; }
    .article-page { padding: 20px 0 40px; }
    .article-hero { max-height: 240px; }
    .auth-card { padding: 20px; }
    .error-box { padding: 24px 16px; margin: 16px; }
    .brand { min-width: 0; }
    .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55vw; display: block; }
}
@media (max-width: 480px) {
    .header-inner { min-height: 60px; gap: 10px; }
    .share a, .share button { flex: 1 1 calc(50% - 8px); text-align: center; justify-content: center; }
    .pagination { gap: 6px; }
}
