/* ==========================================================================
   ZXCMS International Edition — Base Stylesheet
   Design baseline: international minimal aesthetic
   - Inter font stack with CJK fallback
   - Near-white background, single accent color (#2563EB)
   - 8pt spacing scale: 8 / 16 / 24 / 32 / 48 / 64
   - Cards: 1px light border + subtle shadow, border-radius ≤ 8px
   - Body: 16px, line-height 1.6, weight 400
   - No gradients, no high-saturation jumps, no glassmorphism
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Spacing scale (8pt base) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;

  /* Colors — near-white neutrals + single accent */
  --bg: #ffffff;
  --bg-subtle: #f7f8fa;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;

  /* Typography */
  --font-sans: Inter, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-size-base: 16px;
  --font-size-sm: 14px;
  --font-size-lg: 18px;
  --font-size-h1: 48px;
  --font-size-h2: 32px;
  --font-size-h3: 24px;
  --line-height-base: 1.6;
  --line-height-tight: 1.2;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Shape & elevation */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  /* Shadows removed — flat design */

  /* Layout */
  --container-max: 1200px;
  --section-gap: 80px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  font-weight: var(--font-weight-normal);
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

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

ul,
ol {
  padding-left: var(--space-3);
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
}

h1 {
  font-size: var(--font-size-h1);
  margin-bottom: var(--space-3);
}

h2 {
  font-size: var(--font-size-h2);
  margin-bottom: var(--space-2);
}

h3 {
  font-size: var(--font-size-h3);
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-2);
}

.text-secondary {
  color: var(--text-secondary);
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.section {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

.section-subtle {
  background: var(--bg-subtle);
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 var(--space-3);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
}

.nav-links a {
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--accent);
  font-weight: var(--font-weight-bold);
}

/* ---------- Mobile hamburger (front nav) ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
  transition: background-color 160ms ease;
}
.nav-toggle:hover .nav-toggle-bar {
  background: var(--accent);
}
/* Drawer */
.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: #ffffff;
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 120;
  display: flex;
  flex-direction: column;
}
.nav-drawer.open {
  transform: translateX(0);
}
.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}
.nav-drawer-head .nav-brand {
  font-size: 18px;
}
.nav-drawer-close {
  position: relative;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.nav-drawer-close:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.nav-close-bar {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
}
.nav-close-bar:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}
.nav-close-bar:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}
.nav-drawer-links {
  list-style: none;
  margin: 0;
  padding: 12px 0;
  overflow-y: auto;
}
.nav-drawer-links a {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 20px;
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  font-size: 15px;
  border-left: 3px solid transparent;
}
.nav-drawer-links a:hover {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
  border-left-color: var(--accent);
}
.nav-drawer-links a.active {
  color: var(--accent);
  font-weight: var(--font-weight-bold);
  border-left-color: var(--accent);
}
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
  z-index: 110;
}
.nav-backdrop.show {
  opacity: 1;
  visibility: visible;
}
body.nav-locked {
  overflow: hidden;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}

.card:hover {
  border-color: var(--border-strong);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px var(--space-3);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  font-family: var(--font-sans);
  line-height: 1.4;
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

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

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

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

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: var(--space-2);
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---------- Tables ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-3);
}

.table th,
.table td {
  padding: var(--space-2);
  border: 1px solid var(--border);
  text-align: left;
  font-size: var(--font-size-sm);
}

.table th {
  background: var(--bg-subtle);
  font-weight: var(--font-weight-semibold);
}

.table tr:nth-child(even) {
  background: var(--bg-subtle);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding-top: var(--space-5);
  padding-bottom: var(--space-4);
  margin-top: var(--section-gap);
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.footer a {
  color: var(--text-secondary);
}

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

.footer-bottom {
  margin-top: var(--space-4);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  text-align: center;
}

/* ---------- Utilities ---------- */
.grid {
  display: grid;
  gap: var(--space-3);
}

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

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

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .nav-links { display: none; } /* hamburger menu replaces links on mobile */
  .nav-toggle { display: inline-flex; }
}

/* ==========================================================================
   Modern overseas redesign
   - Light, airy hero with soft gradient glows + fine grid texture
   - Glassmorphism navigation
   - Cards with hover lift + gradient top line
   - Flat primary buttons (#2563eb), no gradient, no shadow
   - Feature icon chips, stats band, 160-200ms micro-motions
   ========================================================================== */

