:root {
    --ink: #111;
    --ink-soft: #555;
    --ink-muted: #999;
    --ink-faint: #ccc;
    --paper: #f7f6f3;
    --surface: #fff;
    --border: #ddd9d1;
    --border-soft: #ece8e1;
    --accent: #d63031;
    --accent-hover: #b71c1c;
    --accent-soft: rgba(214,48,49,0.08);
    --teal: #00b894;
    --teal-soft: rgba(0,184,148,0.08);
    --amber: #e17055;
    --amber-soft: rgba(225,112,85,0.08);
    --success: #00b894;
    --success-soft: rgba(0,184,148,0.08);
    --warning: #fdcb6e;
    --warning-soft: rgba(253,203,110,0.15);
    --danger: #d63031;
    --danger-soft: rgba(214,48,49,0.08);
    --radius: 6px;
    --radius-sm: 4px;
    --radius-lg: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --font-display: 'Georgia', 'Cambria', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Code', monospace;
}

html.dark {
    --ink: #f0f0f0;
    --ink-soft: #a0a0a0;
    --ink-muted: #666;
    --ink-faint: #444;
    --paper: #0a0a0a;
    --surface: #141414;
    --border: #282828;
    --border-soft: #1e1e1e;
    --accent: #ff6b6b;
    --accent-hover: #ee5a5a;
    --accent-soft: rgba(255,107,107,0.1);
    --teal: #55efc4;
    --teal-soft: rgba(85,239,196,0.1);
    --amber: #fab1a0;
    --amber-soft: rgba(250,177,160,0.1);
    --success: #55efc4;
    --success-soft: rgba(85,239,196,0.1);
    --warning: #ffeaa7;
    --warning-soft: rgba(255,234,167,0.12);
    --danger: #ff6b6b;
    --danger-soft: rgba(255,107,107,0.1);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 4px 6px rgba(0,0,0,0.35);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
}

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

.container { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; width: 100%; }

/* ─── Navbar ─── */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.25rem;
}

.navbar-brand {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.navbar-brand::before {
    content: '';
    width: 0.5rem;
    height: 1.375rem;
    background: var(--accent);
    border-radius: 1px;
    display: inline-block;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
}

.navbar-nav a,
.navbar-nav button {
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-soft);
    transition: all var(--transition);
    white-space: nowrap;
}

.navbar-nav a:hover,
.navbar-nav button:hover {
    color: var(--ink);
    background: var(--border-soft);
}

@media (max-width: 640px) {
    .navbar .container { height: 3rem; padding: 0 0.75rem; }
    .navbar-brand { font-size: 1.125rem; }
    .navbar-brand::before { width: 0.4rem; height: 1.125rem; }
    .navbar-nav { gap: 0; }
    .navbar-nav a,
    .navbar-nav button { padding: 0.3rem 0.375rem; font-size: 0.75rem; }
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    text-align: center;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

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

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #00a884; }

.btn-warning { background: var(--amber); color: #fff; }
.btn-warning:hover { background: #d35400; }

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

.btn-outline {
    background: var(--surface);
    border-color: var(--border);
    color: var(--ink-soft);
}
.btn-outline:hover {
    border-color: var(--ink-muted);
    color: var(--ink);
    background: var(--border-soft);
}

.btn-sm { padding: 0.25rem 0.625rem; font-size: 0.75rem; }
.btn-block { width: 100%; }

/* ─── Forms ─── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.375rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.5625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition);
    background: var(--surface);
    color: var(--ink);
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-textarea { resize: vertical; min-height: 8rem; line-height: 1.6; }

/* ─── Cards ─── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
    border-color: var(--ink-faint);
}

.card-body { padding: 1rem; }

/* ─── News Grid ─── */
.news-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 640px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .news-grid { grid-template-columns: repeat(3, 1fr); } }

/* ─── News Card ─── */
.news-card-image {
    height: 11rem;
    background: var(--border-soft);
    overflow: hidden;
}
.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover .news-card-image img { transform: scale(1.04); }

.news-card-placeholder {
    height: 7rem;
    background: linear-gradient(135deg, var(--ink) 0%, #333 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.news-card-placeholder span {
    color: var(--paper);
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    opacity: 0.12;
}

/* ─── Detail Page ─── */
.detail-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.detail-image img { width: 100%; height: 22rem; object-fit: cover; }

/* ─── Prose ─── */
.prose p { margin-bottom: 1.125rem; line-height: 1.8; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--accent-hover); }
.prose strong { font-weight: 600; }
.prose blockquote { border-left: 3px solid var(--accent); padding-left: 1.25rem; color: var(--ink-soft); font-style: italic; margin: 1.25rem 0; }

/* ─── Badges ─── */
.badge { display: inline-flex; align-items: center; padding: 0.125rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.6875rem; font-weight: 600; line-height: 1.5; }
.badge-ai { background: var(--teal-soft); color: var(--teal); }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-yellow { background: var(--warning-soft); color: #b8860b; }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-gray { color: var(--ink-muted); }

/* ─── Stats ─── */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(5, 1fr); } }

.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; text-align: center; }
.stat-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-label { font-size: 0.75rem; color: var(--ink-muted); font-weight: 500; margin-top: 0.125rem; }

