/* 支架学件系统 - 公共样式 v2.0（大按钮版）*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
}

body {
    background: linear-gradient(145deg, #e9f0f5 0%, #d9e2ec 100%);
    font-family: 'Segoe UI', 'Roboto', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    padding: 8px;
    line-height: 1.5;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 1rem;
    backdrop-filter: blur(2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.split-layout {
    display: flex;
    flex-wrap: wrap;
}

.left-panel {
    flex: 1;
    min-width: 280px;
    background: #fefcf5;
    padding: 1rem;
}

.right-panel {
    flex: 1;
    min-width: 260px;
    background: #f8f3e8;
    padding: 1rem;
    border-left: 1px solid #e2dccd;
    font-size: 0.92rem;
}

/* 统计栏 */
.stats-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    background: #fff3e0;
    padding: 0.5rem 0.8rem;
    border-radius: 40px;
    margin-bottom: 1rem;
    gap: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.stat-item {
    background: white;
    padding: 0.2rem 0.6rem;
    border-radius: 28px;
    font-weight: 600;
    color: #b45f2b;
    font-size: 0.75rem;
    white-space: nowrap;
}

.game-title {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #b45f2b, #2c5f2d);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
    text-align: center;
    padding: 0.5rem;
}

/* 进度条 */
.level-progress-area {
    margin-bottom: 1rem;
}

.level-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    color: #5a5a5a;
}

