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

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

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

.navbar {
    background: rgba(255,255,255,0.95);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
}

.nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #666;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    background: #667eea;
    color: white;
}

.user-info {
    color: #667eea;
    font-weight: 500;
}

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

.hidden {
    display: none !important;
}

h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
}

h2 {
    color: #333;
    margin-bottom: 20px;
}

.subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 30px;
}

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

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

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s;
}

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

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
    background: #e0e0e0;
    color: #333;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 0.9em;
}

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

.btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.login-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin-top: 100px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.progress-bar {
    margin-bottom: 20px;
}

#progressText {
    display: block;
    text-align: center;
    margin-bottom: 8px;
    color: #666;
}

.progress {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

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

.question {
    padding: 20px 0;
}

.q-num {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.q-content {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
}

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

.option {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.option.correct {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
}

.option.correct .opt-radio {
    color: #28a745;
}

.option.wrong {
    border-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.option.wrong .opt-radio {
    color: #dc3545;
}

.option.struck {
    text-decoration: line-through;
    color: #aaa;
    background: #fafafa;
}

.fill-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
}

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

.score-area {
    text-align: center;
    padding: 30px 0;
}

.score-big {
    font-size: 4em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.score-text {
    font-size: 1.2em;
    color: #666;
    margin-top: 10px;
}

.score-detail {
    color: #888;
    margin-top: 5px;
}

.result-item {
    padding: 15px;
    margin: 10px 0;
    border-radius: 10px;
    border-left: 4px solid;
}

.result-item.correct {
    background: #e8f5e9;
    border-color: #4caf50;
}

.result-item.wrong {
    background: #ffebee;
    border-color: #f44336;
}

.result-icon {
    font-size: 1.2em;
    margin-right: 10px;
}

.result-correct {
    color: #4caf50;
    margin-left: 10px;
}

.result-explanation {
    margin-top: 8px;
    color: #666;
    font-size: 0.9em;
}

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

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

.score-num {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

.wrong-item {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
}

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

.wrong-type {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85em;
}

.wrong-type.choice {
    background: #e3f2fd;
    color: #1976d2;
}

.wrong-type.fill {
    background: #f3e5f5;
    color: #7b1fa2;
}

.wrong-count {
    color: #f44336;
    font-size: 0.9em;
}

.wrong-content {
    margin-bottom: 10px;
    line-height: 1.6;
}

.wrong-options {
    color: #666;
    margin-bottom: 10px;
}

.wrong-options span {
    margin-right: 15px;
}

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

.wrong-explanation {
    color: #666;
    margin-top: 8px;
    font-size: 0.9em;
}

.empty {
    text-align: center;
    color: #888;
    padding: 40px;
}

.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-bar select {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

.question-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

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

.q-type {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85em;
}

.q-type.choice {
    background: #e3f2fd;
    color: #1976d2;
}

.q-type.fill {
    background: #f3e5f5;
    color: #7b1fa2;
}

.q-category {
    background: #e0e0e0;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85em;
}

.q-options {
    color: #666;
    margin: 8px 0;
}

.q-answer {
    color: #4caf50;
}

.generated-item {
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    margin: 8px 0;
}

.gen-type {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    margin-right: 8px;
}

.gen-options {
    color: #666;
    margin: 5px 0;
}

.gen-answer {
    color: #4caf50;
    font-size: 0.9em;
}

.success {
    color: #4caf50;
    font-weight: 500;
    margin-bottom: 15px;
}

.option-input {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.tip {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.review-content {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    line-height: 1.8;
}

.review-content h3 {
    color: #667eea;
    margin: 15px 0 10px;
}

.review-content li {
    margin: 5px 0 5px 20px;
}

.review-content p {
    margin: 8px 0;
}

.review-item {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
}

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

.review-type {
    background: #667eea;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85em;
}

.review-unit {
    background: #e0e0e0;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85em;
}

.review-date {
    color: #888;
    font-size: 0.85em;
    margin-left: auto;
}

.review-title {
    font-weight: 500;
    margin-bottom: 8px;
}

.review-preview {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    .navbar {
        flex-direction: column;
        gap: 10px;
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    .form-row {
        flex-direction: column;
    }
    .login-card {
        margin-top: 50px;
    }
}
