* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f1f5f9; color: #2c2c2c; }
#topbar { background: #0369a1; color: #fff; padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 10; }
.logo { font-size: 18px; font-weight: bold; cursor: pointer; }
.badge { font-size: 12px; background: rgba(255,255,255,.2); padding: 3px 10px; border-radius: 10px; }
main { max-width: 900px; margin: 0 auto; padding: 20px; }

.card { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.card h2 { font-size: 18px; margin-bottom: 12px; color: #0369a1; }
.btn { display: inline-block; background: #0369a1; color: #fff; border: none; padding: 10px 22px; border-radius: 8px; font-size: 15px; cursor: pointer; margin: 4px 6px 4px 0; }
.btn.ghost { background: #e2e8f0; color: #4a4a4a; }
.btn:hover { opacity: .88; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cat-item { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 10px; padding: 14px; text-align: center; cursor: pointer; }
.cat-item:hover { border-color: #0369a1; }
.cat-item .n { font-size: 22px; font-weight: bold; color: #0369a1; }

.q-stem { font-size: 16px; line-height: 1.8; margin-bottom: 12px; white-space: pre-wrap; }
.q-images { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 10px; }
.q-images img { max-width: 100%; max-height: 420px; object-fit: contain; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; padding: 4px; }
.opt { display: block; padding: 10px 14px; margin: 6px 0; border: 1px solid #ddd; border-radius: 8px; cursor: pointer; background: #fafafa; }
.opt:hover { border-color: #0369a1; }
.opt.sel { border-color: #0369a1; background: #e0f2fe; }
.opt.right { border-color: #15803d; background: #ecfdf3; }
.opt.wrong { border-color: #b91c1c; background: #fef2f2; }
.answer-box { background: #f0fdf4; border-left: 4px solid #15803d; padding: 12px; margin-top: 10px; border-radius: 6px; white-space: pre-wrap; font-size: 14px; }
.answer-box.warn { background: #fffbeb; border-left-color: #d97706; }
textarea.ans { width: 100%; min-height: 90px; padding: 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; font-family: inherit; }
.tag { display: inline-block; font-size: 12px; background: #e0f2fe; color: #0369a1; padding: 2px 8px; border-radius: 8px; margin-right: 6px; }

.timer-bar { position: sticky; top: 46px; z-index: 9; background: #292524; color: #fff; padding: 10px 16px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 15px; }
.timer-bar .t { font-size: 22px; font-weight: bold; font-variant-numeric: tabular-nums; }
.timer-bar .t.danger { color: #fca5a5; }

.material { background: #f0f9ff; border-radius: 8px; padding: 12px; margin: 10px 0; font-size: 14.5px; line-height: 1.8; white-space: pre-wrap; }

/* 长文题组：左栏材料吸顶 + 右栏题目滚动，划过该组最后一题后左栏自动解除；窄屏退回纵向 */
.split-group { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.split-left { flex: 0 0 44%; position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; margin-bottom: 0; }
.split-right { flex: 1; min-width: 0; }
.split-right .card:last-child { margin-bottom: 0; }

/* 题目配图：点击放大查看（所有科目通用） */
.q-images img, .opt img { cursor: zoom-in; }
#img-zoom { position: fixed; inset: 0; z-index: 300; background: rgba(15,10,5,.92); display: flex; align-items: center; justify-content: center; overflow: auto; cursor: zoom-out; padding: 2vh 2vw; box-sizing: border-box; }
#img-zoom img { background: #fff; border-radius: 8px; padding: 6px; box-shadow: 0 8px 40px rgba(0,0,0,.5); max-width: none; max-height: none; }

/* 已做过的整卷入口高亮 */
.btn.done-exam { background: #ecfdf5; border: 2px solid #34d399; color: #065f46; }
.btn.done-exam .done-tip { display: block; font-size: 12px; color: #059669; margin-top: 2px; }
@media (max-width: 900px) {
  .split-group { display: block; }
  .split-left { position: static; max-height: none; margin-bottom: 16px; }
}
.subq { border-top: 1px dashed #cbd5e1; padding-top: 10px; margin-top: 10px; }
.progress-line { font-size: 13px; color: #64748b; margin-bottom: 8px; }

#lock-mask { position: fixed; inset: 0; background: rgba(20,10,5,.93); z-index: 100; display: flex; align-items: center; justify-content: center; }
#lock-mask.hidden { display: none; }
.lock-box { background: #fff; border-radius: 14px; padding: 28px; width: 340px; text-align: center; }
.lock-box input { width: 100%; padding: 10px; font-size: 16px; margin: 12px 0; border: 1px solid #ccc; border-radius: 8px; text-align: center; }
.lock-btns .btn { width: 100%; margin: 4px 0; }

table.scores { width: 100%; border-collapse: collapse; font-size: 14px; }
table.scores th, table.scores td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; }
.warn-banner { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
/* 切屏警告跟随页面：吸附在计时条下方，滚动时始终可见 */
#switch-warn { position: sticky; top: 110px; z-index: 8; }
#switch-warn .warn-banner { box-shadow: 0 2px 10px rgba(185,28,28,.25); }

/* 登录与家长端 */
.login-input { display: block; width: 100%; padding: 10px 12px; font-size: 15px; margin: 8px 0; border: 1px solid #ccc; border-radius: 8px; }
.login-input:focus { outline: none; border-color: #0369a1; }
.cfg-label { display: block; font-size: 13px; color: #64748b; margin-top: 10px; }
#user-chip .badge { margin-left: 8px; }
#user-chip a { text-decoration: none; color: #fff; }

/* 手写画板（数学/物理/化学作图题） */
.draw-wrap { margin: 8px 0 4px; }
.draw-toolbar { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.draw-toolbar .btn { padding: 4px 12px; font-size: 13px; }
.draw-toolbar .btn.on { background: #0369a1; color: #fff; }
canvas.drawpad { display: block; width: 100%; aspect-ratio: 3/2; border: 1.5px solid #94a3b8; border-radius: 8px; background: #fff; touch-action: none; cursor: crosshair; }
/* 英语单词模块 */
.eng-word { font-size: 40px; font-weight: bold; color: #0369a1; letter-spacing: 1px; margin: 12px 0 2px; }
.eng-ph { font-size: 16px; color: #57534e; margin-bottom: 8px; }
.eng-sentence { font-size: 17px; margin: 10px 0 4px; line-height: 1.6; }
.eng-input { font-size: 20px; padding: 10px 14px; border: 1.5px solid #94a3b8; border-radius: 8px; width: 260px; margin: 8px 8px 8px 0; letter-spacing: 1px; }
.wt-opt.sel { border-color: #0369a1; background: #e0f2fe; }
.wt-read-ok.sel { background: #15803d; color: #fff; }
.wt-read-no.sel { background: #b91c1c; color: #fff; }

/* 填空题空白处下划线 */
.blank { display: inline-block; min-width: 3.2em; border-bottom: 1.5px solid #444; text-align: center; line-height: 1.1; padding: 0 2px; }
.blank:empty::after { content: '\00a0'; }

/* ============ 登录落地页（浅色清新 · 大幅面） ============ */
.landing { max-width: 1160px; margin: 0 auto; position: relative;
  background-image: linear-gradient(#eef4fb 1px, transparent 1px), linear-gradient(90deg, #eef4fb 1px, transparent 1px);
  background-size: 48px 48px; }
.landing::before { content: ''; position: absolute; top: -100px; right: -60px; width: 560px; height: 560px; pointer-events: none;
  background: radial-gradient(circle, rgba(56,189,248,.18) 0%, rgba(56,189,248,0) 65%); }
.hero { text-align: center; padding: 84px 20px 64px; position: relative; animation: landIn .5s ease both; }
@keyframes landIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.land-title { font-size: 16px; font-weight: bold; color: #0ea5e9; letter-spacing: 4px; margin-bottom: 26px; }
.hero h1 { font-size: clamp(32px, 5.4vw, 58px); line-height: 1.28; color: #0f172a; font-weight: 800; letter-spacing: 1px; }
.hero h1 .accent { color: #0284c7; position: relative; white-space: nowrap; }
.hero h1 .accent::after { content: ''; position: absolute; left: 0; right: 0; bottom: 6px; height: 14px; background: rgba(56,189,248,.28); z-index: -1; border-radius: 4px; }
.land-sub { font-size: clamp(14px, 1.8vw, 18px); color: #64748b; margin: 22px 0 34px; letter-spacing: 1px; }
.lp-cta { font-size: 17px; padding: 14px 42px; border-radius: 12px; background: #0284c7; letter-spacing: 1px; box-shadow: 0 10px 26px rgba(2,132,199,.3); }
.lp-cta:hover { background: #0369a1; opacity: 1; transform: translateY(-2px); }
/* 卖点大卡区 */
.feat-grid-big { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; padding: 0 20px 40px; position: relative; }
.feat-big { background: rgba(255,255,255,.9); border: 1px solid #e2e8f0; border-radius: 18px; padding: 30px 32px; transition: all .25s ease; animation: landIn .5s ease both; }
.feat-big:nth-child(2) { animation-delay: .06s; } .feat-big:nth-child(3) { animation-delay: .12s; }
.feat-big:nth-child(4) { animation-delay: .18s; } .feat-big:nth-child(5) { animation-delay: .24s; }
.feat-big:hover { border-color: #7dd3fc; box-shadow: 0 14px 40px rgba(56,189,248,.16); transform: translateY(-4px); }
.feat-big i { font-style: normal; font-size: 34px; }
/* 科技感线性图标（替代 emoji） */
.fic { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 13px;
  background: #e0f2fe; border: 1px solid #bae6fd; color: #0284c7; }
.fic svg { width: 28px; height: 28px; }
.feat-big:hover .fic { background: #0284c7; color: #fff; }
.logo-mark { width: 1.05em; height: 1.05em; vertical-align: -0.18em; margin-right: 6px; }
.feat-big > b { display: block; font-size: 21px; color: #0f172a; margin: 12px 0 8px; letter-spacing: .5px; }
.feat-big > span { font-size: 15px; color: #475569; line-height: 1.75; }
.feat-big > span b { color: #0284c7; }
.feat-eng { grid-column: 1 / -1; }
.eng-subs { margin-top: 10px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 28px; }
.eng-subs p { font-size: 14.5px; color: #475569; line-height: 1.7; background: #f0f9ff; border: 1px solid #e0f2fe; border-radius: 10px; padding: 12px 16px; }
.eng-subs p b { color: #0284c7; margin-right: 4px; }
.land-foot { text-align: center; font-size: 13px; color: #94a3b8; letter-spacing: 2px; padding: 12px 0 36px; }
/* 登录弹窗：移动端居中模态（带遮罩），桌面端右上角下拉 */
.lp-panel { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center;
  padding: 72px 16px 0; background: rgba(15,23,42,0); opacity: 0; pointer-events: none; transition: opacity .22s ease, background .22s ease; }
.lp-panel.open { opacity: 1; pointer-events: auto; background: rgba(15,23,42,.38); }
.login-card { position: relative; width: 100%; max-width: 380px; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 26px 24px;
  box-shadow: 0 18px 50px rgba(15,23,42,.2); transform: translateY(-10px); transition: transform .22s ease; }
.lp-panel.open .login-card { transform: none; }
.lp-close { position: absolute; top: 10px; right: 14px; font-size: 16px; color: #94a3b8; cursor: pointer; padding: 4px; }
.lp-close:hover { color: #334155; }
@media (min-width: 861px) {
  .lp-panel { justify-content: flex-end; padding: 58px 16px 0 0; }
  .lp-panel.open { background: transparent; }
  .login-card { width: 340px; }
}
.login-card h2 { font-size: 20px; color: #0f172a; margin-bottom: 6px; }
.lp-tip { font-size: 12.5px; color: #64748b; line-height: 1.6; margin-bottom: 14px; }
.login-card .login-input { border: 1.5px solid #e2e8f0; background: #f8fafc; padding: 11px 13px; border-radius: 10px; transition: border .2s; }
.login-card .login-input:focus { border-color: #38bdf8; background: #fff; }
.lp-btn { width: 100%; margin-top: 12px; padding: 12px; font-size: 16px; letter-spacing: 6px; background: #0284c7; border-radius: 10px; }
.lp-btn:hover { background: #0369a1; opacity: 1; }
@media (max-width: 860px) {
  .hero { padding: 40px 14px 36px; }
  .feat-grid-big { grid-template-columns: 1fr; gap: 12px; padding: 0 4px 28px; }
  .feat-big { padding: 20px 20px; }
  .feat-big > b { font-size: 18px; }
  .eng-subs { grid-template-columns: 1fr; }
}

/* ============ 移动端适配（≤640px） ============ */@media (max-width: 640px) {
  /* 顶栏：单行紧凑，logo 省略，右侧徽章可压缩，退出按钮不被挤出屏 */
  #topbar { padding: 8px 8px; gap: 4px; flex-wrap: nowrap; }
  .logo { font-size: 14px; white-space: nowrap; flex-shrink: 1; min-width: 0; max-width: 38vw; overflow: hidden; text-overflow: ellipsis; }
  #topbar > span:last-child { display: flex; align-items: center; gap: 3px; flex-wrap: nowrap; min-width: 0; flex-shrink: 0; }
  #ai-badge { display: none; }
  .badge { font-size: 10.5px; padding: 2px 5px; border-radius: 8px; white-space: nowrap; }
  #user-chip { display: flex; align-items: center; gap: 3px; min-width: 0; }
  #user-chip .badge { margin-left: 0; max-width: 76px; overflow: hidden; text-overflow: ellipsis; }

  /* 页面与卡片：收紧留白 */
  main { padding: 12px 10px; }
  .card { padding: 14px; margin-bottom: 12px; border-radius: 10px; }
  .card h2 { font-size: 16px; margin-bottom: 10px; }

  /* 卡片内主按钮：整行排列，加大触控区 */
  .card > .btn { display: block; width: 100%; margin: 6px 0; padding: 12px 16px; text-align: center; font-size: 15px; }

  /* 分类网格与标签更紧凑 */
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
  .cat-item { padding: 10px 6px; }
  .tag { margin-bottom: 4px; }

  /* 成绩表格不溢出 */
  table.scores { font-size: 12px; }
  table.scores th, table.scores td { padding: 6px 6px; }

  /* 英语输入框不超出屏宽 */
  .eng-input { width: 100%; max-width: 100%; margin-right: 0; }
  .eng-word { font-size: 34px; }

  /* 计时条：单行限高，标题超长省略，按钮不堆叠 */
  .timer-bar { padding: 6px 10px; font-size: 12px; flex-wrap: nowrap; gap: 8px; height: 50px; }
  .timer-bar > span:first-child { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .timer-bar .t { font-size: 18px; flex-shrink: 0; }
  .timer-bar > span:last-child { display: flex; gap: 6px; flex-shrink: 0; }
  .timer-bar .btn { padding: 6px 12px; font-size: 13px; margin: 0; white-space: nowrap; }
  .q-stem { font-size: 15px; }
  .material { font-size: 14px; padding: 10px; }
}

/* ============ 家长端 v2：Tab 布局（移动端优先） ============ */
.ptab-bar { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ptab { flex: 1 0 auto; padding: 10px 14px; border-radius: 10px; background: #e2e8f0; color: #475569; font-size: 14.5px; text-align: center; cursor: pointer; white-space: nowrap; border: none; }
.ptab.on { background: #0369a1; color: #fff; font-weight: bold; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; -webkit-overflow-scrolling: touch; }
.chip { flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: 14px; cursor: pointer; border: 1.5px solid transparent; white-space: nowrap; }
.chip.on { background: #e0f2fe; color: #0369a1; border-color: #0369a1; font-weight: bold; }
/* 今日打卡 */
.ci-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ci-ring { font-size: 26px; font-weight: 800; color: #0369a1; white-space: nowrap; }
.ci-ring small { font-size: 14px; color: #64748b; font-weight: normal; }
.ci-task { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 8px; margin: 5px 0; font-size: 14.5px; background: #f8fafc; }
.ci-task.no { background: #fef2f2; }
.ci-task.ex { background: #f1f5f9; color: #94a3b8; }
.ci-task .st { flex-shrink: 0; }
.ci-task .sm { display: block; color: #64748b; font-size: 12.5px; margin-top: 1px; }
/* 本周格子 */
.ci-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.ci-day { border-radius: 8px; padding: 8px 2px; text-align: center; font-size: 12px; cursor: pointer; background: #f1f5f9; color: #64748b; border: 1.5px solid transparent; }
.ci-day b { display: block; font-size: 14px; margin-top: 2px; }
.ci-day.full { background: #ecfdf5; color: #15803d; }
.ci-day.part { background: #fffbeb; color: #b45309; }
.ci-day.miss { background: #fef2f2; color: #b91c1c; }
.ci-day.future { opacity: .45; cursor: default; }
.ci-day.sel { border-color: #0369a1; }
.ci-eng { margin-top: 12px; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; color: #075985; }
/* 成绩记录卡 */
.rec-card { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 14px; margin: 8px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rec-card .tt { font-size: 14.5px; font-weight: 600; }
.rec-card .tm { font-size: 12.5px; color: #94a3b8; margin-top: 2px; font-weight: normal; }
.rec-card .sc { font-size: 20px; font-weight: 800; color: #0369a1; white-space: nowrap; }
.rec-card .mt { font-size: 12.5px; color: #64748b; text-align: right; white-space: nowrap; }
/* 学生账号卡 */
.stu-card { border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; margin: 8px 0; }
.stu-card .nm { font-size: 16px; font-weight: bold; }
.stu-card .meta { font-size: 13px; color: #64748b; margin: 4px 0 8px; }
/* 错题分区卡 */
.wb-sec { border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; margin: 8px 0; }
.wb-sec > b.t { color: #0369a1; display: block; margin-bottom: 6px; }
@media (max-width: 640px) {
  .ptab { padding: 9px 12px; font-size: 13.5px; }
  .ci-week { gap: 4px; }
  .ci-day { font-size: 11px; padding: 6px 0; }
  .ci-day b { font-size: 13px; }
  .rec-card { padding: 9px 12px; }
  .rec-card .sc { font-size: 18px; }
}
