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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

a {
    color: #1890ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav a {
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav a:hover, .nav a.active {
    background: rgba(255,255,255,0.2);
}

.search-box {
    display: flex;
    gap: 10px;
}

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

.search-box button {
    padding: 8px 20px;
    background: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #667eea;
    font-weight: bold;
}

.main {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.announcement {
    background: #fff7e6;
    border-left: 4px solid #fa8c16;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 0 4px 4px 0;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.resource-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.resource-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

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

.resource-info {
    padding: 15px;
}

.resource-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.resource-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.tag {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 5px;
}

.badge-top {
    background: #ff4d4f;
    color: #fff;
}

.badge-hot {
    background: #fa8c16;
    color: #fff;
}

.badge-recommend {
    background: #52c41a;
    color: #fff;
}

.detail-cover {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: #f5f5f5;
    margin-bottom: 20px;
}

.detail-content {
    font-size: 15px;
    line-height: 1.8;
}

.detail-content img {
    max-width: 100%;
    height: auto;
}

.download-box {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.download-btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

.download-btn:hover {
    opacity: 0.9;
}

.comment-form {
    margin-top: 30px;
}

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

.comment-form button {
    margin-top: 10px;
    padding: 10px 30px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.comment-list {
    margin-top: 20px;
}

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

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #666;
}

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

.sidebar-list li {
    list-style: none;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-list li a {
    color: #333;
}

.sidebar-list li a:hover {
    color: #1890ff;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-item {
    padding: 8px 20px;
    background: #f0f0f0;
    border-radius: 4px;
    transition: background 0.3s;
}

.category-item:hover, .category-item.active {
    background: #667eea;
    color: #fff;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 8px 15px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination .current {
    background: #667eea;
    color: #fff;
}

.footer {
    background: #333;
    color: #999;
    padding: 30px 0;
    margin-top: 40px;
    text-align: center;
}

.footer a {
    color: #999;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #667eea;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 20px;
}

.back-to-top.show {
    opacity: 1;
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

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

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: #1890ff;
    color: #fff;
}

.btn-success {
    background: #52c41a;
    color: #fff;
}

.btn-danger {
    background: #ff4d4f;
    color: #fff;
}

.btn-default {
    background: #f0f0f0;
    color: #333;
}

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

.alert-warning {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    color: #faad14;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #fafafa;
    font-weight: bold;
}

@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        flex: 1;
    }
    
    .main {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
    }
}
