/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjUiPgo8cmVjdCB3aWR0aD0iNSIgaGVpZ2h0PSI1IiBmaWxsPSIjZmZmZmZmIj48L3JlY3Q+CjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IiNmNWY1ZjUiPjwvcmVjdD4KPC9zdmc+');
}

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

/* 头部样式 */
header {
    background-color: #2c7e4d;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
}

.logo i {
    font-size: 28px;
    margin-right: 10px;
    color: #ffcc00;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
}

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

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
}

nav ul li a i {
    margin-right: 6px;
}

nav ul li a:hover {
    background-color: #1e5d36;
}

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

.search-box input {
    padding: 8px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    width: 200px;
}

.search-box button {
    background-color: #ffcc00;
    color: #333;
    border: none;
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: #e6b800;
}

/* 英雄区域样式 */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 100px 0;
    text-align: center;
}

/* 当本地图片不存在时使用的回退样式 */
.hero { 
    background-color: #2c7e4d; /* 当图片无法加载时使用绿色背景 */
}

.hero h2 {
    font-size: 36px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 18px;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 按钮样式 */
.btn-primary {
    background-color: #2c7e4d;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-primary:hover {
    background-color: #1e5d36;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #f8f8f8;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: #e9e9e9;
}

/* 资源区域样式 */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 28px;
    color: #2c7e4d;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-header h2 i {
    margin-right: 10px;
}

.section-header p {
    color: #666;
    font-size: 16px;
}

.resources-section {
    padding: 60px 0;
}

.resources-section:nth-child(even) {
    background-color: #f0f0f0;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.resource-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.resource-image {
    height: 180px;
    background-color: #ddd;
    overflow: hidden;
}

.resource-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.resource-card:hover .resource-image img {
    transform: scale(1.05);
}

.resource-info {
    padding: 20px;
}

.resource-info h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.resource-info p {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
}

.resource-actions {
    display: flex;
    justify-content: space-between;
}

.resource-actions button {
    padding: 8px 15px;
    font-size: 14px;
}

/* 用户头像样式 */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown a {
    display: flex;
    align-items: center;
}

.dropdown i.fa-chevron-down {
    margin-left: 5px;
    font-size: 12px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 100;
    border-radius: 4px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dropdown-menu a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
}

.dropdown-menu a:hover {
    background-color: #f1f1f1;
}

/* 用户菜单样式 */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu:hover .dropdown-menu {
    display: block;
}

/* 文章卡片样式 */
.article-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.article-header {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.article-header h3 {
    margin: 0;
    color: #2c7e4d;
    font-size: 1.2rem;
}

.article-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.source-tag {
    display: inline-block;
    background-color: #2c7e4d;
    color: white;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 10px;
    margin-bottom: 5px;
}

/* 资源过滤器样式 */
.resource-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f5f7fa;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    color: #333;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
}

/* 收藏按钮样式 */
.favorite-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    transition: color 0.3s;
}

.favorite-btn:hover {
    color: #e74c3c;
}

.favorite-btn.favorited {
    color: #e74c3c;
}

/* 评价区域样式 */
.reviews-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.review {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.review:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
}

.user-name {
    font-weight: 600;
    color: #333;
}

.review-rating {
    color: #f39c12;
}

