*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--pink-50); color: var(--ink-900);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; }
#app { min-height: 100dvh; display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; background: var(--pink-50); position: relative; }
.appbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 8px; background: rgba(255,247,244,.92); backdrop-filter: blur(10px);
}
.appbar .back { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--ink-700); padding: 4px 8px 4px 0; cursor: pointer; }
.appbar h1 { font-size: 16px; margin: 0; font-weight: 600; }
.appbar .spacer { flex: 1; }
main.page { flex: 1; padding: 4px 18px 108px; }

.eyebrow { font-size: 11.5px; letter-spacing: .14em; color: var(--wine-500); font-weight: 600; }
h2.title { font-size: 22px; line-height: 1.35; margin: 8px 0 6px; letter-spacing: -.3px; }
p.sub { font-size: 13px; color: var(--ink-500); margin: 0 0 16px; line-height: 1.7; }

.card { background: #fff; border-radius: 20px; padding: 16px; box-shadow: 0 6px 20px rgba(122,26,22,.06); border: 1px solid rgba(255,255,255,.8); }
.card + .card { margin-top: 12px; }
.progress {
  position: relative; overflow: hidden; color: #fff; border: 0;
  background: linear-gradient(135deg, #7A1A16 0%, #A82B24 62%, #D8544A 100%);
  box-shadow: 0 16px 34px rgba(122,26,22,.24);
}
.progress::after { content: ""; position: absolute; width: 210px; height: 210px; right: -90px; top: -104px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.3), transparent 66%); }
.progress .k { font-size: 11.5px; letter-spacing: .14em; color: rgba(255,255,255,.84); }
.progress .big { font-family: var(--font-num); font-size: 46px; font-weight: 700; line-height: 1; margin: 10px 0 2px; letter-spacing: -1.4px; }
.progress .big small { font-size: 13px; font-weight: 500; color: rgba(255,255,255,.82); letter-spacing: 0; }
.bars { display: flex; gap: 4px; margin-top: 16px; }
.bars i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.24); }
.bars i.on { background: #FFE3D6; }
.progress .meta { display: flex; justify-content: space-between; font-size: 11.5px; color: rgba(255,255,255,.88); margin-top: 10px; }

.today .cover { height: 84px; background: linear-gradient(135deg,#EFC3C7,#F7D9D2 55%,#FFF0E8); display: flex; align-items: flex-end; justify-content: space-between; padding: 12px 14px; position: relative; overflow: hidden; border-radius: 20px 20px 0 0; }
.today .cover em { position: absolute; right: 10px; bottom: -14px; font-style: normal; font-family: var(--font-num); font-weight: 700; font-size: 76px; color: rgba(122,26,22,.1); }
.pill { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,.84); color: var(--wine-700); font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.today .body { padding: 13px 16px 16px; }
.today h3 { font-size: 15.5px; margin: 0 0 6px; line-height: 1.5; }
.today p { font-size: 12.5px; color: var(--ink-500); margin: 0 0 12px; line-height: 1.65; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.btn {
  border: 0; font: inherit; font-size: 14.5px; font-weight: 600; color: #fff; cursor: pointer;
  background: var(--grad-cta); padding: 13px 18px; border-radius: 999px;
  box-shadow: 0 10px 22px rgba(168,43,36,.24);
}
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--wine-600); border: 1px solid rgba(122,26,22,.18); box-shadow: none; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; box-shadow: none; }
.muted { color: var(--ink-300); font-size: 12px; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; background: var(--pink-100); color: var(--wine-600); }
.tag.done { background: #EDF5F0; color: #2F6B50; }
.tag.lock { background: #F4F1EF; color: var(--ink-300); }

.mod { display: flex; align-items: center; gap: 12px; padding: 15px 16px; }
.mod .idx { width: 32px; height: 32px; border-radius: 10px; background: var(--pink-100); color: var(--wine-600); display: grid; place-items: center; font-family: var(--font-num); font-weight: 700; font-size: 13px; }
.mod h3 { font-size: 14.5px; margin: 0; }
.mod p { margin: 3px 0 0; font-size: 11.5px; color: var(--ink-300); }
.lesson { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; border-top: 1px solid rgba(122,26,22,.07); background: #fff; }
.lesson:hover { background: var(--pink-50); }
.lesson .dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgba(122,26,22,.2); display: grid; place-items: center; font-size: 10px; color: var(--ink-300); flex: none; }
.lesson.done .dot { background: #3F7D62; border-color: #3F7D62; color: #fff; }
.lesson.current .dot { border-color: var(--coral-500); background: #FFEFEA; color: var(--wine-600); }
.lesson .t { flex: 1; min-width: 0; }
.lesson .t b { display: block; font-size: 13.5px; font-weight: 500; }
.lesson .t span { font-size: 11px; color: var(--ink-300); }
.lesson.locked { opacity: .45; cursor: default; }

.player { height: 190px; border-radius: 18px; background: linear-gradient(140deg,#4E1714,#8E1E18 55%,#C9554C); position: relative; display: grid; place-items: center; overflow: hidden; }
.player .play { width: 56px; height: 56px; border-radius: 50%; border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.18); color: #fff; font-size: 16px; cursor: pointer; }
.player .cap { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; justify-content: space-between; font-size: 11px; color: rgba(255,255,255,.85); }
.player .seek { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.2); }
.player .seek i { display: block; height: 100%; width: 0; background: var(--coral-300); transition: width .4s linear; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }

.chapter { display: flex; gap: 12px; padding: 12px 2px; border-bottom: 1px solid rgba(122,26,22,.08); }
.chapter:last-child { border: 0; }
.chapter .n { font-family: var(--font-num); font-size: 12px; color: var(--wine-500); width: 18px; flex: none; }

.q { margin-bottom: 16px; }
.q label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; line-height: 1.5; }
.q label em { font-style: normal; color: var(--wine-500); font-family: var(--font-num); margin-right: 6px; }
.q .hint { font-size: 11.5px; color: var(--ink-300); margin: 0 0 8px; }
textarea { width: 100%; min-height: 84px; resize: vertical; border-radius: 14px; border: 1px solid rgba(122,26,22,.2); background: #fff; padding: 12px; font: inherit; font-size: 13.5px; line-height: 1.65; color: var(--ink-900); outline: none; }
textarea:focus { border-color: var(--coral-500); box-shadow: 0 0 0 4px rgba(240,132,120,.14); }

.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.stats div { background: #fff; border-radius: 14px; padding: 12px; text-align: center; box-shadow: 0 4px 14px rgba(122,26,22,.05); }
.stats b { display: block; font-family: var(--font-num); font-size: 20px; color: var(--wine-600); }
.stats span { font-size: 11px; color: var(--ink-300); }

.reflection-item { padding: 12px 0; border-bottom: 1px solid rgba(122,26,22,.08); }
.reflection-item:last-child { border: 0; }
.reflection-item b { font-size: 13px; display: block; margin-bottom: 4px; }
.reflection-item p { margin: 0; font-size: 12.5px; color: var(--ink-500); line-height: 1.65; }
.reply { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: #FFF4EF; font-size: 12.5px; color: var(--wine-700); line-height: 1.65; }

.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; height: 74px; padding: 8px 12px 16px; display: grid; grid-template-columns: repeat(4,1fr); background: rgba(255,252,250,.94); backdrop-filter: blur(14px); border-top: 1px solid rgba(122,26,22,.1); z-index: 6; }
.tab { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--ink-300); cursor: pointer; }
.tab svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--wine-600); font-weight: 600; }

.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; padding: 32px 26px 30px; background: radial-gradient(420px 320px at 85% 4%, #FBD3D4 0%, transparent 62%), radial-gradient(520px 380px at 0% 30%, #FFEFE7 0%, transparent 60%), linear-gradient(170deg,#FFF8F4,#FCE7E6); max-width: 520px; margin: 0 auto; }
.login .mark { width: 54px; height: 54px; border-radius: 18px; background: var(--grad-cta); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 700; box-shadow: 0 12px 26px rgba(168,43,36,.3); }
.login h1 { font-size: 30px; line-height: 1.3; margin: 24px 0 10px; letter-spacing: -.8px; }
.login h1 em { font-style: normal; color: var(--wine-600); }
.login .box { background: rgba(255,255,255,.9); border-radius: 24px; padding: 18px; box-shadow: 0 14px 32px rgba(122,26,22,.12); }
.login input { width: 100%; height: 54px; border-radius: 14px; border: 1px solid rgba(122,26,22,.22); text-align: center; font-size: 22px; letter-spacing: .34em; font-family: var(--font-num); color: var(--wine-700); outline: none; }
.login input:focus { border-color: var(--coral-500); box-shadow: 0 0 0 4px rgba(240,132,120,.16); }
.login .steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 18px; }
.login .steps div { border-top: 1px solid rgba(122,26,22,.16); padding-top: 10px; font-size: 11.5px; color: var(--ink-500); }
.login .steps b { display: block; font-family: var(--font-num); font-size: 11px; color: var(--coral-500); margin-bottom: 4px; }

.empty { text-align: center; padding: 46px 16px; color: var(--ink-300); font-size: 13px; }
.skeleton { padding: 40px 16px; text-align: center; color: var(--ink-300); }
.toast { position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 10px); background: rgba(58,29,27,.94); color: #fff; font-size: 12.5px; padding: 10px 16px; border-radius: 999px; opacity: 0; transition: .22s; z-index: 20; max-width: 80%; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.note { font-size: 11.5px; color: var(--ink-300); text-align: center; margin-top: 14px; line-height: 1.7; }

@media (min-width: 560px) {
  body { background: #FBF0EB; padding: 20px 0; }
  #app { border-radius: 28px; overflow: hidden; box-shadow: 0 30px 70px rgba(122,26,22,.16); min-height: calc(100dvh - 40px); }
  .tabbar { border-radius: 0 0 28px 28px; }
}
