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

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

#app {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 15px 20px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    z-index: 1;
}

.settings-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    z-index: 1;
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.upload-section {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.download-demo-btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.download-demo-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.download-demo-btn:active {
    transform: translateY(0);
}

.upload-box {
    border: 2px dashed #667eea;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9ff;
}

.upload-box:hover {
    border-color: #764ba2;
    background: #f0f2ff;
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.upload-box p {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 14px;
    color: #888;
}

.mode-section {
    margin-top: 30px;
}

.mode-section h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mode-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.mode-icon {
    font-size: 24px;
}

.badge {
    position: absolute;
    right: 15px;
    background: #ff4757;
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.question-count {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

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

.search-box {
    position: relative;
    margin-bottom: 15px;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

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

.search-box .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
}

.highlight {
    background-color: #ffeb3b;
    color: #d32f2f;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

.progress-info {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
}

.question-type {
    background: #e8ecff;
    color: #667eea;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 14px;
}

.question-content {
    margin-bottom: 20px;
}

.question-title {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.option-item.selected {
    border-color: #667eea;
    background: #e8ecff;
}

.option-item.correct {
    border-color: #10b981;
    background: #d1fae5;
}

.option-item.wrong {
    border-color: #ef4444;
    background: #fee2e2;
}

.option-letter {
    width: 30px;
    height: 30px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #666;
}

.multiple .option-letter {
    border-radius: 6px;
}

.option-item.selected .option-letter {
    background: #667eea;
    color: #fff;
}

.option-item.correct .option-letter {
    background: #10b981;
    color: #fff;
}

.option-item.wrong .option-letter {
    background: #ef4444;
    color: #fff;
}

.fill-input, .essay-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.fill-input:focus, .essay-input:focus {
    border-color: #667eea;
}

.essay-input {
    min-height: 120px;
    resize: vertical;
}

.answer-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
}

.answer-result.correct {
    background: #d1fae5;
    border-left: 4px solid #10b981;
}

.answer-result.wrong {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
}

.result-title {
    font-weight: 600;
    margin-bottom: 10px;
}

.result-answer {
    font-size: 14px;
    color: #666;
}

.result-analysis {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 14px;
    color: #555;
}

.quiz-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
}

.nav-btn, .submit-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn {
    background: #f0f0f0;
    color: #333;
}

.nav-btn:hover:not(:disabled) {
    background: #e0e0e0;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
}

.submit-btn:hover {
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.question-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.question-card {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    background: #fff;
    transition: all 0.2s;
}

.question-card:hover {
    border-color: #667eea;
}

.question-card.current {
    border-color: #667eea;
    background: #667eea;
    color: #fff;
}

.question-card.answered {
    border-color: #10b981;
    background: #d1fae5;
}

.question-card.wrong {
    border-color: #ef4444;
    background: #fee2e2;
}

.result-container {
    text-align: center;
    padding: 20px 0;
}

.result-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.result-container h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 30px;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-num {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
}

.stat-num.correct {
    color: #10b981;
}

.stat-num.wrong {
    color: #ef4444;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.accuracy {
    font-size: 18px;
    color: #333;
    margin-bottom: 30px;
}

.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-btn {
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.result-btn:not(.primary) {
    background: #f0f0f0;
    color: #333;
}

.result-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.result-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.type-filter {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.type-filter h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.type-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.type-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 15px;
    background: #f8f9ff;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.type-checkbox:hover {
    background: #e8ecff;
}

.type-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.type-checkbox span {
    font-size: 14px;
    color: #333;
}

.type-checkbox:has(input:checked) {
    background: #667eea;
}

.type-checkbox:has(input:checked) span {
    color: #fff;
}

.confirm-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.quiz-name {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    margin-top: 4px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.memorize-btn {
    flex: 0 0 auto;
    width: 100px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #ffd700, #ffb700);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
    font-weight: 500;
    transition: all 0.3s;
}

.memorize-btn:hover {
    background: linear-gradient(135deg, #ffc700, #ffa700);
    transform: translateY(-1px);
}

.memorize-btn.active {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.question-cards-toggle {
    flex: 0 0 auto;
    width: 100px;
    padding: 10px 12px;
    background: #f5f5f5;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clear-progress-btn {
    width: 100%;
    padding: 12px;
    background: #fff5f5;
    border: 2px solid #feb2b2;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
    color: #c53030;
    transition: all 0.2s;
}

.clear-progress-btn:hover {
    background: #fee2e2;
    border-color: #fc8181;
}

.remove-favorite-btn {
    width: 100%;
    padding: 12px;
    background: #fffbf0;
    border: 2px solid #ffd966;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
    color: #9c7d18;
    transition: all 0.2s;
}

.remove-favorite-btn:hover {
    background: #fff5d6;
    border-color: #ffc107;
}

.favorite-toggle-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
    color: #fff;
    transition: all 0.2s;
    font-weight: 600;
}

.favorite-toggle-btn.favorited {
    background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%);
}

.favorite-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.favorite-toggle-btn:active {
    transform: translateY(0);
}

.font-size-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    padding: 12px;
    background: #f8f9ff;
    border-radius: 10px;
}

.font-size-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.font-size-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.font-size-btn:active {
    transform: translateY(0);
}

.font-size-display {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    min-width: 60px;
    text-align: center;
}

.settings-section {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    width: 90%;
    max-width: 400px;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
}

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

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    font-size: 24px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.toast-overlay.show {
    opacity: 1;
    visibility: visible;
}

.toast-container {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 85%;
    width: 320px;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.toast-overlay.show .toast-container {
    transform: scale(1) translateY(0);
}

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

.toast-icon.success {
    color: #52c41a;
}

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

.toast-icon.info {
    color: #1890ff;
}

.toast-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.toast-message {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

.toast-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 32px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    min-width: 100px;
}

.toast-btn:hover {
    opacity: 0.9;
}

.toast-btn:active {
    transform: scale(0.98);
}

.quiz-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 16px;
    border-radius: 12px;
    color: #fff;
    margin-bottom: 20px;
}

.quiz-info .quiz-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.quiz-info .quiz-stats {
    font-size: 12px;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.question-filter {
    margin-bottom: 20px;
}

.question-filter select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
}

.question-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.question-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.question-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.question-index {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.question-type-badge {
    font-size: 12px;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 20px;
    color: #666;
}

.question-content-preview {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 8px;
}

.question-options-preview {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
}

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

.question-answer {
    font-size: 13px;
    color: #667eea;
    padding: 8px 12px;
    background: #f0f2ff;
    border-radius: 6px;
    margin-bottom: 12px;
}

.question-answer .answer-label {
    font-weight: 600;
}

.question-answer .answer-text {
    white-space: pre-wrap;
}

.question-answer.essay-answer .answer-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9ff;
    border-radius: 8px;
}

.option-label {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.option-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

.remove-option-btn {
    width: 28px;
    height: 28px;
    background: #ff4d4f;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group textarea {
    resize: vertical;
}

.option-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-label {
    width: 28px;
    height: 28px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.option-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.remove-option-btn {
    width: 28px;
    height: 28px;
    background: #ff4d4f;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-option-btn {
    margin-top: 10px;
    padding: 10px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    color: #667eea;
    cursor: pointer;
    width: 100%;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.modal-btn.cancel {
    background: #f0f0f0;
    color: #666;
}

.modal-btn.confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.edit-modal {
    max-width: 90%;
    width: 450px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.edit-modal .modal-body {
    flex: 1;
    overflow-y: auto;
}

.modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.library-section {
    margin-top: 30px;
}

.library-section h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
}

.library-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 400px);
    overflow-y: auto;
    padding-bottom: 10px;
    margin-bottom: 80px;
}

.library-item {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
}

.library-item:hover {
    background: #e8ecff;
}

.library-info {
    width: 100%;
}

.library-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.library-meta {
    font-size: 14px;
    color: #666;
    display: flex;
    gap: 15px;
}

.library-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    justify-content: flex-end;
}

.action-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-btn.secondary {
    background: #f0f0f0;
    color: #333;
}

.action-btn.danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
}

.action-btn.info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.wrong-badge {
    background: #ff6b6b;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.favorite-badge {
    background: #ffc107;
    color: #333;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.action-btn.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.empty-state p {
    color: #666;
    font-size: 16px;
}

.type-select-header {
    margin-bottom: 20px;
}

.type-select-header h2 {
    font-size: 18px;
    color: #333;
}

.question-count-select {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
}

.question-count-select label {
    font-size: 14px;
    color: #333;
}

.question-count-select select {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.question-count-select select:focus {
    border-color: #667eea;
}

.delete-btn {
    color: #ef4444;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}

.delete-btn:hover {
    color: #dc2626;
}

.wrong-section {
    margin-top: 30px;
}

.wrong-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.wrong-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(239, 68, 68, 0.4);
}

.wrong-icon {
    font-size: 24px;
}

.wrong-text {
    flex: 1;
    text-align: center;
}

.badge {
    background: rgba(255,255,255,0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.type-quantity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.type-quantity-item .type-checkbox {
    margin: 0;
}

.quantity-input {
    width: 80px;
}

.quantity-input input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    outline: none;
}

.quantity-input input:focus {
    border-color: #667eea;
}

.fill-blank-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.fill-blank-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fill-blank-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.fill-blank-input {
    width: 100%;
    min-height: 80px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    resize: vertical;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.fill-blank-input:focus {
    border-color: #667eea;
}

.fill-blank-input.correct {
    border-color: #22c55e;
    background: #dcfce7;
}

.fill-blank-input.wrong {
    border-color: #ef4444;
    background: #fee2e2;
}

.essay-input {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    resize: vertical;
    outline: none;
    font-family: inherit;
}

.essay-input:focus {
    border-color: #667eea;
}

.essay-input:disabled {
    background: #f5f5f5;
    color: #999;
}

.retry-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

.retry-btn:active {
    transform: translateY(0);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 100;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.auth-form {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    margin: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s;
    box-sizing: border-box;
}

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

.form-input::placeholder {
    color: #999;
}

.submit-btn.full-width {
    width: 100%;
    margin-top: 10px;
}

.auth-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.auth-link {
    font-size: 14px;
    color: #667eea;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-divider {
    color: #ddd;
}

.header-placeholder {
    width: 60px;
}

.share-btn, .update-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.update-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
    margin-right: 10px;
}

.share-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    transform: translateY(-1px);
}

.update-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f6dad);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    transform: translateY(-1px);
}

.share-icon {
    font-size: 16px;
}

.share-text {
    font-weight: 500;
}

.loading-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
}

.loading-page .loading-icon {
    font-size: 48px;
    margin-bottom: 20px;
    animation: spin 1s linear infinite;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    padding: 10px 0;
    z-index: 100;
    border-top: 1px solid #eee;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0;
    transition: all 0.2s;
}

.nav-item.active {
    color: #667eea;
}

.nav-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.nav-text {
    font-size: 12px;
    color: #666;
}

.nav-item.active .nav-text {
    color: #667eea;
    font-weight: 500;
}

.with-nav .main-content {
    padding-bottom: 80px;
}

.loading-more {
    text-align: center;
    padding: 15px;
    color: #999;
    font-size: 14px;
}

.loading-icon {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.profile-section {
    display: none;
}

.profile-section.active {
    display: block;
}

.user-info {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    margin-bottom: 20px;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 36px;
}

.user-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.user-status {
    font-size: 14px;
    opacity: 0.8;
}

.login-btn {
    margin-top: 15px;
    margin-left: auto;
    margin-right: auto;
    padding: 10px 30px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: block;
}

.login-btn:hover {
    background: rgba(255,255,255,0.3);
}

.logout-btn {
    margin-top: 15px;
    margin-left: auto;
    margin-right: auto;
    padding: 10px 30px;
    background: rgba(255,107,107,0.8);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: block;
}

.logout-btn:hover {
    background: rgba(255,107,107,1);
}

.profile-menu {
    background: #fff;
    border-radius: 10px;
    margin: 0 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.profile-menu-item:last-child {
    border-bottom: none;
}

.profile-menu-item:hover {
    background: #f8f9ff;
}

.profile-menu-item.danger .menu-item-text {
    color: #e74c3c;
}

.profile-menu-item.danger:hover {
    background: #fff5f5;
}

.menu-item-icon {
    font-size: 18px;
    margin-right: 15px;
}

.menu-item-text {
    flex: 1;
    font-size: 15px;
    color: #333;
}

.menu-item-arrow {
    color: #999;
    font-size: 16px;
}

.contact-page {
    padding: 20px;
    text-align: center;
}

.contact-qr {
    width: 250px;
    height: 250px;
    margin: 0 auto 20px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.contact-qr img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-info {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.contact-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.contact-text {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
}

.guide-page {
    padding: 20px;
}

.guide-content {
    background: #fff;
    border-radius: 10px;
    padding: 30px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
}

.guide-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.guide-text {
    font-size: 15px;
    color: #666;
    line-height: 2;
}

.feedback-page {
    padding: 20px;
}

.feedback-content {
    background: #fff;
    border-radius: 10px;
    padding: 30px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.feedback-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.feedback-input {
    width: 100%;
    height: 150px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    resize: none;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.feedback-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.feedback-tip {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    text-align: left;
}

.feedback-char-count {
    font-size: 12px;
    color: #999;
    text-align: right;
    margin-bottom: 20px;
}

.feedback-submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    color: #fff;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.feedback-submit-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
}

.about-page {
    padding: 20px;
}

.about-content {
    background: #fff;
    border-radius: 10px;
    padding: 30px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
}

.about-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.about-text {
    font-size: 15px;
    color: #666;
    line-height: 2;
}

.page-btn {
    padding: 8px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.submit-score-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s;
}

.submit-score-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4);
}

.result-container {
    text-align: center;
    padding: 30px 20px;
}

.result-header {
    margin-bottom: 30px;
}

.result-icon {
    font-size: 80px;
    margin-bottom: 15px;
}

.result-header h2 {
    font-size: 24px;
    color: #333;
}

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

.stat-item {
    background: #f8f9ff;
    padding: 20px 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
}

.stat-item.correct .stat-value {
    color: #10b981;
}

.stat-item.wrong .stat-value {
    color: #ef4444;
}

.stat-item.rate .stat-value {
    color: #f59e0b;
}

.stat-item .stat-label {
    font-size: 12px;
    color: #666;
}

.result-chart {
    margin-bottom: 30px;
}

.chart-bar {
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
}

.chart-correct {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    transition: width 0.5s ease;
}

.chart-wrong {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f87171);
    transition: width 0.5s ease;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-actions .action-btn {
    padding: 15px;
    font-size: 16px;
}

.detail-page {
    padding-top: 10px;
}

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

.detail-header h3 {
    font-size: 18px;
    color: #333;
}

.close-detail-btn {
    padding: 8px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-item {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid #667eea;
}

.detail-item.correct {
    border-left-color: #10b981;
}

.detail-item.wrong {
    border-left-color: #ef4444;
}

.detail-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.detail-item-index {
    width: 28px;
    height: 28px;
    background: #667eea;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.detail-item-type {
    font-size: 12px;
    padding: 4px 10px;
    background: #e8ecff;
    color: #667eea;
    border-radius: 20px;
}

.detail-item-status {
    font-size: 12px;
    font-weight: 600;
}

.detail-item.correct .detail-item-status {
    color: #10b981;
}

.detail-item.wrong .detail-item-status {
    color: #ef4444;
}

.detail-item-content {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 12px;
}

.detail-item-answers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.answer-row {
    font-size: 13px;
}

.answer-label {
    color: #666;
    margin-right: 8px;
}

.answer-value {
    font-weight: 500;
}

.answer-value.correct {
    color: #10b981;
}

.answer-value.wrong {
    color: #ef4444;
}

.detail-item-analysis {
    font-size: 13px;
    color: #666;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.quiz-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 20px;
    color: #fff;
    margin-bottom: 25px;
}

.quiz-info-card .quiz-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    word-break: break-all;
}

.quiz-meta {
    display: flex;
    gap: 25px;
}

.quiz-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    opacity: 0.9;
}

.stat-icon {
    font-size: 16px;
}

.stat-value {
    font-weight: 600;
}

.function-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.function-btn {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    padding: 25px 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.function-btn:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.function-btn:active {
    transform: scale(0.98);
}

.function-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.function-icon {
    font-size: 32px;
}

.function-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

