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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* M01 网站头部 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

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

.main-nav ul li {
    margin: 0 15px;
}

.main-nav ul li a {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

.main-nav ul li a:hover {
    color: #007bff;
}

.user-actions a {
    margin-left: 15px;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.login-btn {
    color: #333;
    border: 1px solid #ddd;
}

.register-btn {
    color: #fff;
    background-color: #007bff;
    border: 1px solid #007bff;
}

.login-btn:hover {
    background-color: #f5f5f5;
}

.register-btn:hover {
    background-color: #0056b3;
}

/* M02 全局搜索栏 */
.search-section {
    background-color: #f8f9fa;
    padding: 20px 0;
}

.search-box {
    display: flex;
    margin-bottom: 15px;
}

.search-box input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.search-box select {
    padding: 12px;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
    font-size: 14px;
}

.search-btn {
    padding: 12px 20px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: #0056b3;
}

.hot-keywords {
    font-size: 14px;
    color: #666;
}

.hot-keywords a {
    margin: 0 8px;
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s;
}

.hot-keywords a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 主内容区布局 */
.main-content {
    display: flex;
    margin: 20px 0;
}

/* M04 资源分类导航 */
.sidebar {
    width: 250px;
    margin-right: 20px;
    flex-shrink: 0;
}

.category-nav {
    background-color: #fff;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.category-nav h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.category-tree {
    list-style: none;
}

.category-tree > li {
    margin-bottom: 10px;
}

.category-tree > li > a {
    font-weight: bold;
    color: #333;
    text-decoration: none;
    display: block;
    padding: 5px 0;
    transition: color 0.3s;
}

.category-tree > li > a:hover {
    color: #007bff;
}

.category-tree ul {
    list-style: none;
    margin-left: 20px;
    margin-top: 5px;
}

.category-tree ul li a {
    color: #666;
    text-decoration: none;
    display: block;
    padding: 3px 0;
    font-size: 14px;
    transition: color 0.3s;
}

.category-tree ul li a:hover {
    color: #007bff;
}

/* M10 广告位模块 */
.ad-section {
    background-color: #fff;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ad-item {
    margin-bottom: 15px;
    border-radius: 4px;
    overflow: hidden;
}

.ad-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* 主内容区 */
.content {
    flex: 1;
}

/* M06 排序与筛选控件 */
.filter-section {
    background-color: #fff;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-left, .filter-right {
    display: flex;
    align-items: center;
}

.filter-left span, .filter-right span {
    margin-right: 10px;
    color: #666;
}

.filter-section select {
    margin-right: 15px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* M05 资源内容流（主展示区） */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.resource-card {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.resource-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.resource-info {
    padding: 15px;
}

.resource-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    text-decoration: none;
    display: block;
    line-height: 1.4;
}

.resource-title:hover {
    color: #007bff;
}

.resource-price {
    font-size: 16px;
    font-weight: bold;
    color: #dc3545;
    margin-bottom: 10px;
}

.resource-price.free {
    color: #28a745;
}

.resource-tags {
    margin-bottom: 10px;
}

.tag {
    display: inline-block;
    background-color: #f8f9fa;
    color: #666;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.resource-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    justify-content: space-between;
}

/* M09 底部信息 */
.footer {
    background-color: #343a40;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.footer-info h3 {
    margin-bottom: 10px;
    font-size: 20px;
}

.footer-info p {
    color: #ccc;
    font-size: 14px;
}

.footer-links h4 {
    margin-bottom: 15px;
    font-size: 16px;
}

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

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

.footer-links ul li a {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

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

.footer-stats h4 {
    margin-bottom: 15px;
    font-size: 16px;
}

.footer-stats p {
    color: #ccc;
    font-size: 14px;
    margin-bottom: 5px;
}

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

/* 资源详情页样式 */
.resource-detail {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 20px;
}

.detail-header {
    margin-bottom: 30px;
}

.detail-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.detail-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.detail-meta span {
    margin-right: 20px;
}

.detail-intro {
    margin-bottom: 30px;
    line-height: 1.8;
}

.detail-screenshots {
    margin-bottom: 30px;
}

.detail-screenshots h3 {
    margin-bottom: 15px;
    font-size: 20px;
    color: #333;
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.screenshot-item {
    border-radius: 4px;
    overflow: hidden;
}

.screenshot-item img {
    width: 100%;
    height: auto;
    display: block;
}

.detail-actions {
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
}

.download-btn, .buy-btn {
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.download-btn {
    background-color: #28a745;
    color: #fff;
}

.buy-btn {
    background-color: #007bff;
    color: #fff;
}

.download-btn:hover {
    background-color: #218838;
}

.buy-btn:hover {
    background-color: #0056b3;
}

.detail-comments {
    margin-top: 40px;
}

.detail-comments h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #333;
}

.comment-form {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 30px;
}

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
}

.comment-form button {
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.comment-form button:hover {
    background-color: #0056b3;
}

.comment-list {
    list-style: none;
}

.comment-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

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

.comment-author {
    font-weight: bold;
    color: #333;
}

.comment-time {
    color: #999;
    font-size: 12px;
}

.comment-content {
    color: #666;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        padding: 15px;
    }
    
    .logo {
        margin-bottom: 15px;
    }
    
    .main-nav ul {
        margin-bottom: 15px;
    }
    
    .main-nav ul li {
        margin: 0 10px;
    }
    
    .user-actions a {
        margin: 0 5px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box input {
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    .search-box select {
        border-radius: 4px;
        border: 1px solid #ddd;
        margin-bottom: 10px;
    }
    
    .search-btn {
        border-radius: 4px;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .filter-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-left, .filter-right {
        margin-bottom: 15px;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-info, .footer-links, .footer-stats {
        margin-bottom: 30px;
    }
    
    .resource-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-title {
        font-size: 24px;
    }
    
    .detail-actions {
        flex-direction: column;
    }
    
    .download-btn, .buy-btn {
        width: 100%;
    }
}