/* ===== CSS Variables ===== */
:root {
    /* Colors - Light Theme */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Neutrals */
    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Spacing */
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.2s ease-in-out;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --border-dark: #475569;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

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

html {
    scroll-behavior: smooth;
}

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

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

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

a:hover {
    color: var(--primary-dark);
}

/* ===== Container ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===== Header ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .header {
    background-color: rgba(15, 23, 42, 0.9);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.logo-icon {
    font-size: 1.5rem;
}

.nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    background-color: var(--bg-secondary);
    color: var(--text);
}

.nav-link.active {
    background-color: var(--primary);
    color: white;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

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

.admin-btn {
    padding: 0.5rem 1rem;
    background-color: var(--primary);
    color: white;
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
}

.admin-btn:hover {
    background-color: var(--primary-dark);
    color: white;
}

/* ===== Hero Section ===== */
.hero {
    padding: 4rem 0;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg) 100%);
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-search {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background-color: var(--bg);
    color: var(--text);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background-color: var(--primary-dark);
}

/* ===== Sections ===== */
.section {
    padding: 3rem 0;
}

.section-alt {
    background-color: var(--bg-secondary);
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* ===== Cards Grid ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}



/* ===== Article Notice (Red Bold Disclaimer) ===== */
.article-notice {
    background-color: rgba(239, 68, 68, 0.08);
    border-left: 4px solid var(--danger);
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.article-notice p {
    color: var(--danger);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

[data-theme="dark"] .article-notice {
    background-color: rgba(239, 68, 68, 0.15);
}/* ===== Article Card ===== */
.article-card {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.article-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.article-title a {
    color: var(--text);
}

.article-title a:hover {
    color: var(--primary);
}

.article-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.article-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.article-link:hover {
    text-decoration: underline;
}

/* ===== Category Card ===== */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition);
    gap: 0.5rem;
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.category-icon {
    font-size: 2.5rem;
}

.category-name {
    font-weight: 600;
    color: var(--text);
}

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

/* ===== Footer ===== */
.footer {
    margin-top: auto;
    padding: 3rem 0;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.footer-desc {
    color: var(--text-secondary);
    max-width: 500px;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

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

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

.footer-copyright {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        height: auto;
        padding: 1rem 0;
    }

    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-search {
        flex-direction: column;
    }

    .search-btn {
        width: 100%;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* ===== Loading State ===== */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}