:root {
  --accent-2: #60a5fa;
  --gradient-accent: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
  --gradient-soft: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(96, 165, 250, 0.10));
  --nav-bg: rgba(255, 255, 255, 0.72);
}

body {
  background: #fdfdfe;
}

/* ---------- Glass navigation ---------- */
.nav {
  background: var(--nav-bg);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gradient-accent);
}

.nav-links a {
  transition: color 160ms ease;
}

/* ---------- Buttons ---------- */
.btn {
  transition: background-color 160ms ease, border-color 160ms ease,
    color 160ms ease;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
  text-decoration: none;
}

.btn-ghost {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.22);
  color: var(--text-primary);
}

.btn-ghost:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
  text-decoration: none;
}

/* ---------- Cards: hover lift + gradient top line ---------- */
.card {
  position: relative;
  overflow: hidden;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 180ms ease;
}

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

.card:hover::before {
  opacity: 1;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding-top: 96px;
  padding-bottom: 64px;
  overflow: hidden;
  background:
    radial-gradient(600px 360px at 16% 10%, rgba(37, 99, 235, 0.12), transparent 62%),
    radial-gradient(640px 400px at 84% 6%, rgba(96, 165, 250, 0.12), transparent 62%),
    radial-gradient(520px 320px at 50% 115%, rgba(37, 99, 235, 0.08), transparent 60%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 25%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 25%, transparent 72%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gradient-accent);
}

.hero-title {
  font-size: 56px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  max-width: 560px;
  margin: 0 auto 36px;
  font-size: 17px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Section head ---------- */
.section-head {
  text-align: center;
  margin-bottom: var(--space-4);
}

.section-head h2 {
  margin-bottom: 8px;
}

.section-head p {
  margin-bottom: 0;
}

/* ---------- Feature cards ---------- */
.feature-grid {
  margin-top: var(--space-4);
}

.feature-card h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.feature-card p {
  margin-bottom: 0;
  font-size: 15px;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--gradient-soft);
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: var(--accent);
  margin-bottom: 16px;
}

.feature-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

/* ---------- Stats band ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  max-width: 860px;
  margin: 0 auto;
}

.stat {
  text-align: center;
  padding: 24px 16px;
}

.stat-number {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.stat-label {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ---------- Releases ---------- */
.release-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.release-title {
  font-size: 20px;
  font-weight: 700;
}

/* ---------- Responsive (modern additions) ---------- */
@media (max-width: 640px) {
  .hero-title { font-size: 38px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat-number { font-size: 34px; }
}

/* ==========================================================================
   Full-site modernization — shared components
   (pills, tags, badges, post cards, article typography, admin, forms)
   ========================================================================== */

/* ---------- Page head ---------- */
.page-head {
  max-width: 860px;
  margin: 0 auto 32px;
  text-align: center;
}

.page-title {
  font-size: 40px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.page-sub {
  margin-bottom: 0;
}

/* ---------- Pills / tags / badges ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color 160ms ease, color 160ms ease;
}

a.pill:hover {
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent);
  text-decoration: none;
}

.pill-accent {
  background: var(--gradient-accent);
  color: #ffffff;
}

.tag {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-success {
  background: rgba(22, 163, 74, 0.10);
  color: var(--success);
}

.badge-draft {
  background: rgba(217, 119, 6, 0.10);
  color: var(--warning);
}

/* ---------- Buttons: sizes & danger ---------- */
.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-danger {
  color: #ffffff;
  background: var(--error);
  border-color: var(--error);
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  text-decoration: none;
}

/* ---------- Post grid cards (home / category) ---------- */
.post-grid {
  margin-top: var(--space-4);
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--space-4);
}

.post-card-top {
  display: flex;
  align-items: center;
}

.post-card-title {
  font-size: 20px;
  margin: 0;
}

.post-card-title a {
  color: var(--text-primary);
}

.post-card-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-card-summary {
  margin: 0;
  font-size: 15px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: auto;
}

.post-meta .dot-sep {
  opacity: 0.5;
}

/* ---------- Post article ---------- */
.post-article {
  max-width: 780px;
  margin: 0 auto;
  padding: var(--space-5);
}

.post-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.post-meta-row .post-meta-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.post-title {
  font-size: 40px;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.post-body {
  margin-top: 8px;
  font-size: 17px;
  line-height: 1.75;
}

.post-body h2,
.post-body h3,
.post-body h4 {
  margin-top: 32px;
  margin-bottom: 12px;
}

.post-body p {
  margin-bottom: 16px;
}

.post-body ul,
.post-body ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.post-body li {
  margin-bottom: 6px;
}

.post-body blockquote {
  margin: 20px 0;
  padding: 12px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
}

.post-body code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.9em;
}

.post-body pre {
  margin: 20px 0;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: #f8fafc;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.post-body pre code {
  padding: 0;
  background: transparent;
  border: none;
}

/* ---------- Page article (about / rules / changelog) ---------- */
.page-article {
  max-width: 780px;
  margin: 0 auto;
  padding: var(--space-5);
}

.page-updated {
  font-size: 13px;
  margin-bottom: 24px;
}

/* ---------- Admin ---------- */
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  text-align: left;
}

