:root {
    /* 基础颜色变量 */
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-secondary: #7f8c8d;
    --text-muted: #666666;
    --border-color: #dddddd;
    --header-color: #2c3e50;
    --item-bg: #f8f9fa;
    --input-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    /* 功能颜色变量 */
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --success-color: #2ecc71;
    --success-hover: #27ae60;
    --danger-color: #e74c3c;
    --danger-hover: #c0392b;
    --warning-color: #ffd700;
    
    /* 选项状态颜色 - 亮色模式 */
    --correct-bg: #d4edda;
    --correct-border: #c3e6cb;
    --correct-text: #155724;
    --wrong-bg: #f8d7da;
    --wrong-border: #f5c6cb;
    --wrong-text: #721c24;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #999999;
    --border-color: #333333;
    --header-color: #ffffff;
    --item-bg: #2d2d2d;
    --input-bg: #2d2d2d;
    --shadow-color: rgba(0, 0, 0, 0.5);
    
    /* 选项状态颜色 - 暗色模式 */
    --correct-bg: #1b4332;
    --correct-border: #2d6a4f;
    --correct-text: #d8f3dc;
    --wrong-bg: #4a1d1d;
    --wrong-border: #7a2b2b;
    --wrong-text: #ffd6d6;
}

/* =========================================
   基础重置与布局 (Base & Layout)
   ========================================= */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 15px;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    margin: 0;
    color: var(--header-color);
    font-size: 22px;
    font-weight: bold;
}

.header p {
    margin: 5px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.footer {
    text-align: center;
    padding: 15px 0;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 20px;
}

/* =========================================
   通用组件 (Components)
   ========================================= */

/* 卡片 (Card) */
.card, .features, .user-info, .question, .strategy-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: background-color 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.user-info, .question, .strategy-card {
    padding: 10px;
}

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

.card-title, .title, .user-name, .feature-content h3, .strategy-title {
    margin: 0;
    font-size: 17px;
    color: var(--header-color);
    font-weight: bold;
}

.feature-content h3, .strategy-title {
    font-size: 16px;
}

.user-name {
    font-size: 14px;
}

.card-content {
    margin-bottom: 10px;
}

.card-footer {
    text-align: right;
}

/* 图标 (Icon) */
.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
}

.practice-icon { background-color: var(--primary-color); color: white; }
.favorite-icon { background-color: var(--danger-color); color: white; }
.stats-icon { background-color: var(--success-color); color: white; }

/* 按钮 (Button) */
.btn, button, .ai-button, .favorite-btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    border: none;
    text-decoration: none;
    margin-right: 8px;
}

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

.btn-primary:hover, button:hover {
    background-color: var(--primary-hover);
}

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

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

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

.btn-success:hover {
    background-color: var(--success-hover);
}

button:disabled, .ai-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.button-container {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.home-link {
    display: inline-block;
    margin: 10px 0;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    background-color: var(--card-bg);
    border-radius: 6px;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: background-color 0.3s;
}

.home-link:hover {
    background-color: var(--item-bg);
}

/* =========================================
   页面特定样式 (Page Specific)
   ========================================= */

/* 用户信息 (User Info) */
.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.user-info-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

.user-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.user-actions a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
    white-space: nowrap;
    display: inline-block;
}

.theme-toggle-inline {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
    white-space: nowrap;
    display: inline-block;
    cursor: pointer;
}

.floating-toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 9999;
    background: var(--card-bg);
    box-shadow: 0 2px 8px var(--shadow-color);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
    font-size: 18px;
}

.floating-toggle:hover {
    transform: scale(1.1);
    background: var(--item-bg);
}

.user-actions a:hover {
    background-color: var(--item-bg);
}

/* 统计区域 (Stats) */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background-color: var(--item-bg);
    border-radius: 8px;
    transition: background-color 0.3s;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--header-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.stats {
    margin-top: 8px;
    padding: 16px 8px 8px; /* 增加顶部内边距，为刻度标签留出空间 */
    background-color: var(--item-bg);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.answer-strip {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-height: 20px; /* 稍微增加高度以容纳阴影 */
    overflow: hidden;
    padding: 2px 6px;
    position: relative;
    background-color: rgba(0, 0, 0, 0.05); /* 半透明底色 */
    border-radius: 10px; /* 圆管感 */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); /* 内阴影增加深度 */
}