.streak-badge {
    background: linear-gradient(135deg, #f5a65a, #e68a2e);
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 题目区 */
.question-area {
    background: white;
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.question-text {
    font-size: 1.4rem;
    color: #3a3a3a;
    line-height: 1.8;
}

.question-box {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ========== 选项区域 - 2列网格布局（高优先级选择器） ========== */
.left-panel .options-area,
.app-container .options-area {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1rem 0;
}

/* ===== 大圆角大按钮样式（覆盖原尺寸） ===== */
.left-panel .option-btn,
.app-container .option-btn {
    background: white;
    border: 2px solid #e0d5c5;
    border-radius: 24px;           /* 大圆角 */
    padding: 1rem 0.5rem;          /* 上下内边距增大 */
    font-size: 1.1rem;             /* 字体稍大 */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: #2b5876;
    font-family: inherit;
    min-height: 60px;              /* 保证最小高度 */
    word-break: break-word;
    line-height: 1.3;
}

.left-panel .option-btn:hover {
    border-color: #f5a65a;
    background: #fff8f0;
    transform: scale(0.98);
}

.left-panel .option-btn.selected {
    border-color: #f5a65a;
    background: #fff3e0;
}

.left-panel .option-btn.correct {
    border-color: #28a745;
    background: #d4edda;
}

.left-panel .option-btn.wrong {
    border-color: #dc3545;
    background: #f8d7da;
}

/* 兼容 choice-interaction 组件输出的类名 */
.left-panel .option-btn.correct-highlight {
    border-color: #28a745;
    background: #d4edda;
}

.left-panel .option-btn.wrong-highlight {
    border-color: #dc3545;
    background: #f8d7da;
}
.left-panel .option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* 当只有3个选项时，第三个按钮占满整行 */
.left-panel .option-btn:last-child:nth-child(3) {
    grid-column: span 2;
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.nav-btn {
    flex: 1;
    min-width: 80px;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: #f5f0e6;
}

.nav-btn:hover {
    background: #ebe5d8;
}

/* 反馈 */
.feedback {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    display: none;
}

.feedback.correct {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.feedback.wrong {
    display: block;
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.feedback.upgrade {
    display: block;
    background: linear-gradient(135deg, #fff9c4, #fff176);
    color: #f57f17;
    border: 2px solid #ffd700;
    font-weight: bold;
}

.feedback.downgrade {
    display: block;
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

.feedback.warning {
    display: block;
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ff9800;
}

/* 知识卡片 */
.knowledge-card,
.tip-card {
    background: white;
    padding: 0.8rem;
    border-radius: 10px;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    line-height: 1.7;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.right-panel h3 {
    font-size: 1rem;
    color: #2b5876;
    margin: 0 0 0.8rem 0;
    padding-left: 0.5rem;
    border-left: 4px solid #f5a65a;
}

/* 页脚 */
.footer-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem;
    border-top: 1px solid #e0d5c5;
    background: #f5f0e6;
    gap: 1rem;
}

.footer-link {
    color: #2b5876;
    text-decoration: none;
}

.footer-author {
    color: #7a6a5a;
    font-style: italic;
}

/* 场景标签 */
.scene-badge {
    background: rgba(245, 166, 90, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 60px;
    padding: 0.2rem 0.9rem;
    font-size: 0.75rem;
    font-weight: bold;
    color: #c55a1a;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid #f5a65a;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    background: rgba(245, 166, 90, 0.2);
    border-radius: 30px;
    padding: 0.2rem 0.7rem;
    font-size: 0.75rem;
    font-weight: bold;
    color: #c55a1a;
    margin-left: 0.5rem;
    border: 1px solid #f5a65a;
}

/* 访问计数器 */
.visit-counter {
    position: fixed;
    right: 15px;
    bottom: 15px;
    background: linear-gradient(135deg, #2b5876, #4e4376);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(43, 88, 118, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    html {
        font-size: 14px;
    }
    body {
        padding: 4px;
    }
    .split-layout {
        flex-direction: column;
    }
    .left-panel,
    .right-panel {
        min-width: 100%;
        padding: 0.8rem;
    }
    .right-panel {
        border-left: none;
        border-top: 1px solid #e2dccd;
    }
    .btn-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }
    .nav-btn {
        width: 100%;
        min-width: unset;
    }
    .stats-bar {
        gap: 4px;
    }
    .question-text {
        font-size: 1.4rem;
    }
    /* 手机端：选项区域改为单列，按钮保持大圆角但略微缩小 */
    .left-panel .options-area {
        grid-template-columns: 1fr !important;
        gap: 0.6rem;
    }
    .left-panel .option-btn {
        padding: 0.8rem 0.3rem !important;
        min-height: 60px !important;
        font-size: 1.4rem !important;
        border-radius: 24px !important;
    }
    .visit-counter {
        right: 10px;
        bottom: 10px;
        padding: 0.5rem 0.8rem;
    }
    .MathJax {
        font-size: 0.9em !important;
    }
}

@media screen and (max-width: 480px) {
    .game-title {
        font-size: 1.1rem;
    }
    .MathJax {
        font-size: 0.85em !important;
    }
}

/* 公式缩放 */
.MathJax {
    font-size: 1.1em;
}

/* ========== 以下为 tracker.js 相关样式（弹窗、动画） ========== */

/* 升级弹窗 */
.xlxt-levelup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    backdrop-filter: blur(5px);
}

.xlxt-levelup-content {
    background: linear-gradient(145deg, #fff9ef, #fff3e0);
    padding: 2rem 2.5rem;
    border-radius: 30px;
    text-align: center;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    animation: xlxt-popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes xlxt-popIn {
    0% { transform: scale(0.3) rotate(-10deg); opacity: 0; }
    50% { transform: scale(1.08) rotate(2deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.xlxt-levelup-icon {
    font-size: 5rem;
    margin-bottom: 0.5rem;
}

.xlxt-levelup-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f3b33d, #e68a2e, #ffd700);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.xlxt-levelup-desc {
    font-size: 1rem;
    color: #5a3e1b;
    margin: 1rem 0;
}

.xlxt-levelup-btn {
    background: linear-gradient(95deg, #4caf50, #8bc34a);
    border: none;
    padding: 12px 32px;
    border-radius: 35px;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
}

/* 星星飘落 */
.xlxt-star {
    position: fixed;
    font-size: 1.5rem;
    pointer-events: none;
    z-index: 9999;
    animation: xlxt-starFall 2.5s ease-out forwards;
}

@keyframes xlxt-starFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(300px) rotate(360deg); opacity: 0; }
}

/* 哭脸动画 */
.xlxt-blink-cry {
    animation: xlxt-cryBlink 0.4s 3;
}

@keyframes xlxt-cryBlink {
    0% { background-color: transparent; }
    50% { background-color: rgba(255, 0, 0, 0.1); }
    100% { background-color: transparent; }
}

.xlxt-sad-face {
    position: fixed;
    left: 50%;
    top: 40%;
    font-size: 4rem;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10000;
    animation: xlxt-sadPop 0.6s ease-out forwards;
}

@keyframes xlxt-sadPop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1.4); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}