.admin-head .page-title {
  margin-bottom: 0;
}

.admin-table th {
  background: var(--bg-subtle);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.admin-table tbody tr {
  transition: background-color 160ms ease;
}

.admin-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

.admin-table .table-title {
  font-weight: 600;
  color: var(--text-primary);
}

.admin-table .table-title:hover {
  color: var(--accent);
}

.table-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
  justify-content: flex-end;
}

.table th.table-actions,
.table td.table-actions {
  text-align: right;
}

/* ---------- Forms ---------- */
.form-card {
  padding: var(--space-5);
  max-width: 720px;
  margin: 0 auto;
}

.form-label {
  margin-bottom: 8px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: var(--space-3);
}

/* ---------- Responsive (shared additions) ---------- */
@media (max-width: 640px) {
  .post-article,
  .page-article {
    padding: var(--space-3);
  }
  .post-title {
    font-size: 30px;
  }
  .admin-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ==========================================================================
   Flat modern design pass — blue-only accents, no shadows, no gradients on buttons
   (page hero, post hero, admin stats, form sections, post card icons)
   ========================================================================== */

/* ---------- Page hero (shared page header decoration) ---------- */
.page-hero,
.post-hero {
  position: relative;
  text-align: center;
  padding: 72px 0 48px;
  overflow: hidden;
  background:
    radial-gradient(560px 320px at 18% 0%, rgba(37, 99, 235, 0.10), transparent 62%),
    radial-gradient(600px 340px at 82% 8%, rgba(96, 165, 250, 0.12), transparent 62%),
    radial-gradient(480px 300px at 50% 118%, rgba(37, 99, 235, 0.06), transparent 60%);
}

.page-hero::before,
.post-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 22%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 22%, transparent 70%);
}

.page-hero .page-title,
.post-hero .post-title {
  position: relative;
}

.page-hero .page-sub,
.post-hero .post-meta-row {
  position: relative;
}

/* ---------- Post hero ---------- */
.post-hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 56px 0 40px;
  text-align: left;
}

.post-hero .post-meta-row {
  margin-bottom: 16px;
}

.post-hero .post-title {
  margin-bottom: 16px;
}

/* ---------- Post card icon ---------- */
.post-card-top {
  align-items: center;
  gap: 10px;
}

.post-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient-soft);
  border: 1px solid rgba(37, 99, 235, 0.14);
  color: var(--accent);
  flex: none;
}

.post-card-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
}

/* ---------- Admin stats ---------- */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px 16px;
  text-align: center;
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gradient-soft);
  border: 1px solid rgba(37, 99, 235, 0.14);
  color: var(--accent);
  margin-bottom: 12px;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
}

.stat-card .stat-label {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ---------- Form sections ---------- */
.form-section {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.form-section-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient-accent);
  margin-right: 8px;
  vertical-align: 1px;
}

/* ---------- Responsive (flat pass) ---------- */
@media (max-width: 640px) {
  .page-hero,
  .post-hero {
    padding: 48px 0 32px;
  }
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .post-hero {
    padding: 40px 0 28px;
  }
}


