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

:root {
    --bg: #ffffff;
    --bg-alt: #f7f8fa;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #f59e0b;
    --border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --max-width: 1200px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.7; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 780px; }

/* === HEADER === */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.25rem; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-icon { font-size: 1.5rem; }
.nav { display: flex; gap: 24px; }
.nav a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: var(--primary); text-decoration: none; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* === HERO === */
.hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: white; padding: 60px 0 80px; text-align: center;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 12px; font-weight: 800; }
.hero-sub { font-size: 1.1rem; opacity: 0.9; margin-bottom: 32px; line-height: 1.6; }

/* === SEARCH === */
.search-box {
    display: flex; max-width: 640px; margin: 0 auto;
    background: white; border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.search-box input {
    flex: 1; padding: 16px 20px; border: none; font-size: 1rem;
    outline: none; color: var(--text);
}
.search-box button {
    padding: 16px 28px; background: var(--accent); color: white;
    border: none; font-weight: 700; font-size: 1rem; cursor: pointer;
    transition: background 0.2s;
}
.search-box button:hover { background: #d97706; }
.search-results {
    max-width: 640px; margin: 12px auto 0; text-align: left;
}
.result-item {
    background: rgba(255,255,255,0.95); padding: 16px 20px; margin-bottom: 8px;
    border-radius: 8px; color: var(--text);
}
.result-item .old { color: var(--text-muted); font-size: 0.9rem; }
.result-item .new { font-weight: 700; font-size: 1.05rem; color: var(--primary-dark); }
.result-item .arrow { margin: 4px 0; color: var(--accent); font-weight: 700; }
.no-results { color: rgba(255,255,255,0.8); padding: 12px; }

/* === STATS === */
.stats { padding: 48px 0; background: var(--bg-alt); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat-card {
    background: white; padding: 24px; border-radius: var(--radius);
    text-align: center; box-shadow: var(--shadow);
}
.stat-number { display: block; font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }

/* === PROVINCES === */
.provinces { padding: 60px 0; }
.provinces h2 { font-size: 1.6rem; margin-bottom: 8px; }
.provinces > .container > p { color: var(--text-muted); margin-bottom: 32px; }
.province-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.province-card {
    padding: 20px; border: 1px solid var(--border); border-radius: var(--radius);
    transition: box-shadow 0.2s, transform 0.2s;
}
.province-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.province-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.province-card .province-info { color: var(--text-muted); font-size: 0.85rem; }
.province-card a { color: var(--text); }
.province-card a:hover { text-decoration: none; color: var(--primary); }
.province-tag { display: inline-block; background: #dbeafe; color: var(--primary); padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; margin-bottom: 8px; }
.province-tag.city { background: #fef3c7; color: #92400e; }

/* === POSTS === */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-top: 24px; }
.post-card { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); }
.post-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.post-card p { color: var(--text-muted); font-size: 0.9rem; }
.post-card time { color: var(--text-muted); font-size: 0.8rem; }

.latest-posts { padding: 60px 0; background: var(--bg-alt); }
.latest-posts h2 { font-size: 1.6rem; }

/* === ARTICLE === */
.article { padding: 48px 0; }
.article-header { margin-bottom: 32px; }
.article-header h1 { font-size: 2rem; line-height: 1.3; }
.article-meta { color: var(--text-muted); font-size: 0.9rem; margin-top: 8px; display: flex; gap: 16px; }
.tags a { color: var(--primary); font-size: 0.85rem; }
.toc { background: var(--bg-alt); padding: 20px 24px; border-radius: var(--radius); margin-bottom: 32px; }
.toc ul { padding-left: 20px; }
.toc a { color: var(--text-muted); font-size: 0.9rem; }
.article-content h2 { font-size: 1.4rem; margin: 32px 0 12px; }
.article-content h3 { font-size: 1.15rem; margin: 24px 0 8px; }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin-bottom: 16px; padding-left: 24px; }
.article-content table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.article-content th, .article-content td { padding: 10px 14px; border: 1px solid var(--border); text-align: left; }
.article-content th { background: var(--bg-alt); font-weight: 600; }

/* === LIST === */
.list-page { padding: 48px 0; }
.list-page h1 { font-size: 1.8rem; margin-bottom: 24px; }
.post-item { padding: 20px 0; border-bottom: 1px solid var(--border); }
.post-item h2 { font-size: 1.15rem; margin-bottom: 6px; }
.post-item p { color: var(--text-muted); font-size: 0.9rem; }
.post-item time { color: var(--text-muted); font-size: 0.8rem; }

/* === FOOTER === */
.footer { padding: 32px 0; border-top: 1px solid var(--border); text-align: center; }
.footer p { color: var(--text-muted); font-size: 0.85rem; }
.footer nav { margin-top: 8px; }
.footer nav a { color: var(--text-muted); margin: 0 12px; font-size: 0.85rem; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.6rem; }
    .hero { padding: 40px 0 60px; }
    .search-box { flex-direction: column; }
    .search-box button { padding: 14px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: white; flex-direction: column; padding: 16px 20px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
    .nav.open { display: flex; }
    .menu-toggle { display: block; }
    .province-grid { grid-template-columns: 1fr; }
}
