/* 儒家风格配色方案 */
:root {
    --primary-color: #8B0000; /* 朱红 - 儒家主色 */
    --secondary-color: #DAA520; /* 金色 - 点缀色 */
    --accent-color: #2F4F4F; /* 墨绿 - 辅助色 */
    --light-color: #F5E6D3; /* 米色 - 背景色 */
    --dark-color: #1a1a1a; /* 墨色 - 文字色 */
    --paper-color: #FFF8DC; /* 宣纸色 */
    --jade-color: #5F9EA0; /* 玉色 */
    --bronze-color: #CD853F; /* 青铜色 */
    
    --shadow: 0 2px 10px rgba(139, 0, 0, 0.1);
    --shadow-hover: 0 8px 25px rgba(139, 0, 0, 0.2);
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "SimSun", "KaiTi", serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航 */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6B0000 100%);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 24px;
    font-weight: bold;
}

.logo i {
    font-size: 32px;
    color: var(--secondary-color);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(255, 255, 255, 0.2);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 80%;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.login-btn {
    background: var(--secondary-color);
    color: var(--dark-color);
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(218, 165, 32, 0.4);
}

.user-welcome {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
}

/* 主横幅 */
.hero {
    position: relative;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(135deg, rgba(139, 0, 0, 0.85) 0%, rgba(47, 79, 79, 0.85) 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="10" y="50" font-size="20" fill="rgba(255,255,255,0.05)">子曰学而时习之不亦说乎</text></svg>');
    background-size: cover, 200px;
    animation: bgMove 30s linear infinite;
}

@keyframes bgMove {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 0 0, 200px 200px; }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 56px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 1s ease;
}

.hero-subtitle {
    font-size: 28px;
    margin-bottom: 15px;
    color: var(--secondary-color);
    animation: fadeInUp 1s ease 0.3s both;
}

.hero-desc {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.6s both;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 40px;
    animation: fadeIn 1s ease 0.9s both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.stat-item {
    text-align: center;
}

.stat-item i {
    font-size: 36px;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    margin: 10px 0;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.cta-btn {
    background: var(--secondary-color);
    color: var(--dark-color);
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    animation: fadeIn 1s ease 1.2s both;
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(218, 165, 32, 0.5);
}

/* 功能特色 */
.features {
    padding: 80px 0;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
    color: var(--primary-color);
    position: relative;
}

.title-icon {
    color: var(--secondary-color);
    margin-right: 10px;
}

.section-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--primary-color), transparent);
    margin: 20px auto 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--paper-color);
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: var(--shadow);
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.feature-icon i {
    font-size: 36px;
    color: white;
}

.feature-card h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.feature-card p {
    color: #666;
    line-height: 1.8;
}

/* 热门资源 */
.hot-resources {
    padding: 80px 0;
    background: var(--light-color);
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.resource-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.resource-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.resource-thumbnail {
    height: 180px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.resource-thumbnail::before {
    content: '儒';
    font-size: 100px;
    color: rgba(255, 255, 255, 0.2);
    position: absolute;
}

.resource-thumbnail i {
    font-size: 60px;
    color: white;
    z-index: 1;
}

.resource-category {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary-color);
    color: var(--dark-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.resource-info {
    padding: 20px;
}

.resource-info h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.resource-info p {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.6;
}

.resource-meta {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 14px;
}

.resource-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 热门课程 */
.hot-courses {
    padding: 80px 0;
    background: white;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.course-card {
    background: var(--paper-color);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.course-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hover);
}

.course-cover {
    height: 160px;
    background: linear-gradient(135deg, var(--accent-color), var(--jade-color));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.course-cover::before {
    content: '书';
    font-size: 80px;
    color: rgba(255, 255, 255, 0.2);
}

.course-cover i {
    font-size: 50px;
    color: white;
}

.course-info {
    padding: 20px;
}

.course-info h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.course-info p {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #999;
}

.course-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 文化藏品 */
.collections-preview {
    padding: 80px 0;
    background: var(--light-color);
}

.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.collection-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.collection-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.collection-image {
    height: 200px;
    background: linear-gradient(135deg, var(--bronze-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.collection-image::before {
    content: '藏';
    font-size: 90px;
    color: rgba(255, 255, 255, 0.2);
}

.collection-image i {
    font-size: 50px;
    color: white;
}

.collection-dynasty {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
}

.collection-info {
    padding: 20px;
}

.collection-info h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.collection-info p {
    color: #666;
    font-size: 14px;
}

.more-btn {
    text-align: center;
}

.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), #6B0000);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 0, 0, 0.3);
}

/* 页脚 */
.footer {
    background: linear-gradient(135deg, var(--dark-color), var(--accent-color));
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.footer-section p,
.footer-section a {
    color: #ccc;
    line-height: 2;
    text-decoration: none;
    display: block;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.footer-section i {
    margin-right: 10px;
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #999;
}

/* 登录弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 40px;
    border-radius: 20px;
    max-width: 450px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--primary-color);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.modal-content h2 i {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-color);
    font-weight: bold;
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

.login-tip {
    text-align: center;
    margin-top: 15px;
    color: #999;
    font-size: 12px;
}

/* 页面标题 */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 18px;
    opacity: 0.9;
}

/* 筛选栏 */
.filter-bar {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin: 30px 0;
    display: flex;
    gap: 20px;
    align-items: center;
    box-shadow: var(--shadow);
}

.filter-bar label {
    font-weight: bold;
    color: var(--primary-color);
}

.filter-bar select {
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    background: white;
    cursor: pointer;
}

.filter-bar input {
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    flex: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 30px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .filter-bar {
        flex-direction: column;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
}

.loading::after {
    content: '';
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 60px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #666;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--light-color);
    color: var(--primary-color);
    border-radius: 15px;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 8px;
}

.tag.active {
    background: var(--primary-color);
    color: white;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-secondary {
    background: var(--secondary-color);
    color: var(--dark-color);
}

.badge-success {
    background: #4CAF50;
    color: white;
}