[data-theme="dark"] .answer-strip {
    background-color: rgba(255, 255, 255, 0.05);
}

.answer-block {
    display: inline-block;
    height: 10px;
    border-radius: 2px;
    flex: 1 1 0;
    transition: all 0.3s ease;
}

.answer-block.correct {
    background-color: var(--success-color);
}

.answer-block.wrong {
    background-color: var(--danger-color);
}

.answer-block.target {
    width: auto;
    height: 12px;
    border: 2px solid var(--success-color);
    border-radius: 3px;
    background-color: transparent;
    box-sizing: border-box;
    flex: 1 1 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease;
}

.answer-block.target.filled {
    background-color: var(--success-color);
    animation: block-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes block-pop {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.answer-block.correct-solid {
    width: auto;
    height: 12px;
    border-radius: 3px;
    background-color: var(--success-color);
    flex: 1 1 0;
}

.answer-block.wrong-solid {
    width: auto;
    height: 12px;
    border-radius: 3px;
    background-color: var(--danger-color);
    flex: 1 1 0;
}

.answer-threshold {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background-color: var(--warning-color);
    pointer-events: none;
    z-index: 10;
    transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.4s ease, box-shadow 0.4s ease;
}

/* 指针小三角 */
.answer-threshold::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--warning-color);
    transition: border-top-color 0.4s ease;
}

.answer-threshold.passed {
    background-color: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
    animation: threshold-pulse 2s infinite;
}

@keyframes threshold-pulse {
    0% { box-shadow: 0 0 8px var(--success-color); }
    50% { box-shadow: 0 0 15px var(--success-color), 0 0 20px rgba(46, 204, 113, 0.4); }
    100% { box-shadow: 0 0 8px var(--success-color); }
}

.answer-threshold.passed::before {
    border-top-color: var(--success-color);
}

.answer-threshold.passed .answer-threshold-label {
    background-color: var(--success-color);
    color: white;
    box-shadow: 0 0 10px var(--success-color);
}

.answer-threshold-label {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    background-color: var(--warning-color);
    color: var(--bg-color);
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: bold;
    white-space: nowrap;
    transition: all 0.4s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.answer-rate {
    white-space: nowrap;
    color: var(--text-secondary);
    font-weight: 600;
    line-height: 16px; /* 与 min-height 保持一致确保居中 */
}

/* 进度条 (Progress) */
.progress-container {
    margin-top: 10px;
    padding: 12px;
    background-color: var(--item-bg);
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.progress-bar {
    width: 100%;
    height: 8px; /* 调细一点更精致 */
    background-color: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
    position: relative;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), #2ecc71);
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); /* 弹性动画 */
    position: relative;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

/* 进度条头部的发光点 */
.progress::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: progress-glow 2s infinite linear;
}

@keyframes progress-glow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 4px;
}

/* 功能列表 (Features) */
.features {
    margin-top: 30px;
}

.features h2 {
    margin: 0 0 15px 0;
}

.feature-item {
    margin-bottom: 15px;
    padding: 15px;
    background: var(--item-bg);
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    transition: transform 0.3s ease, background-color 0.3s;
}

.feature-item:hover {
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 24px;
    margin-right: 15px;
    min-width: 40px;
    text-align: center;
}

.feature-content {
    flex: 1;
}

.feature-content h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.feature-details {
    margin: 12px 0 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.feature-details li {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 5px;
    padding-left: 15px;
    position: relative;
}

.feature-details li:before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

.feature-item:last-child {
    margin-bottom: 0;
}

/* 策略卡片 (Strategy Card) */
.strategy-card {
    margin-bottom: 15px;
    position: relative;
    padding: 16px;
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.strategy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
    flex-wrap: nowrap !important;
}

.strategy-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap !important;
}

.home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: var(--item-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.home-button:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.home-icon {
    font-size: 18px;
    line-height: 1;
    display: block;
}

.strategy-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--header-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
    line-height: 32px; /* 与按钮高度一致 */
}

.strategy-description {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 8px 12px;
    background-color: var(--item-bg);
    border-radius: 8px;
    opacity: 0.85;
}

