/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* 页面切换 */
.page {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.page.active {
    display: block;
}

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

/* 标题 */
.main-title {
    text-align: center;
    color: white;
    font-size: 3em;
    margin-top: 30px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    text-align: center;
    color: rgba(255,255,255,0.9);
    font-size: 1.2em;
    margin-bottom: 30px;
}

/* 范围切换器样式 */
.range-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px auto;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 500px;
}

.range-label {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
    white-space: nowrap;
}

.range-btn {
    padding: 10px 25px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.range-btn:hover {
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

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

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

h2 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
}

h3 {
    color: #333;
    margin-bottom: 15px;
}

/* 用户信息 */
.user-info {
    text-align: center;
    margin-bottom: 30px;
}

.user-greeting {
    background: rgba(255,255,255,0.9);
    padding: 15px 30px;
    border-radius: 50px;
    display: inline-block;
    font-size: 1.1em;
    color: #667eea;
    font-weight: bold;
}

/* 功能卡片网格 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.feature-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.feature-card .icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.feature-card p {
    color: #666;
    font-size: 0.95em;
}

/* 按钮样式 */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

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

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-large {
    padding: 15px 50px;
    font-size: 1.2em;
}

.btn-back {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.btn-back:hover {
    background: white;
    color: #667eea;
}

/* 登录表单 */
.login-form {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    margin: 0 auto;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

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

.existing-users {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.existing-users h4 {
    color: #333;
    margin-bottom: 15px;
}

.user-tag {
    display: inline-block;
    background: #f0f0f0;
    padding: 8px 15px;
    border-radius: 15px;
    margin: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-tag:hover {
    background: #667eea;
    color: white;
}

/* 练习页面 */
.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.practice-info {
    background: white;
    padding: 10px 20px;
    border-radius: 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.practice-info span {
    color: #667eea;
    font-weight: bold;
}

.question-card {
    background: white;
    border-radius: 30px;
    padding: 50px;
    text-align: center;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.question-text {
    font-size: 3em;
    font-weight: bold;
    color: #333;
    margin-bottom: 40px;
}

.choice-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.choice-btn {
    padding: 30px;
    font-size: 2em;
    background: #f8f9fa;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.choice-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(1.05);
}

.choice-btn.correct {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.choice-btn.wrong {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.fill-input {
    display: flex;
    gap: 15px;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.fill-input input {
    flex: 1 1 auto;
    min-width: 150px;
    max-width: 300px;
    padding: 20px;
    font-size: 2em;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    text-align: center;
}

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

.fill-input button {
    padding: 20px 40px;
    font-size: 1.5em;
    flex-shrink: 0;
}

/* 小屏幕适配 */
@media (max-width: 600px) {
    .fill-input {
        flex-direction: column;
        max-width: 90%;
        gap: 12px;
    }
    
    .fill-input input {
        width: 100%;
        max-width: 100%;
        font-size: 1.8em;
        padding: 15px;
    }
    
    .fill-input button {
        width: 100%;
        padding: 18px 30px;
        font-size: 1.3em;
    }
}

/* 中等屏幕适配 */
@media (max-width: 768px) and (min-width: 601px) {
    .fill-input input {
        font-size: 1.8em;
        padding: 18px;
    }
    
    .fill-input button {
        font-size: 1.3em;
        padding: 18px 35px;
    }
}

/* 题目卡片响应式优化 */
@media (max-width: 768px) {
    .question-card {
        padding: 30px 20px;
        min-height: 300px;
    }
    
    .question-text {
        font-size: 2em;
        margin-bottom: 25px;
    }
    
    .choice-options {
        grid-template-columns: 1fr;
        gap: 15px;
        max-width: 90%;
    }
    
    .choice-btn {
        padding: 20px;
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .question-card {
        padding: 20px 15px;
        min-height: 250px;
    }
    
    .question-text {
        font-size: 1.6em;
        margin-bottom: 20px;
    }
    
    .choice-btn {
        padding: 18px;
        font-size: 1.3em;
    }
    
    /* 按钮响应式 */
    .btn-large {
        padding: 12px 25px;
        font-size: 1em;
    }
    
    /* 标题字体大小调整 */
    .main-title {
        font-size: 2em;
    }
    
    h2 {
        font-size: 1.8em;
    }
}

/* 操作栏样式（月巩固记录等） */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

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

.filter-label {
    font-weight: bold;
    white-space: nowrap;
}

.filter-select {
    padding: 8px 15px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    font-size: 1em;
    min-width: 150px;
}

.btn-export,
.btn-export-alt {
    background: linear-gradient(135deg, #67B26F 0%, #4ca2cd 100%);
    white-space: nowrap;
}

/* 操作按钮组样式 */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* 登录表单响应式优化 */
@media (max-width: 768px) {
    .login-form {
        padding: 30px 20px;
        max-width: 90%;
    }
    
    .login-form .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 600px) {
    .login-form {
        padding: 25px 15px;
    }
    
    .form-group input {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    /* 操作栏响应式 */
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-select {
        flex: 1;
        min-width: auto;
    }
    
    .btn-export {
        width: 100%;
        padding: 12px 20px;
    }
    
    /* 操作按钮组响应式 */
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .login-form {
        padding: 20px 12px;
    }
    
    .login-form .btn {
        padding: 14px 20px;
        font-size: 0.95em;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-label {
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    /* 全局按钮小屏幕优化 */
    .btn {
        font-size: 0.9em;
        padding: 10px 20px;
    }
    
    .action-buttons .btn {
        padding: 14px 20px;
        font-size: 1em;
    }
    
    /* 范围切换器响应式 */
    .range-switcher {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    
    .range-label {
        width: 100%;
        text-align: center;
    }
    
    .range-btn {
        width: 100%;
        padding: 12px 20px;
    }
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    margin-top: 30px;
    overflow: hidden;
}

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

/* 统计页面 */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
    font-size: 1em;
}

.chart-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
}

.error-analysis {
    background: white;
    border-radius: 20px;
    padding: 30px;
}

.error-item {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
}

/* 学习建议卡片样式 */
.suggestion-card {
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.suggestion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.suggestion-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0,0,0,0.1);
}

.suggestion-content {
    color: #555;
    line-height: 1.8;
}

.suggestion-content p {
    margin: 10px 0;
}

.suggestion-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.suggestion-content li {
    margin: 8px 0;
    line-height: 1.6;
}

.suggestion-content strong {
    color: #333;
    font-weight: 600;
}

/* 易错题图表容器优化 */
.chart-container {
    min-height: 300px;
    margin-bottom: 30px;
}

.chart-container canvas {
    max-height: 400px;
}

/* 月巩固记录 */
.monthly-review-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.monthly-review-month {
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 20px;
}

.monthly-review-items {
    display: grid;
    gap: 15px;
}

.monthly-review-item {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 15px 20px;
    border-radius: 10px;
    border-left: 4px solid #70AD47;
}

.monthly-review-item .question {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.monthly-review-item .info {
    font-size: 13px;
    color: #666;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.monthly-review-item .badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: bold;
    color: white;
}

.monthly-review-item .badge-blue {
    background: #667eea;
}

.monthly-review-item .badge-purple {
    background: #764ba2;
}

.monthly-review-summary {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    text-align: center;
}

.monthly-review-summary strong {
    color: #667eea;
    font-size: 18px;
}

/* 错题本 */
#wrongQuestionsList {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    min-height: 200px;
}

.wrong-question-item {
    background: #fff3cd;
    border-left: 4px solid #f44336;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    font-size: 1.2em;
}

.wrong-question-item .question {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.wrong-question-item .info {
    color: #666;
    font-size: 0.9em;
}

/* 排行榜 */
.ranking-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn {
    padding: 12px 25px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
}

.tab-btn:hover, .tab-btn.active {
    background: white;
    color: #667eea;
}

.ranking-list {
    background: white;
    border-radius: 20px;
    padding: 30px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
    transition: background 0.3s ease;
}

.ranking-item:hover {
    background: #f8f9fa;
}

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

.rank-number {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    width: 50px;
}

.rank-number.top1 {
    color: #ffd700;
    font-size: 2em;
}

.rank-number.top2 {
    color: #c0c0c0;
    font-size: 1.8em;
}

.rank-number.top3 {
    color: #cd7f32;
    font-size: 1.6em;
}

.rank-info {
    flex: 1;
}

.rank-name {
    font-weight: bold;
    font-size: 1.2em;
    color: #333;
}

.rank-class {
    color: #666;
    font-size: 0.9em;
}

.rank-time {
    font-weight: bold;
    color: #667eea;
    font-size: 1.2em;
}

/* 留言板 */
.feedback-form {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
}

.feedback-form textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 15px;
}

.feedback-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.feedback-list {
    background: white;
    border-radius: 20px;
    padding: 30px;
}

.feedback-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #666;
    font-size: 0.9em;
}

.feedback-content {
    color: #333;
    line-height: 1.6;
}

/* 结果页面 */
.result-card {
    background: white;
    border-radius: 30px;
    padding: 50px;
    text-align: center;
    max-width: 600px;
    margin: 50px auto;
}

.result-card h2 {
    color: #667eea;
    margin-bottom: 30px;
}

.result-stats {
    margin-bottom: 40px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 1.3em;
}

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

.result-item .label {
    color: #666;
}

.result-item .value {
    font-weight: bold;
    color: #667eea;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .main-title {
        font-size: 2em;
    }

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

    .question-card {
        padding: 30px 20px;
    }

    .question-text {
        font-size: 2em;
    }

    .choice-options {
        grid-template-columns: 1fr;
    }

    .choice-btn {
        font-size: 1.5em;
    }

    .practice-header {
        flex-direction: column;
    }

    .practice-info {
        width: 100%;
        justify-content: center;
    }

    .result-card {
        padding: 30px 20px;
    }

    .result-buttons {
        flex-direction: column;
    }

    .result-buttons button {
        width: 100%;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 平板横屏 */
@media (orientation: landscape) and (max-width: 1024px) {
    .question-card {
        min-height: 300px;
    }
}

/* 动画效果 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.bounce {
    animation: bounce 0.5s;
}

/* Toast 提示样式 */
#toastContainer {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: toastSlideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    justify-content: center;
}

.toast.success {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toast.error {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

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

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease-out forwards;
}


