:root {
    --bg-primary: #0a0f1c;
    --bg-secondary: #0f1629;
    --bg-tertiary: #141b2d;
    --bg-card: rgba(20, 27, 45, 0.6);
    --bg-glass: rgba(20, 27, 45, 0.4);
    --text-primary: #e8eaf0;
    --text-secondary: #8b92a5;
    --text-muted: #5a6178;
    --accent-primary: #00d4ff;
    --accent-secondary: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(0, 212, 255, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-primary); background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.gradient-text { background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Nav */
.blog-nav { position: sticky; top: 0; z-index: 100; background: rgba(10, 15, 28, 0.9); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border-color); padding: 16px 0; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-logo img { height: 36px; }
.nav-links { display: flex; gap: 8px; }
.nav-links a { padding: 8px 16px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); }
.nav-cta { padding: 10px 24px; border-radius: var(--radius-xl); background: var(--accent-gradient); color: #0a0f1c; font-weight: 600; font-size: 0.9rem; transition: all 0.3s; }
.nav-cta:hover { box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4); transform: translateY(-2px); }

/* Hero */
.blog-hero { padding: 100px 0 60px; text-align: center; }
.blog-hero .section-tag { display: inline-block; padding: 6px 16px; border-radius: var(--radius-xl); background: rgba(0, 212, 255, 0.1); border: 1px solid rgba(0, 212, 255, 0.2); color: var(--accent-primary); font-size: 0.85rem; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 20px; }
.blog-hero h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; margin-bottom: 16px; }
.blog-hero p { color: var(--text-secondary); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* Category Filter */
.category-filter { padding: 0 0 40px; }
.category-filter .container { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.filter-btn { padding: 8px 20px; border-radius: var(--radius-xl); font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); border: 1px solid var(--border-color); transition: all 0.3s; display: inline-block; }
.filter-btn:hover { color: var(--text-primary); border-color: var(--border-hover); }
.filter-btn.active { background: var(--accent-gradient); color: #0a0f1c; border-color: transparent; }

/* Blog Grid */
.blog-grid-section { padding-bottom: 80px; }
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.blog-card { background: var(--bg-glass); backdrop-filter: blur(20px); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; transition: all 0.3s; }
.blog-card:hover { border-color: var(--border-hover); box-shadow: 0 0 40px rgba(0, 212, 255, 0.15); transform: translateY(-4px); }
.card-image { display: block; aspect-ratio: 16/10; overflow: hidden; background: var(--bg-tertiary); }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.blog-card:hover .card-image img { transform: scale(1.05); }
.card-image-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.card-body { padding: 24px; }
.card-category { display: inline-block; padding: 3px 10px; border-radius: var(--radius-sm); background: rgba(0, 212, 255, 0.08); color: var(--accent-primary); font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.card-body h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.card-body h2 a { transition: color 0.2s; }
.card-body h2 a:hover { color: var(--accent-primary); }
.card-body > p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; gap: 16px; color: var(--text-muted); font-size: 0.8rem; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; }
.page-btn { padding: 10px 18px; border-radius: var(--radius-sm); background: var(--bg-glass); border: 1px solid var(--border-color); color: var(--text-secondary); font-size: 0.9rem; transition: all 0.3s; }
.page-btn:hover, .page-btn.active { background: var(--accent-gradient); color: #0a0f1c; border-color: transparent; }

/* Empty State */
.empty-state { text-align: center; padding: 80px 0; }
.empty-state h2 { font-size: 1.5rem; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); }

/* Article Page */
.article-page { padding: 100px 0 60px; max-width: 800px; margin: 0 auto; }
.breadcrumb { display: flex; gap: 0; flex-wrap: wrap; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 32px; }
.breadcrumb a { color: var(--text-secondary); transition: color 0.2s; margin: 0 4px; }
.breadcrumb a:first-child { margin-left: 0; }
.breadcrumb a:hover { color: var(--accent-primary); }
.breadcrumb span { margin-left: 4px; color: var(--text-primary); }

.article-header { margin-bottom: 32px; }
.article-category { display: inline-block; padding: 4px 12px; border-radius: var(--radius-sm); background: rgba(0, 212, 255, 0.08); color: var(--accent-primary); font-size: 0.8rem; font-weight: 500; text-transform: uppercase; margin-bottom: 16px; }
.article-header h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.3; margin-bottom: 16px; }
.article-meta { display: flex; gap: 20px; color: var(--text-muted); font-size: 0.85rem; }

.article-featured-image { margin-bottom: 32px; border-radius: var(--radius-lg); overflow: hidden; }
.article-featured-image img { width: 100%; }

/* TOC */
.toc { background: var(--bg-glass); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 24px; margin-bottom: 32px; }
.toc h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; color: var(--accent-primary); }
.toc ul { list-style: none; }
.toc li { margin-bottom: 8px; }
.toc li a { color: var(--text-secondary); font-size: 0.9rem; transition: color 0.2s; }
.toc li a:hover { color: var(--accent-primary); }
.toc li.toc-sub { padding-left: 20px; }

