/* 人生大计 LifeTally · H5 呈现版 —— 浅粉底 + 青绿强调 */
:root {
  --bg: #FDF2F0;
  --card: #FFFFFF;
  --ink: #1E2B2A;
  --muted: #707572;
  --line: #EADBD9;
  --primary: #0E7C7B;
  --primary-soft: #D9EFEC;
  --accent: #E86A58;
  --green: #0E9F6E;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: #E9E4E3; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--ink); }
.phone {
  position: relative; width: 100%; max-width: 480px; min-height: 100vh; margin: 0 auto;
  background: var(--bg); overflow-x: hidden; padding-bottom: 150px;
}
.page { display: none; padding: 16px 16px 24px; }
.page.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: .3; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 登录 */
.login-page { display: flex; min-height: 100vh; flex-direction: column; justify-content: center; align-items: stretch; }
.login-hero { text-align: center; margin-bottom: 34px; }
.login-logo { width: 62px; height: 62px; line-height: 62px; margin: 0 auto 14px; border-radius: 18px; background: var(--primary); color: #fff; font-size: 30px; }
.login-title { font-size: 23px; font-weight: 700; letter-spacing: .3px; }
.login-sub { font-size: 12px; color: var(--muted); margin-top: 8px; }
.auth-tabs { display: flex; background: #F6E7E4; border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.auth-tab { flex: 1; text-align: center; padding: 10px 0; font-size: 14px; font-weight: 600; border-radius: 9px; color: var(--muted); cursor: pointer; }
.auth-tab.active { background: var(--primary); color: #fff; }
.auth-field { margin-bottom: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.auth-field input { width: 100%; height: 48px; border: none; outline: none; background: transparent; font-size: 14px; color: var(--ink); }
.auth-primary, .generate-btn, .primary-button { width: 100%; height: 48px; border: none; border-radius: 12px; background: var(--primary); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.auth-wechat { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; }
.auth-or { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0; }
.auth-agree { display: flex; align-items: flex-start; gap: 8px; margin-top: 22px; font-size: 12px; color: var(--muted); line-height: 1.7; cursor: pointer; }
.agree-box { width: 18px; height: 18px; flex: none; margin-top: 2px; border: 1px solid #C9C4C2; border-radius: 5px; background: #fff; }
.auth-agree.checked .agree-box { background: var(--primary); border-color: var(--primary); }
.auth-agree.checked .agree-box::after { content: "✓"; display: block; color: #fff; font-size: 13px; text-align: center; line-height: 17px; }
.link { color: var(--primary); }

/* 通用块 */
.hero { padding: 6px 2px 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.eyebrow { font-size: 10px; letter-spacing: 1.6px; color: var(--primary); font-weight: 700; }
.hero-row { display: flex; align-items: center; justify-content: space-between; }
.hero-title { font-size: 26px; font-weight: 800; margin-top: 6px; }
.hero-sub { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 8px; }
.hero-end { align-items: flex-end; }
.mode-switch { display: flex; background: #F1E3E1; border-radius: 20px; padding: 3px; }
.mode-chip { padding: 7px 14px; font-size: 12px; border-radius: 18px; color: var(--muted); cursor: pointer; }
.mode-chip.active { background: var(--primary); color: #fff; font-weight: 600; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 15px; margin-bottom: 14px; }
.card-title { font-size: 14px; font-weight: 700; }
.card-note { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 16px 2px 10px; }
.section-head-title { font-size: 15px; font-weight: 700; }
.section-head-extra { font-size: 11px; color: var(--muted); cursor: pointer; }
.section-divider { height: 1px; background: var(--line); margin: 14px 0; }
.block-row { display: flex; justify-content: space-between; align-items: center; margin: 14px 2px 10px; }
.block-label { font-size: 13px; font-weight: 700; }
.block-current { font-size: 12px; color: var(--primary); font-weight: 600; }
.sheet-tip { font-size: 11px; color: var(--muted); background: #F8F1F0; padding: 10px 12px; border-radius: 10px; line-height: 1.6; margin-top: 12px; }

/* 首页 */
.notice { display: flex; align-items: center; gap: 8px; background: var(--primary-soft); border-radius: 12px; padding: 11px 12px; margin-bottom: 14px; font-size: 11px; cursor: pointer; }
.notice-icon { color: var(--primary); font-size: 15px; }
.notice-text { flex: 1; color: #24514F; line-height: 1.5; }
.notice-link { color: var(--primary); font-weight: 700; white-space: nowrap; }
.empty-card { border: 1px dashed #D9C6C3; border-radius: 16px; padding: 34px 24px; text-align: center; background: rgba(255,255,255,.45); }
.empty-icon { font-size: 34px; color: #B8C9C5; }
.empty-title { font-size: 14px; font-weight: 700; margin: 12px 0 8px; }
.empty-desc { font-size: 11px; color: var(--muted); line-height: 1.7; }
.timeline { margin-top: 4px; }
.year-label { font-size: 12px; font-weight: 700; color: var(--muted); margin: 16px 2px 8px; }
.exp-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 13px; margin-bottom: 10px; cursor: pointer; }
.exp-head { display: flex; align-items: center; gap: 7px; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.exp-title { font-size: 14px; font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-cat { font-size: 10px; color: var(--muted); background: #F4EFEE; padding: 3px 7px; border-radius: 6px; }
.exp-meta { font-size: 11px; color: var(--muted); margin: 8px 0 4px; }
.exp-result { font-size: 12px; color: #3D5451; line-height: 1.6; }
.exp-foot { display: flex; justify-content: space-between; font-size: 10px; margin-top: 10px; }
.exp-evidence { color: var(--accent); }
.exp-evidence.done { color: var(--green); }
.exp-visibility { color: var(--muted); }

/* 底部输入与导航 */
.composer { position: fixed; z-index: 30; bottom: 62px; left: 50%; transform: translateX(-50%); width: calc(100% - 24px); max-width: 456px; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 28px; padding: 8px 10px; box-shadow: 0 4px 18px rgba(0,0,0,.06); }
.composer.hidden { display: none; }
.mic, .add-btn { width: 38px; height: 38px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: #F2F7F6; color: var(--primary); cursor: pointer; font-size: 20px; }
.add-btn { border: 1px solid var(--line); background: #F7F5F4; color: var(--ink); }
.mic svg { width: 19px; height: 19px; }
.composer-input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 18px; height: 38px; padding: 0 14px; font-size: 11px; outline: none; background: #FFF9F8; }
.tabbar { position: fixed; z-index: 40; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: 62px; display: flex; background: #fff; border-top: 1px solid var(--line); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #A7A9AE; font-size: 10px; cursor: pointer; }
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--primary); font-weight: 700; }

/* 草稿页 */
.draft-top { display: flex; justify-content: space-between; align-items: center; }
.draft-title { font-size: 14px; font-weight: 700; }
.draft-badge { font-size: 10px; color: var(--primary); background: var(--primary-soft); padding: 4px 9px; border-radius: 8px; }
.draft-divider { height: 1px; background: var(--line); margin: 12px 0 14px; }
.field-label { display: block; font-size: 12px; font-weight: 700; margin: 14px 0 7px; }
.field-input, .field-textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: #fff; padding: 12px 13px; font-size: 13px; outline: none; color: var(--ink); font-family: inherit; }
.field-input:focus, .field-textarea:focus { border-color: var(--primary); }
.field-textarea { min-height: 78px; resize: vertical; line-height: 1.6; }
.option-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-chip { padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 12px; cursor: pointer; }
.opt-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.ledger-row .opt-chip { flex: 1; text-align: center; font-size: 11px; }
.soul-box { background: #F5F5F3; border-radius: 12px; padding: 12px; margin-top: 18px; }
.soul-head { font-size: 12px; font-weight: 700; color: #D65A6B; }
.soul-note { font-size: 10px; color: var(--muted); margin-top: 5px; }
.attach-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.attach-add { color: var(--primary); font-weight: 700; cursor: pointer; }
.attachment { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 10px; font-size: 11px; margin-bottom: 6px; }
.attachment-empty { border: 1px dashed var(--line); border-radius: 9px; padding: 12px; text-align: center; font-size: 10px; color: var(--muted); }
.draft-submit { margin-top: 20px; }

/* 详情页 */
.detail-card { padding-top: 18px; }
.detail-head { display: flex; align-items: center; gap: 8px; }
.detail-meta { font-size: 11px; color: var(--muted); margin: 10px 0 14px; }
.detail-row { padding: 10px 0; border-top: 1px solid #F1EAE9; }
.detail-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.detail-value { font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.detail-actions { display: flex; gap: 10px; }
.ghost-button, .danger-button { flex: 1; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 13px; cursor: pointer; }
.danger-button { color: var(--accent); border-color: #F0C9C2; }

/* 规划页 */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 13px; cursor: pointer; }
.mode-card.active { border-color: var(--primary); background: #F1FAF8; }
.mode-head { display: flex; justify-content: space-between; align-items: center; }
.mode-name { font-size: 13px; font-weight: 700; }
.mode-badge { font-size: 9px; background: var(--primary); color: #fff; padding: 2px 7px; border-radius: 7px; }
.mode-desc { display: block; font-size: 10px; color: var(--muted); line-height: 1.5; margin-top: 8px; }
.rule-head { display: flex; align-items: center; gap: 7px; }
.rule-icon { color: var(--primary); font-size: 17px; }
.rule-title { flex: 1; font-size: 14px; font-weight: 700; }
.rule-tag { font-size: 9px; color: var(--primary); background: var(--primary-soft); padding: 4px 8px; border-radius: 7px; }
.rule-intro { font-size: 12px; line-height: 1.7; margin-top: 11px; }
.rule-kv { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.rule-kv span:first-child { color: var(--ink); font-weight: 700; }
.board-caption { font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.board-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.board { background: #FBF7F6; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.board-title { font-size: 12px; font-weight: 700; }
.board-fields { font-size: 10px; color: var(--muted); line-height: 1.7; margin-top: 6px; }
.rule-line { display: flex; gap: 6px; font-size: 11px; color: #3D5451; margin-top: 7px; }
.rule-dot { color: var(--green); font-weight: 700; }
.select-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.select-actions { font-size: 10px; color: var(--muted); }
.select-actions span { color: var(--primary); cursor: pointer; }
.exp-option { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid #F3ECEB; cursor: pointer; }
.checkbox { width: 18px; height: 18px; flex: none; border: 1px solid #C9C4C2; border-radius: 5px; text-align: center; line-height: 16px; font-size: 12px; color: #fff; }
.checkbox.checked { background: var(--primary); border-color: var(--primary); }
.option-title { font-size: 12px; font-weight: 700; }
.option-meta { font-size: 10px; color: var(--muted); margin-top: 3px; }
.select-empty { font-size: 11px; color: var(--muted); text-align: center; padding: 14px 0; }
.generate-btn { margin-top: 4px; }
.generate-note { font-size: 10px; color: var(--muted); text-align: center; margin-top: 9px; }

/* 发现页 */
.empower-btn { font-size: 10px; color: var(--primary); background: var(--primary-soft); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tag-item { border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 8px 13px; font-size: 11px; cursor: pointer; }
.tag-item.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.year-tabs { display: flex; gap: 7px; }
.year-tab { padding: 7px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 11px; cursor: pointer; }
.year-tab.active { border-color: var(--primary); color: var(--primary); background: #F1FAF8; font-weight: 700; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px; }
.stat-label { font-size: 11px; color: var(--muted); }
.stat-value { font-size: 30px; font-weight: 800; margin: 8px 0 4px; color: var(--ink); }
.stat-value .unit { font-size: 15px; }
.stat-sub { font-size: 10px; color: var(--muted); }
.sync-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sync-status { font-size: 10px; color: var(--primary); background: var(--primary-soft); padding: 3px 8px; border-radius: 7px; }
.sync-line { display: flex; justify-content: space-between; font-size: 11px; margin: 12px 0 5px; }
.sync-track { height: 7px; background: #F0EAE9; border-radius: 5px; overflow: hidden; }
.sync-fill { height: 100%; background: var(--primary); border-radius: 5px; }
.sync-fill.heart { background: var(--accent); }
.cat-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cat-tag { font-size: 11px; background: var(--primary-soft); color: #24514F; padding: 7px 11px; border-radius: 9px; }

/* 我的 */
.level-card { background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: 16px; margin-bottom: 14px; }
.level-top { display: flex; align-items: center; gap: 13px; }
.level-avatar { width: 56px; height: 56px; flex: none; border-radius: 15px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 25px; font-weight: 800; }
.level-name { font-size: 16px; font-weight: 800; }
.lv-pill { font-size: 10px; background: var(--primary); color: #fff; padding: 3px 8px; border-radius: 8px; vertical-align: middle; }
.level-exp, .level-exp-total { font-size: 11px; color: var(--muted); margin-top: 3px; }
.level-progress-head { display: flex; justify-content: space-between; font-size: 11px; margin: 16px 0 6px; }
.level-progress-head span:last-child { color: var(--primary); font-weight: 700; }
.progress-track { height: 7px; background: #F0EAE9; border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 5px; }
.level-subs { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 15px; }
.level-sub { display: flex; align-items: center; gap: 8px; background: #FBF8F7; border-radius: 11px; padding: 10px; }
.sub-icon { width: 27px; height: 27px; flex: none; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.sub-icon.teal { background: var(--primary-soft); color: var(--primary); }
.sub-icon.orange { background: #FFE3DC; color: var(--accent); }
.sub-info { flex: 1; min-width: 0; }
.sub-name { font-size: 11px; font-weight: 700; }
.sub-note { font-size: 9px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.sub-lv { font-size: 10px; color: var(--primary); font-weight: 700; }
.showcase { display: flex; align-items: center; gap: 11px; background: linear-gradient(120deg, #EAF6F3, #FDF2F0); cursor: pointer; }
.showcase-icon { width: 40px; height: 40px; flex: none; border-radius: 11px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.showcase-main { flex: 1; }
.showcase-title { font-size: 13px; font-weight: 700; }
.showcase-note { font-size: 10px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.new-pill { font-size: 9px; background: var(--accent); color: #fff; padding: 2px 6px; border-radius: 5px; }
.showcase-arrow { color: var(--primary); font-size: 20px; }
.skill { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 8px; margin-top: 11px; }
.skill-name { font-size: 11px; }
.skill-tier { font-size: 9px; color: var(--muted); margin-left: 5px; }
.skill-track { height: 7px; background: #F0EAE9; border-radius: 5px; overflow: hidden; }
.skill-fill { height: 100%; border-radius: 5px; }
.skill-pct { font-size: 10px; color: var(--muted); text-align: right; }
.badges { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 8px; }
.badge { border: 1px solid var(--line); border-radius: 11px; padding: 11px; text-align: center; opacity: .45; background: #FAF7F6; }
.badge.unlocked { opacity: 1; background: #F1FAF8; border-color: #CBE7E2; }
.badge-icon { font-size: 21px; }
.badge-name { font-size: 11px; font-weight: 700; margin-top: 5px; }
.badge-note { font-size: 9px; color: var(--muted); margin-top: 3px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 14px; }
.stat-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 13px 6px; text-align: center; }
.stat-num { font-size: 21px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 10px; color: var(--muted); margin-top: 3px; }
.visibility-row { display: flex; gap: 7px; margin-top: 10px; }
.vis-chip { flex: 1; text-align: center; padding: 9px 2px; border: 1px solid var(--line); border-radius: 9px; font-size: 10px; cursor: pointer; background: #fff; }
.vis-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.privacy-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid #F3ECEB; cursor: pointer; }
.privacy-main { flex: 1; }
.privacy-name { font-size: 12px; font-weight: 700; }
.privacy-note { font-size: 10px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.privacy-action { font-size: 11px; font-weight: 700; white-space: nowrap; }
.teal-text { color: var(--primary); }
.red-text { color: var(--accent); }
.school-card { border-color: #D9ECE8; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; margin-top: 11px; }
.toggle { width: 42px; height: 24px; border-radius: 14px; background: #CFCACA; position: relative; cursor: pointer; transition: background .2s; flex: none; }
.toggle.on { background: var(--primary); }
.toggle-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle.on .toggle-knob { transform: translateX(18px); }
.about-btn { width: 100%; height: 42px; border: none; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; margin-top: 6px; }

/* 弹层 */
.mask { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s; }
.mask.show { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; z-index: 60; bottom: 0; left: 50%; transform: translateX(-50%) translateY(105%); width: 100%; max-width: 480px; max-height: 88vh; background: #fff; border-radius: 20px 20px 0 0; transition: transform .25s ease; display: flex; flex-direction: column; }
.sheet.show { transform: translateX(-50%) translateY(0); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); flex: none; }
.sheet-title { font-size: 15px; font-weight: 700; }
.sheet-close { font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; }
.sheet-body { overflow-y: auto; padding: 4px 16px 16px; }
.sheet-foot { padding: 12px 16px 18px; border-top: 1px solid var(--line); flex: none; }
.preview-meta { padding: 12px 16px 0; font-size: 11px; color: var(--muted); }
.preview-body { overflow-y: auto; padding: 12px 16px; flex: 1; }
.preview-text { white-space: pre-wrap; font-size: 12px; line-height: 1.9; }
.preview-foot { display: flex; gap: 10px; padding: 12px 16px 18px; border-top: 1px solid var(--line); }
.preview-foot .ghost-button { flex: 0 0 34%; }
.toast { position: fixed; z-index: 90; bottom: 140px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(24,45,43,.94); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 12px; opacity: 0; pointer-events: none; transition: all .25s; max-width: 88%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
