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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segui UI', Helvetica, Arial, sans-serif;
    background-color: #f7f7f5;
    color: #37352f;
    line-height: 1.6;
}

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

.header {
    padding: 40px 0 20px;
    border-bottom: 1px solid #e9e9e7;
    background: white;
    margin-bottom: 20px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon {
    font-size: 48px;
    line-height: 1;
}

.header-title {
    font-size: 40px;
    font-weight: 700;
    color: #37352f;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 16px;
    color: #787774;
    margin-top: 4px;
}

.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.sidebar {
    background: white;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
    border: 1px solid #e9e9e7;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 600;
    color: #37352f;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-upload {
    border: 2px dashed #d3d3d1;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.file-upload:hover {
    border-color: #2383e2;
    background-color: #f8fafc;
}

.file-upload input {
    display: none;
}

.upload-content {
    color: #787774;
    font-size: 14px;
}

.upload-btn {
    background: #2383e2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
    transition: background-color 0.2s ease;
}

.upload-btn:hover {
    background: #1a6dbf;
}

.chapter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d3d3d1;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #37352f;
}

.chapter-select:focus {
    outline: none;
    border-color: #2383e2;
    box-shadow: 0 0 0 1px #2383e2;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: #f7f7f5;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #37352f;
}

.stat-label {
    font-size: 12px;
    color: #787774;
    margin-top: 4px;
}

.mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.mode-tab {
    flex: 1;
    padding: 8px 16px;
    border: 1px solid #d3d3d1;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    transition: all 0.2s ease;
}

.mode-tab.active {
    background: #2383e2;
    color: white;
    border-color: #2383e2;
}

.content-area {
    background: white;
    border-radius: 8px;
    border: 1px solid #e9e9e7;
    min-height: 600px;
}

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

.content-title {
    font-size: 20px;
    font-weight: 600;
    color: #37352f;
}

.progress-container {
    flex: 1;
    max-width: 200px;
    margin-left: 20px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e9e9e7;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #2383e2;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: #787774;
    margin-top: 4px;
}

.questions-container {
    padding: 20px;
}

.question-block {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #f1f1ef;
}

.question-block:last-child {
    border-bottom: none;
}

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

.question-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.question-number {
    background: #f1f1ef;
    color: #37352f;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.question-type {
    background: #e8f4fd;
    color: #1a6dbf;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.question-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: none;
    border: 1px solid #d3d3d1;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #f7f7f5;
}

.search-btn {
    border-color: #2383e2;
    color: #2383e2;
}

.search-btn:hover {
    background: #e8f4fd;
}

.question-content {
    font-size: 16px;
    color: #37352f;
    margin-bottom: 20px;
    line-height: 1.6;
}

.options-list {
    list-style: none;
    margin-bottom: 20px;
}

.option-item {
    margin-bottom: 8px;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #e9e9e7;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.option-label:hover {
    background: #f7f7f5;
    border-color: #d3d3d1;
}

.option-input {
    margin-right: 12px;
    width: 16px;
    height: 16px;
}

.option-text {
    flex: 1;
    font-size: 14px;
    color: #37352f;
}

.option-label.correct {
    background: #edf7ed;
    border-color: #4caf50;
    color: #2e7d32;
}

.option-label.wrong {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.option-label.selected {
    background: #e8f4fd;
    border-color: #2383e2;
}

.submit-btn {
    background: #2383e2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.submit-btn:hover {
    background: #1a6dbf;
}

.submit-btn:disabled {
    background: #d3d3d1;
    cursor: not-allowed;
}

.result-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

.result-message.correct {
    background: #edf7ed;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.result-message.wrong {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #787774;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-description {
    font-size: 14px;
    line-height: 1.5;
}

.wrong-questions-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.wrong-question-item {
    padding: 8px 12px;
    border: 1px solid #e9e9e7;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 12px;
    background: #fff5f5;
    color: #37352f;
}

.clear-wrong-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    width: 100%;
}

.clear-wrong-btn:hover {
    background: #d32f2f;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .sidebar {
        order: -1;
        margin-bottom: 15px;
        padding: 15px;
    }
    
    .header {
        padding: 20px 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .header-icon {
        font-size: 36px;
    }
    
    .header-title {
        font-size: 28px;
    }
    
    .header-subtitle {
        font-size: 14px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .content-area {
        border-radius: 6px;
        padding: 0;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    
    .progress-container {
        width: 100%;
        margin: 10px 0 0 0;
    }
    
    .questions-container {
        padding: 15px;
    }
    
    .question-block {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }
    
    .question-header {
        flex-direction: column;
        
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .question-meta {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .question-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
    
    .question-content {
        font-size: 15px;
        margin-bottom: 15px;
    }
    
    .option-label {
        padding: 10px 12px;
    }
    
    .option-text {
        font-size: 13px;
    }
    
    .submit-btn {
        width: 100%;
        padding: 12px;
    }
    
    .mode-tabs {
        flex-direction: column;
        gap: 6px;
    }
    
    .mode-tab {
        padding: 10px;
    }
    
    .chapter-select {
        padding: 8px 10px;
    }
    
    .wrong-questions-list {
        max-height: 200px;
    }
    
    .empty-state {
        padding: 40px 15px;
    }
    
    .empty-icon {
        font-size: 36px;
    }
    
    .empty-title {
        font-size: 16px;
    }
    
    .empty-description {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 24px;
    }
    
    .stat-number {
        font-size: 18px;
    }
    
    .question-content {
        font-size: 14px;
    }
    
    .option-label {
        padding: 8px 10px;
    }
    
    .result-message {
        font-size: 13px;
    }
}