/* ---------- Admin console (v0.0.2 redesign) ---------- */
.admin-body {
  background: var(--bg, #f7f9fc);
}
.admin-shell {
  display: flex;
  min-height: 100vh;
}
.admin-sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: #101827;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .2px;
  padding: 0 10px;
}
.admin-brand-sub {
  font-size: 12px;
  color: #64748b;
  margin: 4px 0 26px 30px;
}
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.admin-nav a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.admin-nav a.active {
  background: #2563eb;
  color: #fff;
}
.admin-nav-ico {
  width: 18px;
  text-align: center;
  font-size: 15px;
  opacity: .9;
}
.admin-sidebar-foot {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 14px 10px 4px;
}
.admin-version {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
}
.admin-version-sub {
  color: #64748b;
  font-size: 12px;
  margin-top: 2px;
}
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid #e8edf4;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.admin-topbar-title {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
}
.admin-topbar-meta {
  display: flex;
  gap: 8px;
}
.admin-content {
  padding: 26px 28px 48px;
  max-width: 1080px;
  width: 100%;
}
.admin-card {
  padding: 22px;
  margin-bottom: 20px;
}
.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.update-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 12px 0;
}
.changelog-entry {
  padding: 22px;
  margin-bottom: 16px;
  border-left: 4px solid #2563eb;
}
.changelog-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.changelog-version {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: .3px;
}
.changelog-date {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
}
.changelog-title {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 10px;
  color: #111827;
}
.changelog-list {
  margin: 0;
  padding-left: 20px;
  color: #374151;
  font-size: 14px;
  line-height: 1.75;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 860px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-sidebar-foot { border-top: 0; }
  .update-grid, .form-row { grid-template-columns: 1fr; }
}

/* ---------- Changelog: version directory (year → series → version) ---------- */
.changelog-tree {
  padding: 20px 22px;
}
.tree-year + .tree-year {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.tree-year-label {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 10px;
}
.tree-series {
  margin: 0 0 10px 16px;
  padding-left: 14px;
  border-left: 2px solid #e5e7eb;
}
.tree-series-label {
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 8px;
  letter-spacing: .3px;
}
.tree-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tree-version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.tree-version:hover {
  border-color: #2563eb;
  background: #eff6ff;
  text-decoration: none;
}
.tree-version-name {
  font-weight: 800;
}

/* ---------- Changelog: Latest badge & festival banner ---------- */
.badge-latest {
  background: #2563eb;
  color: #fff;
}
.badge-latest::before {
  background: #fff;
}
.badge-festival {
  background: #fff1f2;
  color: #be123c;
}
.badge-festival::before {
  background: #be123c;
}
.changelog-entry-latest {
  border-left-color: #2563eb;
  background: #f8faff;
}
.festival-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #fef3c7, #fee2e2);
  border: 1px solid #fcd34d;
}
.festival-title {
  font-size: 14px;
  font-weight: 800;
  color: #b45309;
}
.festival-note {
  font-size: 13px;
  color: #b91c1c;
  font-weight: 600;
}

/* ---------- Changelog: category tags on notes ---------- */
.changelog-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
}
.note-cat {
  flex: 0 0 auto;
  display: inline-block;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .2px;
  margin-top: 3px;
}
.note-text {
  min-width: 0;
}

/* ---------- Changelog: full-card new year theme ---------- */
.changelog-theme-newyear {
  border: 1px solid #fcd34d;
  border-left: 5px solid #dc2626;
  background: linear-gradient(180deg, #fffdf5, #fff1f2 60%, #fef2f2);
}
.changelog-theme-newyear .changelog-version {
  background: #dc2626;
}
.changelog-theme-newyear .changelog-title {
  color: #991b1b;
}
.changelog-theme-newyear .changelog-list {
  color: #7f1d1d;
}
.changelog-theme-newyear .changelog-note {
  background: rgba(255, 255, 255, .7);
  border: 1px solid #fecaca;
}
.changelog-theme-newyear .note-cat {
  background: #dc2626;
}
.changelog-theme-newyear .festival-banner {
  background: linear-gradient(90deg, #fbbf24, #f87171);
  border-color: #dc2626;
  color: #fff;
}
.changelog-theme-newyear .festival-title,
.changelog-theme-newyear .festival-note {
  color: #fff;
}

/* ---------- Application center ---------- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.app-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
}
.app-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.app-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .5px;
}
.app-card-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}
.app-version {
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
}
.app-desc {
  flex: 1 1 auto;
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #4b5563;
}
.app-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.app-foot-note {
  font-size: 12px;
}
.app-inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.badge-on {
  background: #dcfce7;
  color: #15803d;
}
.badge-on::before {
  background: #15803d;
}
.badge-off {
  background: #fef3c7;
  color: #b45309;
}
.badge-off::before {
  background: #b45309;
}
.badge-muted {
  background: #f3f4f6;
  color: #6b7280;
}
.badge-muted::before {
  background: #6b7280;
}

/* Admin application center */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: 14px 0;
}
.admin-stat {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 12px);
  padding: 16px;
  text-align: center;
}
.admin-stat-num {
  font-size: 26px;
  font-weight: 800;
  color: #111827;
}
.admin-stat-label {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}
.admin-app {
  padding: 18px 20px;
  margin-bottom: 14px;
}
.admin-app-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.admin-app-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}
.admin-app-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.app-url-input {
  min-width: 260px;
}
.btn-danger {
  background: #dc2626;
  color: #fff;
}
.btn-danger:hover {
  background: #b91c1c;
}
code {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  color: #be123c;
}
.notice {
  padding: 10px 14px;
  border-radius: var(--radius-sm, 8px);
  margin-bottom: 14px;
  font-size: 13px;
}
.notice-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

