/* ================= 基础样式与适配 (引入CSS主题变量) ================= */
:root {
    --theme-main: #4a90e2; 
    --theme-light: #e3f2fd; 
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

/* 专门针对手机 App 体验的优化：禁止长按选中文本 */
body { 
    background-color: #f5f7fa; color: #333; line-height: 1.6; padding-bottom: 90px; 
    -webkit-user-select: none; /* Safari */
    user-select: none; /* 阻止普通文本被选中 */
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; border-radius: 6px; padding: 10px 15px; font-size: 14px; transition: 0.2s; font-weight: bold; }
button:active { opacity: 0.8; transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* 恢复输入框的文本选择功能，否则没法打字了 */
input, select, textarea { 
    width: 100%; padding: 10px; margin-top: 5px; margin-bottom: 15px; border: 2px solid #eee; border-radius: 6px; font-size: 14px; transition: border-color 0.3s;
    -webkit-user-select: auto; user-select: auto; 
}
input:focus, select:focus, textarea:focus { border-color: var(--theme-main); outline: none; }
.checkbox-custom { width: 18px; height: 18px; margin-right: 10px; cursor: pointer; accent-color: var(--theme-main); }
.batch-bar { display: flex; justify-content: space-between; align-items: center; background: var(--theme-light); padding: 10px 15px; border-radius: 8px; margin-bottom: 15px; border: 1px solid var(--theme-main);}

/* ================= 视图与导航 ================= */
.view { display: none; padding: 20px; max-width: 600px; margin: 0 auto; }
.view.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.tab-bar { position: fixed; bottom: 0; left: 0; width: 100%; background: white; display: flex; box-shadow: 0 -2px 15px rgba(0,0,0,0.05); z-index: 9999; padding-bottom: env(safe-area-inset-bottom, 10px); }
.tab-item { flex: 1; text-align: center; padding: 15px 0; font-size: 13px; color: #777; cursor: pointer; border-top: 3px solid transparent; transition: 0.3s;}
.tab-item.active { color: var(--theme-main); border-top-color: var(--theme-main); font-weight: bold; background: linear-gradient(to top, var(--theme-light) 0%, #fff 80%); }

/* ================= 卡片与组件大面积变色 ================= */
.card { background: white; border-radius: 12px; padding: 20px; margin-bottom: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); transition: 0.3s; }
.card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.stat-box { background: white; padding: 15px; border-radius: 12px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.04); border-bottom: 4px solid var(--theme-main); }
.stat-num { font-size: 26px; font-weight: 900; color: var(--theme-main); margin-top: 5px; }

.progress-bg { background: #eee; border-radius: 10px; height: 12px; width: 100%; overflow: hidden; margin-top: 5px; }
.progress-bar { background: var(--theme-main); height: 100%; transition: width 0.5s ease-in-out; }
.progress-bar.success { background: #43a047; }
.progress-bar.danger { background: #e53935; }
.quote-box { margin-top: 15px; padding: 12px; border-radius: 8px; font-size: 14px; font-weight: bold; text-align: center; background: var(--theme-light); border-left: 5px solid var(--theme-main); color: var(--theme-main); }

/* 👑 专属称号大展台 */
.title-banner { background: linear-gradient(135deg, #ffffff, var(--theme-light)); border: 3px solid var(--theme-main); border-radius: 15px; padding: 25px 20px; text-align: center; margin-bottom: 20px; box-shadow: 0 8px 20px rgba(0,0,0,0.08); position: relative; overflow: hidden; }
.title-banner::after { content: "✨"; position: absolute; top: 10px; right: 15px; font-size: 24px; opacity: 0.5; }
.title-name { font-size: 24px; font-weight: 900; color: var(--theme-main); margin-bottom: 8px; letter-spacing: 1px; }
.title-flattery { font-size: 13px; color: var(--theme-main); font-weight: bold; margin-bottom: 15px; line-height: 1.4; opacity: 0.8; }
.points-badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; background: rgba(255,255,255,0.9); padding: 6px 18px; border-radius: 20px; color: var(--theme-main); font-weight: 900; font-size: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); border: 2px solid var(--theme-main); margin: 0 auto; width: fit-content;}

/* 图表 */
.chart-container { display: flex; height: 180px; align-items: flex-end; justify-content: space-between; padding-top: 20px; border-bottom: 2px solid #eee; margin-bottom: 15px; padding-bottom: 5px; }
.chart-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; flex: 1; margin: 0 4px; }
.chart-bar { width: 100%; max-width: 35px; background: var(--theme-light); border-radius: 6px 6px 0 0; position: relative; transition: height 0.8s ease-out; min-height: 4px; }
.chart-bar.today { background: var(--theme-main); box-shadow: 0 -2px 8px rgba(0,0,0,0.1); }
.chart-num { font-size: 11px; color: var(--theme-main); font-weight: bold; margin-bottom: 4px; }
.chart-label { font-size: 10px; color: #999; margin-top: 6px; }

/* 核心按钮与颜色 */
.btn-primary { background-color: var(--theme-main); color: white; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.btn-success { background-color: #43a047; color: white; }
.btn-danger { background-color: #e53935; color: white; }
.btn-warning { background-color: #f39c12; color: white; }
.btn-purple { background-color: #8e44ad; color: white; }
.btn-outline { background-color: transparent; border: 2px solid var(--theme-main); color: var(--theme-main); font-weight: bold;}
.btn-dark { background-color: #2c3e50; color: #f1c40f; border: 1px solid #f39c12; }

/* 答题区 */
.option-label { display: block; padding: 15px; margin-bottom: 12px; background: #fafafa; border: 2px solid #eee; border-radius: 8px; cursor: pointer; transition: 0.2s; font-weight: 500;}
.option-label.selected { background: var(--theme-light); border-color: var(--theme-main); color: var(--theme-main); }
.option-label.correct { background: #e8f5e9; border-color: #43a047; color: #2e7d32; }
.option-label.wrong { background: #ffebee; border-color: #e53935; color: #c62828; }
.explanation { margin-top: 20px; padding: 15px; background: #fff3e0; border-radius: 6px; display: none; border-left: 4px solid #ff9800; }

.list-item { background: white; padding: 15px; border-radius: 8px; margin-bottom: 10px; border-left: 5px solid var(--theme-main); box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.tag { font-size: 12px; background: var(--theme-light); color: var(--theme-main); padding: 3px 10px; border-radius: 12px; font-weight: bold; }
.header-title { font-size: 20px; font-weight: 900; margin-bottom: 20px; color: var(--theme-main); border-left: 6px solid var(--theme-main); padding-left: 12px; }

/* 竞技场与商店 */
.currency-bar { display: flex; justify-content: space-between; background: var(--theme-light); border: 2px solid var(--theme-main); padding: 12px 20px; border-radius: 30px; margin-bottom: 20px; font-weight: bold; font-size: 16px; color: var(--theme-main); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.store-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; background: #f8f9fa; border-radius: 10px; margin-bottom: 12px; border: 1px solid #eee; }
.timer-box { font-size: 28px; font-weight: 900; text-align: center; color: var(--theme-main); margin-bottom: 15px; letter-spacing: 2px; }
.timer-box.danger { color: #e53935; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
.bounty-board { background: #fffaf0; padding: 15px; border-radius: 8px; margin-bottom: 15px; border: 2px dashed #ffb74d; }
.bounty-item { font-size: 14px; color: #d35400; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; font-weight: bold;}
.bounty-score { font-size: 16px; font-weight: 900; color: #e53935; }

/* 弹窗样式 */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: none; z-index: 10000; justify-content: center; align-items: center; backdrop-filter: blur(3px); }
.modal-box { background: white; padding: 30px 25px; border-radius: 16px; width: 90%; max-width: 400px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.3); border-top: 6px solid var(--theme-main); }
.modal-box h2 { color: var(--theme-main) !important; font-weight: 900; }

/* ================= 核心刷题大按钮特效 (新增代码) ================= */
.tab-item.practice-center-btn {
    background: linear-gradient(135deg, var(--theme-main), #2b5797) !important;
    color: white !important;
    border-radius: 50%;
    width: 65px;
    height: 65px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    top: -20px; /* 向上凸起，打破常规底栏 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 4px solid #fff !important;
    font-weight: 900;
    flex: none; /* 防止被 flex 挤压变形 */
    font-size: 12px;
    z-index: 10;
    transition: all 0.2s ease;
}

.tab-item.practice-center-btn.active {
    transform: translateY(-5px) scale(1.05); /* 点击激活时微微上浮并变大 */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-top-color: transparent !important; /* 隐藏普通 active 状态下附带的顶边框 */
}