/* ===== 全局样式重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* ===== 布局容器 ===== */
.app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== 侧边栏样式 ===== */
.sidebar {
    width: 320px;
    background: #2c3e50;
    color: white;
    overflow-y: auto;
    flex-shrink: 0;
    border-right: 1px solid #34495e;
    transition: all 0.3s ease;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .sidebar-header .logo h1,
.sidebar.collapsed .search-container,
.sidebar.collapsed .nav-list .nav-link span,
.sidebar.collapsed .category-count,
.sidebar.collapsed .nav-subcategories {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px 10px;
}

/* 移除原来的 X 样式，现在使用文本图标 */

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.sidebar-toggle {
    display: block;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: currentColor;
    margin: 3px 0;
    transition: 0.3s;
}

/* ===== 搜索区域 ===== */
.search-container {
    padding: 20px;
    border-bottom: 1px solid #34495e;
}

.search-box {
    display: flex;
    margin-bottom: 15px;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    outline: none;
    font-size: 14px;
}

.search-box input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.search-box button {
    padding: 10px 15px;
    background: #3498db;
    border: none;
    border-radius: 0 4px 4px 0;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-box button:hover {
    background: #2980b9;
}

.search-filters {
    display: flex;
    gap: 10px;
}

.search-filters select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    outline: none;
    font-size: 14px;
}

/* ===== 导航菜单 ===== */
.sidebar-nav {
    flex: 1;
    padding: 10px 0;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin: 2px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    justify-content: space-between;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background: #3498db;
    color: white;
}

.category-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.nav-subcategories {
    list-style: none;
    background: rgba(0, 0, 0, 0.1);
}

.nav-sublink {
    display: block;
    padding: 8px 20px 8px 50px;
    color: #95a5a6;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.nav-sublink:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ecf0f1;
}

.nav-sublink.active {
    background: #2980b9;
    color: white;
}

/* ===== 难度级别导航 ===== */
.nav-category-header {
    display: flex;
    align-items: center;
}

.nav-category-header .nav-link {
    flex: 1;
}

.difficulty-toggle {
    background: none;
    border: none;
    color: #bdc3c7;
    cursor: pointer;
    padding: 8px;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.difficulty-toggle:hover {
    color: white;
    transform: scale(1.1);
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 12px;
}

.toggle-icon.expanded {
    transform: rotate(90deg);
}

.difficulty-levels {
    background: rgba(0, 0, 0, 0.15);
    border-left: 2px solid #3498db;
    margin-left: 20px;
}

.difficulty-level {
    margin: 0;
}

.difficulty-link {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    color: #95a5a6;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    gap: 8px;
}

.difficulty-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ecf0f1;
}

.difficulty-link.active {
    background: #27ae60;
    color: white;
}

.difficulty-icon {
    font-size: 12px;
}

/* ===== 侧边栏统计 ===== */
.sidebar-stats {
    padding: 20px;
    margin-top: auto;
    border-top: 1px solid #34495e;
    background: rgba(0, 0, 0, 0.1);
}

.stats-title {
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 16px;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.stats-item span {
    font-weight: 600;
    color: #3498db;
}

.stats-levels {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.level-item {
    font-size: 12px;
    margin-bottom: 4px;
    color: #bdc3c7;
}

/* ===== 主内容区域 ===== */
.main-content {
    flex: 1;
    background: #ffffff;
    overflow-y: auto;
    position: relative;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
}

/* ===== 首页样式 ===== */
.home-page {
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin-top: -40px;
    margin-left: -40px;
    margin-right: -40px;
    margin-bottom: 50px;
}

.page-header h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
}

.page-description {
    font-size: 18px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    opacity: 0.9;
}

/* ===== 统计卡片 ===== */
.stats-overview {
    margin-bottom: 50px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stats-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stats-icon {
    font-size: 40px;
}

.stats-content {
    flex: 1;
}

.stats-number {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stats-label {
    color: #7f8c8d;
    font-size: 16px;
    font-weight: 500;
}

/* ===== 分类网格 ===== */
.categories-section {
    margin-bottom: 50px;
}

.categories-section h2 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #2c3e50;
    font-weight: 600;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.category-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.category-link {
    display: block;
    padding: 25px;
    text-decoration: none;
    color: inherit;
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.category-icon {
    font-size: 32px;
}

.category-title {
    flex: 1;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.category-count {
    background: #e8f4fd;
    color: #3498db;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.category-subcategories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.subcategory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
}

.subcategory-name {
    font-weight: 500;
    color: #495057;
}

.subcategory-count {
    color: #6c757d;
    font-size: 12px;
}

.subcategory-more {
    padding: 8px 12px;
    background: #e9ecef;
    border-radius: 6px;
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    font-style: italic;
}

/* ===== 难度分布 ===== */
.difficulty-section {
    margin-bottom: 50px;
}

.difficulty-section h2 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #2c3e50;
    font-weight: 600;
}

.difficulty-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.difficulty-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.difficulty-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.difficulty-card.beginner {
    border-left: 4px solid #27ae60;
}

.difficulty-card.intermediate {
    border-left: 4px solid #f39c12;
}

.difficulty-card.advanced {
    border-left: 4px solid #e74c3c;
}

.difficulty-icon {
    font-size: 32px;
}

.difficulty-content {
    flex: 1;
}

.difficulty-number {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.difficulty-label {
    font-size: 16px;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 5px;
}

.difficulty-desc {
    font-size: 14px;
    color: #7f8c8d;
}

/* ===== 使用指南 ===== */
.guide-section {
    margin-bottom: 50px;
}

.guide-section h2 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #2c3e50;
    font-weight: 600;
}

.guide-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.guide-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.guide-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.guide-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.guide-card h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: 600;
}

.guide-card p {
    color: #7f8c8d;
    line-height: 1.6;
}

/* ===== 页脚 ===== */
.page-footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid #e9ecef;
    margin-top: 50px;
    color: #6c757d;
}

.page-footer p {
    margin-bottom: 10px;
}

.build-info {
    font-size: 14px;
    color: #adb5bd;
}

/* ===== 分类页面样式 ===== */
.category-page {
    max-width: 1200px;
    margin: 0 auto;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #2980b9;
}

.breadcrumb-separator {
    margin: 0 10px;
    color: #6c757d;
}

.breadcrumb-current {
    color: #495057;
    font-weight: 600;
}

/* 分类页面标题 */
.category-header {
    margin-bottom: 30px;
}

.category-title-section h1 {
    font-size: 36px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.category-description {
    font-size: 18px;
    color: #6c757d;
}

/* 筛选工具栏 */
.filter-toolbar {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #495057;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.filter-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.filter-btn.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.filter-btn.level-beginner.active {
    background: #27ae60;
    border-color: #229954;
}

.filter-btn.level-intermediate.active {
    background: #f39c12;
    border-color: #e67e22;
}

.filter-btn.level-advanced.active {
    background: #e74c3c;
    border-color: #c0392b;
}

/* 题目容器 */
.questions-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 40px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #495057;
}

.empty-state p {
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 16px;
}

/* 题目列表 */
.questions-list {
    padding: 0;
}

.question-item {
    border-bottom: 1px solid #e9ecef;
    padding: 30px;
    transition: background-color 0.3s ease;
}

.question-item:last-child {
    border-bottom: none;
}

.question-item:hover {
    background-color: #f8f9fa;
}

/* 题目头部 */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.question-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.question-number {
    background: #e8f4fd;
    color: #3498db;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
}

.question-level {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.question-level.level-beginner {
    background: #d5f4e6;
    color: #27ae60;
}

.question-level.level-intermediate {
    background: #fef9e7;
    color: #f39c12;
}

.question-level.level-advanced {
    background: #fadbd8;
    color: #e74c3c;
}

.question-subcategory {
    background: #f8f9fa;
    color: #6c757d;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.question-toggle {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.question-toggle:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.question-toggle.showing {
    background: #27ae60;
}

.question-toggle.showing:hover {
    background: #229954;
}

/* 题目标题 */
.question-title {
    margin-bottom: 20px;
}

.question-title h3 {
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
}

.question-title-en {
    font-size: 16px;
    color: #6c757d;
    font-style: italic;
    margin-bottom: 10px;
}

.question-exam-point {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #495057;
}

.exam-point-label {
    background: #fff3cd;
    color: #856404;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

/* 题目内容 */
.question-content {
    margin-bottom: 20px;
}

.question-description {
    font-size: 16px;
    line-height: 1.6;
    color: #495057;
}

/* 答案区域 */
.question-answer {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border-left: 4px solid #3498db;
}

.answer-header {
    padding: 15px 20px;
    background: #e8f4fd;
    border-bottom: 1px solid #dee2e6;
}

.answer-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.answer-content {
    padding: 20px;
    font-size: 15px;
    line-height: 1.7;
    color: #495057;
}

/* Markdown 内容样式 */
.answer-content h1,
.answer-content h2,
.answer-content h3,
.answer-content h4,
.answer-content h5,
.answer-content h6 {
    color: #2c3e50;
    margin: 20px 0 15px 0;
    font-weight: 600;
    line-height: 1.4;
}

.answer-content h1 { font-size: 1.5em; }
.answer-content h2 { font-size: 1.3em; }
.answer-content h3 { font-size: 1.2em; }
.answer-content h4 { font-size: 1.1em; }

.answer-content p {
    margin: 15px 0;
    line-height: 1.7;
}

.answer-content ul,
.answer-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.answer-content li {
    margin: 8px 0;
    line-height: 1.6;
}

.answer-content strong {
    font-weight: 600;
    color: #2c3e50;
}

.answer-content em {
    font-style: italic;
    color: #555;
}

.answer-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
    border: 1px solid #e9ecef;
}

/* 代码高亮样式 */
.answer-content pre.hljs {
    background: #f6f8fa !important;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.answer-content .hljs {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1.1em;
}

.answer-content code.hljs {
    background: #f6f8fa !important;
    color: #24292e !important;
    border: none;
    padding: 0;
}

/* 保持行内代码的原样式 */
.answer-content code:not(.hljs) {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
    border: 1px solid #e9ecef;
}

.answer-content blockquote {
    border-left: 4px solid #007bff;
    background: #f8f9fa;
    margin: 20px 0;
    padding: 15px 20px;
    color: #555;
}

.answer-content blockquote p {
    margin: 0;
}

.answer-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.answer-content th,
.answer-content td {
    border: 1px solid #dee2e6;
    padding: 10px 15px;
    text-align: left;
}

.answer-content th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.answer-content a {
    color: #007bff;
    text-decoration: none;
}

.answer-content a:hover {
    text-decoration: underline;
}

.no-answer {
    color: #6c757d;
    font-style: italic;
    margin: 0;
}

/* 页面导航 */
.page-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.nav-info {
    color: #6c757d;
    font-size: 14px;
}

.nav-actions {
    display: flex;
    gap: 10px;
}

/* 快速导航 */
.quick-navigation {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.quick-nav-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: #495057;
}

.quick-nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.quick-nav-btn:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
}

.quick-nav-more {
    padding: 8px 12px;
    color: #6c757d;
    font-size: 14px;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* 搜索模态框 */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    backdrop-filter: blur(4px);
}

.search-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.search-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.search-modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.search-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.search-modal-close:hover {
    background: #e9ecef;
    color: #495057;
}

.search-modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 8px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    .content-wrapper {
        padding: 30px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .stats-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    /* iPad代码字体优化 */
    .answer-content .hljs,
    .answer-content code.hljs {
        font-size: 1.1em !important;
    }
    
    .answer-content code:not(.hljs) {
        font-size: 1em !important;
    }
}

@media (max-width: 768px) {
    .app {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1500;
        transform: translateX(-100%);
        max-height: 100vh;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .main-content {
        width: 100%;
        margin-left: 0;
        padding-top: 70px;
    }
    
    /* 移动端导航栏 */
    .mobile-nav {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: #2c3e50;
        color: white;
        z-index: 1400;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
    }
    
    .mobile-nav-title {
        font-size: 18px;
        font-weight: 600;
    }
    
    .mobile-nav-toggle {
        background: none;
        border: none;
        color: white;
        cursor: pointer;
        padding: 10px;
        border-radius: 4px;
        display: flex;
        flex-direction: column;
        gap: 3px;
    }
    
    .mobile-nav-toggle span {
        width: 20px;
        height: 2px;
        background: currentColor;
        transition: 0.3s;
    }
    
    .content-wrapper {
        padding: 20px;
    }
    
    .page-header {
        margin-left: -20px;
        margin-right: -20px;
        padding: 30px 20px;
    }
    
    .page-header h1 {
        font-size: 32px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .difficulty-cards {
        grid-template-columns: 1fr;
    }
    
    .guide-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .category-title-section h1 {
        font-size: 28px;
    }
    
    .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .question-meta {
        flex-wrap: wrap;
    }
    
    .filter-toolbar {
        padding: 20px;
    }
    
    .filter-buttons {
        gap: 6px;
    }
    
    .filter-btn {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .page-navigation {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .nav-actions {
        justify-content: center;
    }
    
    .quick-nav-buttons {
        gap: 6px;
    }
    
    .quick-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .back-to-top {
        right: 20px;
        bottom: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .search-modal {
        padding-top: 5vh;
    }
    
    .search-modal-content {
        width: 95%;
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 15px;
    }
    
    .page-header {
        margin-left: -15px;
        margin-right: -15px;
        padding: 25px 15px;
    }
    
    .page-header h1 {
        font-size: 28px;
    }
    
    .page-description {
        font-size: 16px;
    }
    
    .stats-card {
        padding: 20px;
        gap: 15px;
    }
    
    .stats-icon {
        font-size: 32px;
    }
    
    .stats-number {
        font-size: 24px;
    }
    
    .category-card {
        margin-bottom: 15px;
    }
    
    .category-link {
        padding: 20px;
    }
    
    .category-title {
        font-size: 18px;
    }
    
    .difficulty-card {
        padding: 20px;
        gap: 15px;
    }
    
    .difficulty-number {
        font-size: 24px;
    }
    
    .guide-card {
        padding: 20px;
    }
    
    .guide-icon {
        font-size: 40px;
    }
    
    .question-item {
        padding: 20px;
    }
    
    .question-title h3 {
        font-size: 18px;
    }
    
    .filter-toolbar {
        padding: 15px;
    }
    
    .quick-navigation {
        padding: 15px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 选中文本样式 */
::selection {
    background: #3498db;
    color: white;
}

::-moz-selection {
    background: #3498db;
    color: white;
}

/* 打印样式 */
@media print {
    .sidebar,
    .filter-toolbar,
    .quick-navigation,
    .back-to-top,
    .page-navigation,
    .question-toggle {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .question-answer {
        display: block !important;
    }
    
    .question-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}