/* ============================================================
 * favorites.css - 习题收藏功能公共样式（自包含）
 * 设计：同时被学科页（已加载 quiz.css）与根 index.html（仅加载本文件）使用，
 *       因此把爱心、收藏弹窗、列表、跨科目详情、toast 所需样式都集中在此，
 *       不依赖 quiz.css。与 quiz.css 同名类保持视觉一致。
 * 主题：收藏主色 #eb2f96（玫红）
 * ============================================================ */

/* ===== 爱心按钮 ===== */
.heart-btn {
    background: none; border: none; cursor: pointer; padding: 4px 6px;
    border-radius: 50%; line-height: 1; color: #bfbfbf; font-size: 20px;
    transition: transform .15s ease, color .15s ease, background .15s ease;
}
.heart-btn:hover { transform: scale(1.15); background: rgba(235,47,150,0.08); }
.heart-btn:active { transform: scale(0.92); }
.heart-btn.faved { color: #eb2f96; }
.heart-btn .heart-ico { font-size: 20px; display: inline-block; }
.heart-btn.faved .heart-ico { animation: heart-pop .3s ease; }
@keyframes heart-pop { 0% { transform: scale(0.6); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* 题库卡片上的爱心：顶部信息行内，年级徽章之前 */
.bank-heart-slot {
    line-height: 0; display: inline-flex; align-items: center; margin-right: 2px;
}
.bank-heart-slot .heart-btn { font-size: 18px; padding: 2px 4px; }
.fav-card { position: relative; }   /* 收藏列表卡片也支持绝对定位的取消按钮 */

/* ===== 通用弹窗（与 quiz.css .modal-overlay/.ai-modal 视觉一致） ===== */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.45); z-index: 1000; justify-content: center; align-items: flex-start; padding: 30px 15px; overflow-y: auto; }
.modal-overlay.active { display: flex; }
.ai-modal { background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); max-width: 600px; width: 100%; padding: 25px; margin-bottom: 30px; }
.modal-title { font-size: 20px; font-weight: bold; color: #eb2f96; margin-bottom: 8px; text-align: center; }
.modal-subtitle { text-align: center; color: #999; font-size: 13px; margin-bottom: 20px; }
.modal-controls { display: flex; gap: 12px; justify-content: flex-end; margin-top: 16px; }
.btn-cancel { background: #fff; color: #666; border: 1px solid #d9d9d9; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 16px; }
.btn-cancel:hover { border-color: #999; color: #333; }

/* ===== 收藏弹窗（列表） ===== */
.fav-modal { max-width: 700px; width: 100%; max-height: 88vh; overflow-y: auto; }
.fav-list { display: flex; flex-direction: column; gap: 12px; min-height: 80px; }
.fav-empty { text-align: center; color: #999; padding: 40px 0; font-size: 15px; }

.fav-card {
    border: 1px solid #e8e8e8; border-radius: 10px; padding: 14px 16px;
    cursor: pointer; background: #fff; transition: all .2s; overflow: hidden;
}
.fav-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #eb2f96; }
.fav-card:hover { border-color: #eb2f96; box-shadow: 0 4px 16px rgba(235,47,150,0.12); transform: translateY(-2px); }
.fav-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.fav-subject { display: inline-flex; align-items: center; gap: 4px; font-weight: bold; color: #333; font-size: 13px; }
.fav-favtime { font-size: 12px; color: #eb2f96; margin-top: 8px; }
.fav-cancel {
    position: absolute; right: 12px; bottom: 12px; z-index: 2;
    background: #fff; color: #f5222d; border: 1px solid #ffa39e; padding: 4px 12px;
    border-radius: 6px; cursor: pointer; font-size: 13px; transition: all .2s;
}
.fav-cancel:hover { background: #fff1f0; border-color: #ff7875; }

/* 分页（收藏列表独立样式，避免依赖 quiz.css 的 .bank-pagination） */
.fav-pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.fav-page-btn { min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid #d9d9d9; background: #fff; border-radius: 8px; cursor: pointer; font-size: 14px; color: #333; transition: all .2s; }
.fav-page-btn:hover:not(:disabled) { border-color: #eb2f96; color: #eb2f96; }
.fav-page-btn.active { background: #eb2f96; color: #fff; border-color: #eb2f96; font-weight: bold; }
.fav-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bank-page-ellipsis { color: #999; padding: 0 4px; }

/* ===== 复用题库卡片内的基础类（确保仅加载 favorites.css 的页面也能正常显示） ===== */
.bank-id-badge { background: var(--c-primary-light); color: var(--c-primary); font-weight: bold; font-size: 12px; padding: 2px 8px; border-radius: 4px; }
.bank-grade-badge { background: #fff7e6; color: #fa8c16; font-size: 12px; padding: 2px 8px; border-radius: 4px; }
.bank-answer-badge { background: #52c41a; color: #fff; font-size: 12px; font-weight: bold; padding: 2px 10px; border-radius: 4px; margin-left: auto; }
.bank-card-question { font-size: 15px; font-weight: bold; color: #262626; line-height: 1.6; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bank-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.bank-tag { background: var(--c-primary-lighter); color: var(--c-primary-bright); font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.bank-card-module { font-size: 12px; color: #999; }
.bank-type-badge { font-size: 12px; font-weight: bold; padding: 2px 8px; border-radius: 4px; }
.bank-type-multi { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.bank-type-judge { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.bank-type-fill_blank { background: #e6fffb; color: #13c2c2; border: 1px solid #87e8de; }
.bank-type-essay { background: var(--c-primary-light); color: var(--c-primary); border: 1px solid var(--c-primary-border); }

/* ===== 跨科目详情弹窗基础类 ===== */
.detail-modal { max-width: 680px; width: 100%; max-height: 90vh; overflow-y: auto; }
.detail-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 2px solid #f0f0f0; }
.detail-head .bank-id-badge, .detail-head .bank-grade-badge { font-size: 13px; padding: 3px 10px; }
.detail-module { color: var(--c-primary); font-weight: bold; font-size: 15px; }
.detail-section-label { font-size: 13px; font-weight: bold; color: #8c8c8c; margin: 18px 0 8px; display: flex; align-items: center; gap: 6px; }
.detail-question { font-size: 17px; font-weight: bold; color: #262626; line-height: 1.7; background: #fafafa; border-radius: 8px; padding: 14px 16px; }
.detail-option { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border: 1px solid #e8e8e8; border-radius: 8px; margin-bottom: 8px; font-size: 15px; line-height: 1.6; background: #fff; }
.detail-option .opt-letter { flex-shrink: 0; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #f0f0f0; color: #666; font-weight: bold; font-size: 13px; }
.detail-option.correct { border-color: #52c41a; background: #f6ffed; box-shadow: 0 0 0 1px #b7eb8f; }
.detail-option.correct .opt-letter { background: #52c41a; color: #fff; }
.detail-option.correct .opt-text { color: #389e0d; font-weight: bold; }
.detail-option .opt-flag { margin-left: auto; color: #52c41a; font-weight: bold; font-size: 13px; white-space: nowrap; }
.detail-judge-answer { display: inline-block; padding: 8px 22px; border-radius: 8px; font-size: 18px; font-weight: bold; }
.detail-judge-answer.is-true { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.detail-judge-answer.is-false { background: #fff2f0; color: #f5222d; border: 1px solid #ffa39e; }
.detail-blank-answers { margin: 6px 0 0; padding-left: 22px; font-size: 15px; line-height: 1.9; color: #262626; }
.detail-blank-answers li { margin-bottom: 2px; }
.detail-explanation { background: var(--c-primary-light); border: 1px solid var(--c-primary-border); border-left: 4px solid var(--c-primary); border-radius: 0 8px 8px 0; padding: 14px 16px; font-size: 15px; line-height: 1.8; color: #333; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-tag { background: var(--c-primary-lighter); color: var(--c-primary-bright); border: 1px solid var(--c-primary-border2); font-size: 13px; padding: 3px 10px; border-radius: 12px; }

/* ===== 轻提示 toast ===== */
.fav-toast { position: fixed; left: 50%; bottom: 42px; transform: translateX(-50%) translateY(10px); background: rgba(0,0,0,0.82); color: #fff; padding: 10px 20px; border-radius: 22px; font-size: 14px; z-index: 3000; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; max-width: 80vw; }
.fav-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
