/* ===== 全局 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #FFF5F8; color: #4A3441; }
body { padding-bottom: 40px; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; border: none; outline: none; cursor: pointer; }

/* ===== 顶部导航 ===== */
.navbar { position: sticky; top: 0; z-index: 100; background: linear-gradient(135deg, #FF6B9D, #FF9ECB); color: #fff; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 12px rgba(255,107,157,0.25); }
.navbar .title { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.navbar .back { font-size: 22px; padding: 0 8px; cursor: pointer; }
.navbar .spacer { width: 40px; }

/* ===== 容器 ===== */
.container { max-width: 480px; margin: 0 auto; padding: 16px; }

/* ===== 卡片 ===== */
.card { background: #fff; border-radius: 16px; padding: 18px; margin-bottom: 16px; box-shadow: 0 4px 16px rgba(255,107,157,0.08); }
.card-title { font-size: 16px; font-weight: 700; color: #FF4D87; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }

/* ===== 首页头部 ===== */
.hero { background: linear-gradient(135deg, #FF6B9D 0%, #FF9ECB 55%, #FFC7DE 100%); border-radius: 20px; padding: 28px 20px; color: #fff; text-align: center; margin-bottom: 16px; box-shadow: 0 6px 20px rgba(255,107,157,0.3); }
.hero .app-name { font-size: 26px; font-weight: 800; letter-spacing: 2px; }
.hero .slogan { font-size: 13px; margin-top: 8px; opacity: 0.92; }
.hero .nick-row { margin-top: 14px; display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.22); padding: 6px 14px; border-radius: 20px; font-size: 13px; }

/* ===== 四宫格 ===== */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-item { background: #fff; border-radius: 16px; padding: 18px 12px; text-align: center; box-shadow: 0 4px 14px rgba(255,107,157,0.10); cursor: pointer; transition: transform 0.12s; }
.grid-item:active { transform: scale(0.96); }
.grid-item .icon { font-size: 34px; display: block; margin-bottom: 8px; }
.grid-item .name { font-size: 15px; font-weight: 700; color: #4A3441; }
.grid-item .desc { font-size: 11px; color: #B0848F; margin-top: 4px; }

/* ===== 榜单 ===== */
.rank-row { display: flex; align-items: center; padding: 8px 4px; border-bottom: 1px solid #FFF0F4; }
.rank-row:last-child { border-bottom: none; }
.rank-no { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; margin-right: 10px; color: #fff; background: #E8B4C3; flex-shrink: 0; }
.rank-no.top3 { background: linear-gradient(135deg, #FF6B9D, #FF9ECB); }
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-meta { font-size: 11px; color: #B0848F; margin-top: 2px; }
.rank-score { font-size: 18px; font-weight: 800; color: #FF4D87; }
.rank-score small { font-size: 11px; font-weight: 400; }

/* ===== 按钮 ===== */
.btn-primary { display: block; width: 100%; background: linear-gradient(135deg, #FF6B9D, #FF9ECB); color: #fff; border-radius: 24px; padding: 13px; font-size: 16px; font-weight: 700; box-shadow: 0 4px 14px rgba(255,107,157,0.35); }
.btn-primary:active { transform: scale(0.98); }
.btn-outline { display: block; width: 100%; background: #fff; color: #FF4D87; border: 1.5px solid #FF6B9D; border-radius: 24px; padding: 11px; font-size: 15px; font-weight: 600; }
.btn-outline:active { background: #FFF0F4; }
.btn-row { display: flex; gap: 12px; margin-top: 14px; }
.btn-row .btn-primary, .btn-row .btn-outline { flex: 1; width: auto; }

/* ===== 答题页 ===== */
.progress-wrap { height: 8px; background: #FFE3EC; border-radius: 4px; overflow: hidden; margin: 6px 0 4px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #FF6B9D, #FF9ECB); border-radius: 4px; transition: width 0.3s; }
.progress-text { font-size: 12px; color: #B0848F; text-align: right; }
.quiz-dim { font-size: 12px; color: #FF4D87; background: #FFE3EC; display: inline-block; padding: 3px 10px; border-radius: 12px; margin-bottom: 10px; }
.question { font-size: 19px; font-weight: 700; line-height: 1.5; margin-bottom: 18px; }
.option { display: flex; align-items: center; background: #fff; border: 1.5px solid #F3D5DF; border-radius: 14px; padding: 14px 14px; margin-bottom: 12px; cursor: pointer; transition: all 0.15s; }
.option:active { border-color: #FF6B9D; background: #FFF5F8; }
.option.picked { border-color: #FF6B9D; background: linear-gradient(135deg, #FFF0F4, #FFE3EC); }
.option .letter { width: 28px; height: 28px; border-radius: 50%; background: #FFE3EC; color: #FF4D87; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; margin-right: 12px; flex-shrink: 0; }
.option.picked .letter { background: #FF6B9D; color: #fff; }
.option .text { font-size: 15px; flex: 1; }

/* ===== 结果页 ===== */
.result-hero { background: linear-gradient(135deg, #FFD9E8, #FFEED9); border-radius: 20px; padding: 30px 20px; text-align: center; margin-bottom: 16px; }
.result-hero .emoji { font-size: 60px; }
.result-hero .score { font-size: 64px; font-weight: 800; color: #FF4D87; margin: 8px 0 2px; }
.result-hero .title { font-size: 22px; font-weight: 700; color: #4A3441; }
.result-hero .desc { font-size: 13px; color: #8C6A76; margin-top: 10px; line-height: 1.6; padding: 0 10px; }
.result-names { font-size: 14px; color: #8C6A76; margin-top: 10px; }
.dim-row { display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.dim-name { font-size: 14px; font-weight: 600; }
.dim-emoji { margin-right: 6px; }
.dim-score { font-size: 13px; color: #FF4D87; font-weight: 700; }
.dim-level { font-size: 11px; color: #B0848F; margin-left: 8px; }

/* 复盘 */
.review-item { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 12px; border-left: 4px solid #FF6B9D; }
.review-item.wrong { border-left-color: #B0A8AE; }
.review-q { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.review-line { font-size: 13px; color: #8C6A76; margin-top: 4px; }
.review-line .tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-right: 6px; }
.tag-host { background: #FFE3EC; color: #FF4D87; }
.tag-my { background: #E8F4FF; color: #4A90D9; }
.tag-ok { background: #E4F8E8; color: #2E9E5B; }
.review-note { font-size: 12px; color: #B0848F; margin-top: 6px; font-style: italic; }

/* ===== 盲盒 ===== */
.box-wrap { text-align: center; padding: 30px 0; }
.box-gift { font-size: 96px; display: inline-block; cursor: pointer; transition: transform 0.1s; }
.box-gift.shaking { animation: shake 0.6s ease-in-out; }
@keyframes shake { 0%,100% { transform: rotate(0) scale(1); } 25% { transform: rotate(-12deg) scale(1.08); } 50% { transform: rotate(10deg) scale(0.96); } 75% { transform: rotate(-6deg) scale(1.05); } }
.box-content { background: linear-gradient(135deg, #FFF0F4, #FFE3EC); border-radius: 20px; padding: 30px 20px; margin-top: 20px; }
.box-type { font-size: 12px; color: #FF4D87; background: #fff; display: inline-block; padding: 3px 12px; border-radius: 12px; margin-bottom: 12px; }
.box-text { font-size: 17px; font-weight: 600; line-height: 1.7; color: #4A3441; }

/* ===== 每日一题 ===== */
.daily-head { text-align: center; padding: 20px 0 10px; }
.daily-date { font-size: 14px; color: #FF4D87; font-weight: 700; }
.daily-card { background: #fff; border-radius: 16px; padding: 24px 18px; }
.daily-q { font-size: 17px; font-weight: 700; line-height: 1.6; margin-bottom: 18px; }
.daily-done { background: #E4F8E8; border-radius: 14px; padding: 16px; text-align: center; color: #2E9E5B; font-weight: 600; font-size: 14px; }

/* ===== 会员 ===== */
.vip-hero { background: linear-gradient(135deg, #FF6B9D, #FF9ECB, #FFC7DE); border-radius: 20px; padding: 26px 18px; text-align: center; color: #fff; margin-bottom: 16px; }
.vip-hero .big { font-size: 20px; font-weight: 800; }
.plan-row { display: flex; gap: 10px; }
.plan { flex: 1; background: #fff; border: 2px solid #F3D5DF; border-radius: 16px; padding: 14px 6px; text-align: center; cursor: pointer; }
.plan.active { border-color: #FF6B9D; background: linear-gradient(135deg, #FFF0F4, #FFE3EC); }
.plan .p-name { font-size: 13px; font-weight: 700; }
.plan .p-price { font-size: 22px; font-weight: 800; color: #FF4D87; margin: 6px 0 2px; }
.plan .p-unit { font-size: 11px; color: #B0848F; }
.plan .p-desc { font-size: 11px; color: #B0848F; margin-top: 4px; }
.plan .p-hot { display: inline-block; background: #FF6B9D; color: #fff; font-size: 10px; padding: 1px 8px; border-radius: 8px; margin-bottom: 4px; }
.perk-row { display: flex; align-items: center; padding: 10px 4px; font-size: 14px; }
.perk-row .ck { color: #FF4D87; margin-right: 10px; font-weight: 800; }

/* ===== 海报弹层 ===== */
.poster-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; flex-direction: column; z-index: 300; }
.poster-mask.show { display: flex; }
.poster-mask img { width: 75%; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
.poster-mask .tip { color: #fff; font-size: 13px; margin-top: 14px; }

/* ===== toast / modal ===== */
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,0.78); color: #fff; padding: 12px 22px; border-radius: 10px; font-size: 14px; z-index: 500; opacity: 0; pointer-events: none; transition: opacity 0.2s; max-width: 70%; text-align: center; }
.toast.show { opacity: 1; }
.toast-success { background: rgba(46,158,91,0.92); }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 400; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 82%; max-width: 340px; overflow: hidden; }
.modal-title { font-size: 17px; font-weight: 700; text-align: center; padding: 20px 16px 6px; }
.modal-content { font-size: 14px; color: #8C6A76; text-align: center; padding: 10px 18px 18px; line-height: 1.6; }
.modal-btns { display: flex; border-top: 1px solid #F3D5DF; }
.modal-btns button { flex: 1; padding: 14px; font-size: 16px; background: #fff; }
.modal-cancel { color: #8C6A76; }
.modal-confirm { color: #FF4D87; font-weight: 700; border-left: 1px solid #F3D5DF; }

/* ===== 空状态 ===== */
.empty { text-align: center; color: #B0848F; font-size: 13px; padding: 24px 0; }

/* ===== 历史记录 ===== */
.his-row { display: flex; align-items: center; padding: 10px 4px; border-bottom: 1px solid #FFF0F4; font-size: 14px; }
.his-row:last-child { border-bottom: none; }
.his-label { flex: 1; }
.his-score { font-weight: 700; color: #FF4D87; margin-right: 10px; }
.his-time { font-size: 11px; color: #B0848F; }

/* ===== 底部导航 ===== */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; display: flex; border-top: 1px solid #FFE3EC; z-index: 200; max-width: 480px; margin: 0 auto; }
.bottom-nav a { flex: 1; text-align: center; padding: 8px 0 10px; font-size: 11px; color: #B0848F; }
.bottom-nav a .ic { font-size: 20px; display: block; margin-bottom: 2px; }
.bottom-nav a.active { color: #FF4D87; font-weight: 700; }

.hidden { display: none !important; }