/* 顶栏控制组优化 */
.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-pill {
    display: flex;
    align-items: center;
    background-color: var(--item-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3px;
    height: 36px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.pill-item {
    display: flex;
    align-items: center;
    padding: 0 14px;
    height: 100%;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-color);
    transition: all 0.2s ease;
    border-radius: 15px;
    white-space: nowrap;
}

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

.pill-item .pill-icon {
    margin-right: 5px;
    font-size: 15px;
}

.pill-divider {
    width: 1px;
    height: 14px;
    background-color: var(--border-color);
    margin: 0 2px;
}

/* 状态激活样式 */
#shuffle-pill.active,
.immersive-mode #immersive-pill {
    background-color: var(--primary-color);
    color: white !important;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

#shuffle-pill.active .pill-label,
.immersive-mode #immersive-pill .pill-label {
    color: white !important;
}

.strategy-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--item-bg);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.strategy-settings-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: rotate(90deg);
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.strategy-settings-btn .btn-icon {
    font-size: 18px;
    margin: 0;
}

.strategy-settings-btn .btn-text {
    display: none;
}

/* 题型与覆盖率行 */
.question-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 4px;
}

.meta-left, .meta-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-right {
    margin-left: auto;
}

.coverage-stats {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 500;
    white-space: nowrap;
}

/* 徽章化统计 */
.streak-badge, .today-badge {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background-color: var(--item-bg);
    border: 1px solid var(--border-color);
    white-space: nowrap;
    flex-shrink: 0;
}

/* 徽章图标样式 */
.streak-icon, .today-icon {
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
}

.streak-badge {
    color: var(--text-color);
}

.streak-flame {
    width: 10px;
    height: 14px;
    border-radius: 60% 60% 60% 60% / 70% 70% 45% 45%;
    background: radial-gradient(circle at 50% 75%, #ffe08a 0%, #ff8c2a 50%, #d6452b 100%);
    transform-origin: 50% 100%;
    opacity: 0;
    margin-right: 2px;
}

.streak-hot .streak-flame, .streak-fire .streak-flame {
    opacity: 1;
    animation: streakFlameFlicker 0.9s infinite ease-in-out;
}

@keyframes streakFlameFlicker {
    0% { transform: scale(1) rotate(-6deg); filter: blur(0); }
    50% { transform: scale(1.15) rotate(6deg); filter: blur(0.2px); }
    100% { transform: scale(1) rotate(-6deg); filter: blur(0); }
}

.today-badge {
    color: var(--text-muted);
}

.today-badge span {
    color: var(--primary-color);
}

.streak-hot {
    background-color: rgba(255, 140, 42, 0.1);
    border-color: rgba(255, 140, 42, 0.3);
    color: #ff8c2a;
}

.streak-fire {
    background-color: rgba(214, 69, 43, 0.1);
    border-color: rgba(214, 69, 43, 0.3);
    color: #d6452b;
    animation: pulse-fire 2s infinite;
}

@keyframes pulse-fire {
    0% { box-shadow: 0 0 0 0 rgba(214, 69, 43, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(214, 69, 43, 0); }
    100% { box-shadow: 0 0 0 0 rgba(214, 69, 43, 0); }
}

@media (max-width: 600px) {
    .strategy-card {
        padding: 12px;
    }

    .strategy-header {
        gap: 8px;
    }
    
    .strategy-header-left {
        gap: 8px;
    }

    .home-button {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .home-icon {
        font-size: 18px;
    }

    .strategy-title {
        font-size: 15px;
        max-width: none;
        flex: 1;
        min-width: 0;
    }

    .header-controls {
        gap: 6px;
        flex-shrink: 0;
    }

    .control-pill {
        height: 32px;
        padding: 2px;
    }

    .pill-item {
        padding: 0 6px;
    }

    .pill-item .pill-label {
        display: none; /* 移动端隐藏文字标签，只留图标 */
    }

    .pill-item .pill-icon {
        margin-right: 0;
        font-size: 16px;
    }

    .strategy-settings-btn {
        width: 32px;
        height: 32px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }

    .strategy-settings-btn .btn-text {
        display: none;
    }

    .strategy-settings-btn .btn-icon {
        margin-right: 0;
        font-size: 16px;
    }
}

/* 快速继续卡片 (Resume Card) */
.resume-card {
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(to right, var(--card-bg), var(--item-bg));
}

.resume-card .card-header {
    padding-bottom: 2px;
}

.resume-card .last-time {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
}

.resume-content {
    padding: 2px 0;
}

.resume-text {
    font-size: 13px;
    color: var(--text-color);
    line-height: 1.3;
    font-style: italic;
    opacity: 0.9;
}

/* 视觉化统计 (Visual Stats) */
.stat-visual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px 0;
}

.stat-visual-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.progress-circle {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    position: relative;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 100%;
}

.circle-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 2.5;
}

.circle {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 2.8;
    stroke-linecap: round;
    animation: progress 1s ease-out forwards;
}

@keyframes progress {
    0% { stroke-dasharray: 0 100; }
}

.percentage {
    fill: var(--text-color);
    font-family: 'PingFang SC', sans-serif;
    font-size: 8px;
    font-weight: 600;
    text-anchor: middle;
}

.stat-simple-grid {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    margin: 0 10px;
}

.stat-simple-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-simple-item:first-child {
    border-right: 1px solid var(--border-color);
}

.stat-simple-item .stat-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--header-color);
    margin-bottom: 2px;
}