/* ─── Admin ─── */
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .admin-grid { grid-template-columns: repeat(2, 1fr); } }

.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; transition: all var(--transition); display: block; }
.admin-card:hover { box-shadow: var(--shadow); border-color: var(--ink-faint); }
.admin-card h3 { font-family: var(--font-display); font-weight: 700; color: var(--ink); margin-bottom: 0.25rem; font-size: 1rem; }
.admin-card p { font-size: 0.8125rem; color: var(--ink-soft); }

/* ─── Pending ─── */
.pending-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 0.75rem; }
.pending-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.pending-content { flex: 1; min-width: 0; }
.pending-actions { display: flex; gap: 0.375rem; flex-shrink: 0; flex-wrap: wrap; }
.pending-meta { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; flex-wrap: wrap; }

/* ─── Table ─── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-x: auto; }
table { width: 100%; font-size: 0.8125rem; border-collapse: collapse; }
thead { background: var(--border-soft); }
th { text-align: left; padding: 0.75rem 1rem; font-weight: 600; color: var(--ink-soft); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--border-soft); }

/* ─── Alerts ─── */
.alert { margin-bottom: 1rem; padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.8125rem; font-weight: 500; display: flex; align-items: center; gap: 0.5rem; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(214,48,49,0.15); }
.alert-success { background: var(--success-soft); color: #00a884; border: 1px solid rgba(0,184,148,0.15); }

/* ─── Line Clamp ─── */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ─── Page Header ─── */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; line-height: 1.2; }
.page-header p { font-size: 0.9375rem; color: var(--ink-soft); margin-top: 0.375rem; }

/* ─── Utilities ─── */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.shrink-0 { flex-shrink: 0; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.p-4 { padding: 1rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.8125rem; }
.text-lg { font-size: 1.0625rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-6xl { font-size: 3.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-gray-300 { color: var(--ink-muted); }
.text-gray-400 { color: var(--ink-muted); }
.text-gray-500 { color: var(--ink-soft); }
.text-gray-600 { color: var(--ink-soft); }
.text-gray-700 { color: var(--ink-soft); }
.text-gray-900 { color: var(--ink); }
.text-indigo-600 { color: var(--accent); }
.text-indigo-700 { color: var(--accent-hover); }
.text-green-600 { color: var(--success); }
.text-yellow-600 { color: var(--amber); }
.text-purple-600 { color: var(--teal); }
.text-red-500 { color: var(--danger); }
.text-white { color: #fff; }
.text-blue-600 { color: var(--teal); }
.text-orange-600 { color: var(--amber); }
.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 9999px; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.block { display: block; }
.hidden { display: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relative { position: relative; }
.opacity-30 { opacity: 0.3; }
.cursor-pointer { cursor: pointer; }
.transition { transition: all var(--transition); }
.bg-gray-50 { background: var(--border-soft); }
.bg-white { background: var(--surface); }

/* ─── Animations ─── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.25s ease-out; }

/* ─── Main ─── */
main { flex: 1; padding-top: 2rem; padding-bottom: 2rem; }

/* ─── Footer ─── */
.footer { border-top: 1px solid var(--border); padding: 2rem 0; margin-top: auto; background: var(--surface); }
.footer p { text-align: center; font-size: 0.8125rem; color: var(--ink-muted); }
.footer a { color: var(--ink-soft); }
.footer a:hover { color: var(--ink); }

/* ─── Skip Link ─── */
.skip-link { position: absolute; top: -100%; left: 0; background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; z-index: 200; font-size: 0.875rem; font-weight: 600; border-radius: 0 0 var(--radius) 0; }
.skip-link:focus { top: 0; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-faint); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); }

/* ─── Selection ─── */
::selection { background: var(--accent-soft); color: var(--ink); }

/* ─── Focus Visible ─── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