@media (max-width: 860px) {
  .apps-grid { grid-template-columns: 1fr; }
  .app-url-input { min-width: 100%; }
}

/* ==========================================================================
   Custom-drawn component system
   All native browser controls are re-styled here so every page shares the
   same look: flat, accent-focused, no browser defaults.
   ========================================================================== */

/* ---------- Native control reset ---------- */
button,
input,
select,
textarea {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
}
button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

/* Text-like inputs: fully custom-drawn */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="search"],
select,
textarea,
.form-input,
.form-select,
.form-textarea,
.input {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder,
input[type="url"]::placeholder,
input[type="number"]::placeholder,
input[type="search"]::placeholder,
textarea::placeholder,
.form-input::placeholder,
.form-select::placeholder,
.form-textarea::placeholder,
.input::placeholder {
  color: #9ca3af;
}
input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="url"]:hover,
input[type="number"]:hover,
input[type="search"]:hover,
select:hover,
textarea:hover,
.form-input:hover,
.form-select:hover,
.form-textarea:hover,
.input:hover {
  border-color: var(--accent);
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
input[type="text"]:disabled,
input[type="password"]:disabled,
input[type="email"]:disabled,
input[type="url"]:disabled,
input[type="number"]:disabled,
select:disabled,
textarea:disabled,
.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}
textarea {
  resize: vertical;
  min-height: 70px;
}

/* Select: custom arrow instead of the native one */
select,
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
  cursor: pointer;
}
select option {
  font-size: 14px;
  color: var(--text-primary);
}

/* Checkbox: custom-drawn box with check mark */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 0;
  display: inline-grid;
  place-content: center;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  vertical-align: middle;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
input[type="checkbox"]:hover {
  border-color: var(--accent);
}
input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}
input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}
input[type="checkbox"]:disabled {
  background: #f3f4f6;
  cursor: not-allowed;
}

/* Radio: custom-drawn dot */
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  display: inline-grid;
  place-content: center;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  vertical-align: middle;
  transition: border-color 0.15s ease;
}
input[type="radio"]:hover {
  border-color: var(--accent);
}
input[type="radio"]:checked {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 4.5px var(--accent);
}
input[type="radio"]:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

/* ---------- Switch (custom toggle) ---------- */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}
.switch .switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.switch .switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}
.switch input:checked + .switch-track {
  background: var(--accent);
  border-color: var(--accent);
}
.switch input:checked + .switch-track::after {
  transform: translateX(18px);
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}
.switch input:disabled + .switch-track {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Buttons: shared polish ---------- */
.btn {
  gap: 6px;
  border-radius: var(--radius-md);
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, transform 0.12s ease, filter 0.15s ease;
}
.btn:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}
.btn:active {
  transform: translateY(1px);
}
.btn-ghost {
  color: var(--text-primary);
  background: #fff;
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

/* ---------- Cards & layout polish ---------- */
.card {
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.form-section {
  padding: 0 0 var(--space-2);
}
.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}
.input-sm {
  padding: 6px 10px;
  font-size: 13px;
}

/* Admin app center layout */
.admin-app {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-app-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.admin-app-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.admin-app-state .state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}
.admin-app-state.on .state-dot {
  background: var(--success);
}
.admin-app-state.off .state-dot {
  background: var(--warning);
}

/* App icon variety: per-app gradient */
.app-icon {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
}
.app-icon.accent-violet {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
}
.app-icon.accent-pink {
  background: linear-gradient(135deg, #db2777, #f9a8d4);
}
.app-icon.accent-green {
  background: linear-gradient(135deg, #16a34a, #86efac);
}
.app-icon.accent-amber {
  background: linear-gradient(135deg, #d97706, #fcd34d);
}
.app-icon.accent-cyan {
  background: linear-gradient(135deg, #0891b2, #67e8f9);
}

/* Stat cards with soft glow blob */
.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: -34px;
  right: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.13), transparent 70%);
  pointer-events: none;
}
.admin-stat {
  position: relative;
  overflow: hidden;
}
.admin-stat::before {
  content: "";
  position: absolute;
  top: -26px;
  right: -22px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12), transparent 70%);
  pointer-events: none;
}

