* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --main: #3b82f6; --main-dark: #2563eb; --ok: #16a34a; --bad: #dc2626;
  --bg: #f1f5f9; --card: #ffffff; --line: #e2e8f0; --text: #0f172a; --muted: #64748b;
  --bg-soft: #f8fafc; --hover: #eff6ff; --accent: #1d4ed8;
  --ok-bg: #dcfce7; --ok-text: #14532d; --bad-bg: #fee2e2; --bad-text: #7f1d1d;
}
body { font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; background: var(--bg); color: var(--text); transition: background .3s, color .3s; }
#topbar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { font-size: 18px; font-weight: 700; color: var(--main); cursor: pointer; }
#nav { display: flex; gap: 4px; }
#nav a { padding: 6px 14px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: 14px; }
#nav a.active, #nav a:hover { background: var(--hover); color: var(--main-dark); font-weight: 600; }
#userbox { margin-left: auto; font-size: 13px; color: var(--muted); }

#view { max-width: 720px; margin: 0 auto; padding: 16px; min-height: calc(100vh - 60px); padding-bottom: 96px; }
/* 学习计时：右上角固定显示，从批次开始累计 */
.learn-timer { position: fixed; top: 14px; right: 14px; z-index: 40; background: var(--main-dark); color: #fff; font-size: 17px; font-weight: 700; padding: 8px 14px; border-radius: 999px; box-shadow: 0 3px 10px rgba(0,0,0,.18); letter-spacing: .5px; }
/* 右侧浮动按钮（情景/选项等环节）：位于学习卡片右侧空白带、与选项区同高 */
.side-btn { position: fixed; right: max(10px, calc((100vw - 720px) / 2 - 175px)); top: 46%; transform: translateY(-50%); z-index: 30; font-size: 16px; padding: 14px 22px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
@media (max-width: 1150px) {
  .side-btn { display: none; }
  .learn-timer { font-size: 14px; padding: 6px 10px; }
}
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 10px; box-shadow: 0 -2px 10px rgba(0,0,0,.06); }
.bottom-bar > * { flex: 1; }
.bottom-bar button { font-size: 16px; padding: 12px 0; }
.bottom-bar .danger { flex: 0 0 auto; }
.hint-red { color: var(--bad); font-weight: 700; }
.praise-pop { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%) scale(0); font-size: 130px; z-index: 99; pointer-events: none; animation: praisePop 1.5s ease forwards; text-shadow: 0 6px 24px rgba(0,0,0,.25); }
@keyframes praisePop {
  0% { transform: translate(-50%, -50%) scale(0) rotate(-25deg); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1.35) rotate(12deg); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(1); }
  75% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -80%) scale(1); opacity: 0; }
}
.card { background: var(--card); border-radius: 14px; padding: 20px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
h1 { font-size: 20px; margin-bottom: 12px; }
h2 { font-size: 16px; margin-bottom: 10px; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
/* 复选框与同行文字/按钮垂直居中，统一主题色 */
input[type="checkbox"] { width: 17px; height: 17px; margin: 0; flex: none; accent-color: var(--main); align-self: center; }
.cfg-check { vertical-align: middle; }

button { font-family: inherit; border: none; border-radius: 10px; cursor: pointer; font-size: 15px; padding: 10px 18px; background: var(--main); color: #fff; }
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.ghost { background: var(--bg-soft); color: var(--text); border: 1px solid var(--line); }
button.danger { background: var(--bad); }
button.ok-bg { background: var(--ok); }
button.big { font-size: 17px; padding: 14px 26px; width: 100%; margin-top: 8px; }

input, select, textarea { font-family: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; width: 100%; background: var(--card); color: var(--text); }
textarea { min-height: 90px; resize: vertical; }
label { font-size: 13px; color: var(--muted); display: block; margin: 10px 0 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card); border-radius: 10px; overflow: hidden; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: var(--bg-soft); color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }

.word-big { font-size: 44px; font-weight: 800; letter-spacing: .5px; text-align: center; margin: 10px 0 2px; }
.phonetic { text-align: center; color: var(--muted); font-size: 16px; margin-bottom: 6px; }
.meaning { text-align: center; font-size: 19px; margin: 8px 0; color: var(--accent); }
.hint { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.red-hint { color: var(--bad); font-weight: 600; font-size: 15px; text-align: center; margin-top: 12px; min-height: 22px; }
.progress-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.progress-bar i { display: block; height: 100%; background: var(--main); transition: width .3s; }

/* 词库筛查页：固定布局，单词/释义/按钮位置不随切换跳动 */
#scrWord { cursor: pointer; }
.screen-card { min-height: 300px; display: flex; flex-direction: column; justify-content: center; }
.screen-word-area { min-height: 150px; display: flex; flex-direction: column; justify-content: center; }
.screen-word-area .word-big { cursor: pointer; }
.screen-meaning { min-height: 60px; text-align: center; font-size: 22px; font-weight: 600; color: var(--accent); display: flex; align-items: center; justify-content: center; padding: 6px 0; }
.screen-judge { display: flex; gap: 12px; min-height: 56px; align-items: center; }
.screen-judge button { flex: 1; font-size: 17px; padding: 14px 0; }
/* 校验/结束按钮：固定在学习卡片正下方，位置不随切换变化 */
.screen-actions { display: flex; gap: 10px; margin-top: 4px; }
.screen-actions button { flex: 1; font-size: 16px; padding: 13px 0; }
/* 筛查/快筛/批次复习页：紧凑布局，大幅降低卡片高度（pad 横屏下选项一屏展示） */
.screen-page .screen-card { min-height: 0; }
.screen-page .screen-word-area { min-height: 92px; }
.screen-page .screen-word-area .word-big { font-size: 34px; margin: 4px 0 0; }
.screen-page .screen-word-area .phonetic { font-size: 15px; margin-bottom: 2px; }
.screen-page .screen-meaning { min-height: 46px; font-size: 20px; padding: 4px 0; }
.screen-page .screen-judge { min-height: 44px; }
.screen-page .screen-judge button { font-size: 16px; padding: 10px 0; }
.screen-page .progress-bar { margin-bottom: 8px; }
.screen-page .options { margin-top: 8px; gap: 8px; }
.screen-page .opt { font-size: 15px; padding: 9px 14px; }
.screen-page .screen-actions { margin-top: 2px; }
.screen-page .screen-actions button { font-size: 15px; padding: 10px 0; }
/* 宽屏横屏（平板）：选项两列排布，进一步压缩高度 */
@media (min-width: 640px) and (orientation: landscape) {
  .screen-page .options { grid-template-columns: 1fr 1fr; gap: 8px; }
}
.theme-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 10px 0; }
.theme-dot { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--line); cursor: pointer; }
.theme-dot.active { border-color: var(--main); transform: scale(1.12); }
.ratio-btn { flex: 1; min-width: 64px; padding: 10px 0; background: var(--bg-soft); color: var(--text); border: 2px solid var(--line); }
.ratio-btn.active { border-color: var(--main); background: var(--hover); color: var(--main-dark); font-weight: 700; }

.options { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
.opt { background: var(--bg-soft); border: 2px solid var(--line); color: var(--text); text-align: left; font-size: 16px; padding: 13px 16px; }
.opt.correct { background: var(--ok-bg); border-color: var(--ok); color: var(--ok-text); }
.opt.wrong { background: var(--bad-bg); border-color: var(--bad); color: var(--bad-text); }
.opt:disabled { opacity: 1; }

.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn-row button { flex: 1; font-size: 16px; padding: 13px 0; }

.sentence { font-size: 21px; line-height: 1.9; margin: 10px 0; }
.sentence .w { cursor: pointer; border-radius: 6px; padding: 0 2px; }
.sentence .w:hover { background: var(--hover); }
.sentence .target { color: var(--bad); font-weight: 800; text-decoration: underline; }
.sentence-zh { font-size: 16px; color: var(--accent); margin: 8px 0; }

.pair-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.pair-cols .col { display: flex; flex-direction: column; gap: 10px; }
.pair-item { background: var(--bg-soft); border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; text-align: center; font-size: 18px; font-weight: 700; height: 62px; min-height: 62px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pair-item .txt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.pair-item.sel { border-color: var(--main); background: var(--hover); }
.pair-item.matched { opacity: 0; transform: scale(.8); transition: all .5s; pointer-events: none; }
.pair-item.shake { animation: shake .4s; border-color: var(--bad); }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

.center { text-align: center; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: var(--hover); color: var(--main-dark); }
.badge.red { background: var(--bad-bg); color: var(--bad); }
.badge.green { background: var(--ok-bg); color: var(--ok); }

.tabbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabbar button { background: var(--bg-soft); color: var(--text); padding: 8px 14px; font-size: 14px; border: 1px solid var(--line); }
.tabbar button.active { background: var(--main); color: #fff; border-color: var(--main); }

#toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: rgba(15,23,42,.92); color: #fff; padding: 10px 22px; border-radius: 10px; font-size: 14px; z-index: 99; display: none; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--card); border-radius: 14px; padding: 18px; width: 100%; max-width: 480px; max-height: 86vh; overflow: auto; }
/* 弹窗底部按钮固定在可视区，长列表滚动时始终可点（如待处理列表） */
.modal .sticky-foot { position: sticky; bottom: -18px; margin: 14px -18px -18px; padding: 10px 18px; background: var(--card); border-top: 1px solid var(--line); }
.entry-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.entry-card .en { font-weight: 700; font-size: 17px; }
.small-btn { font-size: 12px; padding: 5px 10px; border-radius: 7px; }
/* 学员词库使用范围：学习/词库筛查/词库快筛 小开关 */
.scope-chip { display: flex; gap: 6px; flex-wrap: wrap; }
.scope-chip label { margin: 0; font-size: 12px; color: var(--text); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.scope-chip label.dim { opacity: .45; }
.scope-chip input { width: 13px; height: 13px; margin: 0; }
.report-word { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; margin: 4px; font-size: 14px; }
.report-word button { padding: 2px 8px; font-size: 13px; border-radius: 999px; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ql-category { padding: 6px 0; color: var(--text); font-size: 15px; }
.ql-meta { margin: 10px 0 2px; }
#qlClock { font-size: 17px; font-variant-numeric: tabular-nums; }
.ql-report-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ql-word-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ql-word-grid .report-cell { min-width: 0; overflow-wrap: anywhere; }
.report-cell { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.report-cell.empty { border: none; background: transparent; }
.rc-word { font-weight: 700; font-size: 16px; }
.rc-word button { padding: 2px 8px; font-size: 13px; border-radius: 999px; margin-left: 4px; }
.rc-phon { color: var(--muted); font-size: 12px; margin: 2px 0; }
.rc-meaning { color: var(--accent); font-size: 13px; line-height: 1.4; }
@media (max-width: 560px) { .word-big { font-size: 36px; } .sentence { font-size: 18px; } }
/* Shared portal and identity controls */
.auth-card { max-width: 460px; margin: 28px auto; }
.auth-card form { text-align: left; margin-top: 22px; }
.auth-card label { display:block; margin-top:14px; }
.auth-card input { width:100%; box-sizing:border-box; }
.auth-card .big { margin-top:20px; width:100%; }
.form-error { color:var(--bad); min-height:1.4em; margin:10px 0; }
.module-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:18px; margin-top:24px; }
.module-card { display:flex; flex-direction:column; align-items:flex-start; gap:16px; padding:24px; min-height:180px; background:var(--bg-soft); color:var(--text); border:1px solid var(--line); border-radius:16px; text-align:left; }
.module-card:hover { background:var(--hover); }
.module-card strong { font-size:1.25rem; }
.module-icon { font-size:2rem; }
.account-row { display:flex; flex-direction:column; gap:10px; padding:18px 0; border-bottom:1px solid var(--line); }
.grantChoices { display:flex; gap:16px; flex-wrap:wrap; }
#userbox { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
[hidden] { display:none !important; }
@media(max-width:600px) { #topbar { flex-wrap:wrap; gap:8px; } .auth-card { margin:12px 0; } .module-grid { grid-template-columns:1fr; } }
/* Subject learning: touch controls, readable lessons, portrait and landscape tablets. */
#view.study-view { max-width:1120px; padding:20px clamp(12px,3vw,28px) max(32px,env(safe-area-inset-bottom)); }
.study-view button,.study-view select,.study-view input:not([type="checkbox"]) { min-height:48px; font-size:16px; }
.study-view button,.study-view summary,.study-view select { touch-action:manipulation; }
.study-view button:focus-visible,.study-view summary:focus-visible { outline:3px solid var(--main); outline-offset:3px; }
.study-view p { line-height:1.7; }
.study-view a { color:var(--main-dark); }
.study-heading { align-items:flex-start; gap:16px; }
.study-heading h1 { margin-bottom:4px; font-size:24px; }
.study-text-link { display:inline-flex; align-items:center; min-height:44px; flex-shrink:0; text-decoration:none; }
.study-subjects { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; margin:20px 0 4px; }
.study-subject { display:flex; align-items:center; justify-content:flex-start; gap:10px; padding:12px; min-height:58px; background:var(--bg-soft); color:var(--text); border:1px solid var(--line); border-radius:12px; }
.study-subject.active { border-color:var(--main); background:var(--hover); color:var(--main-dark); box-shadow:0 0 0 1px var(--main); }
.study-subject > span { font-size:23px; }
.study-subject strong { font-size:16px; white-space:normal; }
.study-continue { margin-top:16px; }
.study-continue button { width:100%; text-align:left; overflow-wrap:anywhere; }
.study-scope-row { display:grid; grid-template-columns:minmax(120px,1fr) minmax(120px,1fr) minmax(180px,2fr); gap:14px; align-items:end; }
.study-scope-row label { display:flex; flex-direction:column; gap:7px; margin:0; font-size:14px; }
.study-scope-row select,.study-scope-row input { width:100%; min-width:0; }
.study-tabs { display:flex; gap:8px; border-bottom:1px solid var(--line); margin:20px 0 16px; padding-bottom:10px; }
.study-tabs button { flex:1; background:transparent; color:var(--muted); padding:10px; border-radius:9px; }
.study-tabs button.active { background:var(--hover); color:var(--main-dark); font-weight:700; }
.study-domains { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.study-domains:empty { display:none; }
.study-domains button { min-height:44px; padding:8px 16px; }
.study-chapters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:start; }
.study-chapter { min-width:0; padding:16px; border:1px solid var(--line); border-radius:12px; }
.study-chapter h2 { line-height:1.6; margin-bottom:8px; color:var(--muted); font-size:15px; font-weight:500; }
.study-topic-row { display:flex; gap:14px; align-items:center; justify-content:space-between; padding:12px 0; border-bottom:1px solid var(--line); }
.study-topic-row:last-child { border-bottom:0; padding-bottom:0; }
.study-topic-title { display:flex; flex-wrap:wrap; gap:8px; align-items:center; min-width:0; font-size:16px; line-height:1.6; }
.study-topic-title strong { font-weight:500; }
.study-topic-actions { flex-shrink:0; }
.study-topic-actions button { min-width:64px; padding:8px 12px; }
.study-topic-pick { display:flex; align-items:center; gap:10px; color:var(--text); font-size:16px; margin:0; min-height:44px; cursor:pointer; }
.study-topic-pick input { width:22px; height:22px; }
.study-read-label { color:var(--ok); font-size:12px; white-space:nowrap; }
.study-empty { padding:24px 0; }
.study-primary-actions { display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
.study-primary-actions button { flex:1; }
.study-practice-setup { margin:0 0 18px; }
.study-practice-setup + p { margin-bottom:16px; }
.study-settings { margin-top:12px; }
.study-view summary { cursor:pointer; min-height:44px; padding:10px 0; line-height:1.5; }
.study-settings .study-scope-row { grid-template-columns:1fr 1fr; padding:10px 0; }
.study-reader { max-width:860px; margin:0 auto; }
.study-reader-nav { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:14px; }
.study-lesson { padding:clamp(20px,4vw,36px); }
.study-lesson h1 { font-size:28px; line-height:1.5; margin:10px 0 28px; }
.study-lesson h2 { font-size:18px; margin-bottom:12px; }
.study-lesson section { margin-bottom:30px; }
.study-prose { font-size:18px; line-height:1.9 !important; white-space:pre-wrap; overflow-wrap:anywhere; }
.study-criteria { padding-left:24px; font-size:17px; line-height:1.9; }
.study-criteria li { padding-left:4px; margin:6px 0; }
.study-source-note { margin-top:10px; }
.study-source-note summary { color:var(--muted); font-size:14px; }
.study-example { padding:20px; background:var(--bg-soft); border:1px solid var(--line); border-radius:12px; margin:12px 0; }
.study-example-choices { display:grid; grid-template-columns:1fr 1fr; gap:8px 18px; margin:14px 0; font-size:17px; }
.study-example-answer { border-top:1px solid var(--line); padding-top:6px; margin-top:16px; }
.study-example-answer summary { color:var(--main-dark); }
.study-example-answer p { margin:10px 0; }
.study-related { display:flex; flex-wrap:wrap; gap:10px; }
.study-related button { text-align:left; }
.study-reading-controls { display:flex; justify-content:flex-end; }
.study-lesson-actions { display:flex; gap:12px; position:sticky; bottom:0; padding:14px 0 max(14px,env(safe-area-inset-bottom)); background:var(--bg); z-index:5; }
.study-lesson-actions button { flex:1; min-width:0; }
.study-session-head { margin-bottom:16px; }
.study-session-head .study-heading { margin-bottom:12px; }
.study-sync { display:flex; flex-direction:column; gap:12px; padding:14px 16px; margin-top:14px; border:1px solid var(--line); border-radius:10px; background:var(--bg-soft); line-height:1.6; }
.study-sync [data-state="offline"],.study-sync [data-state="conflict"] { color:var(--bad); }
.study-question { font-size:21px; line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; margin:20px 0; }
.study-quiz { padding:24px; }
.study-quiz h2 { font-size:20px; margin-top:18px; }
.study-quiz-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:32px; align-items:start; }
.study-question-pane,.study-answer-pane { min-width:0; }
.study-choices { display:grid; gap:12px; }
.study-choices:empty { display:none; }
.study-choices button { text-align:left; background:var(--bg-soft); color:var(--text); border:1px solid var(--line); padding:14px 16px; min-height:54px; font-size:18px; line-height:1.5; overflow-wrap:anywhere; }
.study-choices button.selected { border-color:var(--main); background:var(--hover); box-shadow:0 0 0 1px var(--main); }
.study-answer-actions { display:flex; gap:12px; margin-top:16px; }
.study-answer-actions button { flex:1; padding:14px; min-height:52px; }
.study-answer-actions button:first-child { flex:2; }
.study-answer-pane .form-error:empty { min-height:0; margin:0; }
.study-quiz-tools { margin-top:20px; color:var(--muted); font-size:14px; }
.study-quiz-tools .study-primary-actions { padding:8px 0; }
.study-self-review { margin-top:18px; padding:16px; border:1px solid var(--line); border-radius:10px; }
.study-self-review p { margin:10px 0; }
.study-self-review .study-prose { font-size:17px; }
.study-feedback { max-width:860px; margin:0 auto; padding:28px; }
.study-feedback h2 { font-size:23px; margin-bottom:22px; }
.study-feedback > p { margin:14px 0; }
.study-feedback-explanation { padding:18px; background:var(--bg-soft); border-radius:12px; margin:20px 0; }
.study-feedback-explanation p + p { margin-top:12px; }
.study-correct { color:var(--ok); }
.study-review { color:var(--main-dark); }
.study-stat-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; margin:18px 0; }
.study-stat-grid div { display:flex; flex-direction:column; align-items:center; padding:14px 4px; gap:7px; border-radius:10px; background:var(--bg-soft); }
.study-stat-grid strong { font-size:1.5rem; }
.study-stat-grid span { color:var(--muted); font-size:13px; }
.study-figure { max-width:100%; overflow:auto; margin:12px 0; }
.study-figure svg { display:block; max-width:100%; height:auto; }
.study-graph { overflow:auto; max-width:100%; margin-top:18px; }
.study-graph svg { display:block; width:100%; max-height:900px; }
.study-topic { padding:14px 0; border-bottom:1px solid var(--line); }
.study-topic p { margin:8px 0; overflow-wrap:anywhere; }
.study-history-row { display:flex; gap:16px; align-items:center; justify-content:space-between; padding:16px 0; border-bottom:1px solid var(--line); }
.study-history-row > div { min-width:0; }
.study-history-row strong { overflow-wrap:anywhere; }
.study-history-row p { margin-top:6px; }
.study-history-row button { flex-shrink:0; }
.study-credit { text-align:center; padding:10px; font-size:12px; margin-top:8px; }
.study-credit summary { display:inline-block; font-size:13px; }
.study-import { border-top:1px solid var(--line); margin-top:24px; padding-top:12px; }
.study-import > p { margin:12px 0; }
.study-import-preview { padding:16px; margin-top:12px; border:1px solid var(--line); border-radius:10px; }
.study-import-preview ul { padding-left:22px; }
@media(max-width:900px) {
  .study-subjects { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .study-chapters { grid-template-columns:minmax(0,1fr); }
  .study-quiz-layout { grid-template-columns:minmax(0,1fr); gap:18px; }
  .study-quiz { max-width:800px; margin-left:auto; margin-right:auto; }
  .study-choices { grid-template-columns:1fr 1fr; }
}
@media(min-width:900px) and (orientation:landscape) and (max-height:850px) {
  #view.study-view { padding-top:14px; }
  .study-session-head { margin-bottom:12px; }
  .study-quiz { padding:20px; }
  .study-question { margin:14px 0; }
}
@media(max-width:600px) {
  .study-home-head,.study-content-card { padding:16px; }
  .study-heading h1 { font-size:21px; }
  .study-subject { gap:6px; padding:10px 8px; }
  .study-subject strong { font-size:14px; }
  .study-subject > span { font-size:20px; }
  .study-scope-row { grid-template-columns:1fr 1fr; gap:12px; }
  .study-search-label { grid-column:1/-1; }
  .study-tabs { gap:2px; }
  .study-tabs button { font-size:15px; padding:10px 6px; }
  .study-chapter { padding:12px; }
  .study-choices,.study-example-choices { grid-template-columns:minmax(0,1fr); }
  .study-quiz,.study-feedback { padding:18px; }
  .study-question { font-size:19px; }
  .study-lesson h1 { font-size:24px; }
  .study-prose { font-size:17px; }
  .study-example { padding:14px; }
  .study-stat-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .study-history-row { align-items:flex-start; }
  .study-history-row button { max-width:100px; }
}
@media(pointer:coarse) {
  #topbar { padding-left:max(12px,env(safe-area-inset-left)); padding-right:max(12px,env(safe-area-inset-right)); }
  #topbar button,#nav a { min-height:44px; display:inline-flex; align-items:center; justify-content:center; }
  #topbar button { padding:8px 12px; font-size:14px; }
}
