/* ===== 错题解析页面（参考 eg/src/app/App.tsx）===== */

/* --- 头部导航 --- */
.analysis-header {
    background: linear-gradient(135deg, #B71C1C 0%, #8B0000 60%, #6D0000 100%);
    position: relative;
    overflow: hidden;
}

.analysis-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 80% at 50% 0%, rgba(255,255,255,0.10) 0%, transparent 70%);
    pointer-events: none;
}

/* 状态栏 - 覆盖全局渐变，透明让头部背景透出，完全融合 */
#page-wrong-analysis .status-bar,
#page-team-wrong-analysis .status-bar {
    background: transparent;
}

.analysis-header .analysis-back-btn {
    position: absolute;
    left: 16px;
    top: 52px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    z-index: 10;
}

.analysis-header .analysis-title {
    color: #FFFFFF;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 2px;
    text-align: center;
    display: block;
    padding: 6px 48px 20px;
}

.analysis-header .analysis-counter {
    position: absolute;
    right: 16px;
    top: 54px;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 500;
}

/* 底部金色装饰线 */
.analysis-header + *::before,
.analysis-body::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #D4A017 20%, #F0C040 50%, #D4A017 80%, transparent 100%);
}

/* --- 内容区域 --- */
.analysis-body {
    padding: 14px 12px 24px;
}

/* 空状态 */
.analysis-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 15px;
}

.wrong-empty-lottie {
    width: 180px;
    height: 180px;
    margin-bottom: 8px;
    margin-left: 55px;
}

.analysis-empty-tip {
    font-size: 13px;
    margin-top: 8px;
    color: #BBB;
}

/* --- 通用卡片 --- */
.analysis-card {
    background-color: #FFFFFF;
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    overflow: hidden;
}