.stat-simple-item .stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

[data-theme="dark"] .circle-bg {
    stroke: #333;
}

/* AI 智能分析 (AI Analysis) */
.ai-analysis-container {
    min-height: 80px;
    padding: 10px 0;
}

.ai-analysis-placeholder {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    font-style: italic;
}

.ai-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
}

.ai-analysis-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
}

.ai-analysis-content h1, 
.ai-analysis-content h2, 
.ai-analysis-content h3 {
    font-size: 16px;
    margin: 12px 0 8px 0;
    color: var(--primary-color);
}

.ai-analysis-content p {
    margin-bottom: 10px;
}

.ai-analysis-content strong {
    color: #e67e22;
}

.ai-analysis-content ul, 
.ai-analysis-content ol {
    padding-left: 20px;
    margin-bottom: 10px;
}

.ai-analysis-content li {
    margin-bottom: 5px;
}

/* =========================================
    练习页面样式 (Practice Page)
   ========================================= */

/* 题目 (Question) */
.question {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid var(--border-color);
    position: relative;
    min-height: 100px;
    transition: background-color 0.3s, border-color 0.3s, opacity 0.3s ease;
}

.question-content {
    position: relative;
    z-index: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-color);
}

.question-text {
    vertical-align: middle;
}

.question-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    text-align: center;
    min-width: 50px;
    height: 20px;
    line-height: 1;
    box-sizing: border-box;
}

.type-single { background-color: var(--primary-color); }
.type-multiple { background-color: var(--success-color); }
.type-judge { background-color: #6c757d; }

/* 新题目标签 (New Question Badge) - 丝滑折叠丝带风格 */
.new-question-badge {
    position: absolute;
    top: -1px;
    left: -1px;
    width: 40px;
    height: 40px;
    overflow: hidden;
    z-index: 100;
    pointer-events: none;
}

.new-question-badge span {
    position: absolute;
    display: block;
    width: 60px;
    padding: 2px 0;
    background-color: #ff4757;
    background-image: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    transform: rotate(-45deg) translate(-16px, 0px);
    letter-spacing: 0.5px;
}

/* 确保新题目的文字不被丝带遮挡 */
.question.has-new-badge .question-content {
    padding-top: 10px;
}

/* 装饰：为丝带添加折叠阴影，使其更自然 */
.new-question-badge::before,
.new-question-badge::after {
    content: "";
    position: absolute;
    z-index: -1;
    border: 3px solid #b33939;
}

.new-question-badge::before {
    top: 0;
    right: 0;
}

.new-question-badge::after {
    bottom: 0;
    left: 0;
}

/* 扫光动画 */
.new-question-badge span::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: badge-shine 3s infinite;
}