/* Article Body */
.article-body { font-size: 1.05rem; line-height: 1.85; color: var(--text-secondary); }
.article-body h2 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin: 40px 0 16px; padding-top: 16px; }
.article-body h3 { font-size: 1.2rem; font-weight: 600; color: var(--text-primary); margin: 32px 0 12px; }
.article-body p { margin-bottom: 20px; }
.article-body ul, .article-body ol { margin-bottom: 20px; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }
.article-body a { color: var(--accent-primary); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: #7c3aed; }
.article-body strong { color: var(--text-primary); }
.article-body blockquote { border-left: 3px solid var(--accent-primary); padding: 16px 24px; margin: 24px 0; background: rgba(0, 212, 255, 0.05); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-style: italic; }
.article-body img { border-radius: var(--radius-md); margin: 24px 0; }
.article-body table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.article-body th, .article-body td { padding: 12px 16px; border: 1px solid var(--border-color); text-align: left; }
.article-body th { background: var(--bg-tertiary); color: var(--text-primary); font-weight: 600; }

/* Tags */
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0; }
.tag { padding: 4px 12px; border-radius: var(--radius-xl); background: rgba(0, 212, 255, 0.06); border: 1px solid rgba(0, 212, 255, 0.12); color: var(--accent-primary); font-size: 0.8rem; }

/* CTA Box */
.cta-box { background: var(--bg-glass); border: 1px solid var(--border-hover); border-radius: var(--radius-lg); padding: 40px; text-align: center; margin: 48px 0; }
.cta-box h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 12px; }
.cta-box p { color: var(--text-secondary); margin-bottom: 24px; }
.cta-btn { display: inline-block; padding: 14px 32px; border-radius: var(--radius-xl); background: var(--accent-gradient); color: #0a0f1c; font-weight: 700; font-size: 1rem; transition: all 0.3s; }
.cta-btn:hover { box-shadow: 0 8px 40px rgba(0, 212, 255, 0.5); transform: translateY(-2px); }

/* Related */
.related-articles { margin-top: 60px; }
.related-articles h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 24px; }

/* Footer */
.blog-footer { padding: 32px 0; border-top: 1px solid var(--border-color); text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* Admin Styles */
.admin-wrap { max-width: 1000px; margin: 0 auto; padding: 100px 24px 60px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.admin-header h1 { font-size: 1.5rem; font-weight: 700; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 24px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: all 0.3s; border: none; font-family: var(--font-primary); }
.btn-primary { background: var(--accent-gradient); color: #0a0f1c; }
.btn-primary:hover { box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-ghost { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); }
.btn-ghost:hover { border-color: var(--border-hover); color: var(--accent-primary); }

/* Admin Table */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border-color); }
.admin-table th { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.admin-table td { font-size: 0.9rem; }
.admin-table tr:hover td { background: rgba(0, 212, 255, 0.03); }
.status-badge { padding: 3px 10px; border-radius: var(--radius-xl); font-size: 0.75rem; font-weight: 600; }
.status-published { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.status-draft { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.actions { display: flex; gap: 8px; }

/* Admin Form */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--bg-secondary); border: 1px solid var(--border-color); color: var(--text-primary); font-family: var(--font-primary); font-size: 0.95rem; transition: border-color 0.2s; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--accent-primary); }
.form-group textarea { min-height: 400px; resize: vertical; font-family: monospace; font-size: 0.9rem; }
.form-group select option { background: var(--bg-secondary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }

/* Login */
.login-wrap { max-width: 400px; margin: 0 auto; padding: 200px 24px 60px; text-align: center; }
.login-wrap h1 { font-size: 1.5rem; margin-bottom: 8px; }
.login-wrap p { color: var(--text-secondary); margin-bottom: 32px; }
.login-box { background: var(--bg-glass); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 32px; }
.login-box .form-group { text-align: left; }
.login-box .btn { width: 100%; justify-content: center; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.9rem; }
.alert-error { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.alert-success { background: rgba(34, 197, 94, 0.15); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.3); }

/* Responsive */
@media (max-width: 1024px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .blog-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .article-page { padding: 80px 0 40px; }
    .form-row { grid-template-columns: 1fr; }
    .admin-table { font-size: 0.8rem; }
    .admin-table th, .admin-table td { padding: 10px 8px; }
    .related-articles .blog-grid { grid-template-columns: 1fr; }
    .card-body h2 { font-size: 1rem; }
    .card-body { padding: 16px; }
    .blog-hero { padding: 80px 0 40px; }
    .blog-hero p { font-size: 0.95rem; }
    .category-filter { padding: 0 0 24px; }
    .filter-btn { padding: 6px 14px; font-size: 0.8rem; }
}
