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

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

header {
    background: #333;
    color: #fff;
    padding: 1rem 0;
    text-align: center;
}

header h1 {
    margin-bottom: 0.5rem;
}

nav {
    background: #444;
    padding: 0.5rem;
    text-align: center;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin: 0 1rem;
    padding: 0.5rem;
}

nav a:hover {
    background: #555;
    border-radius: 5px;
}

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

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

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

.project-card:hover {
    transform: translateY(-5px);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.project-info p {
    margin-bottom: 1rem;
    color: #666;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-links a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.project-links a:hover {
    background: #555;
}

footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

/* Admin styles */
.admin-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn:hover {
    background: #555;
}

.btn-primary {
    background: #007bff;
}

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

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.form-group {
    margin-bottom: 1rem;
}

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

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

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

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

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.5rem;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.projects-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}

.projects-table th, .projects-table td {
    border: 1px solid #ddd;
    padding: 0.8rem;
    text-align: left;
    overflow-wrap: break-word;
    max-width: 300px;
}

/* 波形图动画 */
@keyframes wave {
    0%, 100% {
        height: 20%;
    }
    50% {
        height: 100%;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    /* 容器内边距调整 */
    .container {
        padding: 1rem;
    }
    
    /* 导航栏优化 */
    nav {
        padding: 0.5rem 0;
        text-align: center;
    }
    
    nav a {
        display: inline-block;
        margin: 0 0.5rem;
        padding: 0.3rem 0.6rem;
        font-size: 0.9rem;
    }
    
    /* 项目网格优化 */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1rem;
    }
    
    /* 项目卡片优化 */
    .project-card img {
        height: 180px;
    }
    
    .project-info {
        padding: 1rem;
    }
    
    .project-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .project-links a {
        width: 100%;
        text-align: center;
    }
    
    /* 标题字体大小调整 */
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    /* 音乐控制面板优化 */
    header > div {
        position: relative !important;
        top: 0 !important;
        right: 0 !important;
        margin-top: 1rem;
        background: rgba(0, 0, 0, 0.8) !important;
    }
    
    #audio-waveform {
        width: 80px !important;
    }
    
    /* 搜索框和分类按钮优化 */
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav > div {
        margin: 0 !important;
    }
    
    .search-container {
        width: 100% !important;
    }
    
    .search-container input {
        width: calc(100% - 80px) !important;
    }
    
    /* 模态框优化 */
    .modal-content {
        width: 95% !important;
        margin: 10% auto !important;
        padding: 1rem !important;
    }
    
    .project-modal-content {
        width: 95% !important;
        margin: 5% auto !important;
        padding: 1rem !important;
    }
    
    /* 表格优化 */
    .projects-table {
        font-size: 0.9rem;
    }
    
    .projects-table th, .projects-table td {
        padding: 0.5rem;
    }
    
    .actions {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    /* 图像放大模态框优化 */
    .image-modal-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    /* 分类列表优化 */
    .categories-list {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    /* 搜索容器优化 */
    nav > form {
        width: 100%;
        justify-content: center;
    }
}

/* 图像放大模态框样式 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.image-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.image-modal-close:hover {
    color: #ccc;
}

.projects-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.actions {
    display: flex;
    gap: 0.5rem;
}