.review-date {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.review-content {
    color: #555;
    line-height: 1.6;
}

.no-reviews {
    color: #888;
    text-align: center;
    padding: 15px 0;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.empty-state i {
    font-size: 48px;
    color: #2c7e4d;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
}

.empty-state p {
    color: #666;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* 搜索结果样式 */
.search-results {
    display: none;
    background-color: #f8f8f8;
    padding: 40px 0;
    margin-top: 20px;
}

.search-results h2 {
    color: #2c7e4d;
    margin-bottom: 30px;
    text-align: center;
}

.search-results-grid {
    margin-top: 30px;
}

/* 评价表单样式 */
.review-form {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.rating {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.star {
    color: #ddd;
    cursor: pointer;
    font-size: 20px;
    transition: color 0.3s;
}

.star:hover {
    color: #f39c12;
}

.review-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 15px;
}

/* 文章卡片样式 */
.articles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.article-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.article-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.source-tag {
    display: inline-block;
    padding: 3px 8px;
    background-color: #2c7e4d;
    color: white;
    font-size: 12px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.article-header h3 {
    margin: 0;
    color: #333;
}

.article-content {
    padding: 15px;
}

.article-content p {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.6;
}

/* 上传区域样式 */
.upload-section {
    background-color: #f5f7fa;
    padding: 60px 0;
}

.upload-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c7e4d;
}

#upload-form {
    max-width: 600px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
}

#upload-form button {
    width: 100%;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-info h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #ffcc00;
}

.footer-info p {
    color: #ddd;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #ffcc00;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links ul li a:hover {
    color: white;
}

.footer-contact p {
    color: #ddd;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.footer-contact p i {
    margin-right: 10px;
    color: #ffcc00;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    color: #aaa;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    header .container {
        flex-direction: column;
    }

    .logo {
        margin-bottom: 15px;
    }

    nav ul {
        margin-bottom: 15px;
    }
}

@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        margin: 5px 0;
    }

    .hero {
        padding: 80px 0;
    }

    .hero h2 {
        font-size: 28px;
    }

    .hero p {
        font-size: 16px;
    }

    .section-header h2 {
        font-size: 24px;
    }
}

@media (max-width: 576px) {
    .logo h1 {
        font-size: 20px;
    }

    .search-box input {
        width: 150px;
    }

    .hero {
        padding: 60px 0;
    }

    .hero h2 {
        font-size: 24px;
    }

    .resource-grid {
        grid-template-columns: 1fr;
    }
}

/* 加载动画 */
.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #2c7e4d;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
    display: none;
}

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

/* 标签样式 */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    background-color: #e6f2e9;
    color: #2c7e4d;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* 评分样式 */
.rating {
    color: #ffcc00;
    margin-bottom: 10px;
}

.rating i {
    margin-right: 2px;
}

/* 视频专区样式 */
.video-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.video-categories button {
    padding: 8px 16px;
}

.video-categories button.active {
    background-color: #2c7e4d;
    color: white;
    border-color: #2c7e4d;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.video-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.video-thumbnail {
    position: relative;
    height: 180px;
    background-color: #ddd;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.video-info {
    padding: 15px;
}

.video-info h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #888;
}

.video-uploader {
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-stats {
    display: flex;
    align-items: center;
    gap: 15px;
}

.video-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 音乐专区样式 */
.music-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.music-categories button {
    padding: 8px 16px;
}

.music-categories button.active {
    background-color: #2c7e4d;
    color: white;
    border-color: #2c7e4d;
}

.music-player {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.current-song {
    display: flex;
    align-items: center;
    gap: 15px;
}

.album-cover {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
}

.song-info h4 {
    margin-bottom: 5px;
    color: #333;
}

.song-info p {
    color: #888;
    font-size: 14px;
}

.player-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
}

.control-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    transition: color 0.3s;
}

.control-btn:hover {
    color: #2c7e4d;
}

.play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #2c7e4d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.play-btn:hover {
    background-color: #1e5d37;
    color: white;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex-grow: 1;
    height: 6px;
    background-color: #ddd;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.progress {
    height: 100%;
    background-color: #2c7e4d;
    width: 0%;
    transition: width 0.3s;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.volume-control input {
    width: 100px;
}

.music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.music-card {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.music-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.music-card .album-cover {
    width: 50px;
    height: 50px;
}

.music-info {
    flex-grow: 1;
}

.music-info h4 {
    margin-bottom: 5px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.music-info p {
    color: #888;
    font-size: 13px;
}

.music-actions {
    display: flex;
    gap: 10px;
}

.music-actions button {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    transition: color 0.3s;
}

.music-actions button:hover {
    color: #2c7e4d;
}