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

body {
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    /* 移动端优化 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 防止移动端双击缩放 */
    touch-action: manipulation;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
    height: calc(100vh - 40px);
}

/* 左侧控制面板 */
.control-panel {
    width: 280px;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 操作区域 */
.action-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 导入功能组 */
.import-group {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.import-group-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: 0.5px;
}

.import-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.import-buttons .btn {
    flex: 1;
    min-width: 100px;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .import-group {
        padding: 10px;
    }
    
    .import-group-label {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .import-buttons {
        flex-direction: column;
        gap: 6px;
    }
    
    .import-buttons .btn {
        width: 100%;
        min-width: auto;
        font-size: 13px;
        padding: 10px 15px;
    }
}

.mode-buttons {
    display: flex;
    gap: 10px;
}

.mode-buttons .btn {
    flex: 1;
}

.app-title {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    text-align: center;
    margin-bottom: 10px;
}

/* 按钮通用样式 */
.btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-icon {
    font-size: 18px;
}

.btn-import {
    background: #4CAF50;
    color: white;
}

.btn-import:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.btn-paste {
    background: #2196F3;
    color: white;
}

.btn-paste:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.btn-ai-import {
    background: #9C27B0;
    color: white;
}

.btn-ai-import:hover {
    background: #7B1FA2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.3);
}

.btn-clear {
    background: #f44336;
    color: white;
}

.btn-clear:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.3);
}

