:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-bg: #f5f5f5;
    --border-color: #ddd;
    --text-color: #333;
    --text-light: #666;
}

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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
    padding: 20px;
}

.catalog-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
}

h1 {
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.catalog {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.section {
    flex: 1 0 300px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.section:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.section-title {
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 15px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.section-title:hover {
    background-color: var(--primary-color);
}

.section-content {
    padding: 10px;
    max-height: 500px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.subsection {
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.subsection:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.subsection-title {
    color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.subsection-title:hover {
    color: var(--accent-color);
}

.subsection-title a {
    color: inherit;
    text-decoration: none;
}

.difficulty-stats {
    font-size: 12px;
    background-color: var(--light-bg);
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-flex;
    gap: 5px;
    margin-left: 10px;
}

.difficulty-stat {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* 难度图标颜色 */
.diff-5 { color: #ff9500; } /* 🌕 */
.diff-4 { color: #ffb74d; } /* 🌖 */
.diff-3 { color: #ffd54f; } /* 🌗 */
.diff-2 { color: #ffecb3; } /* 🌘 */
.diff-1 { color: #333; }    /* 🌚 */

.section-toggle {
    transition: transform 0.3s ease;
}

.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.collapsed .section-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .section {
        flex: 1 0 100%;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .section {
        flex: 1 0 45%;
    }
}