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

:root {
    --bg: #0c0c14;
    --bg-card: #12121c;
    --bg-hover: #1a1a2a;
    --text: #f0f0f5;
    --text-secondary: #9ca3af;
    --accent: #06b6d4;
    --border: rgba(255,255,255,0.06);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

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

/* Header */
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    background: rgba(12, 12, 20, 0.95);
    backdrop-filter: blur(12px);
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}

.site-logo small {
    font-weight: 400;
    opacity: 0.6;
}

.site-logo svg {
    color: var(--accent);
}

.site-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-cat {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: var(--cat-color, #6b7280);
    opacity: 0.85;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
}

.nav-cat:hover {
    opacity: 1;
    transform: translateY(-1px);
    text-decoration: none;
}

/* Main */
.main-content {
    flex: 1;
    padding-top: 40px;
    padding-bottom: 60px;
}

/* Articles grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.article-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
    text-decoration: none;
    color: var(--text);
}

.article-card:hover {
    transform: translateY(-3px);
    border-color: rgba(6, 182, 212, 0.3);
    text-decoration: none;
}

.card-image {
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
}

.card-image-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.18), transparent 45%),
        radial-gradient(circle at 75% 75%, rgba(0,0,0,0.25), transparent 50%);
    pointer-events: none;
}

.card-image-placeholder svg {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.card-cat {
    display: inline-block;
    width: fit-content;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
}

.card-body h2 {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
}

.card-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-body time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: auto;
}

/* Article full */
.article-full {
    max-width: 760px;
    margin: 0 auto;
}

.article-hero {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 32px;
    position: relative;
}

.article-hero img {
    width: 100%;
    height: auto;
    display: block;
}

.article-hero-placeholder {
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
}

.article-hero-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.18), transparent 45%),
        radial-gradient(circle at 75% 75%, rgba(0,0,0,0.25), transparent 50%);
    pointer-events: none;
}

.article-hero-placeholder svg {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
}

.article-header {
    margin-bottom: 32px;
}

.article-cat {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 12px;
}

.article-header h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 12px;
}

.article-header time {
    font-size: 13px;
    color: var(--text-secondary);
}

.article-content {
    font-size: 16px;
    line-height: 1.8;
}

.article-content h2 {
    font-size: 22px;
    margin: 36px 0 16px;
    color: var(--accent);
}

.article-content h3 {
    font-size: 18px;
    margin: 28px 0 12px;
}

.article-content p {
    margin-bottom: 16px;
}

.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 20px;
    margin: 20px 0;
    background: rgba(6, 182, 212, 0.05);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-secondary);
}

.article-content ul {
    padding-left: 24px;
    margin-bottom: 16px;
}

.article-content li {
    margin-bottom: 6px;
}

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

.article-sources {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.article-sources h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.article-sources h3.sources-secondary {
    margin-top: 24px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.75;
}

.article-sources ul {
    list-style: none;
    padding: 0;
}

.article-sources li {
    padding: 10px 14px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.article-sources li a {
    font-size: 14px;
}

.source-host {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 6px;
}

/* Error / Empty */
.error-page, .empty-message {
    text-align: center;
    padding: 80px 20px;
}

.error-page h1 {
    font-size: 28px;
    margin-bottom: 12px;
}

.error-page p, .empty-message p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 20px;
}

.back-link {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
}

.site-footer p {
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-sub {
    font-size: 11px;
    margin-top: 6px;
    opacity: 0.7;
}

.footer-rss {
    display: inline-flex;
    align-items: center;
    color: #f59e0b;
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 6px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.footer-rss:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }
    .site-nav {
        overflow-x: auto;
        width: 100%;
        padding-bottom: 4px;
    }
    .articles-grid {
        grid-template-columns: 1fr;
    }
    .article-header h1 {
        font-size: 24px;
    }
    .container {
        padding: 0 16px;
    }
}
