:root {
  --bg: #f6f3eb;
  --bg-elev: #fffdf8;
  --bg-soft: #eee8da;
  --text: #1a1917;
  --text-muted: #625d54;
  --border: #e2dccf;
  --accent: #c82829;
  --accent-hover: #a61e1f;
  --gold: #b88214;
  --shadow: 0 2px 10px rgba(26, 25, 23, 0.05);
  --radius: 10px;
}

[data-theme="dark"] {
  --bg: #121318;
  --bg-elev: #1a1c24;
  --bg-soft: #232632;
  --text: #eceae4;
  --text-muted: #9da3b4;
  --border: #2c3040;
  --accent: #ff5a5f;
  --accent-hover: #e0484d;
  --gold: #f5b841;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-elev);
  border-bottom: 2px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1.12rem;
  letter-spacing: 0.02em;
}

.brand-text small {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 700;
}

.header-search {
  display: flex;
  flex: 1 1 260px;
  max-width: 420px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.header-search input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 8px 14px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  min-width: 0;
}

.header-search button {
  border: 0;
  background: var(--bg-soft);
  color: var(--text);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.header-search button:hover {
  background: var(--border);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  padding: 2px;
  gap: 2px;
}

.lang-btn {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  background: var(--text);
  color: var(--bg-elev);
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.nav-pill:hover {
  background: var(--bg-soft);
}

.nav-pill-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.nav-pill-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

[data-theme="light"] .theme-label-dark,
:root:not([data-theme="dark"]) .theme-label-dark {
  display: none;
}

[data-theme="dark"] .theme-label-light {
  display: none;
}

/* Main */
.main-wrap {
  padding-top: 24px;
  padding-bottom: 48px;
  min-height: calc(100vh - 170px);
}

/* Platform filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}

.filter-pill span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.filter-pill:hover {
  border-color: var(--accent);
}

.filter-pill.active {
  background: var(--text);
  color: var(--bg-elev);
  border-color: var(--text);
}

.filter-pill.active span {
  color: var(--bg-elev);
  opacity: 0.8;
}

.active-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 18px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.clear-filter {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

/* Layout grid */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 24px;
  align-items: start;
}

.feed-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Badges */
.platform-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: #5c5a55;
}

