# frontend/css/style.css
/* --- 全局变量与基础重置 --- */
:root {
    --primary-color: #a73737; /* 更沉稳的中国红 */
    --secondary-color: #3a3a3a;
    --text-color: #333;
    --light-text-color: #666;
    --bg-color: #f4f4f4;
    --container-bg: #ffffff;
    --border-color: #e0e0e0;
    --header-height: 70px;
    --font-serif: "Songti SC", "STSong", "SimSun", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", 
                 "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", 
                 "Microsoft YaHei", sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.8;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 头部与导航 --- */
.site-header {
    background-color: var(--container-bg);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

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

.logo a {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav li {
    position: relative;
    margin-left: 30px;
}

.main-nav a {
    text-decoration: none;
    color: var(--secondary-color);
    font-size: 1rem;
    padding: 8px 4px;
    border-bottom: 3px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* 下拉菜单 */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--container-bg);
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.dropdown-content a {
    color: var(--secondary-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: none;
    font-size: 0.95rem;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: var(--primary-color);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* --- 主内容区域 --- */
#main-content {
    flex-grow: 1;
    padding-top: 40px;
    padding-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#main-content.loaded {
    opacity: 1;
    transform: translateY(0);
}

.content-card {
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.content-card h1 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    text-align: center;
}

.content-card h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-top: 30px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.content-card p {
    margin-bottom: 1.2em;
    text-indent: 2em;
    color: var(--light-text-color);
}

.content-card blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #555;
    background-color: #f9f9f9;
    padding-top: 10px;
    padding-bottom: 10px;
}

.content-card ul {
    list-style-type: circle;
    padding-left: 40px;
    margin-bottom: 1.2em;
}

.content-card li {
    margin-bottom: 10px;
    color: var(--light-text-color);
}

.content-card strong {
    color: var(--primary-color);
}

/* 先贤名录卡片 */
.notables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.notable-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s, transform 0.3s;
}

.notable-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.notable-card h3 {
    color: var(--primary-color);
    font-family: var(--font-serif);
    margin-bottom: 10px;
}

/* --- 加载动画 --- */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- 尾部 --- */
.site-footer {
    background-color: var(--secondary-color);
    color: #555;
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
}


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

/* --- 响应式设计 --- */
@media (max-width: 768px) {
    .site-header {
        height: auto;
        padding: 15px 0;
    }
    .site-header .container {
        flex-direction: column;
    }
    .logo {
        margin-bottom: 15px;
    }
    .main-nav ul {
        flex-direction: column;
        align-items: center;
    }
    .main-nav li {
        margin: 8px 0;
    }
    .dropdown-content {
        position: static;
        display: none; /* JS will handle this for mobile */
        box-shadow: none;
        border: none;
        background-color: transparent;
        text-align: center;
    }
    .content-card {
        padding: 20px;
    }
    .content-card h1 {
        font-size: 2rem;
    }
}