@keyframes badge-shine {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

/* 移除旧的样式 */

/* 选项 (Options) */
.options {
    margin-top: 12px;
}

.option {
    display: block;
    margin: 8px 0;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    background-color: var(--card-bg);
    color: var(--text-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden; /* 必须溢出隐藏以显示波纹 */
}

.option:hover {
    background-color: var(--item-bg);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 波纹元素样式 */
.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(52, 152, 219, 0.3);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.option.selected {
    background-color: var(--item-bg);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

[data-theme="dark"] .option.selected {
    background-color: #2c3e50;
    border-color: var(--primary-color);
}

.option.correct {
    background-color: var(--correct-bg);
    border-color: var(--correct-border);
    color: var(--correct-text);
}

.option.wrong {
    background-color: var(--wrong-bg);
    border-color: var(--wrong-border);
    color: var(--wrong-text);
}

/* 解析与结果 (Explanation & Result) */
.explanation, .ai-explanation, .result {
    margin-top: 15px;
    padding: 12px;
    background-color: var(--item-bg);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    display: none;
}

.explanation-toggle {
    background-color: var(--item-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.explanation-toggle:hover {
    background-color: var(--card-bg);
}

.explanation-title {
    font-weight: bold;
    color: var(--header-color);
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

.result.correct {
    background-color: var(--correct-bg);
    border: 1px solid var(--correct-border);
    color: var(--correct-text);
}

.result.wrong {
    background-color: var(--wrong-bg);
    border: 1px solid var(--wrong-border);
    color: var(--wrong-text);
}

/* AI 解析 (AI Explanation) */
.ai-explanation pre {
    background-color: var(--card-bg);
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 13px;
    border: 1px solid var(--border-color);
}

.ai-explanation code {
    background-color: var(--card-bg);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 13px;
}

.ai-explanation p { margin: 8px 0; line-height: 1.5; }
.ai-explanation ul, .ai-explanation ol { margin: 8px 0; padding-left: 15px; }
.ai-explanation li { margin: 4px 0; }

.ai-explanation h1, .ai-explanation h2, .ai-explanation h3, .ai-explanation h4 {
    margin: 12px 0 8px 0;
    color: var(--header-color);
    font-size: 16px;
}

.ai-button {
    margin-top: 8px;
    padding: 6px 12px;
    background-color: #6c757d;
    color: white;
    font-size: 13px;
}

.ai-button:hover { background-color: #5a6268; }

/* 收藏按钮 (Favorite Button) */
.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 20px;
    color: var(--text-muted);
    transition: color 0.3s ease;
    margin-right: 0;
}

.favorite-btn.active, .favorite-btn:hover {
    color: var(--warning-color);
    background: none;
}

.favorites-link {
    margin-left: auto;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
}

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

/* =========================================
   浮动元素与动画 (Floating Elements & Animations)
   ========================================= */

/* 热力图卡片 */
.heatmap-card {
    overflow: hidden; /* 移除滚动条 */
}

.heatmap-container {
    margin: 10px 0;
    min-height: 120px;
    display: flex;
    justify-content: center;
    overflow: hidden; /* 移除滚动条 */
    padding-bottom: 5px;
}

.heatmap-table {
    display: flex;
    gap: 4px;
}

.heatmap-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 5px;
    font-size: 10px;
    color: #888;
    padding-top: 15px; /* 对齐网格 */
}

.day-label {
    height: 12px;
    line-height: 12px;
    margin-bottom: 4px;
}

.heatmap-grid {
    display: flex;
    gap: 4px; /* 网格间隙 */
}

.heatmap-week {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.heatmap-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background-color: var(--heatmap-bg, #ebedf0);
    transition: transform 0.1s, background-color 0.2s;
}

[data-theme="dark"] .heatmap-cell {
    --heatmap-bg: #161b22;
}

.heatmap-cell:hover {
    transform: scale(1.3);
    z-index: 1;
}

/* 打卡信息 (Streak Info) */
.streak-info {
    background-color: var(--item-bg);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border-color);
}

.streak-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: bold;
    color: var(--header-color);
    margin-bottom: 5px;
}

.streak-number {
    font-size: 24px;
    color: #e67e22;
    font-family: 'DIN Alternate', 'PingFang SC', sans-serif;
}

.streak-status {
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 12px;
}

.streak-status.completed {
    color: #27ae60;
    background-color: rgba(39, 174, 96, 0.1);
}

.streak-status.pending {
    color: #f39c12;
    background-color: rgba(243, 156, 18, 0.1);
}
/* 热力图等级颜色 */
.level-0 { background-color: var(--heatmap-bg, #ebedf0); }
.level-1 { background-color: #9be9a8; }
.level-2 { background-color: #40c463; }
.level-3 { background-color: #30a14e; }
.level-4 { background-color: #216e39; }

[data-theme="dark"] .level-1 { background-color: #0e4429; }
[data-theme="dark"] .level-2 { background-color: #006d32; }
[data-theme="dark"] .level-3 { background-color: #26a641; }
[data-theme="dark"] .level-4 { background-color: #39d353; }

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 11px;
    color: #888;
    margin-top: 10px;
}

.legend-box {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.heatmap-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    color: #888;
}

/* 骨架屏 (Skeleton Screen) */
.skeleton-container {
    padding: 12px;
    background-color: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, var(--item-bg) 25%, var(--bg-color) 50%, var(--item-bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-title { width: 60%; height: 20px; margin-bottom: 15px; }
.skeleton-text { width: 100%; }

.skeleton-option {
    height: 40px;
    margin: 8px 0;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--item-bg) 25%, var(--bg-color) 50%, var(--item-bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border: 1px solid var(--border-color);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 渐变过渡 (Fade Transition) */
.fade-out { opacity: 0; }
.fade-in { opacity: 1; }

/* 连对指示器 (Streak Indicator) */
/* 沉浸模式退出按钮 (Immersive Exit) */
.exit-immersive {
    display: none;
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 2000;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.exit-immersive:hover { background: rgba(0, 0, 0, 0.8); }

body.immersive-mode .exit-immersive { display: block; }

body.immersive-mode .user-info,
body.immersive-mode .strategy-card,
body.immersive-mode .progress-container,
body.immersive-mode #coverage-stats {
    display: none !important;
}

/* 主题切换按钮 (Theme Toggle) */
.theme-toggle-inline {
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 10px;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.theme-toggle-inline:hover { transform: scale(1.2); }

/* 烟花效果 (Fireworks) */
.firework {
    position: fixed;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ff0;
    box-shadow: 0 0 10px #ff0, 0 0 20px #ff0, 0 0 30px #ff0;
    animation: firework 1s ease-out forwards;
    z-index: 9999;
}

@keyframes firework {
    0% { transform: scale(0); opacity: 1; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.firework-particle {
    position: fixed;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #ff0;
    box-shadow: 0 0 5px #ff0, 0 0 10px #ff0;
    animation: particle 1s ease-out forwards;
    z-index: 9999;
}

@keyframes particle {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

.celebration-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: #f00;
    text-shadow: 0 0 10px #f00, 0 0 20px #f00;
    animation: celebration 2s ease-out forwards;
    z-index: 10000;
    font-weight: bold;
}

@keyframes celebration {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* =========================================
   响应式适配 (Responsive)
   ========================================= */
@media (max-width: 480px) {
    body { padding: 10px; }
    
    .card, .features { padding: 15px; }
    
    .card-icon { width: 32px; height: 32px; font-size: 16px; }
    .card-title, .features h2 { font-size: 16px; }
    .feature-content h3 { font-size: 14px; }
    
    .stat-value { font-size: 18px; }
    .stat-label, .progress-info { font-size: 11px; }
    
    .btn, button, .favorites-link { padding: 6px 16px; font-size: 13px; }
    .nav-buttons { gap: 6px; }
    
    .feature-item { padding: 8px; margin-bottom: 10px; }
    .feature-item p { font-size: 12px; line-height: 1.4; }
    
    .footer { font-size: 12px; padding: 15px 0; margin-top: 20px; }
    
    .user-info { flex-direction: column; gap: 10px; text-align: center; }
    .user-info-left, .user-actions { justify-content: center; }
    
    .question { padding: 10px; }
    .question-content { font-size: 14px; }
    .option { padding: 8px; font-size: 13px; }
    .explanation, .result, .ai-explanation { padding: 10px; font-size: 13px; }
}

/* 提示框 (Toast) */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    z-index: 9999;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success { background-color: rgba(46, 204, 113, 0.9); }
.toast.error { background-color: rgba(231, 76, 60, 0.9); }
.toast.info { background-color: rgba(52, 152, 219, 0.9); }
.toast.warning { background-color: rgba(241, 196, 15, 0.9); }