.badge-FC { background: #c82829; }
.badge-SFC { background: #5c4db1; }
.badge-MD { background: #1e293b; }
.badge-PCE { background: #d97706; }
.badge-PS1 { background: #2563eb; }
.badge-SS { background: #0f766e; }
.badge-GBA { background: #4338ca; }
.badge-NDS { background: #0284c7; }
.badge-PSP { background: #334155; }
.badge-N64 { background: #15803d; }
.badge-DC { background: #ea580c; }
.badge-Arcade { background: #be185d; }
.badge-other { background: #64748b; }

.pin-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--gold);
  color: #fff;
}

.draft-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #475569;
  color: #fff;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Featured & Post cards */
.featured-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.featured-cover img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
}

.featured-body {
  padding: 22px;
}

.featured-body h2 {
  margin: 10px 0 10px;
  font-size: 1.42rem;
  line-height: 1.35;
}

.featured-body h2 a:hover,
.post-title a:hover {
  color: var(--accent);
}

.post-card {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.post-card-main {
  flex: 1;
  min-width: 0;
}

.post-thumb {
  width: 156px;
  flex-shrink: 0;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--border);
  align-self: center;
}

.post-thumb img {
  width: 100%;
  height: 104px;
  object-fit: cover;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.post-title {
  margin: 8px 0 6px;
  font-size: 1.15rem;
  line-height: 1.4;
}

.post-summary {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.post-footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tag-row,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.tag-chip:hover,
.tag-chip.active {
  background: var(--accent);
  color: #fff;
}

.tag-chip em {
  font-style: normal;
  opacity: 0.75;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.sidebar-title {
  margin: 0 0 12px;
  font-size: 0.96rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.archive-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.88rem;
}

.archive-list a:hover,
.archive-list a.active {
  background: var(--bg-soft);
  color: var(--accent);
  font-weight: 600;
}

.archive-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sidebar-notice p {
  margin: 0 0 10px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.btn-rss {
  display: block;
  text-align: center;
  padding: 8px 12px;
  border-radius: 7px;
  background: var(--gold);
  color: #fff;
  font-weight: 700;
  font-size: 0.86rem;
  margin-bottom: 10px;
}

.notice-small {
  font-size: 0.78rem !important;
  opacity: 0.88;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
}

.page-btn {
  padding: 7px 14px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 0.88rem;
  font-weight: 600;
}

.page-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.page-info {
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Article detail */
.article-shell {
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.admin-inline-edit {
  margin-left: auto;
  color: var(--accent);
  font-weight: 600;
}

.fallback-banner {
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 7px;
  background: var(--bg-soft);
  border-left: 4px solid var(--gold);
  font-size: 0.86rem;
  color: var(--text-muted);
}

.article-title {
  margin: 12px 0 10px;
  font-size: 1.75rem;
  line-height: 1.3;
}

.article-lead {
  margin: 0 0 20px;
  font-size: 1.02rem;
  color: var(--text-muted);
}

.dossier-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 22px;
}

.dossier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.dossier-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dossier-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.dossier-source {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.btn-source {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-source:hover {
  background: var(--accent-hover);
}

.article-cover {
  margin: 0 0 22px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.prose {
  font-size: 1rem;
  line-height: 1.8;
}

.prose h2,
.prose h3,
.prose h4 {
  margin: 1.5em 0 0.6em;
  line-height: 1.35;
}

.prose p {
  margin: 0 0 1em;
}

.prose ul,
.prose ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}

.prose blockquote {
  margin: 1.2em 0;
  padding: 10px 16px;
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 0 6px 6px 0;
  color: var(--text-muted);
}

.prose code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--bg-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.prose pre {
  padding: 14px;
  border-radius: 8px;
  background: var(--bg-soft);
  overflow-x: auto;
}

.prose pre code {
  padding: 0;
  background: transparent;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
}

.prose img {
  margin: 14px auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.article-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.article-disclaimer {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.adjacent-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.adj-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.adj-card small,
.adj-empty span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.adj-next {
  text-align: right;
}

/* Buttons & states */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-elev);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--bg-soft);
}

.btn-mini {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-mini-danger {
  color: var(--accent);
  border-color: var(--accent);
}

.empty-state {
  text-align: center;
  padding: 44px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Login & Admin */
.login-wrap {
  max-width: 420px;
  margin: 40px auto;
}

.login-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.login-desc {
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form input,
.editor-form input[type="text"],
.editor-form input[type="url"],
.editor-form input[type="date"],
.editor-form select,
.editor-form textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.93rem;
}

.alert-error {
  padding: 10px 12px;
  border-radius: 7px;
  background: rgba(200, 40, 41, 0.12);
  color: var(--accent);
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.admin-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-topbar h1 {
  margin: 0 0 4px;
  font-size: 1.45rem;
}

.admin-topbar p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.stat-card span {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stat-card strong {
  font-size: 1.55rem;
}

.admin-table-wrap {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.admin-title-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.admin-sub-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}

.status-pub {
  background: rgba(21, 128, 61, 0.14);
  color: #15803d;
}

.status-draft {
  background: var(--bg-soft);
  color: var(--text-muted);
}

.admin-actions-cell {
  white-space: nowrap;
}

.admin-actions-cell .btn-mini + .btn-mini {
  margin-left: 6px;
}

/* Editor */
.editor-form {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.editor-lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.editor-lang-tab {
  padding: 7px 14px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.editor-lang-tab.active {
  background: var(--text);
  color: var(--bg-elev);
  border-color: var(--text);
}

.editor-lang-panel {
  display: none;
}

.editor-lang-panel.active {
  display: block;
}

.editor-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.84rem;
  font-weight: 600;
}

.field-wide {
  grid-column: 1 / -1;
}

.upload-inline {
  display: flex;
  gap: 8px;
}

.upload-btn {
  white-space: nowrap;
  cursor: pointer;
}

.checkbox-field {
  justify-content: flex-end;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 0;
}

.editor-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.editor-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 600;
}

.pane-head small {
  color: var(--text-muted);
  font-weight: 400;
}

.editor-pane textarea {
  min-height: 400px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.6;
}

.md-preview {
  min-height: 400px;
  max-height: 560px;
  overflow-y: auto;
  padding: 14px 16px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.editor-submit-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
}

.editor-status {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Traffic Sources Analytics */
.analytics-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.analytics-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.range-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
}

.range-tab {
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.range-tab:hover {
  color: var(--text);
}

.range-tab.active {
  background: var(--text);
  color: var(--bg-elev);
}

.stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.analytics-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.analytics-card h3 {
  margin: 0 0 12px;
  font-size: 0.94rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.ref-bar-list,
.compact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ref-bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.ref-host {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ref-count {
  color: var(--text-muted);
  white-space: nowrap;
}

.ref-bar-track {
  height: 7px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
}

.ref-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.compact-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
}

.compact-link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

.compact-link a {
  color: var(--accent);
}

.country-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.country-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.analytics-subhead {
  padding: 12px 14px 4px;
  font-size: 0.92rem;
  font-weight: 700;
}

.analytics-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.mono-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  white-space: nowrap;
}

@media (max-width: 880px) {
  .stats-grid-4,
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 22px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand,
.footer-note {
  margin: 0;
}

.footer-note {
  font-size: 0.8rem;
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 880px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
  .editor-split,
  .editor-meta-grid,
  .adjacent-nav {
    grid-template-columns: 1fr;
  }
  .article-shell {
    padding: 20px;
  }
}

@media (max-width: 640px) {
  .post-card {
    flex-direction: column;
  }
  .post-thumb {
    width: 100%;
  }
  .post-thumb img {
    height: 160px;
  }
  .header-search {
    order: 3;
    max-width: 100%;
    flex-basis: 100%;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
