:root {
  --bg: #0c0a06;
  --panel: #171309;
  --panel-soft: #20190d;
  --text: #f5f0e6;
  --muted: #b9ab8a;
  --line: rgba(233, 185, 73, 0.16);
  --gold: #e9b949;
  --gold-deep: #9a6e12;
  --ok: #1f8f4d;
  --danger: #b53434;
  --radius: 14px;
  --wrap: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--gold); text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { width: min(var(--wrap), calc(100% - 32px)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(12, 10, 6, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { color: var(--text); font-weight: 800; font-size: 1.05rem; }
.nav-links { display: flex; gap: 16px; flex-wrap: wrap; }
.nav-links a { color: var(--muted); font-weight: 600; }
.nav-links a:hover { color: var(--gold); }
.page-hero { padding: 42px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.page-hero h1 { margin: 0 0 12px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; color: var(--gold); font-size: 0.76rem; font-weight: 700; margin: 0 0 12px; }
.hero-meta { color: var(--muted); max-width: 760px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; margin-bottom: 42px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card h2, .card h3 { margin-top: 0; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.post-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.post-card-body { padding: 18px; }
.post-card h2 { font-size: 1.15rem; margin: 0 0 10px; }
.post-card p { color: var(--muted); margin: 0 0 12px; }
.post-cover { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: #0a0906; }
.meta-list, .term-list, .admin-list { display: grid; gap: 10px; }
.meta-list span, .term-list a { color: var(--muted); }
.article { display: grid; gap: 20px; }
.article header { border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.article .article-content { color: #f0ead9; }
.article .article-content img { border-radius: 12px; margin: 18px 0; }
.article .article-content h2, .article .article-content h3 { margin-top: 28px; }
.article-breadcrumbs { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 0.92rem; }
.article-breadcrumbs a { color: var(--muted); }
.article-breadcrumbs a:hover { color: var(--gold); }
.article-shell { display: grid; gap: 24px; }
.article-main.card { padding: 0; overflow: hidden; }
.article-header { display: grid; gap: 18px; padding: 24px 24px 0; }
.article-cover { aspect-ratio: 16 / 8; object-fit: cover; width: 100%; background: #0a0906; border-radius: 0; }
.article-meta-row { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 0.94rem; }
.article-summary { color: var(--muted); font-size: 1.02rem; max-width: 68ch; }
.article .article-content { padding: 0 24px 24px; font-size: 1.02rem; }
.article .article-content p,
.article .article-content li { max-width: 72ch; }
.article .article-content a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.article .article-content blockquote {
  margin: 22px 0;
  padding: 16px 18px;
  border-left: 3px solid var(--gold);
  background: rgba(233,185,73,0.06);
  color: #f4e9c9;
}
.article-sidebar { display: grid; gap: 18px; align-content: start; }
.article-nav-card { display: grid; gap: 10px; }
.article-nav-card a { color: var(--text); font-weight: 600; }
.article-nav-card a:hover { color: var(--gold); }
.article-links { display: grid; gap: 10px; }
.article-links a { color: var(--muted); }
.article-links a:hover { color: var(--gold); }
.sidebar-block h3 { margin-bottom: 12px; }
.pill-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pill { background: rgba(233,185,73,0.08); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 7px 12px; font-size: 0.9rem; }
.empty { color: var(--muted); font-style: italic; }
.site-footer { border-top: 1px solid var(--line); margin-top: 50px; }
.footer-inner { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }

.admin-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { background: #120f09; border-right: 1px solid var(--line); padding: 24px 18px; }
.admin-sidebar a { display: block; color: var(--muted); padding: 10px 12px; border-radius: 10px; margin-bottom: 6px; }
.admin-sidebar a.active, .admin-sidebar a:hover { background: rgba(233,185,73,0.08); color: var(--text); }
.admin-main { padding: 28px; }
.admin-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.stack { display: grid; gap: 16px; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.editor-main,
.editor-sidebar { display: grid; gap: 18px; }
.editor-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.editor-box h2,
.editor-box h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}
.editor-title {
  font-size: 1.6rem;
  font-weight: 800;
}
.editor-slug-preview,
.field-hint,
.muted-text {
  color: var(--muted);
  font-size: 0.9rem;
}
.editor-textarea-lg { min-height: 440px; }
.editor-textarea-md { min-height: 140px; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.post-list-title { display: grid; gap: 6px; }
.post-list-title a { color: var(--text); font-weight: 700; }
.post-list-title a:hover { color: var(--gold); }
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(233,185,73,0.08);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
}
label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="datetime-local"], textarea, select {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: #0f0d08;
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 700; cursor: pointer; }
.btn-primary { background: var(--gold); color: #1d1509; }
.btn-secondary { background: rgba(255,255,255,0.06); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.notice { padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; }
.notice.ok { background: rgba(31,143,77,0.14); border: 1px solid rgba(31,143,77,0.3); }
.notice.error { background: rgba(181,52,52,0.14); border: 1px solid rgba(181,52,52,0.3); }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 10px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }

@media (max-width: 960px) {
  .content-grid,
  .admin-shell,
  .form-grid,
  .editor-layout { grid-template-columns: 1fr; }
  .footer-inner,
  .admin-toolbar { align-items: flex-start; flex-direction: column; }
  .article-header { padding: 18px 18px 0; }
  .article .article-content { padding: 0 18px 18px; }
}
