:root {
    color-scheme: dark;
    --bg: #030806;
    --panel: #08130f;
    --panel-2: #0d1b16;
    --line: rgba(74, 238, 160, 0.18);
    --text: #eafff5;
    --muted: #9ec8b6;
    --green: #4af0a0;
    --green-2: #1ebf76;
    --danger: #ff7777;
    --radius: 18px;
    --shadow: 0 20px 60px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background:
        radial-gradient(circle at 10% 0%, rgba(32, 187, 112, .12), transparent 32rem),
        linear-gradient(180deg, #020604 0%, var(--bg) 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
}

a { color: var(--green); }
a:hover { color: #8dffc7; }
img { max-width: 100%; }

.articles-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.articles-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(18px);
    background: rgba(3, 8, 6, .82);
    border-bottom: 1px solid var(--line);
}
.articles-header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.articles-brand {
    color: var(--green);
    text-decoration: none;
    font-weight: 900;
    letter-spacing: .26em;
    font-size: 1.05rem;
}
.articles-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.articles-nav a { color: var(--muted); text-decoration: none; font-weight: 650; }
.articles-nav a:hover { color: var(--green); }

.hero { padding: 72px 0 42px; }
.hero-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 34px; align-items: center; }
.eyebrow { color: var(--green); text-transform: uppercase; letter-spacing: .16em; font-size: .82rem; font-weight: 800; }
.hero h1 { margin: 10px 0 18px; font-size: clamp(2.3rem, 6vw, 5rem); line-height: .98; letter-spacing: -.045em; }
.hero p { max-width: 760px; color: var(--muted); font-size: 1.08rem; }
.hero-card {
    background: linear-gradient(145deg, rgba(15, 42, 31, .92), rgba(7, 17, 13, .95));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
}
.hero-card strong { color: var(--green); display: block; margin-bottom: 8px; }

.filters {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    margin: 12px 0 34px;
}
.search-box { display: flex; gap: 10px; }
input, textarea, select, button {
    font: inherit;
}
input[type="search"], input[type="text"], input[type="datetime-local"], textarea, select {
    width: 100%;
    background: #06100c;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(74,240,160,.3); border-color: var(--green-2); }
.button, button {
    border: 1px solid rgba(74,240,160,.35);
    border-radius: 12px;
    padding: 11px 16px;
    background: rgba(22, 94, 62, .4);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font-weight: 750;
}
.button:hover, button:hover { background: rgba(38, 145, 93, .45); }
.button-danger { border-color: rgba(255,119,119,.35); background: rgba(130,35,35,.28); }

.category-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.category-chip, .tag {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    background: rgba(7, 25, 17, .7);
    color: var(--muted);
    border-radius: 999px;
    padding: 6px 11px;
    font-size: .84rem;
    text-decoration: none;
}
.category-chip.active, .category-chip:hover { color: var(--text); border-color: rgba(74,240,160,.45); }

.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; padding-bottom: 42px; }
.article-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: linear-gradient(180deg, rgba(9,24,18,.95), rgba(5,13,10,.95));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.article-card-image, .article-placeholder {
    aspect-ratio: 16 / 9;
    width: 100%;
    object-fit: cover;
    background:
        linear-gradient(135deg, rgba(74,240,160,.20), rgba(8, 32, 23, .8)),
        repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 1px, transparent 1px 12px);
}
.article-placeholder { display: grid; place-items: center; color: rgba(234,255,245,.75); font-size: 2.8rem; font-weight: 900; }
.article-card-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.article-meta { color: var(--muted); font-size: .84rem; display: flex; gap: 10px; flex-wrap: wrap; }
.article-card h2 { font-size: 1.35rem; line-height: 1.2; margin: 10px 0; }
.article-card h2 a { color: var(--text); text-decoration: none; }
.article-card h2 a:hover { color: var(--green); }
.article-card p { color: var(--muted); margin: 0 0 18px; }
.article-card .read-more { margin-top: auto; font-weight: 800; text-decoration: none; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 9px; margin: 10px 0 70px; }
.pagination a, .pagination span { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; text-decoration: none; }
.pagination .current { background: rgba(36, 137, 88, .35); color: var(--text); }
.empty-state { padding: 42px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }

.article-hero { padding: 62px 0 30px; }
.article-hero h1 { font-size: clamp(2.2rem, 5vw, 4.6rem); line-height: 1.03; margin: 14px 0 20px; letter-spacing: -.04em; max-width: 1000px; }
.article-subtitle { max-width: 860px; color: var(--muted); font-size: 1.12rem; }
.article-byline { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); margin-top: 20px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 780px) minmax(240px, 1fr); gap: 36px; align-items: start; padding-bottom: 72px; }
.article-content {
    background: rgba(6, 16, 12, .88);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(22px, 4vw, 52px);
    box-shadow: var(--shadow);
}
.article-content h1, .article-content h2, .article-content h3 { line-height: 1.2; color: var(--text); scroll-margin-top: 100px; }
.article-content h2 { margin-top: 2.1em; font-size: 1.75rem; }
.article-content h3 { margin-top: 1.7em; font-size: 1.3rem; }
.article-content p, .article-content li { color: #d2e9de; }
.article-content code { background: #020705; border: 1px solid var(--line); padding: .1em .38em; border-radius: 6px; color: #9affc9; }
.article-content pre { overflow: auto; background: #020705; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.article-content pre code { border: 0; padding: 0; }
.article-content blockquote { margin: 1.5em 0; padding: 15px 20px; border-left: 4px solid var(--green-2); background: rgba(25, 93, 63, .16); color: var(--muted); }
.article-content ul { padding-left: 1.25rem; }
.article-cover { width: 100%; border-radius: var(--radius); margin: 0 0 28px; border: 1px solid var(--line); }
.sidebar-box { position: sticky; top: 94px; background: rgba(7, 20, 14, .9); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.sidebar-box h2 { font-size: 1.1rem; margin-top: 0; }
.related-list { list-style: none; padding: 0; margin: 0; }
.related-list li + li { border-top: 1px solid var(--line); margin-top: 13px; padding-top: 13px; }
.related-list a { text-decoration: none; font-weight: 700; }

.admin-shell { width: min(1240px, calc(100% - 28px)); margin: 34px auto 70px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-panel { background: rgba(7, 20, 14, .92); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.status { display: inline-flex; border-radius: 999px; padding: 4px 9px; font-size: .78rem; border: 1px solid var(--line); }
.status-published { color: #8dffc7; }
.status-draft { color: #ffd38d; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-full { grid-column: 1 / -1; }
label { display: block; margin-bottom: 7px; color: var(--muted); font-weight: 700; }
textarea { min-height: 150px; resize: vertical; }
textarea.content-editor { min-height: 580px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 1.55; }
.help { color: var(--muted); font-size: .85rem; }
.notice { border: 1px solid var(--line); background: rgba(25,93,63,.18); border-radius: 12px; padding: 12px 15px; margin-bottom: 18px; }
.error-notice { border-color: rgba(255,119,119,.35); background: rgba(130,35,35,.2); color: #ffd1d1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.site-footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); }
.site-footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 920px) {
    .hero-grid, .article-layout { grid-template-columns: 1fr; }
    .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sidebar-box { position: static; }
}

@media (max-width: 640px) {
    .articles-header-inner { align-items: flex-start; padding: 15px 0; }
    .articles-nav { justify-content: flex-end; }
    .filters, .form-grid { grid-template-columns: 1fr; }
    .article-grid { grid-template-columns: 1fr; }
    .hero { padding-top: 48px; }
    .article-content { padding: 20px; }
}
