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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #95a5a6;
    --bg-color: #ffffff;
    --text-color: #333333;
    --card-bg: #f8f9fa;
    --border-color: #dee2e6;
    --hover-color: #34495e;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

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

/* 头部样式 */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px 0;
    margin-bottom: 20px;
}

.logo h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.site-desc {
    opacity: 0.9;
    font-size: 0.9rem;
}

/* 搜索框 */
.search-box {
    margin: 20px auto;
}

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

.search-box input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.search-box button {
    padding: 12px 24px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: var(--hover-color);
}

/* 导航栏 */
.nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

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

/* 公告栏 */
.announcement {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 20px;
}

.announcement-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.marquee {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    animation: marquee 20s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* 统计卡片 */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--secondary-color);
}

/* 资源卡片 */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

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

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

.resource-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.resource-card h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.resource-card h3 a:hover {
    color: var(--primary-color);
}

.resource-card .meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.resource-card .link-type {
    display: inline-block;
    padding: 4px 8px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.resource-card .date {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.resource-card .actions {
    display: flex;
    gap: 5px;
}

.resource-card button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-download {
    background-color: #27ae60;
    color: white;
}

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

.btn-like {
    background-color: #e74c3c;
    color: white;
}

.btn-like:hover {
    background-color: #c0392b;
}

.btn-report {
    background-color: #95a5a6;
    color: white;
}

.btn-report:hover {
    background-color: #7f8c8d;
}

/* 标签页 */
.tab-headers {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.tab-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--secondary-color);
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
    font-weight: bold;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 右侧悬浮按钮 */
.floating-buttons {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.float-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.3s, background-color 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.float-btn:hover {
    transform: scale(1.1);
    background-color: var(--hover-color);
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: var(--bg-color);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    position: relative;
}

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

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--secondary-color);
}

.close:hover {
    color: var(--text-color);
}

/* 主题面板 */
.theme-panel {
    display: none;
    position: fixed;
    top: 100px;
    right: 20px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    z-index: 1500;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.theme-panel.active {
    display: block;
}

.theme-colors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.color-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.3s;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: var(--primary-color);
}

/* 底部 */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
}

.footer p {
    margin: 5px 0;
    font-size: 0.9rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .nav ul {
        flex-wrap: wrap;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    .floating-buttons {
        right: 10px;
        bottom: 10px;
    }
    
    .float-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .search-box form {
        flex-direction: column;
    }
    
    .tab-headers {
        flex-wrap: wrap;
    }
}