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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --bg-white: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.hidden {
    display: none !important;
}

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

.navbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

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

.nav-menu {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius);
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--text);
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
}

.main-content {
    min-height: calc(100vh - 120px);
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 12px;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
}

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

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 700;
}

.stat-label {
    font-size: 14px;
    opacity: 0.8;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin: 40px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.subject-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s;
    cursor: pointer;
}

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.subject-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.subject-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text);
}

.subject-card p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 16px;
}

.subject-hours {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.home-actions {
    text-align: center;
    padding: 20px 0 60px;
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: white;
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: #eff6ff;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.subject-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.subject-overview {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.subject-overview h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.subject-chapters h4,
.study-resources h4 {
    margin: 20px 0 12px;
    font-size: 16px;
    color: var(--text);
}

.chapter-list {
    padding-left: 0;
}

.chapter-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.chapter-list li:hover {
    color: var(--primary);
}

.chapter-list li .chapter-num {
    background: #eff6ff;
    color: var(--primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resource-item {
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 14px;
    border: 1px solid var(--border);
}

.practice-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.form-select,
.form-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-white);
    color: var(--text);
}

.form-select {
    min-width: 160px;
}

.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.practice-area .practice-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

.question-card {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.question-type {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.question-text {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
    color: var(--text);
}

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

.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.option-item:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.option-item.selected {
    background: #eff6ff;
    border-color: var(--primary);
}

.option-item.correct {
    background: #dcfce7;
    border-color: var(--success);
}

.option-item.wrong {
    background: #fee2e2;
    border-color: var(--danger);
}

.option-item.disabled {
    pointer-events: none;
}

.option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.option-item.selected .option-letter {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.practice-actions,
.exam-actions {
    display: flex;
    gap: 12px;
}

.analysis-area {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}

.analysis-area h4 {
    color: #b45309;
    margin-bottom: 8px;
}

.analysis-area p {
    color: #92400e;
    line-height: 1.7;
}

.result-summary {
    background: var(--bg-white);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.result-summary h3 {
    font-size: 22px;
    margin-bottom: 12px;
}

.exam-setup {
    display: flex;
    justify-content: center;
}

.exam-setup .exam-info {
    background: var(--bg-white);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 400px;
}

.exam-info .form-group {
    margin-bottom: 16px;
}

.exam-info label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.exam-area .exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-white);
    padding: 16px 24px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 20px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.timer.warning {
    color: var(--danger);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.exam-progress {
    color: var(--text-light);
}

.exam-result {
    text-align: center;
    padding: 40px 0;
}

.result-card {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 400px;
    margin: 0 auto;
}

.score-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 16px;
}

.score-circle span:first-child {
    font-size: 48px;
    font-weight: 700;
}

.score-circle span:last-child {
    font-size: 16px;
}

.accuracy-text {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 12px;
}

.result-details {
    color: var(--text-light);
    margin-bottom: 20px;
}

.notes-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
}

.notes-sidebar {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.notes-filters {
    margin-bottom: 16px;
}

.notes-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.note-item {
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.note-item:hover {
    background: var(--bg);
    border-color: var(--border);
}

.note-item.active {
    background: #eff6ff;
    border-color: var(--primary);
}

.note-item-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.note-item-meta {
    font-size: 12px;
    color: var(--text-light);
}

.note-editor {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.note-editor input,
.note-editor select,
.note-editor textarea {
    display: block;
    margin-bottom: 12px;
    width: 100%;
}

.note-editor .note-title {
    font-size: 18px;
    font-weight: 600;
}

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

.wrong-questions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.wrong-item {
    background: var(--bg-white);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    cursor: pointer;
}

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

.wrong-subject {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.wrong-date {
    font-size: 12px;
    color: var(--text-light);
}

.wrong-question-text {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
}

.wrong-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

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

.plan-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
}

.plan-form {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.plan-form h3 {
    margin-bottom: 16px;
}

.plan-form .form-group {
    margin-bottom: 16px;
}

.plan-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.plan-form input,
.plan-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
}

.plan-list-container {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.plan-list-container h3 {
    margin-bottom: 16px;
}

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

.plan-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.plan-item.completed {
    opacity: 0.6;
    background: #f0fdf4;
    border-color: var(--success);
}

.plan-item-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.plan-item-content {
    flex: 1;
}

.plan-item-subject {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 4px;
}

.plan-item-text {
    font-size: 14px;
    margin-bottom: 4px;
}

.plan-item-duration {
    font-size: 12px;
    color: var(--text-light);
}

.plan-item-delete {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.stat-desc {
    font-size: 13px;
    color: var(--text-light);
}

.subject-progress {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.progress-chart {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.chart-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-label {
    width: 80px;
    font-size: 14px;
    font-weight: 500;
}

.chart-bar {
    flex: 1;
    height: 24px;
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.chart-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
    border-radius: 12px;
    transition: width 0.5s ease;
    min-width: 4px;
}

.chart-value {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.recent-activity {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.activity-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

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

.activity-time {
    color: var(--text-light);
    font-size: 12px;
    display: block;
    margin-bottom: 4px;
}

.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}

@media (max-width: 1024px) {
    .subject-content {
        grid-template-columns: 1fr;
    }

    .plan-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 12px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }

    .nav-menu.show {
        display: flex;
    }

    .nav-link {
        padding: 10px 16px;
    }

    .nav-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 24px;
    }

    .hero-stats {
        gap: 30px;
    }

    .stat-number {
        font-size: 28px;
    }

    .subjects-grid {
        grid-template-columns: 1fr;
    }

    .practice-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .form-select {
        width: 100%;
    }

    .notes-layout {
        grid-template-columns: 1fr;
    }

    .plan-layout {
        grid-template-columns: 1fr;
    }

    .stats-cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 20px;
    }

    .hero p {
        font-size: 14px;
    }

    .section-title {
        font-size: 20px;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .question-text {
        font-size: 14px;
    }
}
