/* ========================================= */
/* 核心布局与基础样式 */
/* ========================================= */
.exam-container { background: #fff; padding: 20px; min-height: 600px; margin-top: 10px; }
.exam-container a { text-decoration: none; }

:root { --exam-primary: #e60012; --exam-text: #333; --exam-border: #eee; }

/* --- 功能面板 --- */
.my-panel { background: #fdfdfd; border: 1px solid #eee; border-radius: 4px; padding: 20px; margin-bottom: 25px; }
.my-panel-title { font-size: 18px; font-weight: bold; margin-bottom: 15px; padding-left: 10px; border-left: 4px solid var(--exam-primary); line-height: 1; color: #333; }
.my-grid { display: flex; justify-content: space-between; flex-wrap: wrap; }
.my-btn { flex: 1; display: flex; align-items: center; justify-content: center; background: #fff; margin: 0 10px; padding: 15px 0; border-radius: 4px; border: 1px solid #e0e0e0; transition: 0.2s; min-width: 140px; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.my-btn:first-child { margin-left: 0; }
.my-btn:last-child { margin-right: 0; }
.my-btn:hover { border-color: var(--exam-primary); box-shadow: 0 5px 10px rgba(0,0,0,0.05); transform: translateY(-2px); }

.icon-box { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; margin-right: 10px; font-family: Arial; }
.c-red { background: #ff4d4f; }
.c-blue { background: #1890ff; }
.c-orange { background: #fa8c16; }
.c-green { background: #52c41a; }
.c-purple { background: #722ed1; }
.my-text div:first-child { font-size: 15px; font-weight: bold; color: #333; }
.my-text div:last-child { font-size: 12px; color: #999; margin-top: 2px; }

/* --- 推荐试题 --- */
.rec-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 40px; }
.rec-card { background: #fff; border: 1px solid #eee; border-radius: 6px; overflow: hidden; transition: all 0.3s; position: relative; display: flex; flex-direction: column; height: 160px; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.rec-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); border-color: var(--exam-primary); }
.rec-top-line { height: 3px; background: linear-gradient(90deg, #ff7875, #d90011); }
.rec-badge { position: absolute; top: 3px; right: 0; background: #d90011; color: #fff; font-size: 12px; padding: 2px 8px; border-bottom-left-radius: 6px; font-weight: bold; }
.rec-body { padding: 20px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.rec-title { font-size: 16px; font-weight: bold; color: #333; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-bottom: 10px; }
.rec-title:hover { color: var(--exam-primary); }
.rec-info { font-size: 13px; color: #999; display: flex; justify-content: space-between; align-items: center; white-space: nowrap !important; }
.rec-info > span:first-child { white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; margin-right: 5px; flex: 1; min-width: 0; display: block; }
.rec-info span span { white-space: nowrap !important; display: inline; }
.rec-btn { background: #f5f5f5; color: #666; padding: 4px 12px; border-radius: 20px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.rec-card:hover .rec-btn { background: var(--exam-primary); color: #fff; }

/* --- 列表通用样式 --- */
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 15px; border-bottom: 2px solid var(--exam-primary); padding-bottom: 10px; }
.section-title { font-size: 16px; font-weight: bold; color: #333; border-left: 4px solid var(--exam-primary); padding-left: 10px; line-height: 1; }
.section-meta { color: #999; font-size: 13px; }
.list-item { display: flex; align-items: center; padding: 20px 10px; border-bottom: 1px dashed #ddd; transition: background 0.2s; position: relative; }
.list-item:hover { background: #f9f9f9; }
.list-icon { margin-right: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-txt { padding: 3px 8px; border-radius: 4px; color: #fff; font-size: 12px; display: inline-block; line-height: 1.5; white-space: nowrap; }
.bg-top { background: #ff4d4f; }  
.bg-good { background: #52c41a; } 
.list-info { flex: 1; min-width: 0; }
.list-title { font-size: 16px; font-weight: bold; color: #333; margin-bottom: 6px; cursor: pointer; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-title:hover { color: var(--exam-primary); text-decoration: underline; }
.list-tags { display: flex; gap: 15px; font-size: 12px; color: #888; flex-wrap: wrap;}
.list-action { margin-left: 20px; flex-shrink: 0;}
.btn-do { border: 1px solid #ccc; color: #666; padding: 6px 20px; border-radius: 3px; font-size: 14px; background: #fff; white-space: nowrap;}
.btn-do-active { background: var(--exam-primary); color: #fff !important; border: 1px solid var(--exam-primary); padding: 6px 20px; border-radius: 3px; font-size: 14px; white-space: nowrap;}
.btn-do-active:hover { background: #d90011; }
.tag-top { color: #fff; background: #ff4d4f; padding: 1px 4px; border-radius: 2px; font-size: 12px; margin-right: 5px; font-weight: normal; }
.tag-good { color: #fff; background: #52c41a; padding: 1px 4px; border-radius: 2px; font-size: 12px; margin-right: 5px; font-weight: normal; }
.tag-cat { color: #1890ff; background: #e6f7ff; padding: 1px 4px; border-radius: 2px; font-size: 12px; margin-right: 5px; font-weight: normal; }

/* --- 分页样式 --- */
.pagination { margin-top: 40px; text-align: center; }
.page-link { display: inline-block; padding: 5px 12px; background: #fff; border: 1px solid #ddd; margin: 0 3px; color: #666; font-size: 14px; text-decoration: none; transition: 0.2s; }
.page-link:not(.page-active):hover { border-color: var(--exam-primary); color: var(--exam-primary); }
.page-active, .page-active:hover { background: var(--exam-primary); color: #fff !important; border-color: var(--exam-primary); font-weight: bold; cursor: default; }
.page-disabled { background: #f5f5f5; color: #ccc; cursor: default; }

/* ========================================= */
/* --- 错题/收藏页专用样式 (My Wrong/Fav) --- */
/* ========================================= */

/* 详情折叠区域 */
.detail-box { display: none; margin-top: 15px; padding-top: 15px; border-top: 1px dashed #eee; background: #fcfcfc; padding: 15px; border-radius: 4px; }

/* 标题行布局 */
.q-title-inline { display: flex; justify-content: space-between; align-items: flex-start; font-size: 15px; font-weight: bold; color: #333; line-height: 1.6; }

/* 题目文字容器 */
.q-text-wrap { 
    flex: 1; 
    margin-right: 15px; 
    white-space: normal; 
    word-break: break-all; /* 防止长单词撑开 */
}

/* 题型标签 (如：[单选]) */
.q-tag {
    display: inline-block;
    font-size: inherit;
    font-weight: normal;
    color: #1890ff;
    background-color: #e6f7ff;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: baseline;
    border: 1px solid #91d5ff;
    line-height: 1.4;
}

/* 按钮组 */
.q-btn-group { flex-shrink: 0; }

/* 迷你按钮通用 */
.btn-mini { display: inline-block; padding: 6px 20px; border-radius: 3px; font-size: 14px; margin-left: 10px; cursor: pointer; text-decoration: none; line-height: 1.5; white-space: nowrap; border: 1px solid transparent; transition: 0.2s; }

/* 查看按钮 */
.btn-view { background: #52c41a; color: #fff !important; border-color: #52c41a; }
.btn-view:hover { background: #46a61b; border-color: #46a61b; }

/* 删除按钮 */
.btn-del { background: #ff4d4f; color: #fff !important; border-color: #ff4d4f; }
.btn-del:hover { background: #d9363e; border-color: #d9363e; }

/* 返回按钮 */
.btn-back { display: inline-block; padding: 5px 15px; background-color: #fff; border: 1px solid #ddd; border-radius: 20px; color: #666; font-size: 13px; text-decoration: none; transition: all 0.2s; }
.btn-back:hover { border-color: var(--exam-primary); color: var(--exam-primary); }

/* ========================================= */
/* --- 移动端适配 (Mobile) --- */
/* ========================================= */
@media (max-width: 900px) { .rec-box { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 768px) {
    .box, .sitetop1170 { width: 100% !important; max-width: 100% !important; min-width: 0 !important; padding-left:10px; padding-right:10px; box-sizing: border-box; }
    
    /* 顶部防遮挡 */
    .exam-container { padding: 10px; margin-top: 30px !important; }
    
    .rec-box { grid-template-columns: 1fr; gap: 15px; }
    .rec-card { height: auto; min-height: auto; }

    /* --- [重写] 我的考试模块 (强制双列显示) --- */
    /* 使用 !important 确保覆盖之前的样式或缓存残留 */
    .my-grid { 
        display: grid !important; 
        grid-template-columns: repeat(2, 1fr) !important; /* 强制2列 */
        gap: 10px !important; 
        justify-content: space-between;
    }
    
    .my-btn { 
        display: flex !important;
        margin: 0 !important; 
        width: auto !important; /* 让网格控制宽度，防止100%撑满 */
        box-sizing: border-box; 
        padding: 10px 5px !important; 
        justify-content: flex-start !important;
        padding-left: 10px !important;
    }

    /* 第5个按钮(奇数)占满最后一行 */
    .my-btn:last-child {
        grid-column: span 2 !important;
    }

    /* 图标缩小 */
    .my-btn .icon-box {
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
        margin-right: 8px !important;
        flex-shrink: 0;
    }
    
    /* 字体调整 */
    .my-text div:first-child { font-size: 14px !important; }
    .my-text div:last-child { font-size: 11px !important; }
    
    /* 列表布局修复 */
    .list-item { display: flex; flex-direction: row; align-items: center; justify-content: space-between; padding: 15px 0; }
    .list-icon { display: none; }
    .list-info { flex: 1; min-width: 0; padding-left: 0 !important; margin-right: 10px; }
    
    .list-title { font-size: 15px; margin-bottom: 5px; white-space: normal; line-height: 1.4; }
    .list-tags { font-size: 12px; color: #999; display: block; }
    .list-tags span { display: inline-block; margin-right: 5px; }
    
    .list-action { width: auto; margin: 0; padding: 0; border: none; flex-shrink: 0; }
    .btn-do, .btn-do-active { padding: 6px 12px; font-size: 13px; }
    
    /* 错题集移动端适配 */
    .q-title-inline { flex-direction: column; }
    .q-btn-group { margin-top: 10px; align-self: flex-end; }
}