/* 快记单词 · 暖黄+草绿 童趣风 */
:root {
  --yellow: #FCD34D; --yellow-l: #FDE68A;
  --green: #4ADE80; --green-l: #86EFAC;
  --bg: #FFFBEB; --ink: #3F3D33;
  --red: #F87171; --amber: #FBBF24; --emerald: #34D399;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: "PingFang SC", "Microsoft YaHei", sans-serif; min-height: 100vh; }
#view, .app-header { max-width: 520px; margin: 0 auto; }
.app-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.back { background: #fff; color: #92400E; text-decoration: none; font-size: .9rem; font-weight: 700; padding: 8px 14px; border-radius: 12px; border: 2px solid #E7C88A; box-shadow: 0 2px 6px rgba(146,64,14,.18); white-space: nowrap; }
.brand { flex: 1; display: flex; align-items: center; gap: 8px; }
.brand-icon { width: 40px; height: 40px; border-radius: 12px; }
.brand h1 { font-size: 1.25rem; }
.stats { font-size: .82rem; color: #92400E; text-align: right; line-height: 1.5; }
.loading { text-align: center; padding: 60px 0; color: #92400E; }

/* 首页三入口 */
.entry-grid { display: grid; gap: 16px; padding: 10px 16px 30px; }
.entry-card { display: block; border-radius: 24px; padding: 22px; text-decoration: none; color: var(--ink); box-shadow: 0 4px 14px rgba(180, 140, 20, .12); border: 2px solid var(--yellow-l); transition: transform .15s; }
.entry-card:active { transform: scale(.98); }
.entry-card h2 { font-size: 1.3rem; margin-bottom: 6px; }
.entry-card p { color: #8a7a4a; font-size: .9rem; line-height: 1.5; }
.entry-card.c1 { background: linear-gradient(135deg, #FEF3C7, var(--yellow-l)); }
.entry-card.c2 { background: linear-gradient(135deg, #ECFDF5, #D1FAE5); border-color: #A7F3D0; }
.entry-card.c3 { background: linear-gradient(135deg, #FFFBEB, #FEF9C3); }

/* 3D 翻卡 */
.card3d { perspective: 1200px; height: 350px; margin: 14px 0; }
.card3d-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .5s; }
.card3d.flipped .card3d-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #fff; border-radius: 24px; box-shadow: 0 6px 18px rgba(180, 140, 20, .15); border: 2px solid var(--yellow-l); padding: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; cursor: pointer; }
.face-back { transform: rotateY(180deg); align-items: flex-start; text-align: left; justify-content: flex-start; overflow: auto; cursor: default; }
.w-en { font-size: 2.2rem; font-weight: 800; color: #1F2937; word-break: break-all; }
.w-phonetic { color: #6B7280; }
.w-pos { color: #92400E; background: #FEF3C7; border-radius: 999px; padding: 2px 10px; font-size: .85rem; }
.w-cn { font-size: 1.5rem; font-weight: 700; }
.quiz .w-cn { font-size: 2rem; }
.b-word { font-size: 1.4rem; font-weight: 800; color: #1F2937; margin-bottom: 6px; }
.b-mnemonic, .b-phrase, .b-example { font-size: .95rem; margin-bottom: 6px; line-height: 1.55; }
.b-example-cn { color: #6B7280; font-size: .9rem; margin-bottom: 6px; }
.lbl { display: inline-block; background: var(--yellow-l); color: #92400E; border-radius: 8px; padding: 1px 8px; margin-right: 6px; font-size: .8rem; }

/* 按钮（文字，不用图标） */
.card-actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.face-back .card-actions { justify-content: flex-start; }
.btn { border: 0; border-radius: 16px; padding: 10px 18px; font-size: 1rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: default; filter: grayscale(.7); }
.btn-tts { background: var(--green-l); color: #065F46; }
.btn-reveal { background: var(--yellow-l); color: #92400E; }
.btn-plain { background: #F3F4F6; color: #374151; }

/* 会话流程 */
.session-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px 0; }
.session-title { font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.progress { flex: 1; height: 12px; background: var(--yellow-l); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 999px; transition: width .3s; }
.session-card-wrap { padding: 0 16px; }
.grade-row { display: flex; gap: 12px; padding: 4px 16px 20px; }
.grade-row .btn { flex: 1; padding: 14px 0; font-size: 1.02rem; border-radius: 20px; }
.btn-grade-again { background: var(--red); color: #fff; }
.btn-grade-hard { background: var(--amber); color: #fff; }
.btn-grade-good { background: var(--emerald); color: #fff; }

/* 折叠面板（话题/家族列表） */
.panel { background: #fff; border-radius: 24px; margin: 14px 16px; border: 2px solid var(--yellow-l); overflow: hidden; }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; font-weight: 700; }
.panel-h .sub { color: #8a7a4a; font-weight: 400; font-size: .85rem; }
.panel-b { border-top: 1px dashed var(--yellow-l); display: none; }
.panel.open .panel-b { display: block; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid #FFF7DB; cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row:active { background: #FFFBEB; }
.row .r-main { font-weight: 700; }
.row .r-sub { color: #8a7a4a; font-size: .85rem; }
.badge { font-size: .75rem; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.badge.new { background: #F3F4F6; color: #6B7280; }
.badge.doing { background: #FEF3C7; color: #92400E; }
.badge.done { background: #D1FAE5; color: #065F46; }

/* 结算页 */
.done-page { text-align: center; padding: 30px 16px 40px; }
.done-page h2 { font-size: 1.6rem; margin-bottom: 8px; color: #92400E; }
.done-page .tip { color: #8a7a4a; margin-bottom: 16px; }
.done-stats { background: #fff; border-radius: 24px; padding: 20px; margin: 0 0 18px; border: 2px solid var(--yellow-l); }
.done-stats .row { cursor: default; padding: 9px 6px; }
.done-stats .row .r-sub { font-size: 1rem; font-weight: 800; color: #1F2937; }

/* 词墙（一屏一 Day：浏览点读 → 遮住回忆） */
.w-back { background: var(--emerald); color: #fff; text-decoration: none; font-size: .9rem; font-weight: 700; padding: 8px 14px; border-radius: 12px; box-shadow: 0 2px 6px rgba(6,95,70,.25); white-space: nowrap; }
.w-timer { margin-left: auto; background: #fff; border: 2px solid var(--yellow-l); border-radius: 999px; padding: 2px 12px; font-size: .82rem; color: #92400E; font-variant-numeric: tabular-nums; }
.w-hint { text-align: center; color: #8a7a4a; font-size: .85rem; padding: 2px 16px 8px; min-height: 1.4em; }
.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; padding: 0 12px 4px; }
.w-tile { background: #fff; border-radius: 14px; border: 2px solid var(--yellow-l); overflow: hidden; cursor: pointer; transition: box-shadow .2s, transform .1s; }
.w-tile:active { transform: scale(.97); }
.w-imgwrap { position: relative; width: 100%; height: 74px; background: linear-gradient(135deg, #FEF3C7, var(--green-l)); }
.w-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.w-img.show { opacity: 1; }
.w-init { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800; color: #92400E; }
.w-tile .t-word { font-weight: 800; font-size: .9rem; padding: 4px 8px 0; word-break: break-all; }
.w-tile .t-phon { color: #6B7280; font-size: .62rem; padding: 0 8px; }
.w-tile .t-cn { color: #57534E; font-size: .7rem; padding: 0 8px 6px; }
.w-tile .ask { display: none; height: 40px; align-items: center; justify-content: center; color: #D6D3D1; font-size: 1.3rem; font-weight: 800; }
.w-tile.on { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-l); }
.w-tile.revealed { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-l); }
.wall-grid.masked .t-word, .wall-grid.masked .t-phon { display: none; } /* 遮住态保留中文作线索，遮住英文/音标 */
.wall-grid.masked .w-tile:not(.revealed) .ask { display: flex; }
.wall-foot { padding: 10px 14px 24px; }
.wall-foot .btn { display: block; width: 100%; margin-top: 8px; padding: 13px 0; font-size: 1.02rem; }

/* 句子翻译练习 */
.sent-modes { display: flex; gap: 8px; padding: 0 14px 8px; }
.mode-btn { flex: 1; border: 2px solid var(--yellow-l); background: #fff; border-radius: 12px; padding: 8px 0; font-size: .9rem; font-weight: 700; cursor: pointer; font-family: inherit; color: #57534E; }
.mode-btn.on { background: var(--emerald); color: #fff; border-color: var(--emerald); }
.sent-list { padding: 0 14px 10px; display: grid; gap: 8px; }
.sent-row { background: #fff; border: 2px solid var(--yellow-l); border-radius: 14px; padding: 10px 12px; display: flex; gap: 8px; align-items: center; }
.sent-main { flex: 1; min-width: 0; cursor: pointer; }
.sent-tag { display: inline-block; background: #ECFDF5; color: #065F46; border-radius: 6px; font-size: .68rem; padding: 0 6px; margin-bottom: 3px; }
.sent-en { font-weight: 700; font-size: .95rem; line-height: 1.45; word-break: break-word; }
.sent-zh { color: #6B7280; font-size: .85rem; margin-top: 2px; line-height: 1.45; }
.sent-row .sent-eye { white-space: nowrap; font-size: .8rem; padding: 7px 10px; border-radius: 10px; }

/* 索引页返回行 */
.page-back { padding: 0 14px 6px; }
/* 词墙上一天/下一天导航行（标题下方） */
.day-nav { display: flex; gap: 8px; margin-top: 8px; padding: 0 14px; }
.day-nav .btn { display: block; width: auto; flex: 1; margin-top: 0; padding: 11px 0; font-size: .95rem; }
/* 家族卡片页 上一组/下一组 */
.group-nav { display: flex; gap: 8px; padding: 0 14px 4px; }
.group-nav:empty { display: none; }
.group-nav .btn { flex: 1; padding: 12px 0; font-size: .95rem; }

/* ===== 今日复习（简单列表） ===== */
.rv-list { padding: 0 12px 90px; }
.rv-row { background:#fff; border:1px solid #E8DFD0; border-radius:14px; padding:12px 14px; margin-bottom:10px; }
.rv-line { display:flex; align-items:baseline; gap:8px; cursor:pointer; }
.rv-line:active { opacity:.7; }
.rv-idx { font-size:12px; color:#B0A08C; min-width:18px; flex:none; }
.rv-word { font-size:22px; font-weight:800; color:#3E2F1C; }
.rv-phon { font-size:12px; color:#A08C70; }
.rv-cn { font-size:15px; color:#5C4B36; }
.rv-spk { margin-left:auto; font-size:12px; color:#fff; background:#F0A500; border-radius:999px; padding:3px 10px; flex:none; align-self:center; }
.rv-ex { margin-top:8px; padding-top:8px; border-top:1px dashed #EFE6D6; cursor:pointer; font-size:13px; line-height:1.5; }
.rv-ex:active { opacity:.7; }
.rv-ex-en { color:#5C4B36; display:block; }
.rv-ex-cn { color:#A08C70; display:block; font-size:12px; margin-top:2px; }

/* ===== 联想记忆 ===== */
.lk-groups { padding: 0 12px; }
.lk-row { cursor: pointer; }
.lk-row.lk-today { border-left: 3px solid #F0A500; }
.lk-blocks { padding: 0 12px; }
.lk-block.open .panel-b { display: flex; flex-direction: column; gap: 8px; }
.lk-pair { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; cursor: pointer; padding: 6px 8px; background: #FFFBF2; border-radius: 10px; }
.lk-pair:active { opacity: .7; }
.lk-pair b { color: #3E2F1C; }
.lk-hl { color: #C2790A; font-weight: 800; }
.lk-pair i { font-style: normal; color: #A08C70; font-size: 13px; }
.lk-vs { color: #F0A500; font-weight: 800; }
.lk-halves { display: inline-flex; align-items: baseline; gap: 4px; cursor: pointer; }
.lk-fam { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; background: #FFFBF2; border-radius: 10px; }
.lk-tail { font-size: 13px; font-weight: 800; color: #fff; background: #8B6B4F; border-radius: 8px; padding: 2px 8px; flex: none; }
.lk-w { display: inline-flex; align-items: baseline; gap: 4px; font-size: 15px; font-weight: 700; color: #3E2F1C; background: #fff; border: 1px solid #E8DFD0; border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.lk-w:active { opacity: .7; }
.lk-w i { font-style: normal; font-size: 11px; color: #A08C70; font-weight: 400; }
.lk-w.lk-in { border-color: #F0A500; background: #FDF3DC; }
.lk-words { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 90px; }
.lk-tail-t { background: #2F8F6B; }
.lk-famcard { background: #FFFDF4; border: 2px solid #F0E6C8; border-radius: 16px; padding: 12px 14px; }
.lk-fam-root { font-size: 1.15rem; font-weight: 800; color: #4A3B14; margin-bottom: 8px; }
.lk-fam-root i { font-style: normal; font-weight: 400; color: #8a7a4a; font-size: .9rem; margin-left: 6px; }
.lk-root-badge { display: inline-block; background: #2F8F6B; color: #fff; font-size: .72rem; border-radius: 8px; padding: 2px 8px; margin-left: 8px; vertical-align: middle; }
.lk-table { display: flex; flex-direction: column; gap: 2px; }
.lk-tr { display: flex; align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.lk-tr:active { background: #F5EBCF; }
.lk-root-row { background: #FDF6DC; }
.lk-tw { font-weight: 800; font-size: 1.02rem; color: #333; min-width: 5.5em; }
.lk-tt { color: #B08A2E; font-size: .82rem; min-width: 7em; }
.lk-tc { color: #666; font-size: .88rem; margin-left: auto; text-align: right; }
.lk-sent { margin-top: 10px; background: #EAF4EE; border-radius: 12px; padding: 10px 12px; cursor: pointer; font-weight: 700; color: #2F8F6B; font-size: .95rem; line-height: 1.5; }
.lk-sent:active { background: #DDEEE4; }
.lk-sent-label { display: inline-block; background: #2F8F6B; color: #fff; font-size: .7rem; border-radius: 6px; padding: 1px 6px; margin-right: 6px; vertical-align: middle; }
.lk-sent i { display: block; font-style: normal; font-weight: 400; color: #5A7A68; font-size: .85rem; margin-top: 3px; }
.lk-wordlist { display: flex; flex-direction: column; }
.lk-wordlist .rv-row { margin: 0; }
/* ---- 单词森林 ---- */
.fk-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 16px; }
.fk-btn { border: none; background: #fff; border: 2px solid var(--yellow-l); border-radius: 14px; padding: 10px 22px; font-size: 1rem; font-weight: 700; color: var(--text); cursor: pointer; }
.fk-btn:disabled { opacity: .35; cursor: default; }
.fk-pageno { color: #8a7a4a; font-size: .92rem; font-weight: 700; }
.fk-page { display: none; }
.fk-page.on { display: block; }
.fk-title { text-align: center; font-size: 1.25rem; color: var(--text); margin: 14px 16px 4px; }
.fk-intro { background: #FFF7DD; border-radius: 14px; margin: 10px 16px; padding: 12px 16px; color: #8a7a4a; font-size: .92rem; line-height: 1.6; }
.fk-group { background: #fff; border: 2px solid var(--yellow-l); border-radius: 18px; margin: 12px 16px; padding: 12px 14px; }
.fk-gname { font-weight: 800; color: #4A3B14; margin-bottom: 10px; font-size: .98rem; }
.fk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fk-chip { background: #FBF4DF; border-radius: 12px; padding: 8px 12px; cursor: pointer; font-size: .95rem; color: #8a7a4a; }
.fk-chip:active { transform: scale(.94); background: #F3E7C3; }
.fk-chip b { color: var(--text); margin-right: 5px; font-size: 1.02rem; }
.fk-chant { background: #EAF4EE; border: 2px solid #CBE5D5; border-radius: 16px; margin: 12px 16px; padding: 12px 16px; cursor: pointer; font-weight: 700; color: #2F8F6B; line-height: 1.55; font-size: .98rem; }
.fk-chant:active { background: #DDEEE4; }
.fk-chant-label { display: inline-block; background: #2F8F6B; color: #fff; font-size: .72rem; border-radius: 8px; padding: 2px 8px; margin-right: 8px; vertical-align: middle; }
.fk-chant-cn { display: block; font-weight: 400; color: #5A7A68; font-size: .88rem; margin-top: 4px; }
.fk-quiz { background: #F3EFFF; border: 2px solid #DDD3F5; border-radius: 18px; margin: 12px 16px; padding: 14px 16px; }
.fk-quiz .fk-gname { color: #5A4B9E; }
.fk-quiz-box { min-height: 120px; }
.fk-qword { text-align: center; font-size: 1.7rem; font-weight: 800; color: var(--text); cursor: pointer; padding: 12px 0 4px; }
.fk-qword:active { opacity: .7; }
.fk-qtip { display: block; font-size: .78rem; font-weight: 400; color: #9B8FD0; margin-top: 4px; }
.fk-qopts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.fk-qopt { border: none; background: #fff; border: 2px solid #DDD3F5; border-radius: 14px; padding: 12px 8px; font-size: 1rem; color: var(--text); cursor: pointer; }
.fk-qopt:disabled { opacity: .55; }
.fk-qopt.right { background: #2F8F6B; border-color: #2F8F6B; color: #fff; opacity: 1; }
.fk-qopt.wrong { background: #E05B5B; border-color: #E05B5B; color: #fff; opacity: 1; }
.fk-qscore { text-align: center; color: #5A4B9E; font-weight: 700; margin-top: 10px; min-height: 1.4em; }
.fk-retry { display: block; margin: 12px auto 0; }
.fk-note { background: #FDF6DC; border-radius: 10px; padding: 8px 12px; color: #6b5d33; font-size: .88rem; line-height: 1.65; margin-bottom: 10px; }
.fk-note b { color: #B03A2E; }
/* 每日选择题 */
.qz-head { max-width: 720px; margin: 0 auto 12px; }
.qz-head h2 { margin: 4px 0 6px; }
.qz-meta { color: #7a6a4f; font-size: .9rem; margin-bottom: 8px; }
.qz-prog { height: 10px; background: #efe6cf; border-radius: 6px; overflow: hidden; }
.qz-bar { height: 100%; width: 0; background: linear-gradient(90deg, #7cb342, #558b2f); border-radius: 6px; transition: width .3s; }
.qz-card { max-width: 720px; margin: 0 auto 16px; background: #fff; border-radius: 18px; padding: 16px; box-shadow: 0 2px 10px rgba(90,70,30,.08); }
.qz-num { color: #9a8a6a; font-size: .85rem; margin-bottom: 10px; }
.qz-img { text-align: center; margin-bottom: 12px; }
.qz-img img { max-width: 78%; max-height: 260px; border-radius: 14px; background: #fdf6dc; }
.qz-img.noimg::after { content: '图片生成中…'; color: #b8a888; font-size: .9rem; }
.qz-sent { font-size: 1.15rem; line-height: 1.7; margin-bottom: 8px; }
.qz-blank { display: inline-block; min-width: 84px; border-bottom: 3px solid #e0962e; color: #e0962e; text-align: center; font-weight: 700; }
.qz-cn { color: #8a7a5a; font-size: .92rem; margin-bottom: 10px; }
.qz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.qz-opt { border: 2px solid #e8dcc0; background: #fffcf3; border-radius: 12px; padding: 14px 8px; font-size: 1.05rem; cursor: pointer; transition: transform .1s; }
.qz-opt:active { transform: scale(.96); }
.qz-opt.right { border-color: #7cb342; background: #ecf6df; color: #33691e; font-weight: 700; }
.qz-opt.wrong { border-color: #e57373; background: #fdeaea; color: #b03a2e; }
.qz-opt:disabled { cursor: default; opacity: .85; }
.qz-done { max-width: 720px; margin: 24px auto; background: #fff; border-radius: 18px; padding: 28px 16px; text-align: center; box-shadow: 0 2px 10px rgba(90,70,30,.08); }
.qz-done .tip { color: #7a6a4f; margin: 10px 0 18px; }
.qz-replay { display: inline-block; margin-left: 10px; font-size: .78rem; color: #fff; background: #e0962e; border-radius: 10px; padding: 2px 10px; cursor: pointer; }
.qz-sent { cursor: pointer; }
