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

:root {
    --green-deep: #1a3a2b;
    --green: #2d6a4f;
    --green-light: #52b788;
    --green-mist: #b7e4c7;
    --green-pale: #d8f3dc;

    --warm-bg: #faf7f2;
    --warm-surface: #f5f0ea;
    --warm-border: #e8e0d8;

    --text-primary: #1a1a1a;
    --text-secondary: #5a5a5a;
    --text-muted: #9a9a9a;

    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);
    --shadow-xl: 0 20px 48px -8px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--warm-bg);
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration: none;
}

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

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 247, 242, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--warm-border);
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--green);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    font-size: 1.3rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--green);
    border-radius: 1px;
    transition: width 0.3s;
}

.nav-links a:hover {
    color: var(--green);
}

.nav-links a:hover::after {
    width: 100%;
}

.search-form {
    display: flex;
    align-items: center;
}

.search-form input {
    padding: 9px 14px;
    border: 1.5px solid var(--warm-border);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font);
    outline: none;
    width: 180px;
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form input:focus {
    border-color: var(--green-light);
    box-shadow: 0 0 0 3px var(--green-pale);
}

.search-form button {
    padding: 9px 16px;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form button:hover {
    background: var(--green-light);
}

/* Hero */
.hero {
    padding: 80px 0 60px;
    text-align: center;
    background: linear-gradient(180deg, var(--green-pale) 0%, var(--warm-bg) 100%);
    margin-bottom: 56px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(82, 183, 136, 0.08) 0%, transparent 60%),
                radial-gradient(circle at 70% 60%, rgba(45, 106, 79, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.hero .container {
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--white);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--green);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    color: var(--green-deep);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 16px;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Section titles */
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--warm-border);
}

/* Categories grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 64px;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s, transform 0.3s;
    text-decoration: none;
    color: var(--text-primary);
    display: block;
    border: 1px solid var(--warm-border);
}

.category-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.category-card .cat-img {
    height: 140px;
    background: var(--green-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    overflow: hidden;
    position: relative;
}

.category-card .cat-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(transparent, rgba(0,0,0,0.03));
}

.category-card .cat-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.category-card:hover .cat-img img {
    transform: scale(1.08);
}

.category-card .cat-name {
    padding: 16px 18px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    color: var(--text-primary);
}

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

.article-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.4s, transform 0.4s;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--warm-border);
}

.article-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-6px);
}

.article-card .card-img {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    position: relative;
}

.article-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.article-card:hover .card-img img {
    transform: scale(1.06);
}

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

.article-card .card-category {
    font-size: 0.75rem;
    color: var(--green);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    display: inline-block;
}

.article-card .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}

.article-card .card-title a {
    color: var(--text-primary);
    transition: color 0.2s;
}

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

.article-card .card-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex: 1;
    margin-bottom: 14px;
    line-height: 1.6;
}

.article-card .card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-card .card-meta::before {
    content: '—';
    color: var(--warm-border);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--green);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    font-family: var(--font);
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    background: var(--green-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--green);
    border: 2px solid var(--green);
}

.btn-outline:hover {
    background: var(--green);
    color: var(--white);
}

/* Main content spacing */
main {
    flex: 1;
}

/* Article detail */
.article-detail {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 0 80px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 32px;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--green);
}

.article-detail h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.article-detail .meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.article-detail .meta .category-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--green-pale);
    color: var(--green);
    padding: 3px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75rem;
}

.meta-divider {
    color: var(--warm-border);
}

.article-detail .main-image {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 40px;
    box-shadow: var(--shadow-md);
}

.article-detail .content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-primary);
}

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

.article-detail .content h2,
.article-detail .content h3 {
    margin-top: 40px;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.article-detail .content h2 {
    font-size: 1.4rem;
}

.article-detail .content h3 {
    font-size: 1.2rem;
}

.article-detail .content img {
    border-radius: var(--radius);
    margin: 24px 0;
}

.article-detail .content blockquote {
    border-left: 3px solid var(--green-light);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--warm-surface);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article-detail .content ul,
.article-detail .content ol {
    margin: 16px 0;
    padding-left: 24px;
}

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

/* Gallery */
.gallery-section {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--warm-border);
}

.gallery-section .section-title {
    margin-bottom: 20px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.gallery-item {
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    aspect-ratio: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.06);
}

.gallery-item:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item .gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.5));
    color: var(--white);
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
}

/* Article list page */
.page-header {
    padding: 48px 0 20px;
}

.page-header h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-header .page-subtitle {
    color: var(--text-secondary);
    margin-top: 8px;
    font-size: 0.95rem;
}

.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 36px;
    padding: 20px 0;
    border-bottom: 1px solid var(--warm-border);
}

.filter-bar a {
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--white);
    border: 1.5px solid var(--warm-border);
    transition: all 0.25s;
}

.filter-bar a:hover {
    border-color: var(--green-light);
    color: var(--green);
    background: var(--green-pale);
}

.filter-bar a.active {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

.filter-bar a.active:hover {
    background: var(--green-light);
    border-color: var(--green-light);
}

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

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state p {
    font-size: 1rem;
    line-height: 1.6;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-in-delay-1 {
    animation-delay: 0.1s;
}

.animate-in-delay-2 {
    animation-delay: 0.2s;
}

.animate-in-delay-3 {
    animation-delay: 0.3s;
}

/* Responsive */
@media (max-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    header .container {
        height: auto;
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-links {
        gap: 20px;
        width: 100%;
        justify-content: center;
        order: 3;
        padding-top: 8px;
        border-top: 1px solid var(--warm-border);
    }

    .search-form input {
        width: 130px;
    }

    .hero {
        padding: 48px 0 40px;
        margin-bottom: 40px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

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

    .article-detail {
        padding: 24px 0 48px;
    }

    .article-detail h1 {
        font-size: 1.4rem;
    }

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

    .gallery-item:first-child {
        grid-column: span 1;
        grid-row: span 1;
    }

    .page-header {
        padding: 24px 0 16px;
    }

    .filter-bar {
        padding: 12px 0;
        margin-bottom: 24px;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .search-form input {
        width: 100px;
    }
}
