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

body {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

a {
    color: #1a73e8;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #174ea6;
    text-decoration: underline;
}

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

/* 头部样式 */
header {
    background-color: #1a237e;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

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

nav ul li {
    margin-left: 1.5rem;
}

nav ul li a {
    color: white;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

nav ul li a:hover {
    text-decoration: none;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: white;
    transition: width 0.3s;
}

nav ul li a:hover::after {
    width: 100%;
}

#menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 容器样式 */
.container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    gap: 2rem;
}

/* 侧边栏样式 */
.sidebar {
    flex: 0 0 300px;
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 100px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #1a237e;
    color: #1a237e;
}

.toc {
    list-style: none;
}

.toc li {
    margin-bottom: 0.8rem;
}

.toc a {
    display: block;
    padding: 0.3rem 0;
    color: #333;
    transition: color 0.3s;
}

.toc a:hover {
    color: #1a73e8;
}

.toc ul {
    list-style: none;
    margin-left: 1.2rem;
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.toc ul li {
    margin-bottom: 0.5rem;
}

/* 内容区样式 */
.content {
    flex: 1;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.section {
    margin-bottom: 3rem;
}

.section h2 {
    font-size: 2rem;
    color: #1a237e;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #1a237e;
}

article {
    margin-bottom: 2.5rem;
}

article h3 {
    font-size: 1.5rem;
    color: #283593;
    margin-bottom: 1rem;
}

article h4 {
    font-size: 1.2rem;
    color: #303f9f;
    margin: 1rem 0 0.5rem;
}

article p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

article ul, article ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

article li {
    margin-bottom: 0.5rem;
}

/* 媒体内容样式 */
.media-box {
    margin: 1.5rem 0;
    text-align: center;
}

.media-image {
    max-width: 100%;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.caption {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    font-style: italic;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 比例 */
    height: 0;
    overflow: hidden;
    margin: 1.5rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.audio-sample {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.audio-sample audio {
    width: 100%;
    margin: 0.5rem 0;
}

/* 表格样式 */
.table-container {
    margin: 1.5rem 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

table th, table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #ddd;
}

table th {
    background-color: #f2f2f2;
    font-weight: 600;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f5f5f5;
}

/* 乐器卡片样式 */
.instrument-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

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

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

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

.instrument-card h4 {
    padding: 1rem 1rem 0.5rem;
    margin: 0;
}

.instrument-card p {
    padding: 0 1rem 1rem;
    font-size: 0.9rem;
    margin: 0;
}

/* 资源卡片样式 */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.resource-card {
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    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-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.resource-card h4 {
    padding: 1rem 1rem 0.5rem;
    margin: 0;
}

.resource-card p {
    padding: 0 1rem;
    font-size: 0.9rem;
    margin: 0 0 0.5rem;
}

.resource-card p:last-child {
    padding-bottom: 1rem;
}

.resource-list {
    margin: 1.5rem 0;
}

.resource-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.resource-item:last-child {
    border-bottom: none;
}

.resource-item h4 {
    margin-bottom: 0.5rem;
}

.resource-item p {
    margin-bottom: 0.5rem;
}

/* 特色视频样式 */
.featured-video {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.featured-video h3 {
    margin-bottom: 1rem;
    color: #1a237e;
}

/* 页脚样式 */
footer {
    background-color: #1a237e;
    color: white;
    padding: 3rem 2rem 1rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    gap: 2rem;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    transition: color 0.3s;
}

.social-links a:hover {
    color: #90caf9;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        padding: 1rem;
    }
    
    .sidebar {
        flex: none;
        width: 100%;
        position: static;
        max-height: none;
        margin-bottom: 1rem;
    }
    
    .content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    #menu-toggle {
        display: block;
    }
    
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
    }
    
    nav ul.show {
        display: flex;
    }
    
    nav ul li {
        margin: 0;
        padding: 0.5rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .section h2 {
        font-size: 1.8rem;
    }
    
    article h3 {
        font-size: 1.3rem;
    }
    
    .instrument-grid, .resource-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .footer-section {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .section h2 {
        font-size: 1.5rem;
    }
    
    article h3 {
        font-size: 1.2rem;
    }
    
    .instrument-grid, .resource-grid {
        grid-template-columns: 1fr;
    }
}