.btn-random {
    background: #FF9800;
    color: white;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-random:hover {
    background: #F57C00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

.btn-random.active {
    background: #F57C00;
}

.btn-random .btn-text {
    display: block;
    width: 100%;
}

.btn-save {
    background: #607D8B;
    color: white;
}

.btn-save:hover {
    background: #455A64;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(96, 125, 139, 0.3);
}

.btn-export {
    background: #9C27B0;
    color: white;
}

.btn-export:hover {
    background: #7B1FA2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.3);
}

.btn-import-backup {
    background: #FF9800;
    color: white;
}

.btn-import-backup:hover {
    background: #F57C00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

.btn-wrong-cards {
    background: #E91E63;
    color: white;
    position: relative;
    padding-right: 35px; /* 为徽章留出空间 */
}

.btn-wrong-cards:hover {
    background: #C2185B;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.3);
}

.btn-wrong-cards.active {
    background: #C2185B;
    box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.3);
}

.btn-stats {
    background: #FF9800;
    color: white;
}

.btn-stats:hover {
    background: #F57C00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

.btn-back {
    background: #607D8B;
    color: white;
    padding: 8px 16px;
    font-size: 13px;
    width: auto;
    min-width: auto;
    white-space: nowrap;
}

.btn-back:hover {
    background: #455A64;
    transform: translateY(-2px);
}

/* 数量徽章 */
.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f44336;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* AI功能区域 */
.ai-group {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    padding: 15px;
    color: white;
}

.ai-group h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: white;
    text-align: center;
}

.ai-buttons {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-buttons .btn {
    flex: 1;
    min-width: 100px;
}

.btn-text {
    display: inline;
}

@media (max-width: 768px) {
    .ai-buttons {
        flex-direction: column;
    }
    
    .ai-buttons .btn {
        width: 100%;
    }
    
    .btn-text {
        display: none;
    }
    
    .ai-buttons .btn-icon {
        font-size: 20px;
    }
}

.btn-ai {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-ai:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-ai:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-ai-settings {
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 12px;
    padding: 8px;
}

.btn-ai-settings:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: white;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* AI加载动画 */
.ai-loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* AI结果样式 */
.ai-result {
    line-height: 1.8;
    font-size: 16px;
}

.ai-result h3 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 10px;
}

.ai-result p {
    margin-bottom: 15px;
}

.ai-result .highlight {
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 3px;
}

.ai-result .example {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin: 15px 0;
}

.ai-result img {
    max-width: 100%;
    border-radius: 8px;
    margin: 15px 0;
}

/* 设置模态框 */
.modal-settings {
    max-width: 500px;
}

.settings-item {
    margin-bottom: 20px;
}

.settings-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.settings-item input,
.settings-item select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.settings-item input:focus,
.settings-item select:focus {
    outline: none;
    border-color: #667eea;
}

.settings-item small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary {
    flex: 1;
    background: #667eea;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    flex: 1;
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-test {
    background: #9C27B0;
    color: white;
}

.btn-test:hover {
    background: #7B1FA2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.3);
}

.btn-test.active {
    background: #7B1FA2;
}

.btn-open {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    padding: 15px 40px;
    margin-top: 15px;
}

.btn-open:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

/* 分类筛选 */
.filter-group, .stats-group {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 15px;
}

.filter-group h3, .stats-group h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
}

.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #9E9E9E;
    color: white;
}

.filter-btn[data-filter="初学"] {
    background: #f44336;
}

.filter-btn[data-filter="每天"] {
    background: #2196F3;
}

.filter-btn[data-filter="三天"] {
    background: #4CAF50;
}

.filter-btn[data-filter="每周"] {
    background: #9C27B0;
}

.filter-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.filter-btn.active {
    border: 2px solid #000;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* 统计信息 */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

/* 统计网格（新设计） */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

/* 让"全部"卡片占满整行 */
.stats-grid .stat-card.stat-全部 {
    grid-column: 1 / -1;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: height 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.stat-card:hover::before {
    height: 5px;
}

.stat-card.active {
    border: 2px solid #000;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    font-weight: bold;
    transform: translateY(-2px);
}

.stat-card.active::before {
    height: 6px;
}

.stat-card.stat-全部 {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
}

.stat-card.stat-全部::before {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.stat-card.stat-初学 {
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
}

.stat-card.stat-初学::before {
    background: linear-gradient(90deg, #f44336 0%, #e91e63 100%);
}

.stat-card.stat-每天 {
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
}

.stat-card.stat-每天::before {
    background: linear-gradient(90deg, #2196F3 0%, #03a9f4 100%);
}

.stat-card.stat-三天 {
    background: linear-gradient(135deg, #e8f5e9 0%, #ffffff 100%);
}

.stat-card.stat-三天::before {
    background: linear-gradient(90deg, #4CAF50 0%, #8bc34a 100%);
}

.stat-card.stat-每周 {
    background: linear-gradient(135deg, #f3e5f5 0%, #ffffff 100%);
}

.stat-card.stat-每周::before {
    background: linear-gradient(90deg, #9C27B0 0%, #e91e63 100%);
}

.stat-card .stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
    line-height: 1;
}

.stat-card .stat-value {
    font-size: 26px;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-total {
    text-align: center;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.stat-total strong {
    color: #667eea;
    font-size: 16px;
}

.stat-label {
    font-weight: bold;
    font-size: 14px;
}

.stat-label.stat-初学 {
    color: #f44336;
}

.stat-label.stat-每天 {
    color: #2196F3;
}

.stat-label.stat-三天 {
    color: #4CAF50;
}

.stat-label.stat-每周 {
    color: #9C27B0;
}

.stat-item.stat-total .stat-label {
    color: #000;
    font-size: 16px;
}

.stat-value {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

/* 自测统计 */
.test-stats-group {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 15px;
}

.test-stats-group h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
}

.test-stats-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* 紧凑型自测统计（新设计） */
.test-stats-compact {
    display: flex;
    gap: 15px;
    justify-content: space-around;
    align-items: center;
}

.test-stat-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.test-stat-compact .test-stat-label {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

.test-stat-compact .test-stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.test-stat-compact.test-stat-accuracy {
    border-left: 2px solid #ddd;
    padding-left: 15px;
}

.test-stat-compact.test-stat-accuracy .test-stat-value {
    color: #667eea;
    font-size: 22px;
}

@media (max-width: 480px) {
    .test-stats-list {
        grid-template-columns: 1fr;
    }
}

.test-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.test-stat-label {
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.test-stat-value {
    font-weight: bold;
    font-size: 16px;
}

.test-stat-value.test-correct {
    color: #4CAF50;
}

.test-stat-value.test-wrong {
    color: #f44336;
}

.test-stat-item.test-stat-accuracy {
    border-top: 2px solid #ddd;
    padding-top: 12px;
    margin-top: 5px;
}

.test-stat-item.test-stat-accuracy .test-stat-label {
    font-size: 16px;
    color: #667eea;
}

.test-stat-item.test-stat-accuracy .test-stat-value {
    font-size: 20px;
    color: #667eea;
}

/* 主内容区 */
.main-content {
    flex: 1;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative; /* 为拖拽区域提供定位上下文 */
}

/* 顶部工具栏（AI助手和自测统计） */
.top-toolbar {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
    flex-shrink: 0;
    margin-bottom: 10px;
}

.top-toolbar .ai-group {
    flex: 1;
    min-width: 280px;
    margin: 0;
}

.top-toolbar .test-stats-group {
    flex: 1;
    min-width: 200px;
    margin: 0;
}

/* 兼容旧类名 */
.main-toolbar {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
    flex-shrink: 0;
}

.main-toolbar .ai-group {
    flex: 1;
    min-width: 280px;
    margin: 0;
}

.main-toolbar .test-stats-group {
    flex: 1;
    min-width: 200px;
    margin: 0;
}

/* 自测模式下，统计区域更紧凑 */
.main-content.test-mode-active .main-toolbar .test-stats-group {
    min-width: 180px;
    max-width: 250px;
}

/* 自测模式下优化布局间距 */
.main-content.test-mode-active {
    gap: 15px;
}

.main-content.test-mode-active .main-toolbar {
    margin-bottom: 5px;
}

.main-content.test-mode-active .test-input-area {
    margin-top: 0;
}

/* 卡片容器 */
.card-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 400px;
    flex-shrink: 0;
}

/* 自测模式下调整卡片容器高度，避免与输入区域重叠 */
.main-content.test-mode-active .card-container {
    min-height: 350px;
    max-height: 450px;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .card-container {
        min-height: 350px;
    }
    
    .main-content.test-mode-active .card-container {
        min-height: 300px;
        max-height: 350px;
    }
}

@media (max-width: 480px) {
    .card-container {
        min-height: 280px;
    }
    
    .main-content.test-mode-active .card-container {
        min-height: 250px;
        max-height: 300px;
    }
}

/* 占位提示 */
/* 拖拽导入区域（保留边框和特效，但不显示提示文字） */
.drop-zone {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.05);
    border: 3px dashed #667eea;
    border-radius: 15px;
    z-index: 5; /* 降低z-index，确保卡片可以点击 */
    transition: all 0.3s ease;
    pointer-events: all; /* 允许接收拖拽事件 */
}

.drop-zone.drag-over {
    background: rgba(102, 126, 234, 0.15);
    border-color: #764ba2;
    border-width: 4px;
    transform: scale(1.02);
}

.main-content.drag-over {
    background: rgba(102, 126, 234, 0.05);
}

.placeholder {
    text-align: center;
    color: #666;
    padding: 40px;
    max-width: 600px;
    margin: 0 auto;
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.placeholder h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #667eea;
}

.placeholder p {
    font-size: 16px;
    margin-bottom: 20px;
}

.format-hint {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: left;
}

.format-hint pre {
    background: #fff;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 10px 0;
    font-size: 13px;
    border: 1px solid #ddd;
}

/* 闪卡包装器 */
.flashcard-wrapper {
    width: 100%;
    max-width: 700px;
    height: 500px;
    perspective: 1000px;
    flex-shrink: 0;
    position: relative;
    z-index: 1; /* 确保卡片在拖拽区域之上 */
}

/* 自测模式下调整卡片高度 */
.main-content.test-mode-active .flashcard-wrapper {
    height: 400px;
    max-height: 400px;
}

@media (max-width: 768px) {
    .main-content.test-mode-active .flashcard-wrapper {
        height: 350px;
        max-height: 350px;
    }
}

@media (max-width: 480px) {
    .main-content.test-mode-active .flashcard-wrapper {
        height: 280px;
        max-height: 280px;
    }
}

/* 闪卡 */
.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s, opacity 0.15s ease, transform 0.15s ease;
    cursor: pointer;
    /* 增强纸张质感：轻微的内阴影和边框 */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.flashcard.test-mode {
    cursor: default;
}

.flashcard.card-switching {
    opacity: 0.5;
    transform: scale(0.98);
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    /* 纸张质感：多层阴影和纹理 */
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 5px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    /* 纸张纹理背景 */
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        );
    background-blend-mode: overlay;
    /* 纸张质感：轻微的内阴影 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.flashcard-front {
    transform: rotateY(0deg);
}

/* 根据分类设置卡片颜色 */
.flashcard[data-category="初学"] .flashcard-front {
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        ),
        linear-gradient(135deg, #c62828 0%, #b71c1c 50%, #d32f2f 100%);
    color: white;
}

.flashcard[data-category="初学"] .flashcard-back {
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        ),
        linear-gradient(135deg, #b71c1c 0%, #c62828 50%, #d32f2f 100%);
    color: white;
    transform: rotateY(180deg) scaleX(1);
}

.flashcard[data-category="每天"] .flashcard-front {
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        ),
        linear-gradient(135deg, #1565C0 0%, #0d47a1 50%, #1976D2 100%);
    color: white;
}

.flashcard[data-category="每天"] .flashcard-back {
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        ),
        linear-gradient(135deg, #0d47a1 0%, #1565C0 50%, #1976D2 100%);
    color: white;
    transform: rotateY(180deg) scaleX(1);
}

.flashcard[data-category="三天"] .flashcard-front {
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        ),
        linear-gradient(135deg, #2e7d32 0%, #1b5e20 50%, #388E3C 100%);
    color: white;
}

.flashcard[data-category="三天"] .flashcard-back {
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        ),
        linear-gradient(135deg, #1b5e20 0%, #2e7d32 50%, #388E3C 100%);
    color: white;
    transform: rotateY(180deg) scaleX(1);
}

.flashcard[data-category="每周"] .flashcard-front {
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        ),
        linear-gradient(135deg, #6a1b9a 0%, #4a148c 50%, #7B1FA2 100%);
    color: white;
}

.flashcard[data-category="每周"] .flashcard-back {
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        ),
        linear-gradient(135deg, #4a148c 0%, #6a1b9a 50%, #7B1FA2 100%);
    color: white;
    transform: rotateY(180deg) scaleX(1);
}

/* 默认颜色（如果没有分类或分类无效） */
.flashcard:not([data-category]) .flashcard-front,
.flashcard[data-category=""] .flashcard-front {
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        ),
        linear-gradient(135deg, #4a148c 0%, #1565C0 100%);
    color: white;
}

.flashcard:not([data-category]) .flashcard-back,
.flashcard[data-category=""] .flashcard-back {
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
        ),
        linear-gradient(135deg, #1565C0 0%, #4a148c 100%);
    color: white;
    transform: rotateY(180deg) scaleX(1);
}

.card-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    font-size: 18px;
    line-height: 1.8;
    text-align: left;
    padding: 20px;
    word-wrap: break-word;
    /* 文字阴影，增强可读性和质感 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    /* 平滑字体渲染 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.card-content.center {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    padding: 20px;
}

/* 滚动条样式 */
.card-content::-webkit-scrollbar {
    width: 10px;
}

.card-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.card-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
}

.card-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 分类标签 */
.card-category {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
}

/* 卡片进度指示器 */
.card-progress {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
    backdrop-filter: blur(10px);
}

/* 自测输入区域 */
.test-input-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
    margin-top: 10px;
}

.test-input-wrapper {
    width: 100%;
    max-width: 700px;
}

.test-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.test-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.test-result {
    width: 100%;
    max-width: 700px;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.test-result.correct {
    background: #e8f5e9;
    border: 2px solid #4CAF50;
}

.test-result.wrong {
    background: #ffebee;
    border: 2px solid #f44336;
}

.result-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.result-text {
    font-size: 18px;
    font-weight: bold;
    margin-top: 10px;
}

.test-result.correct .result-text {
    color: #4CAF50;
}

.test-result.wrong .result-text {
    color: #f44336;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 分类按钮 */
.category-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.category-buttons-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    margin-bottom: 5px;
}

.category-buttons-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.category-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.category-icon {
    font-size: 18px;
}

.category-text {
    font-size: 15px;
}

.category-btn.category-初学 {
    background: #f44336;
}

.category-btn.category-初学:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.3);
}

.category-btn.category-每天 {
    background: #2196F3;
}

.category-btn.category-每天:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.category-btn.category-三天 {
    background: #4CAF50;
}

.category-btn.category-三天:hover {
    background: #388E3C;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.category-btn.category-每周 {
    background: #9C27B0;
}

.category-btn.category-每周:hover {
    background: #7B1FA2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.3);
}

/* 导航按钮 */
.navigation {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.nav-progress {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    padding: 0 15px;
    min-width: 80px;
    text-align: center;
}

.nav-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    background: #2196F3;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.nav-icon {
    font-size: 18px;
}

.nav-text {
    font-size: 15px;
}

.nav-btn:hover {
    background: #0b7dda;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.nav-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    max-width: 300px;
    word-wrap: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #4CAF50;
}

.toast.error {
    background: #f44336;
}

/* 错题本容器 */
.wrong-cards-container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    margin: -30px -30px 0 -30px; /* 抵消 main-content 的 padding */
    padding: 0 30px 0 30px; /* 移除顶部 padding，完全贴合顶部 */
}

.wrong-cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0 15px 0; /* 只保留很小的顶部 padding */
    border-bottom: 2px solid #eee;
    flex-shrink: 0;
    margin-top: 0; /* 确保没有上边距 */
}

.wrong-cards-header h2 {
    margin: 0;
    color: #667eea;
    font-size: 24px;
}

/* 错题列表 */
.wrong-cards-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.wrong-card-item {
    background: white;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.wrong-card-item:hover {
    border-color: #E91E63;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.15);
    transform: translateY(-2px);
}

.wrong-card-content {
    margin-bottom: 15px;
}

.wrong-card-question,
.wrong-card-answer,
.wrong-card-user-answer {
    margin-bottom: 12px;
    line-height: 1.6;
}

.wrong-card-label {
    font-weight: bold;
    color: #666;
    margin-right: 8px;
    font-size: 14px;
}

.wrong-card-text {
    color: #333;
    font-size: 15px;
    word-wrap: break-word;
}

.correct-answer {
    color: #4CAF50;
    font-weight: 500;
}

.wrong-answer {
    color: #f44336;
    font-weight: 500;
}

.wrong-card-meta {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
    color: #999;
}

.wrong-card-time,
.wrong-card-category {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wrong-card-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-jump {
    background: #2196F3;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-jump:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(33, 150, 243, 0.3);
}

.btn-delete-wrong {
    background: #f44336;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-delete-wrong:hover {
    background: #d32f2f;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(244, 67, 54, 0.3);
}

/* 错题本空状态 */
.wrong-cards-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.wrong-cards-empty .empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.wrong-cards-empty p {
    font-size: 16px;
    margin: 10px 0;
}

.wrong-cards-empty .empty-hint {
    font-size: 14px;
    color: #bbb;
    margin-top: 15px;
}

/* 统计面板样式 */
.modal-stats {
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
}

.modal-stats-body {
    max-height: calc(90vh - 80px);
    overflow-y: auto;
    padding: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stats-chart-card {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-chart-card h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    text-align: center;
}

.stats-chart-card canvas {
    max-height: 300px;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    color: white;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.summary-label {
    font-size: 14px;
    opacity: 0.9;
}

.summary-value {
    font-size: 24px;
    font-weight: bold;
}

.summary-correct {
    color: #4CAF50;
}

.summary-wrong {
    color: #f44336;
}

.summary-accuracy {
    color: #FFD700;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .modal-stats {
        width: 98%;
        max-height: 95vh;
    }
    
    .stats-chart-card canvas {
        max-height: 250px;
    }
    
    .stats-summary {
        grid-template-columns: 1fr;
    }
}

/* 版本信息（右下角） */
.version-info {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    z-index: 999;
    cursor: help;
    user-select: none;
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
}

.version-info:hover {
    background: rgba(0, 0, 0, 0.8);
    opacity: 1;
}

@media (max-width: 768px) {
    .version-info {
        bottom: 5px;
        right: 5px;
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 40px);
    }
    
    .control-panel {
        width: 100%;
        max-height: none;
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
    
    .filter-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .filter-btn {
        flex: 1;
        min-width: 80px;
    }
    
    .main-toolbar {
        flex-direction: column;
    }
    
    .main-toolbar .ai-group,
    .main-toolbar .test-stats-group {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        gap: 10px;
    }
    
    .control-panel {
        padding: 15px;
        max-height: none;
        overflow-y: visible;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .main-toolbar {
        gap: 15px;
    }
    
    .flashcard-wrapper {
        height: 400px;
    }
    
    .card-content {
        /* 平板端基础字体大小，但会被JS动态调整覆盖 */
        font-size: 16px;
    }
    
    .card-content.center {
        /* 平板端居中显示的基础字体大小，但会被JS动态调整覆盖 */
        font-size: 36px;
    }
    
    .category-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .category-btn {
        flex: 1;
        min-width: calc(50% - 5px);
    }
    
    .navigation {
        flex-direction: row;
        gap: 10px;
    }
    
    .nav-btn {
        flex: 1;
    }
    
    .toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    /* 错题本移动端优化 */
    .wrong-cards-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .wrong-cards-header h2 {
        font-size: 20px;
    }
    
    .wrong-card-item {
        padding: 15px;
    }
    
    .wrong-card-actions {
        flex-direction: column;
    }
    
    .btn-jump,
    .btn-delete-wrong {
        width: 100%;
        justify-content: center;
    }
    
    .wrong-card-meta {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .app-title {
        font-size: 18px;
    }
    
    .control-panel {
        padding: 12px;
        border-radius: 10px;
    }
    
    .main-content {
        padding: 12px;
        border-radius: 10px;
    }
    
    .main-toolbar {
        gap: 10px;
        flex-direction: column;
    }
    
    .ai-group,
    .test-stats-group {
        padding: 12px;
        width: 100%;
    }
    
    .ai-group h3,
    .test-stats-group h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .flashcard-wrapper {
        height: 300px;
        max-width: 100%;
    }
    
    .card-content {
        /* 移动端基础字体大小，但会被JS动态调整覆盖 */
        font-size: 14px;
        padding: 15px;
    }
    
    .card-content.center {
        /* 移动端居中显示的基础字体大小，但会被JS动态调整覆盖 */
        font-size: 24px;
    }
    
    .category-buttons {
        flex-direction: column;
    }
    
    .category-btn {
        width: 100%;
        min-width: auto;
        padding: 12px 20px;
        font-size: 14px;
        /* 移动端增大触摸区域 */
        min-height: 44px;
    }
    
    .navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 14px;
        /* 移动端增大触摸区域 */
        min-height: 44px;
    }
    
    .test-input {
        font-size: 16px; /* 移动端防止自动缩放 */
        padding: 12px;
    }
    
    .btn {
        padding: 12px 15px;
        font-size: 14px;
        /* 移动端增大触摸区域 */
        min-height: 44px;
    }
    
    .btn-icon {
        font-size: 18px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 10px;
        border-radius: 10px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 15px;
        font-size: 14px;
    }
    
    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
    
    /* 移动端优化触摸反馈 */
    .btn:active,
    .category-btn:active,
    .nav-btn:active {
        transform: scale(0.98);
    }
    
    /* 移动端优化卡片触摸 */
    .flashcard {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* 移动端优化滚动 */
    .control-panel {
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-body {
        -webkit-overflow-scrolling: touch;
    }
}


