:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #eef2ff;
    --surface-3: #f8fbff;
    --text: #162033;
    --muted: #60708a;
    --primary: #173b8f;
    --primary-2: #1f57d6;
    --accent: #f59e0b;
    --border: #dbe4f0;
    --success: #0f9f6e;
    --danger: #c03a2b;
    --shadow: 0 18px 45px rgba(17, 24, 39, 0.08);
    --shadow-soft: 0 10px 28px rgba(17, 24, 39, 0.05);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(circle at top left, #f8fbff, var(--bg) 42%);
    color: var(--text);
    line-height: 1.65;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); }
img { max-width: 100%; display: block; }
.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.narrow { width: min(780px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
    position: sticky; top: 0; z-index: 20;
    background: rgba(245,247,251,0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(219,228,240,0.9);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand-badge {
    width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: white; font-weight: 700;
    box-shadow: var(--shadow);
}
.brand strong { display: block; font-size: 1rem; }
.brand small { display: block; color: var(--muted); font-size: 0.8rem; }
.main-nav { display: flex; align-items: center; gap: 20px; }
.main-nav a { color: var(--text); font-weight: 600; }
.main-nav a.active { color: var(--primary-2); }
.nav-button {
    padding: 10px 16px; border-radius: 999px; background: var(--primary); color: white !important;
}
.mobile-nav-toggle { display: none; }
.hero { padding: 72px 0 30px; }
.hero-grid, .grid { display: grid; gap: 24px; }
.hero-grid { grid-template-columns: 1.2fr .95fr; align-items: center; }
.hero-v3 { padding-top: 82px; }
.hero-showcase {
    background: linear-gradient(180deg, #ffffff, #eef5ff);
    position: relative;
    overflow: hidden;
}
.hero-showcase::after {
    content: "";
    position: absolute;
    inset: auto -60px -60px auto;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(31,87,214,.18), rgba(31,87,214,0));
}
.showcase-list { display: grid; gap: 18px; }
.showcase-list div { padding: 16px; border-radius: 18px; background: rgba(255,255,255,.78); border: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.showcase-list p { margin-bottom: 0; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-top: 24px; }
.stat-mini { padding: 16px 18px; border-radius: 20px; }
.stat-mini strong { display: block; font-size: 1.4rem; color: var(--primary); }
.stat-mini span { color: var(--muted); font-size: .92rem; }
.eyebrow { display: inline-block; margin-bottom: 12px; color: var(--primary-2); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: clamp(2rem, 4vw, 3.7rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p { margin-top: 0; color: var(--muted); }
.hero p { font-size: 1.08rem; max-width: 690px; }
.hero-actions, .form-actions, .banner-actions, .quick-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 18px; border-radius: 14px; border: 1px solid transparent; font-weight: 700; cursor: pointer; font: inherit;
}
.button-small { padding: 9px 12px; border-radius: 12px; font-size: .92rem; }
.button.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: white; }
.button.secondary { background: white; border-color: var(--border); color: var(--text); }
.danger-outline { color: var(--danger); border-color: rgba(192,58,43,.35); }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 24px;
    box-shadow: var(--shadow);
}
.hero-card { background: linear-gradient(180deg, white, #eff4ff); }
.check-list { padding-left: 18px; color: var(--text); }
.section { padding: 34px 0; }
.section.muted { background: linear-gradient(180deg, rgba(255,255,255,0), rgba(231,237,248,.85)); }
.section-heading { margin-bottom: 20px; }
.section-heading.split { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature-card { min-height: 168px; }
.category-feature { display: flex; flex-direction: column; justify-content: space-between; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.banner-v3 { background: linear-gradient(135deg, #ffffff, #edf3ff); }
.page-header { padding: 54px 0 10px; }
.article-header { padding-bottom: 20px; }
.tag {
    display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 999px;
    background: var(--surface-2); color: var(--primary-2); font-weight: 700; font-size: 0.8rem;
}
.tag.large { margin-bottom: 14px; }
.post-card { padding: 0; overflow: hidden; }
.post-card-rich .post-card-body { padding: 22px; }
.post-card h2, .post-card h3 { margin-top: 14px; }
.post-media { display: block; aspect-ratio: 16/10; overflow: hidden; background: #dfe8ff; }
.post-media img { width: 100%; height: 100%; object-fit: cover; }
.post-media-placeholder { display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), #4f8cff); color: white; font-weight: 700; }
.post-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 0.92rem; margin-top: 18px; }
.post-meta.single { margin-top: 8px; justify-content: flex-start; }
.text-link { font-weight: 700; }
.content-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, .9fr); gap: 24px; align-items: start; }
.filter-bar { display: grid; grid-template-columns: 1.6fr 1fr auto; gap: 12px; margin-bottom: 20px; }
.sidebar { position: sticky; top: 92px; }
.sidebar-card + .sidebar-card { margin-top: 18px; }
.category-list { list-style: none; padding: 0; margin: 0; }
.category-list li + li { border-top: 1px solid var(--border); }
.category-list a { display: flex; justify-content: space-between; padding: 10px 0; color: var(--text); }
.article-cover { padding: 12px; margin-bottom: 20px; overflow: hidden; }
.article-cover img { width: 100%; max-height: 480px; object-fit: cover; border-radius: 16px; }
.article-content { font-size: 1.04rem; }
.article-content p, .article-content li { color: #34435a; }
.article-content h2 { margin-top: 26px; font-size: 1.5rem; }
.article-content ul { padding-left: 20px; }
.related-posts { margin-top: 28px; }
.site-footer { margin-top: 40px; padding: 26px 0 22px; background: #0f1f3d; color: rgba(255,255,255,.86); }
.site-footer p, .site-footer li, .site-footer a { color: rgba(255,255,255,.76); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 24px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 20px; padding-top: 16px; }
form label { display: block; font-weight: 700; color: var(--text); }
input, textarea, select {
    width: 100%; margin-top: 8px; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--border);
    background: white; color: var(--text); font: inherit;
}
textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.contact-form, .admin-form { display: grid; gap: 16px; }
.alert { padding: 14px 16px; border-radius: 16px; margin-bottom: 16px; font-weight: 600; }
.alert.success { background: rgba(15,159,110,.12); color: var(--success); }
.alert.error { background: rgba(192,58,43,.12); color: var(--danger); }
.empty-state { grid-column: 1 / -1; }
.admin-body { background: linear-gradient(180deg, #eef2ff, #f7f9fc); min-height: 100vh; }
.admin-login { width: min(460px, calc(100% - 32px)); margin: 70px auto; }
.admin-hint { margin-top: 14px; padding: 12px; background: var(--surface-2); border-radius: 14px; }
.admin-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar {
    background: #0f1f3d; color: white; padding: 24px 18px; position: sticky; top: 0; height: 100vh;
}
.admin-brand { color: white; margin-bottom: 26px; }
.admin-sidebar nav { display: grid; gap: 8px; }
.admin-sidebar nav a { color: rgba(255,255,255,.84); padding: 12px 14px; border-radius: 14px; font-weight: 600; }
.admin-sidebar nav a.active, .admin-sidebar nav a:hover { background: rgba(255,255,255,.12); color: white; }
.admin-main { padding: 26px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.stat-card strong { display: block; font-size: 2rem; color: var(--primary); margin-top: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
code { background: #eef2ff; padding: 4px 8px; border-radius: 10px; }
.actions { white-space: nowrap; }
.danger-link { color: var(--danger); }
.admin-grid-2 { grid-template-columns: minmax(260px, .95fr) minmax(0, 1.1fr); }
.message-list { display: grid; gap: 12px; }
.message-item { display: block; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.message-item.unread { border-color: #c7d6ff; background: #f4f7ff; }
.message-item span { display: block; color: var(--muted); font-size: .9rem; margin-top: 4px; }
.message-body { background: #f7f9fc; border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.thumb { width: 86px; height: 58px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }
.thumb-placeholder { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: .8rem; }
.editor-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.image-upload-grid { display: grid; gap: 12px; }
.image-preview-card { max-width: 360px; }
.image-preview-card img { width: 100%; border-radius: 16px; max-height: 220px; object-fit: cover; }
.image-preview-empty { display: grid; place-items: center; min-height: 180px; border: 2px dashed var(--border); border-radius: 16px; color: var(--muted); }
.checkbox-inline { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.checkbox-inline input { width: auto; margin: 0; }
.is-hidden { display: none; }
.category-admin-list { display: grid; gap: 12px; }
.category-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; gap: 10px; align-items: center; }
.category-count { color: var(--muted); font-size: .92rem; }
.quick-actions { align-self: start; }
.admin-note { margin-top: 18px; }
@media (max-width: 980px) {
    .hero-grid, .content-layout, .footer-grid, .admin-shell, .grid-3, .hero-stats { grid-template-columns: 1fr; }
    .grid-2, .admin-grid-2, .form-row, .filter-bar, .category-row { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .admin-sidebar { position: relative; height: auto; }
}
@media (max-width: 760px) {
    .mobile-nav-toggle {
        display: inline-flex; align-items: center; justify-content: center;
        padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: white; color: var(--text); font-weight: 700;
    }
    .nav-wrap { align-items: center; }
    .main-nav {
        display: none; width: 100%; flex-direction: column; align-items: flex-start; padding-top: 14px;
    }
    .main-nav.open { display: flex; }
    .banner, .section-heading.split, .admin-topbar { flex-direction: column; align-items: flex-start; }
    .admin-main { padding: 18px; }
}


.brand-logo {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: white;
    box-shadow: var(--shadow-soft);
}
.hero-v31 .hero-showcase,
.banner-v31 {
    background: linear-gradient(135deg, #ffffff, #edf4ff 55%, #f7faff);
}
.ad-section-top { padding-top: 0; }
.ad-slot {
    padding: 18px;
    border-style: dashed;
}
.ad-slot .adsbygoogle {
    min-height: 90px;
}
.ad-label {
    display: inline-flex;
    margin-bottom: 10px;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--primary-2);
}
.ad-placeholder {
    min-height: 90px;
    display: grid;
    place-items: center;
    text-align: center;
    border: 2px dashed rgba(31,87,214,.18);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(31,87,214,.04), rgba(31,87,214,.08));
    padding: 18px;
}
.ad-placeholder p { margin-bottom: 0; }
.footer-ad-wrap { padding-bottom: 10px; }
.settings-logo-grid { align-items: start; }
.settings-logo-card { max-width: 420px; }
.settings-logo-card h3 { margin-bottom: 10px; }
.compact-heading { margin-bottom: 12px; }
.ads-settings-card { display: grid; gap: 14px; }
.checkbox-inline-spaced { margin-top: 34px; }
.editor-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .9fr);
    gap: 18px;
    align-items: start;
}
.editor-panel textarea { min-height: 420px; }
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.editor-preview-panel {
    position: sticky;
    top: 100px;
}
.editor-preview {
    min-height: 300px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    padding: 18px;
}
.editor-preview h2,
.editor-preview h3 { margin-top: 22px; }
.editor-preview p,
.editor-preview li,
.editor-preview blockquote { color: #34435a; }
.editor-preview ul { padding-left: 18px; }
.editor-preview blockquote {
    margin: 18px 0;
    padding: 12px 16px;
    border-left: 4px solid var(--primary);
    background: rgba(31,87,214,.05);
    border-radius: 0 12px 12px 0;
}
.preview-placeholder { color: var(--muted); }
@media (max-width: 980px) {
    .editor-shell { grid-template-columns: 1fr; }
    .editor-preview-panel { position: static; }
}
