/* ========================================
   少数民族ROP数据研究 - 主样式表
   ======================================== */

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

:root {
    --color-primary: #1a56db;
    --color-primary-light: #3b82f6;
    --color-primary-dark: #1e40af;
    --color-accent: #0ea5e9;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-border: #e2e8f0;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-header-bg: #ffffff;
    --color-footer-bg: #1e293b;
    --color-footer-text: #94a3b8;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --max-width: 1000px;
    --header-height: 64px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

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

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

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* --- Container --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

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

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.site-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

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

.title-icon {
    color: var(--color-primary);
    font-size: 1.3rem;
}

/* --- Navigation --- */
.site-nav ul {
    display: flex;
    list-style: none;
    gap: 4px;
}

.site-nav a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all 0.2s;
}

.site-nav a:hover {
    color: var(--color-primary);
    background: rgba(26, 86, 219, 0.06);
}

.site-nav a.active {
    color: var(--color-primary);
    background: rgba(26, 86, 219, 0.1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    padding: 48px 0 64px;
}

/* --- Content Article (Markdown rendered) --- */
.content-article {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 48px 56px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.content-article h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--color-primary);
    line-height: 1.3;
}

.content-article h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-top: 40px;
    margin-bottom: 16px;
    padding-left: 0;
}

.content-article h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text);
    margin-top: 28px;
    margin-bottom: 12px;
}

.content-article h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-top: 20px;
    margin-bottom: 8px;
}

.content-article p {
    margin-bottom: 16px;
    color: var(--color-text);
}

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

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

.content-article strong {
    font-weight: 700;
    color: var(--color-text);
}

.content-article hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 32px 0;
}

/* --- Tables --- */
.content-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.95rem;
}

.content-article th,
.content-article td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.content-article th {
    background: #f1f5f9;
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.9rem;
    text-transform: none;
}

.content-article tr:last-child td {
    border-bottom: none;
}

.content-article tr:hover td {
    background: #f8fafc;
}

/* --- Blockquotes --- */
.content-article blockquote {
    border-left: 4px solid var(--color-primary);
    padding: 12px 20px;
    margin: 20px 0;
    background: #f1f5f9;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--color-text-secondary);
}

/* --- Code --- */
.content-article code {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

.content-article pre {
    background: #1e293b;
    padding: 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 20px 0;
}

.content-article pre code {
    background: none;
    color: #e2e8f0;
    padding: 0;
    font-size: 0.9rem;
}

/* --- Status Tags --- */
.status-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-tag.active {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-tag.pending {
    background: #fef3c7;
    color: #b45309;
}

.status-tag.done {
    background: #dcfce7;
    color: #15803d;
}

/* --- Footer --- */
.site-footer {
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding: 32px 0;
    text-align: center;
    font-size: 0.85rem;
}

.site-footer p {
    margin-bottom: 4px;
}

.footer-meta {
    font-size: 0.8rem;
    opacity: 0.7;
}

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

    .main-content {
        padding: 24px 0 40px;
    }

    .content-article {
        padding: 24px 20px;
        border-radius: var(--radius-sm);
    }

    .content-article h1 {
        font-size: 1.5rem;
    }

    .content-article h2 {
        font-size: 1.25rem;
        margin-top: 28px;
    }

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

    .content-article table {
        font-size: 0.85rem;
    }

    .content-article th,
    .content-article td {
        padding: 8px 10px;
    }

    .site-title {
        font-size: 1rem;
    }

    .nav-toggle {
        display: flex;
    }

    .site-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        padding: 8px 16px;
        display: none;
        box-shadow: var(--shadow-md);
    }

    .site-nav.active {
        display: block;
    }

    .site-nav ul {
        flex-direction: column;
        gap: 2px;
    }

    .site-nav a {
        display: block;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    .content-article {
        padding: 16px;
    }

    .content-article h1 {
        font-size: 1.3rem;
    }
}

/* --- Utility --- */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }