* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --teal: #50B8B8;
  --teal-deep: #3D9E9E;
  --teal-light: #E6F5F5;
  --ink: #223330;
  --ink-2: #5c6d6a;
  --ink-3: #93a19e;
  --line: #e6eeec;
  --bg: #ffffff;
  --danger: #c96a5a;
  --gold: #c9a86a;
}
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "微软雅黑", -apple-system, "PingFang SC", sans-serif;
  color: var(--ink);
  background: #F2FAF9;
  font-size: 15px;
  line-height: 1.6;
}
#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
}
.hidden { display: none !important; }

/* 通用按钮 */
.btn {
  display: block; width: 100%; padding: 14px; border: 0; border-radius: 12px;
  font-family: inherit; font-size: 16px; font-weight: 600; letter-spacing: .5px;
  background: var(--teal); color: #fff; cursor: pointer; transition: opacity .2s, transform .1s;
}
.btn:active { transform: scale(.985); opacity: .9; }
.btn:disabled { background: #C2DAD8; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--teal-deep); border: 1.5px solid var(--teal); }
.btn-ghost:disabled { background: #f4f7f6; color: #b7c6c4; border-color: #e2eae8; }
.btn-sm { width: auto; padding: 8px 18px; font-size: 14px; border-radius: 10px; }

/* 登录页 */
.login-wrap { min-height: 100vh; background: linear-gradient(160deg,#F2FAF9 0%,#ffffff 55%); display: flex; flex-direction: column; padding: 0 30px; }
.login-brand { text-align: center; padding: 64px 0 30px; }
.login-logo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; box-shadow: 0 6px 22px rgba(74,157,146,.18); }
.login-title { font-size: 20px; font-weight: 600; margin-top: 20px; letter-spacing: 1px; color: var(--ink); }
.login-sub { font-size: 13px; color: var(--ink-3); margin-top: 6px; letter-spacing: 2px; }
.login-form { margin-top: 18px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.field input {
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 15px; color: var(--ink); background: #fff; outline: none; transition: border .2s;
}
.field input:focus { border-color: var(--teal); }
.login-tip { text-align: center; color: var(--ink-3); font-size: 12px; margin-top: 20px; }

/* 顶部栏 */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  height: 58px; padding: 0 18px; background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(8px);
}
.topbar .logo-sm { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.topbar .brand { font-size: 15px; font-weight: 600; color: var(--ink); }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: var(--ink-2); }
.back-btn { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--teal-deep); background: none; border: 0; font-family: inherit; cursor: pointer; padding: 6px 0; }

.page { padding: 18px; }
.page-title { font-size: 20px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.page-desc { font-size: 13px; color: var(--ink-3); margin-bottom: 20px; }

/* 续上提示 */
.resume-card {
  background: linear-gradient(135deg,#50B8B8,#3D9E9E); color: #fff; border-radius: 16px;
  padding: 18px; margin-bottom: 20px; box-shadow: 0 6px 18px rgba(74,157,146,.25);
}
.resume-card .rc-tag { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 20px; background: rgba(255,255,255,.22); margin-bottom: 8px; }
.resume-card .rc-name { font-size: 17px; font-weight: 600; }
.resume-card .rc-info { font-size: 13px; opacity: .9; margin: 4px 0 14px; }
.resume-card .btn { background: #fff; color: var(--teal-deep); }
.resume-card .rc-actions { display: flex; gap: 10px; }
.resume-card .rc-actions .btn { flex: 1; }
.resume-card .rc-actions .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.75); }

/* 课程卡片 */
.course-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; margin-bottom: 14px; cursor: pointer; transition: box-shadow .2s, transform .1s; overflow: hidden;
}
.course-card:active { transform: scale(.99); }
.course-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--teal); }
.course-top { display: flex; align-items: center; gap: 10px; }
.course-cat { font-size: 11px; color: var(--teal-deep); background: var(--teal-light); padding: 3px 10px; border-radius: 20px; }
.course-name { font-size: 17px; font-weight: 600; margin: 10px 0 4px; }
.course-desc { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.course-meta { display: flex; gap: 16px; margin-top: 14px; font-size: 12px; color: var(--ink-3); }
.course-card .course-start { margin-top: 14px; padding: 10px; font-size: 14px; }

/* 教案预览块 */
.section-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; overflow: hidden; }
.section-hd { display: flex; align-items: center; gap: 8px; padding: 14px 16px; background: var(--teal-light); color: var(--teal-deep); font-size: 15px; font-weight: 600; }
.section-hd .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.section-bd { padding: 14px 16px; color: var(--ink-2); font-size: 14px; line-height: 1.75; }
.section-bd p { margin-bottom: 6px; }
.section-bd p:last-child { margin-bottom: 0; }
.chapter-preview { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.chapter-preview:last-child { border-bottom: 0; }
.chapter-preview .no { color: var(--teal); font-weight: 600; min-width: 22px; }
.chapter-preview .t { flex: 1; color: var(--ink); }
.chapter-preview .d { color: var(--ink-3); font-size: 13px; }

/* 授课中 */
.teach-screen { height: 100vh; display: flex; flex-direction: column; background: #fff; }
.teach-hd { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.teach-hd-row { display: flex; align-items: center; gap: 10px; }
.teach-hd .cname { font-size: 15px; font-weight: 600; flex: 1; }
.teach-progress-text { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.progress-track { height: 4px; background: var(--line); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--teal); border-radius: 4px; transition: width .3s; }

.chapter-stage { flex: 1; position: relative; overflow: hidden; }
.chapter-scroll { height: 100%; overflow-y: auto; padding: 22px 20px 90px; -webkit-overflow-scrolling: touch; }
.chapter-label { display: inline-block; font-size: 12px; color: var(--teal-deep); background: var(--teal-light); padding: 4px 12px; border-radius: 20px; margin-bottom: 14px; }
.chapter-title { font-size: 22px; font-weight: 600; color: var(--ink); margin-bottom: 18px; line-height: 1.4; }
.chapter-content { color: #3a4a48; font-size: 16px; line-height: 2; }
.chapter-content p { margin-bottom: 14px; }
.chapter-content img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 12px 0; }
.scroll-hint { text-align: center; color: var(--ink-3); font-size: 12px; padding: 10px 0 4px; }

/* 倒计时（右上角悬浮） */
.timer-badge {
  position: absolute; right: 16px; top: 16px; z-index: 15;
  min-width: 84px; text-align: center; padding: 10px 14px; border-radius: 16px;
  background: rgba(31,45,43,.92); color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.timer-badge .lbl { font-size: 10px; opacity: .75; letter-spacing: 1px; }
.timer-badge .num { font-size: 26px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.timer-badge.urgent { background: rgba(201,106,90,.95); }

/* 回顶按钮 */
.to-top {
  position: absolute; right: 16px; bottom: 92px; z-index: 15;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: #fff; color: var(--teal-deep); font-size: 20px;
  box-shadow: 0 4px 16px rgba(31,45,43,.18); cursor: pointer;
}
.teach-foot { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.teach-foot .hint { font-size: 12px; color: var(--ink-3); text-align: center; margin-bottom: 10px; }

/* 完成页 */
.done-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; background: linear-gradient(160deg,#F2FAF9,#fff); }
.done-icon { width: 88px; height: 88px; border-radius: 50%; background: var(--teal-light); display: flex; align-items: center; justify-content: center; font-size: 42px; color: var(--teal); }
.done-title { font-size: 22px; font-weight: 600; margin-top: 22px; }
.done-info { color: var(--ink-2); font-size: 14px; margin: 12px 0 28px; line-height: 1.8; }
.done-stats { display: flex; gap: 12px; width: 100%; margin-bottom: 28px; }
.stat-box { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 8px; }
.stat-box .v { font-size: 20px; font-weight: 600; color: var(--teal-deep); }
.stat-box .k { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.empty { text-align: center; color: var(--ink-3); padding: 60px 20px; font-size: 14px; }
.loading { text-align: center; color: var(--ink-3); padding: 50px; font-size: 14px; }

/* 授课底部并排操作按钮 */
.teach-foot .hint { font-size: 12px; color: var(--ink-3); text-align: center; margin-bottom: 10px; }
.teach-actions { display: flex; gap: 12px; }
.teach-actions .btn { flex: 1; padding: 14px 8px; }
.teach-actions .btn-ghost { flex: 0 0 32%; }