.card-label {
    color: #C41A1A;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

/* --- 题目卡片 --- */
.analysis-question-card {
    border-left: 4px solid #C41A1A;
    padding: 13px 15px 15px;
}

.question-text {
    font-size: 15px;
    color: #1A1A1A;
    line-height: 1.7;
    margin: 0;
}

/* --- 选项+错误复盘卡片 --- */
.analysis-review-card {
    padding: 13px 15px 15px;
}

.review-layout {
    display: flex;
}

.review-options {
    flex: 1;
    padding-right: 12px;
}

.review-divider {
    width: 1px;
    background-color: #E8E8E8;
    flex-shrink: 0;
}

.review-error {
    flex: 1;
    padding-left: 12px;
}

/* 选项行 */
.analysis-option {
    font-size: 14px;
    color: #2A2A2A;
    padding: 6px 0;
    line-height: 1.5;
    border-bottom: 1px solid #F0F0F0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.analysis-option:last-child {
    border-bottom: none;
}

.option-key {
    font-weight: 600;
    min-width: 18px;
}

.option-text {
    flex: 1;
}

.option-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.correct-tag {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #81C784;
}

.wrong-tag {
    background: #FFEBEE;
    color: #C41A1A;
    border: 1px solid #EF9A9A;
}

.user-choice .option-key {
    color: #C41A1A;
    font-weight: 700;
}

.correct-answer .option-text {
    color: #2E7D32;
    font-weight: 600;
}

/* 错误复盘区域 */
.error-info {
    font-size: 13px;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.5;
}

.error-badge {
    display: inline-block;
    border: 1.5px solid #C41A1A;
    border-radius: 5px;
    padding: 5px 14px;
    color: #C41A1A;
    font-size: 14px;
    font-weight: 500;
    background-color: #FFF8F8;
    letter-spacing: 0.5px;
}

/* --- 标准答案区域 --- */
.analysis-answer-section {
    background-color: #F5EDD8;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.answer-section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background-color: #EDE0C0;
    border-bottom: 1px solid #DDD0A8;
    color: #6B4E10;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 3px;
}

.answer-section-body {
    padding: 13px 16px 15px;
}

.correct-answer-text {
    font-size: 14px;
    color: #1A1A1A;
    font-weight: 600;
    margin-bottom: 7px;
}

.answer-note {
    font-size: 12.5px;
    color: #C41A1A;
    line-height: 1.65;
}

/* --- 知识点详解区域 --- */
.analysis-knowledge-section {
    background-color: #FFFFFF;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    margin-bottom: 12px;
}

.knowledge-header {
    background: linear-gradient(90deg, #C41A1A 0%, #A01010 100%);
    padding: 10px 15px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}

.knowledge-content {
    padding: 13px 15px 15px;
}

.knowledge-text {
    border-left: 3px solid #C41A1A;
    padding-left: 11px;
    font-size: 14px;
    color: #2A2A2A;
    line-height: 1.8;
}

/* --- 底部导航按钮 --- */

/* 底部操作区容器（导航+重新答题 统一居中） */
.analysis-bottom-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.analysis-nav-btns {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.analysis-nav-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 24px;
    border-radius: 25px;
    border: 1.5px solid #C41A1A;
    background: #FFF;
    color: #C41A1A;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.analysis-nav-btn:active {
    transform: scale(0.96);
    background: #FFF5F5;
}

/* 重新答题按钮 */
.analysis-retry-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 32px;
    border-radius: 25px;
    border: none;
    background: linear-gradient(135deg, #C41A1A, #A01010);
    color: #FFF;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 3px 10px rgba(196, 26, 26, 0.25);
}

.analysis-retry-btn:active {
    transform: scale(0.96);
    box-shadow: 0 1px 6px rgba(196, 26, 26, 0.2);
}

.home-btn {
    background: linear-gradient(135deg, #C41A1A, #A01010);
    color: #FFF;
    border: none;
}

/* ===== 重新答题弹窗 ===== */

.team-comp-retry-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.team-comp-retry-overlay.show {
    opacity: 1;
    visibility: visible;
}

.team-comp-retry-modal {
    width: 90%;
    max-width: 380px;
    max-height: 85vh;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #FFF;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.team-comp-retry-overlay.show .team-comp-retry-modal {
    transform: scale(1) translateY(0);
}

/* 头部 */
.retry-header {
    background: linear-gradient(135deg, #C41A1A 0%, #8B0000 60%, #6D0000 100%);
    padding: 14px 16px;
    padding-top: 50px;
    padding-left: 44px; /* 避开左侧关闭按钮 */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.retry-close-btn {
    position: absolute;
    left: 14px;
    top: 52px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    z-index: 10;
}

.retry-title {
    color: #FFF;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
}

.retry-counter {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 600;
    margin-left: auto;
}

/* 统计栏 */
.retry-stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 12px 16px;
    background: #FFF8F0;
    border-bottom: 1px solid #F0E0D0;
}

.retry-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.retry-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.retry-stat-label {
    font-size: 12px;
    color: #888;
}

.retry-stat-value {
    font-size: 18px;
    font-weight: 800;
    color: #C41A1A;
}

/* 题目区域 */
.retry-question-area {
    padding: 18px 16px 10px;
}

.retry-question-text {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1.6;
}

/* 选项区域 */
.retry-options-area {
    padding: 4px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.retry-option-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 12px;
    border: 2px solid #EEE;
    background: #FAFAFA;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.retry-option-btn:active {
    transform: scale(0.98);
}

.retry-option-btn.selected {
    border-color: #C41A1A;
    background: #FFF5F5;
}

.retry-option-btn.correct {
    border-color: #4CAF50;
    background: #E8F5E9;
}

.retry-option-btn.wrong {
    border-color: #EF5350;
    background: #FFEBEE;
}

.retry-opt-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #F0EDEA;
    color: #666;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.retry-option-btn.correct .retry-opt-letter {
    background: #4CAF50;
    color: #FFF;
}

.retry-option-btn.wrong .retry-opt-letter {
    background: #EF5350;
    color: #FFF;
}

/* 重新答题弹窗中的选项标签（正确答案/您的选择） */
.retry-option-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
}

.retry-correct-tag {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #81C784;
}

.retry-wrong-tag {
    background: #FFEBEE;
    color: #C41A1A;
    border: 1px solid #EF9A9A;
}

.retry-opt-text {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

/* 底部导航 */
.retry-bottom-area {
    padding: 10px 16px 18px;
}

.retry-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.retry-nav-placeholder {
    width: 90px;
}

.retry-nav-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 11px 22px;
    border-radius: 22px;
    border: 1.5px solid #C41A1A;
    background: #FFF;
    color: #C41A1A;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.retry-nav-btn:active {
    transform: scale(0.96);
    background: #FFF5F5;
}

.retry-finish-btn {
    background: linear-gradient(135deg, #C41A1A, #A01010);
    color: #FFF;
    border: none;
    box-shadow: 0 3px 12px rgba(196, 26, 26, 0.3);
}

.retry-finish-btn:active {
    box-shadow: 0 1px 6px rgba(196, 26, 26, 0.2);
}

.retry-single-finish {
    width: 100%;
    justify-content: center;
}

/* ===== 底部历史错题面板 ===== */

/* 页面容器需要支持滚动 */
#page-wrong-analysis,
#page-team-wrong-analysis {
    background: #F2F2F2;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

.analysis-body {
    flex-shrink: 0;
}

/* 展开时不再顶起内容，面板以覆盖方式显示 */

/* --- 面板容器（相对于手机容器定位，覆盖底部1/3）--- */
.history-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- 触发区：箭头+文字（参考用户上传图片）--- */
.history-trigger {
    position: relative;
    z-index: 51;
    width: 200px;
    padding: 8px 24px 12px;
    margin-bottom: -4px;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* 箭头图标 */
.history-arrow {
    transition: transform 0.3s ease;
}

.history-arrow.rotated {
    transform: rotate(180deg);
}

/* 历史错题文字（参考图片：圆角弧形背景+金色文字） */
.history-trigger-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 6px;
    color: #B08D57;
    background: linear-gradient(180deg, #FFF5E8 0%, #FFE4C4 50%, #FFD9AA 100%);
    border-radius: 14px 14px 20px 20px;
    padding: 7px 28px;
    box-shadow:
        0 1px 3px rgba(176,141,87,0.15),
        inset 0 1px 2px rgba(255,255,255,0.8);
    white-space: nowrap;
}

/* --- 展开的列表区域（覆盖底部1/3）--- */
.history-list-wrap {
    width: 100%;
    height: 0;
    overflow: hidden;
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    background: linear-gradient(180deg, rgba(245,238,216,0.97) 0%, #F5EDD8 40%, #FDF6E8 100%);
    border-top: 1px solid #E8DCC0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
}

.history-panel.expanded .history-list-wrap {
    height: 33vh;
}

/* 列表滚动容器 */
.history-list {
    max-height: 33vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 12px 20px;
}

/* 滚动条美化 */
.history-list::-webkit-scrollbar {
    width: 4px;
}
.history-list::-webkit-scrollbar-track {
    background: transparent;
}
.history-list::-webkit-scrollbar-thumb {
    background: #D4C4A0;
    border-radius: 2px;
}

/* --- 错题列表项 --- */
.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    margin-bottom: 6px;
    border-radius: 10px;
    background: #FFFFFF;
    border: 1px solid #EEE5D5;
    cursor: pointer;
    transition: all 0.15s ease;
}

.history-item:active {
    transform: scale(0.97);
    background: #FFF8EE;
}

.history-item.active {
    background: #FFF5EB;
    border-color: #E8C896;
    box-shadow: 0 1px 4px rgba(196,26,26,0.08);
}

/* 序号圆圈 */
.history-item-index {
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #EDE0C0, #D4BC82);
    color: #8C6820;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.history-item.active .history-item-index {
    background: linear-gradient(135deg, #C41A1A, #A01010);
    color: #FFF;
}

/* 题目文字 */
.history-item-text {
    font-size: 13px;
    color: #444;
    line-height: 1.4;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item.active .history-item-text {
    color: #C41A1A;
    font-weight: 600;
}

/* ===== 全部答对后的空状态 ===== */

/* 已掌握的错题项样式 */
.history-item.mastered-item {
    background: #F8FFF8;
    border-color: #C8E6C9;
    opacity: 0.85;
}

.history-item.mastered-item .history-item-index {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: #FFF;
}

/* 已掌握徽章 */
.history-mastered-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #E8F5E9;
    color: #2E7D32;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 空状态内容区域 */
.analysis-all-mastered-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    padding: 40px 20px;
}

.all-mastered-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Great! Lottie 动画容器 */
.all-mastered-lottie {
    width: 200px;
    height: 120px;
    margin-bottom: 4px;
}

/* 温情提示标题 */
.all-mastered-title {
    font-size: 22px;
    font-weight: 700;
    color: #C41A1A;
    margin: 0;
    letter-spacing: 2px;
}

/* 温情提示副标题 */
.all-mastered-subtitle {
    font-size: 14px;
    color: #888;
    margin: 0;
    line-height: 1.6;
}
