/* 机场代码学习系统样式 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-content h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    color: white;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 导航标签 */
.nav-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 5px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow-x: auto;
}

.nav-tab {
    flex: 1;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-2px);
}

.nav-tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.nav-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.nav-tab:hover::before {
    transform: scaleX(1);
}

.nav-tab i {
    margin-right: 8px;
}

/* 标签内容 */
.tab-content {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.tab-content.active {
    display: block;
}

/* 控制组 */
.learn-controls, .test-controls, .wrong-controls, .favorites-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.learn-controls .btn {
    white-space: nowrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 500;
    color: #555;
}

.control-group select, .control-group input {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

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

/* 搜索框 */
.search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-box input {
    width: 100%;
    padding-right: 40px;
}

.search-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-info {
    background: linear-gradient(135deg, #00b4db 0%, #0083b0 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 180, 219, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 180, 219, 0.4);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

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

/* 题目容器 */
.question-container {
    margin-top: 20px;
}

/* 学习操作按钮 */
.learn-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.learn-actions .btn {
    padding: 8px 15px;
    font-size: 0.8rem;
}

/* 题目导航指示器 */
.question-navigation {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    border: 1px solid #e3f2fd;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navigation-indicator {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    justify-content: center;
}

.question-nav-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.question-nav-dot:hover {
    transform: scale(1.3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.question-nav-dot.correct {
    background: #28a745;
}

.question-nav-dot.wrong {
    background: #dc3545;
}

.question-nav-dot.skipped {
    background: #6c757d;
}

.question-nav-dot.current {
    background: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5), 0 0 0 6px rgba(0, 123, 255, 0.2);
    animation: currentPulse 2s infinite;
}

@keyframes currentPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4), 0 0 0 0 rgba(0, 123, 255, 0.1);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0), 0 0 0 20px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0), 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.nav-info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    justify-content: center;
}

.nav-legend {
    display: flex;
    align-items: center;
    gap: 5px;
}

.current-legend {
    color: #007bff;
    font-weight: bold;
}

/* 导航点工具提示 */
.nav-dot-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1000;
    margin-bottom: 5px;
}

.question-nav-dot:hover .nav-dot-tooltip {
    opacity: 1;
}

.question-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    animation: cardAppear 0.5s ease;
    transform-origin: top center;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.question-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
}

.difficulty-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: #e3f2fd;
    color: #1976d2;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 30px;
    color: #333;
    line-height: 1.5;
}

.question-options {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.option {
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.option:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.option.selected {
    border-color: #667eea;
    background: #e3f2fd;
    color: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.option.selected::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    animation: optionSelect 0.3s ease;
}

@keyframes optionSelect {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.option.correct {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
    animation: correctAnswer 0.5s ease;
}

.option.wrong {
    border-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
    animation: wrongAnswer 0.5s ease;
}

@keyframes correctAnswer {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes wrongAnswer {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    50% {
        transform: translateX(5px);
    }
    75% {
        transform: translateX(-5px);
    }
    100% {
        transform: translateX(0);
    }
}

.question-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* AI解释 */
.ai-explanation {
    margin-top: 30px;
    background: #f8f9ff;
    border-radius: 15px;
    padding: 25px;
    border: 1px solid #e3f2fd;
}

.explanation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.explanation-header h3 {
    color: #667eea;
    font-size: 1.2rem;
}

.explanation-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.explanation-tab {
    padding: 8px 16px;
    border: 1px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.explanation-tab.active {
    background: #667eea;
    color: white;
}

.explanation-content {
    color: #555;
    line-height: 1.6;
    font-size: 1rem;
}

/* 测试容器 */
.test-container {
    margin-top: 20px;
}

.test-progress {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    text-align: center;
    color: #666;
    font-weight: 500;
}

.test-question {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.test-results {
    text-align: center;
}

.result-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 0 auto;
}

.result-card h3 {
    color: #667eea;
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.result-stats {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
}

.result-label {
    font-weight: 500;
    color: #666;
}

.result-value {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* 测试结果列表 */
.test-results-list {
    margin-top: 30px;
    max-height: 400px;
    overflow-y: auto;
}

.result-item.correct {
    border-left: 4px solid #28a745;
}

.result-item.wrong {
    border-left: 4px solid #dc3545;
}

.result-item.skipped {
    border-left: 4px solid #6c757d;
}

.result-question {
    font-weight: 500;
    margin-bottom: 5px;
}

.result-answer, .result-correct {
    font-size: 0.9rem;
    color: #666;
}

.result-answer {
    color: #007bff;
}

.result-correct {
    color: #28a745;
}

/* 答案结果样式 */
.answer-result {
    margin: 15px 0;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
}

.answer-result.correct {
    background: #d4edda;
    color: #155724;
}

.answer-result.wrong {
    background: #f8d7da;
    color: #721c24;
}

.correct-answer {
    margin-top: 10px;
    color: #666;
    font-size: 0.9rem;
    text-align: center;
}

/* 列表样式 */
.wrong-list, .favorites-grid {
    display: grid;
    gap: 20px;
}

.wrong-item, .favorite-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    transition: all 0.3s ease;
}

.wrong-item:hover, .favorite-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.item-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.item-meta {
    color: #666;
    font-size: 0.9rem;
}

.item-content {
    margin-bottom: 15px;
}

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

/* 统计页面 */
.stats-container {
    margin-top: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.stat-icon {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 15px;
}

.stat-content h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #e1e5e9;
    background: white;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover {
    border-color: #667eea;
    color: #667eea;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

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

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h3 {
    color: #333;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding: 20px 25px;
    border-top: 1px solid #e1e5e9;
}

/* 加载动画 */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading.active {
    display: flex;
}

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

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

/* 通知提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    border-left: 4px solid #667eea;
    animation: toastSlideIn 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: #28a745;
}

.toast.error {
    border-left-color: #dc3545;
}

.toast.warning {
    border-left-color: #ffc107;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast.success .toast-icon {
    color: #28a745;
}

.toast.error .toast-icon {
    color: #dc3545;
}

.toast.warning .toast-icon {
    color: #ffc107;
}

.toast-message {
    font-weight: 500;
    color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .header-stats {
        gap: 20px;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .nav-tab {
        text-align: center;
    }
    
    .learn-controls, .test-controls, .wrong-controls, .favorites-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        justify-content: space-between;
    }
    
    .question-actions {
        flex-direction: column;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.5rem;
    }
    
    .header-stats {
        gap: 15px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .tab-content {
        padding: 20px;
    }
}