/* Tables: softer rows */
.table tr:nth-child(even) {
  background: #fafbfc;
}
.admin-table tbody tr {
  transition: background-color 0.12s ease;
}

/* ============================================================
   Mobile pass: ≤768px & ≤480px
   Flat, shadow-free, self-drawn components only.
   ============================================================ */

/* Admin nav groups (desktop) */
.admin-nav-group {
  margin-top: 18px;
}
.admin-nav-group-label {
  padding: 0 14px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: #64748b;
}
.admin-nav a.admin-nav-sub {
  padding-left: 34px;
}

/* Admin topbar left cluster (hamburger + title) */
.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Admin drawer toggle: hidden on desktop, shown on mobile */
.admin-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-subtle);
  cursor: pointer;
  padding: 0;
  transition: border-color .15s ease, background .15s ease;
}
.admin-nav-toggle:hover {
  border-color: #2563eb;
  background: #eff6ff;
}
.admin-nav-toggle-bar {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.admin-sidebar-backdrop {
  display: none;
}

/* Tables scroll horizontally instead of squeezing */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap .table {
  min-width: 640px;
}

/* ---------- ≤768px ---------- */
@media (max-width: 768px) {
  .admin-nav-toggle {
    display: inline-flex;
  }

  /* Drawer sidebar (overrides the 860px horizontal layout) */
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 272px;
    height: 100%;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 70;
  }
  .admin-shell.sidebar-open .admin-sidebar {
    transform: translateX(0);
  }
  .admin-nav {
    flex-direction: column;
    flex-wrap: nowrap;
  }
  .admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 65;
  }
  .admin-shell.sidebar-open .admin-sidebar-backdrop {
    display: block;
  }

  .admin-main {
    width: 100%;
  }
  .admin-topbar {
    padding: 10px 16px;
  }
  .admin-topbar-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
  }
  .admin-content {
    padding: 18px 16px 40px;
  }

  /* Cards and grids stack down */
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .stat-card,
  .admin-stat {
    padding: 16px;
  }
  .apps-grid {
    grid-template-columns: 1fr;
  }
  .admin-app-head {
    flex-wrap: wrap;
  }
  .admin-app-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .app-inline-form {
    margin-bottom: 4px;
  }
  .update-grid,
  .form-row {
    grid-template-columns: 1fr;
  }
  .admin-card {
    padding: 16px;
  }
  .form-section-title {
    font-size: 16px;
  }
  h2 {
    font-size: 22px;
  }
  .page-hero,
  .post-hero {
    padding: 36px 0 24px;
  }
  .hero-title {
    font-size: 34px;
  }
  .section {
    padding: 26px 0;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* ---------- ≤480px ---------- */
@media (max-width: 480px) {
  h1 {
    font-size: 26px;
  }
  h2 {
    font-size: 20px;
  }
  .hero-title {
    font-size: 28px;
  }
  .admin-stats {
    grid-template-columns: 1fr;
  }
  .admin-topbar-meta .btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .admin-app-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-app-actions .app-inline-form {
    width: 100%;
  }
  .app-url-input {
    width: 100%;
    min-width: 0;
  }
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .app-card-head {
    flex-wrap: wrap;
    gap: 10px;
  }
  .table-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .page-sub {
    font-size: 14px;
  }
  .notice {
    padding: 10px 12px;
    font-size: 13px;
  }
  .pagination {
    flex-wrap: wrap;
    gap: 8px;
  }
}

