/* =========================================================
   CAWS 全站樣式
   色彩全部定義在 :root 變數，換色系只改這裡。
   ========================================================= */
:root {
  /* 主色：藍；輔色：青綠、珊瑚、琥珀、紫 —— 每個功能一種顏色 */
  --primary: #2f5fe0;
  --primary-ink: #1e3fa8;
  --primary-soft: #e8efff;
  --teal: #0f9f95;
  --teal-soft: #e0f6f3;
  --coral: #f2675a;
  --coral-soft: #fdeceb;
  --amber: #f0a51f;
  --amber-soft: #fdf3df;
  --violet: #7a5af0;
  --violet-soft: #efeafe;

  --ink: #1d2742;
  --ink-soft: #5b6680;
  --line: #e1e6f0;
  --bg: #f5f7fc;
  --paper: #ffffff;
  --owl: #6b4a3a;

  --radius: 1rem;
  --shadow: 0 1px 2px rgba(29, 39, 66, .06), 0 0.5rem 1.5rem rgba(29, 39, 66, .07);
  --shadow-lg: 0 2px 0.375rem rgba(29, 39, 66, .08), 0 1.125rem 2.5rem rgba(29, 39, 66, .12);
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}

/* 第二套色系（比較用）：青綠為主 */
:root[data-theme="teal"] {
  --primary: #0e8f86;
  --primary-ink: #0a6b64;
  --primary-soft: #dff4f1;
  --teal: #2f6fe0;
  --teal-soft: #e6eefe;
  --coral: #ee6a4d;
  --coral-soft: #fdebe6;
  --amber: #e9a21b;
  --amber-soft: #fcf2dc;
  --violet: #8a4fd8;
  --violet-soft: #f1e9fc;
  --ink: #16323a;
  --ink-soft: #55707a;
  --line: #dde8e8;
  --bg: #f3f8f7;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* 自適應：整站以 rem 為單位，根字級隨螢幕寬度等比例縮放
   手機／平板 16px、1440 寬約 16px、1920 寬約 18.6px、2560 寬約 21.8px */
html { font-size: clamp(16px, 0.5vw + 9px, 22px); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img { max-width: 100%; }  /* 不可套用到 svg：知識建構區的箭頭圖層需要超出畫面寬度 */
body { font: 0.9375rem/1.6 var(--sans); color: var(--ink); background: var(--bg); }
a { color: var(--primary); }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
small { color: var(--ink-soft); font-weight: 400; }

/* ---------- 頂部導覽 ---------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  height: 4.25rem; padding: 0 clamp(1rem, 4vw, 3rem);
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(0.5rem);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--ink); }
.brand img { width: 2.875rem; height: 2.875rem; object-fit: contain; }
.brand b { font: 800 1.375rem/1 var(--display); letter-spacing: .5px; }
.brand span { display: block; font-size: 0.75rem; color: var(--ink-soft); margin-top: 0.1875rem; }
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-links a { padding: 0.5rem 0.875rem; border-radius: 62.4375rem; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.9062rem; }
.nav-links a:hover { background: var(--primary-soft); color: var(--primary-ink); }
.nav-links a { white-space: nowrap; }
/* 教師、管理者的連結比較多：字小一點；寬度不夠時「回上一頁」只留箭頭 */
.nav-staff .nav-links a { padding: 0.5rem 0.625rem; font-size: 0.8438rem; }
@media (max-width: 1560px) { .nav-staff .nav-back .nb-t { display: none; } .nav-staff .logo-text { font-size: 1rem; } .nav-staff .uname { display: none; } }
@media (max-width: 1360px) { .nav-staff .logo-text .lt-abbr { display: none; } }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: 0; border-radius: 0.75rem; padding: 0.6875rem 1.25rem; font-weight: 700; text-decoration: none;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 0.375rem 1rem color-mix(in srgb, var(--primary) 30%, transparent); }
.btn-primary:hover { background: var(--primary-ink); }
.btn-ghost { background: var(--paper); color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 首頁 hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(2.25rem, 6vw, 4.5rem) clamp(1rem, 4vw, 3rem) clamp(2.5rem, 6vw, 5rem);
  background:
    radial-gradient(37.5rem 18.75rem at 8% 0%, color-mix(in srgb, var(--teal) 16%, transparent), transparent 70%),
    radial-gradient(32.5rem 20rem at 92% 10%, color-mix(in srgb, var(--coral) 14%, transparent), transparent 70%),
    linear-gradient(180deg, var(--primary-soft), var(--bg));
}
.hero-inner { max-width: 73.75rem; margin: 0 auto; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.75rem; border-radius: 62.4375rem; background: var(--paper); color: var(--primary-ink); font-weight: 700; font-size: 0.8125rem; box-shadow: var(--shadow); }
.eyebrow i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--teal); display: inline-block; }
.hero h1 { font: 800 clamp(2.125rem, 5vw, 3.375rem)/1.1 var(--display); margin: 1.125rem 0 0.625rem; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--primary), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: clamp(1rem, 1.6vw, 1.1562rem); color: var(--ink-soft); max-width: 35rem; margin: 0 0 1.375rem; }
.hero .lead b { color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: center; }
.hero-owl { display: flex; align-items: center; gap: 0.875rem; margin-top: 1.625rem; }
.hero-owl img { width: 4rem; height: 4rem; object-fit: contain; filter: drop-shadow(0 0.375rem 0.625rem rgba(0, 0, 0, .12)); }
.bubble { position: relative; background: var(--paper); border-radius: 0.875rem; padding: 0.625rem 0.875rem; box-shadow: var(--shadow); font-size: 0.875rem; max-width: 22.5rem; }
.bubble::before { content: ""; position: absolute; left: -7px; top: 1.125rem; border: 0.4375rem solid transparent; border-right-color: var(--paper); border-left: 0; }

/* ---------- 登入卡 ---------- */
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.login { padding: 1.625rem 1.625rem 1.375rem; box-shadow: var(--shadow-lg); border: 0; }
.login h2 { margin: 0 0 0.25rem; font: 800 1.375rem var(--display); }
.login p.sub { margin: 0 0 1.125rem; color: var(--ink-soft); font-size: 0.875rem; }
.field { display: block; margin-bottom: 0.875rem; }
.field > span { display: block; font-weight: 700; font-size: 0.8438rem; margin-bottom: 0.375rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.6875rem 0.8125rem; border-radius: 0.625rem; border: 1.5px solid var(--line);
  font: 0.9375rem var(--sans); color: var(--ink); background: #fbfcff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 0.25rem var(--primary-soft); background: #fff; }
.role { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1.125rem; }
.role label { position: relative; }
.role input { position: absolute; opacity: 0; }
.role span { display: block; text-align: center; padding: 0.625rem; border-radius: 0.625rem; border: 1.5px solid var(--line); font-weight: 700; color: var(--ink-soft); }
.role input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.role input:focus-visible + span { box-shadow: 0 0 0 0.25rem var(--primary-soft); }
.role .soon { font-size: 0.6875rem; font-weight: 600; display: block; color: var(--ink-soft); }
.login .btn { width: 100%; }
.form-msg { margin: 0.625rem 0 0; font-size: 0.8438rem; color: var(--coral); min-height: 1.2em; }

/* ---------- 功能卡片 ---------- */
.section { max-width: 73.75rem; margin: 0 auto; padding: clamp(2.25rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem); }
.section-h { text-align: center; margin-bottom: 1.75rem; }
.section-h h2 { font: 800 clamp(1.5rem, 3vw, 2rem)/1.2 var(--display); margin: 0 0 0.375rem; }
.section-h p { margin: 0; color: var(--ink-soft); }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.125rem; }
.feature { --c: var(--primary); --cs: var(--primary-soft); padding: 1.375rem 1.25rem 1.25rem; position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 0.3125rem; background: var(--c); }
.feature .ic { width: 3.25rem; height: 3.25rem; border-radius: 0.875rem; background: var(--cs); color: var(--c); display: grid; place-items: center; margin-bottom: 0.875rem; }
.feature .ic svg { width: 1.75rem; height: 1.75rem; }
.feature h3 { margin: 0 0 2px; font: 800 1.125rem var(--display); }
.feature .en { margin: 0 0 0.625rem; color: var(--c); font-weight: 700; font-size: 0.8125rem; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 0.875rem; }
.f-board { --c: var(--coral); --cs: var(--coral-soft); }
.f-analysis { --c: var(--teal); --cs: var(--teal-soft); }
.f-assistant { --c: var(--primary); --cs: var(--primary-soft); }
.f-feedback { --c: var(--violet); --cs: var(--violet-soft); }

/* ---------- 流程 ---------- */
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem; counter-reset: step; }
.step { padding: 1.125rem 1rem; text-align: left; position: relative; }
.step .n { width: 2.125rem; height: 2.125rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--c, var(--primary)); margin-bottom: 0.625rem; }
.step b { display: block; font-size: 0.9688rem; }
.step span { font-size: 0.8438rem; color: var(--ink-soft); }

/* ---------- 頁尾 ---------- */
.footer { border-top: 1px solid var(--line); background: var(--paper); padding: 1.375rem clamp(1rem, 4vw, 3rem); color: var(--ink-soft); font-size: 0.8438rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; }

/* ---------- 響應式 ---------- */
@media (max-width: 1000px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .features { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .nav { height: 3.75rem; }
  .brand span { display: none; }
  .nav-links a { padding: 0.375rem 0.5625rem; font-size: 0.8438rem; }
}

/* =========================================================
   首頁（AmazingTalker 式版型）
   ========================================================= */
/* 固定在最上方的橫幅：Logo 與右上角功能永遠可見，下方內容捲動 */
.nav-landing, .nav-fixed {
  position: fixed; inset: 0 0 auto 0; height: 5.75rem;
  background: #fff; box-shadow: 0 2px 0.625rem rgba(29, 39, 66, .08); border-bottom: 0;
}
body.landing, body.app { padding-top: 5.75rem; }
html { scroll-padding-top: 6rem; scroll-behavior: smooth; }

/* 貓頭鷹標誌：貓頭鷹在上、CAWS 字樣在下 */
.logo { display: flex; align-items: center; gap: 0.875rem; text-decoration: none; color: var(--ink); }
.logo-mark { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.logo-mark img { width: 4.75rem; height: 4.25rem; object-fit: contain; }
.logo-mark b { font: 900 1rem/1 var(--display); letter-spacing: 0.1875rem; color: var(--owl); margin-top: -2px; }
.logo-text { font: 800 1.5rem/1.2 var(--display); color: var(--ink); border-left: 2px solid var(--line); padding-left: 1rem; white-space: nowrap; }
.logo-text .lt-abbr { color: var(--owl); }
/* 選單較多的頁面（教師端、已登入）字小一點，避免擠到選單 */
.nav-fixed .logo-text { font-size: 1.25rem; }
@media (max-width: 1440px) { .logo-text { font-size: 1.25rem; } .nav-fixed .logo-text { font-size: 1.125rem; } }

/* 左上角會動的貓頭鷹：12 秒一輪 —— 眨眼、左眼眨、拋媚眼（右眼眨＋斜看＋臉紅）、連眨兩下 */
.owl-logo { width: 4.75rem; height: 4.25rem; overflow: visible; }
.owl-logo .ow-head { transform-origin: 60px 105px; animation: owHead 12s ease-in-out infinite; }
.owl-logo .ow-lid { transform-box: fill-box; transform-origin: center top; transform: scaleY(0); }
.owl-logo .ow-lid.l { animation: owLidL 12s infinite; }
.owl-logo .ow-lid.r { animation: owLidR 12s infinite; }
.owl-logo .ow-pupils { animation: owPupils 12s ease-in-out infinite; }
.owl-logo .ow-blush { opacity: 0; animation: owBlush 12s ease-in-out infinite; }
.owl-logo .ow-ear { transform-box: fill-box; transform-origin: bottom center; }
.owl-logo .ow-ear.r { animation: owEar 12s ease-in-out infinite; }
/* 0–3% 眨眼；30–36% 左眼眨；58–68% 拋媚眼；86–92% 連眨兩下 */
@keyframes owLidL { 0%, 100% { transform: scaleY(0); } 1.5% { transform: scaleY(1); } 3% { transform: scaleY(0); }
  30% { transform: scaleY(0); } 32% { transform: scaleY(1); } 35% { transform: scaleY(1); } 37% { transform: scaleY(0); }
  86% { transform: scaleY(0); } 87% { transform: scaleY(1); } 88% { transform: scaleY(0); } 89.5% { transform: scaleY(1); } 90.5% { transform: scaleY(0); } }
@keyframes owLidR { 0%, 100% { transform: scaleY(0); } 1.5% { transform: scaleY(1); } 3% { transform: scaleY(0); }
  58% { transform: scaleY(0); } 60% { transform: scaleY(1); } 66% { transform: scaleY(1); } 68% { transform: scaleY(0); }
  86% { transform: scaleY(0); } 87% { transform: scaleY(1); } 88% { transform: scaleY(0); } 89.5% { transform: scaleY(1); } 90.5% { transform: scaleY(0); } }
@keyframes owPupils { 0%, 12% { transform: translate(0, 0); } 16%, 24% { transform: translate(3px, 0); } 28%, 52% { transform: translate(0, 0); }
  56%, 70% { transform: translate(-3px, 2px); } 74%, 100% { transform: translate(0, 0); } }
@keyframes owHead { 0%, 28%, 100% { transform: rotate(0); } 32%, 36% { transform: rotate(-6deg); } 40%, 56% { transform: rotate(0); } 60%, 66% { transform: rotate(7deg) translateY(-1px); } 70% { transform: rotate(0); } }
@keyframes owBlush { 0%, 56%, 74%, 100% { opacity: 0; } 60%, 68% { opacity: .75; } }
@keyframes owEar { 0%, 58%, 100% { transform: rotate(0); } 61% { transform: rotate(10deg); } 64% { transform: rotate(-4deg); } 67% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .owl-logo * { animation: none !important; } }
.btn-sm { padding: 0.5rem 1rem; border-radius: 0.625rem; font-size: 0.9062rem; margin-left: 0.375rem; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { filter: brightness(.93); }
.muted { color: var(--ink-soft); }
.small { font-size: 0.8125rem; }

/* Hero 背景照片 */
.hero-photo {
  position: relative; color: #fff;
  background: linear-gradient(90deg, rgba(14, 22, 48, .86) 0%, rgba(14, 22, 48, .62) 55%, rgba(14, 22, 48, .35) 100%), url('../img/hero.jpg') center / cover no-repeat, #24335f;
  padding: clamp(2.25rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem);
}
.hero-photo .hero-inner { max-width: 75rem; margin: 0 auto; display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.crumb { margin: 0 0 0.75rem; font-size: 0.8438rem; opacity: .8; letter-spacing: .3px; }
.hero-photo h1 { font: 800 clamp(1.75rem, 3.6vw, 2.625rem)/1.2 var(--display); margin: 0 0 0.875rem; }
.hero-photo h1 span { color: #ffd27a; }
.hero-photo .lead { color: rgba(255, 255, 255, .88); font-size: 1rem; max-width: 37.5rem; margin: 0 0 1.625rem; }
.hero-photo .lead b { color: #fff; }
.stats { display: flex; flex-wrap: wrap; gap: clamp(1.125rem, 4vw, 2.75rem); }
.stats div { display: flex; flex-direction: column; }
.stats b { font: 800 2.125rem/1.1 var(--display); }
.stats span { font-size: 0.8125rem; opacity: .85; line-height: 1.35; }

/* 右側「你想寫什麼」選單卡 */
.need-card { color: var(--ink); padding: 1.375rem; box-shadow: var(--shadow-lg); border: 0; }
.need-card h2 { margin: 0; font: 800 1.1875rem var(--display); }
.need-card .sub { margin: 2px 0 0.875rem; color: var(--ink-soft); font-size: 0.875rem; }
.need-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.need-grid button {
  border: 1.5px solid var(--line); background: #fff; border-radius: 0.625rem; padding: 0.5625rem 0.375rem; min-height: 3.625rem;
  font-size: 0.8125rem; line-height: 1.3; color: var(--ink); position: relative;
}
.need-grid button small { display: block; font-size: 0.7188rem; }
.need-grid button:hover { border-color: var(--teal); }
.need-grid button[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); color: #0b6f68; font-weight: 700; }
.need-grid .dot { position: absolute; top: 0.375rem; right: 0.375rem; width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: var(--teal); }
.need-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.625rem; margin-top: 0.875rem; }

.strip { background: var(--amber-soft); color: #7a5209; text-align: center; padding: 0.6875rem 1rem; font-size: 0.9062rem; }

/* 題材分類標籤 */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-bottom: 1.5rem; }
.tabs button { border: 1.5px solid var(--line); background: #fff; border-radius: 62.4375rem; padding: 0.4375rem 1rem; font-weight: 700; font-size: 0.875rem; color: var(--ink-soft); }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 題材卡片 */
.genre-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.genre { display: flex; flex-direction: column; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.genre:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.genre-top { position: relative; height: 8rem; background: linear-gradient(135deg, var(--gs), #fff); display: grid; place-items: center; color: var(--gc); }
.genre-top svg { width: 3.375rem; height: 3.375rem; opacity: .9; }
.genre-top .tag { position: absolute; left: 0.75rem; top: 0.75rem; background: #fff; color: var(--gc); font-size: 0.75rem; font-weight: 700; padding: 0.1875rem 0.625rem; border-radius: 62.4375rem; }
.genre-top .status { position: absolute; right: 0.75rem; top: 0.75rem; font-size: 0.75rem; font-weight: 700; padding: 0.1875rem 0.625rem; border-radius: 62.4375rem; background: rgba(29, 39, 66, .08); color: var(--ink-soft); }
.genre-top .status.open { background: var(--teal); color: #fff; }
.genre-body { padding: 1rem 1.125rem 1.125rem; display: flex; flex-direction: column; flex: 1; }
.genre-body h3 { margin: 0; font: 800 1.125rem var(--display); }
.genre-body .zh { margin: 0 0 0.5rem; color: var(--gc); font-weight: 700; font-size: 0.875rem; }
.genre-body p.d { margin: 0 0 0.25rem; font-size: 0.875rem; color: var(--ink); }
.genre-body p.dz { margin: 0 0 0.875rem; font-size: 0.8438rem; color: var(--ink-soft); flex: 1; }
.genre-meta { display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed var(--line); padding-top: 0.75rem; margin-bottom: 0.75rem; font-size: 0.8125rem; color: var(--ink-soft); }
.genre-meta b { color: var(--ink); }
.genre .btn { width: 100%; }
.genre .btn-soon { background: #eef1f7; color: var(--ink-soft); cursor: default; }

.section-tint { max-width: none; background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-tint > * { max-width: 73.75rem; margin-left: auto; margin-right: auto; }

.footer-logo { display: inline-flex; align-items: center; gap: 0.5rem; }
.footer-logo img { width: 1.625rem; height: 1.625rem; }
.footer-logo b { color: var(--owl); letter-spacing: 1.5px; }

/* 登入視窗 */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(14, 22, 48, .55); display: grid; place-items: center; padding: 1rem; }
.modal .login { width: min(26.25rem, 100%); position: relative; }
.modal-x { position: absolute; right: 0.75rem; top: 0.5rem; border: 0; background: none; font-size: 1.625rem; color: var(--ink-soft); }
.login-owl { display: flex; flex-direction: column; align-items: center; margin-bottom: 0.375rem; }
.login-owl img { width: 4rem; height: 3.75rem; object-fit: contain; }
.login-owl b { font: 900 0.9375rem var(--display); letter-spacing: 2.5px; color: var(--owl); }
.login h2 { text-align: center; }
.login p.sub { text-align: center; }

@media (max-width: 1000px) {
  .genre-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links a:not(.keep) { display: none; }
}
@media (max-width: 860px) {
  .hero-photo .hero-inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .nav-landing, .nav-fixed { height: 4.375rem; }
  body.landing, body.app { padding-top: 4.375rem; }
  .logo-mark img, .owl-logo { width: 3rem; height: 2.75rem; }
  .logo-mark b { font-size: 0.75rem; }
  .logo-text { font-size: 0.8125rem; padding-left: 0.625rem; white-space: normal; max-width: 8.5rem; }
  .logo-text .lt-abbr { display: none; }
  .genre-grid { grid-template-columns: 1fr; }
  .need-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   單畫面首頁 + 右上角下拉選單
   ========================================================= */
body.landing { min-height: 100vh; display: flex; flex-direction: column; }
.hero-full { flex: 1; display: flex; align-items: center; }
.hero-full .hero-inner { width: 100%; }
.open-note { margin: 1.375rem 0 0; display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(255, 255, 255, .12); padding: 0.5rem 0.875rem; border-radius: 62.4375rem; font-size: 0.875rem; }
.open-note .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #4fe0d0; display: inline-block; }
.footer-slim { justify-content: center; padding: 0.75rem 1rem; font-size: 0.7812rem; }

.need-grid { grid-template-columns: repeat(3, 1fr); }
.need-grid button { min-height: 4rem; font-size: 0.9062rem; }
.need-desc { margin: 0.875rem 0 0; min-height: 2.75rem; font-size: 0.8438rem; color: var(--ink-soft); background: #f6f8fc; border-radius: 0.625rem; padding: 0.625rem 0.75rem; }
.need-desc b { color: var(--ink); }
.need-desc .lvl { display: inline-block; margin-left: 0.5rem; font-size: 0.75rem; font-weight: 700; color: var(--teal); }

/* 下拉選單 */
.dd { position: relative; }
.dd-btn { border: 0; background: none; padding: 0.5rem 0.75rem; border-radius: 62.4375rem; font-weight: 600; font-size: 0.9062rem; color: var(--ink); }
.dd-btn i { font-style: normal; font-size: 0.6875rem; margin-left: 2px; color: var(--ink-soft); transition: transform .15s; display: inline-block; }
.dd-btn:hover, .dd.open .dd-btn { background: var(--primary-soft); color: var(--primary-ink); }
.dd.open .dd-btn i { transform: rotate(180deg); }
.dd-menu {
  position: absolute; top: calc(100% + 0.625rem); left: 50%; transform: translateX(-50%) translateY(-4px);
  width: 21.25rem; background: #fff; border-radius: 0.875rem; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  padding: 0.5rem; opacity: 0; visibility: hidden; transition: opacity .15s, transform .15s, visibility .15s; z-index: 40;
}
.dd-wide { width: 27.5rem; }
.dd.open .dd-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dd-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.625rem; border-radius: 0.625rem; text-align: left; width: 100%; border: 0; background: none; color: var(--ink); }
.dd-item:hover { background: #f5f7fc; }
.dd-item b { display: block; font-size: 0.9062rem; }
.dd-item b .zh { color: var(--c, var(--primary)); margin-left: 0.25rem; }
.dd-item small { display: block; font-size: 0.7812rem; line-height: 1.45; margin-top: 2px; }
.dd-ic { flex: none; width: 2.125rem; height: 2.125rem; border-radius: 0.625rem; display: grid; place-items: center; font-weight: 800; background: var(--cs, var(--primary-soft)); color: var(--c, var(--primary)); }
.dd-genre { align-items: center; }
.dd-genre > div { flex: 1; }
.pill { font-style: normal; flex: none; font-size: 0.7188rem; font-weight: 700; padding: 2px 0.5625rem; border-radius: 62.4375rem; background: #eef1f7; color: var(--ink-soft); }
.pill-open { background: var(--teal); color: #fff; }
.menu-toggle { display: none; border: 1.5px solid var(--line); background: #fff; border-radius: 0.625rem; width: 2.5rem; height: 2.5rem; font-size: 1.125rem; margin-left: 0.375rem; }

@media (max-width: 1180px) {
  .nav-links .keep-lg { display: none; }
}
@media (max-width: 900px) {
  .menu-toggle { display: inline-block; margin-left: auto; }
  .nav-links { display: none; }
  .nav-links.mobile-open { display: flex; }
  .nav-links .dd { display: none; }
  .nav-links.mobile-open .dd { display: block; position: static; }
  .nav-links.mobile-open {
    position: fixed; top: 5.75rem; left: 0; right: 0; background: #fff; box-shadow: var(--shadow-lg);
    flex-direction: column; align-items: stretch; padding: 0.625rem 1rem 1rem; gap: 2px; max-height: calc(100vh - 5.75rem); overflow-y: auto;
  }
  .nav-links.mobile-open .keep-lg { display: block; }
  .nav-links.mobile-open .dd-menu { position: static; transform: none; width: auto; box-shadow: none; border: 0; display: none; opacity: 1; visibility: visible; padding: 0 0 0.375rem; }
  .nav-links.mobile-open .dd.open .dd-menu { display: block; }
  .nav-links.mobile-open .btn-sm { order: -1; margin: 0 0 0.5rem; }
}
@media (max-width: 560px) {
  .nav-links.mobile-open { top: 4.375rem; max-height: calc(100vh - 4.375rem); }
  .need-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   登入後頁面（與首頁同一格式）
   ========================================================= */
.nav-links a.on { background: var(--primary-soft); color: var(--primary-ink); }
.user-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3125rem 0.75rem 0.3125rem 0.3125rem; border: 1.5px solid var(--line); }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 0.875rem; }
.uname { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-right { left: auto; right: 0; transform: translateY(-4px); width: 16.25rem; }
.dd.open .dd-right { transform: translateY(0); }
a.dd-item { text-decoration: none; }
button.dd-item { cursor: pointer; font: inherit; }

/* 頁面橫幅：與首頁同一張背景照片，較矮 */
.page-banner {
  color: #fff; padding: clamp(0.875rem, 2vw, 1.25rem) clamp(1rem, 4vw, 3rem);
  background: linear-gradient(90deg, rgba(14, 22, 48, .88) 0%, rgba(14, 22, 48, .66) 60%, rgba(14, 22, 48, .45) 100%), url('../img/hero.jpg') center / cover no-repeat, #24335f;
}
.page-banner-inner { max-width: 75rem; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.page-banner .crumb a { color: #fff; }
.page-banner h1 { font: 800 clamp(1.125rem, 2vw, 1.625rem)/1.25 var(--display); margin: 0 0 0.375rem; max-width: none; white-space: normal; overflow-wrap: anywhere; } /* 題目一定完整顯示 */
@media (max-width: 640px) { .page-banner h1 { white-space: normal; } }
.page-banner .crumb { margin-bottom: 0.375rem; }
.page-banner h1 span { color: #ffd27a; }
.page-banner .lead { margin: 0; color: rgba(255, 255, 255, .88); font-size: 0.9375rem; }
.btn-lg { padding: 0.8125rem 1.375rem; font-size: 1rem; border-radius: 0.75rem; }
.tag-light { display: inline-block; background: #fff; color: var(--gc); font-weight: 700; font-size: 0.7812rem; padding: 0.1875rem 0.625rem; border-radius: 62.4375rem; margin-right: 0.5rem; }

.page { max-width: 75rem; margin: 0 auto; padding: 1.625rem clamp(1rem, 4vw, 3rem) 3.75rem; }
.block { margin-bottom: 1.875rem; }
.block-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.875rem; }
.block-h h2 { margin: 0; font: 800 1.3125rem var(--display); }
.empty { grid-column: 1 / -1; padding: 1.375rem; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--ink-soft); text-align: center; background: #fff; }
.skeleton { height: 13.75rem; border-radius: var(--radius); background: linear-gradient(90deg, #eef1f7, #f7f9fc, #eef1f7); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* 主題卡片 */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(21.25rem, 1fr)); gap: 1.125rem; }
.topic-card { display: flex; flex-direction: column; padding: 1.125rem 1.25rem 1rem; text-decoration: none; color: var(--ink); border-top: 0.3125rem solid var(--gc); transition: transform .15s, box-shadow .15s; }
.topic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.tag { display: inline-block; background: var(--gs); color: var(--gc); font-weight: 700; font-size: 0.7812rem; padding: 0.1875rem 0.625rem; border-radius: 62.4375rem; }
.bell { position: relative; font-size: 1.125rem; filter: grayscale(1); opacity: .5; }
.bell.on { filter: none; opacity: 1; }
.bell i { position: absolute; top: 0; right: -2px; width: 0.5625rem; height: 0.5625rem; border-radius: 50%; background: var(--coral); border: 2px solid #fff; }
.tc-class { margin: 0; font-size: 0.8125rem; color: var(--ink-soft); font-weight: 600; }
.topic-card h3 { margin: 0.25rem 0 0.5rem; font: 800 1.0938rem/1.4 var(--display); }
.tc-meta { margin: 0 0 0.75rem; font-size: 0.8125rem; color: var(--ink-soft); }
.tc-go { margin-top: 0.75rem; align-self: flex-end; font-weight: 800; color: var(--gc); font-size: 0.875rem; }

/* 寫作進度 */
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: relative; }
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 0.8125rem; color: var(--ink-soft); }
.stepper li::before { content: ""; position: absolute; top: 1rem; left: -50%; right: 50%; height: 0.1875rem; background: var(--line); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.done::before { background: var(--teal); }
.stepper .b { position: relative; z-index: 1; width: 2.125rem; height: 2.125rem; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2.5px solid var(--line); font-weight: 800; color: var(--ink-soft); }
.stepper li.done .b { background: var(--teal); border-color: var(--teal); color: #fff; }
.stepper .l { margin-top: 0.375rem; font-weight: 700; color: var(--ink); line-height: 1.25; }
.stepper .l small { display: block; font-weight: 400; }
.stepper.compact .b { width: 1.375rem; height: 1.375rem; font-size: 0.6875rem; border-width: 2px; }
.stepper.compact li::before { top: 0.625rem; height: 2px; }
.stepper.compact .l { font-size: 0.6875rem; margin-top: 0.1875rem; }
.stepper.compact .l small { display: none; }

.progress-card { padding: 0.75rem 1.25rem 0.875rem; }
.pc-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.375rem 1rem; margin-bottom: 0.5rem; }
.pc-h > b span { font-weight: 800; color: var(--teal); margin-left: 0.375rem; }
.pc-owl { display: flex; align-items: center; gap: 0.5rem; min-height: 3rem; flex: 0 1 34rem; min-width: 0; }
.pc-owl .owl-live { width: 2.75rem; height: 2.75rem; }
.pc-owl .bubble { max-width: none; flex: 1 1 auto; font-size: 0.8438rem; padding: 0.375rem 0.75rem; line-height: 1.4; background: var(--amber-soft); color: #6b4a07; box-shadow: none; }
.pc-owl .bubble::before { border-right-color: var(--amber-soft); top: 50%; transform: translateY(-50%); }
.pc-owl .bubble .zh { display: block; color: #8a6a2a; font-size: 0.78rem; }
@media (max-width: 640px) { .pc-owl { flex-basis: 100%; } }
.pc-next { margin: 0; background: var(--amber-soft); color: #6b4a07; padding: 0.3rem 0.75rem; border-radius: 62rem; font-size: 0.8438rem; }
/* 主題頁的進度條：扁一點，中英同一行 */
.progress-card .stepper .b { width: 1.625rem; height: 1.625rem; font-size: 0.75rem; border-width: 2px; }
.progress-card .stepper li::before { top: 0.8125rem; height: 2px; }
.progress-card .stepper .l { margin-top: 0.25rem; font-size: 0.8125rem; }
.progress-card .stepper .l small { display: inline; margin-left: 0.25rem; color: var(--ink-soft); }
@media (max-width: 640px) { .progress-card .stepper .l small { display: block; margin: 0; } }

/* 貓頭鷹說話 */
.owl-say { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.875rem; min-height: 3.5rem; }
.owl-say img { width: 3.25rem; height: 3.25rem; object-fit: contain; flex: none; }
.owl-say .bubble { max-width: 47.5rem; font-size: 0.875rem; padding: 0.4rem 0.875rem; line-height: 1.45; }
.owl-say .zh { color: var(--ink-soft); font-size: 0.8125rem; }

/* 會動的貓頭鷹：眨眼、眼珠左右看、身體輕搖、翅膀拍動；對話泡泡由左向右冒出，停 5 秒後收起再重來 */
.owl-live { width: 3.5rem; height: 3.5rem; flex: none; overflow: visible; }
.owl-live .ol-body { transform-origin: 60px 110px; animation: olSway 7s ease-in-out infinite; }
.owl-live .ol-lid { transform-box: fill-box; transform-origin: center top; transform: scaleY(0); animation: olBlink 3.5s infinite; }
.owl-live .ol-pupils { animation: olLook 7s ease-in-out infinite; }
.owl-live .ol-wing.l { transform-box: fill-box; transform-origin: top right; animation: olFlapL 7s ease-in-out infinite; }
.owl-live .ol-wing.r { transform-box: fill-box; transform-origin: top left; animation: olFlapR 7s ease-in-out infinite; }
.owl-live .ol-ear { transform-box: fill-box; transform-origin: bottom center; animation: olEar 7s ease-in-out infinite; }
@keyframes olBlink { 0%, 90%, 100% { transform: scaleY(0); } 94% { transform: scaleY(1); } }
@keyframes olLook { 0%, 20% { transform: translateX(0); } 28%, 45% { transform: translateX(3px); } 55%, 70% { transform: translateX(-3px); } 80%, 100% { transform: translateX(0); } }
@keyframes olSway { 0%, 100% { transform: rotate(0); } 4% { transform: rotate(-5deg) translateY(-2px); } 8% { transform: rotate(4deg); } 12% { transform: rotate(0); } }
@keyframes olFlapL { 0%, 14%, 100% { transform: rotate(0); } 3%, 9% { transform: rotate(18deg); } 6% { transform: rotate(-4deg); } }
@keyframes olFlapR { 0%, 14%, 100% { transform: rotate(0); } 3%, 9% { transform: rotate(-18deg); } 6% { transform: rotate(4deg); } }
@keyframes olEar { 0%, 30%, 100% { transform: rotate(0); } 33% { transform: rotate(-8deg); } 36% { transform: rotate(0); } }
.owl-pop { transform-origin: left center; animation: olPop 7s ease-in-out infinite; }
@keyframes olPop {
  0%, 2% { opacity: 0; transform: translateX(-0.75rem) scale(0.4); }
  9% { opacity: 1; transform: translateX(0.25rem) scale(1.03); }
  12% { opacity: 1; transform: translateX(0) scale(1); }
  83% { opacity: 1; transform: translateX(0) scale(1); }
  90%, 100% { opacity: 0; transform: translateX(-0.75rem) scale(0.4); }
}
@media (prefers-reduced-motion: reduce) { .owl-live *, .owl-pop { animation: none !important; } .owl-live .ol-lid { transform: scaleY(0); } .owl-pop { opacity: 1; transform: none; } }

/* 四大功能 */
.fn-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.125rem; }
.fn-grid.fn-five { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .875rem; }
@media (max-width: 1280px) { .fn-grid.fn-five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fn { --c: var(--primary); --cs: var(--primary-soft); position: relative; padding: 1.375rem 1.25rem 1.25rem; display: flex; flex-direction: column; border-top: 0.3125rem solid var(--c); }
.fn .ic { width: 3.375rem; height: 3.375rem; border-radius: 0.875rem; background: var(--cs); color: var(--c); display: grid; place-items: center; margin-bottom: 0.75rem; }
.fn .ic svg { width: 1.875rem; height: 1.875rem; }
.fn-n { position: absolute; top: 1rem; right: 1.125rem; width: 2rem; height: 2rem; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 800; }
.fn h3 { margin: 0; font: 800 1.1875rem var(--display); }
.fn .zh { margin: 0 0 0.625rem; color: var(--c); font-weight: 700; }
.fn p { margin: 0 0 0.25rem; font-size: 0.875rem; }
.fn .pz { color: var(--ink-soft); font-size: 0.8438rem; margin-bottom: 1rem; }
.fn-actions { margin-top: auto; display: flex; flex-direction: column; gap: 0.375rem; }
.fn-actions .btn { width: 100%; }
.fn-actions .note { color: var(--ink-soft); font-size: 0.7812rem; text-align: center; }
.f-write { --c: var(--amber); --cs: var(--amber-soft); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-amber { background: var(--amber); color: #fff; }
.btn-violet { background: var(--violet); color: #fff; }
.btn-coral:hover, .btn-amber:hover, .btn-violet:hover { filter: brightness(.93); }
.btn-soon { background: #eef1f7; color: var(--ink-soft); cursor: default; }
.bot-link { display: flex; align-items: center; gap: 0.625rem; padding: 0.5625rem 0.625rem; border-radius: 0.625rem; border: 1.5px solid var(--line); text-decoration: none; color: var(--ink); background: #fff; }
.bot-link:hover { border-color: var(--primary); background: var(--primary-soft); }
.bot-link b { display: block; font-size: 0.875rem; }
.bot-link small { display: block; font-size: 0.75rem; }
.bl-n { width: 1.5rem; height: 1.5rem; border-radius: 0.4375rem; background: var(--primary-soft); color: var(--primary-ink); display: grid; place-items: center; font-weight: 800; font-size: 0.8125rem; flex: none; }
.bl-s { margin-left: auto; color: var(--teal); font-weight: 800; }

.found-topic { background: #f6f8fc; border-radius: 0.625rem; padding: 0.625rem 0.75rem; margin-bottom: 0.875rem; display: flex; flex-direction: column; gap: 0.25rem; }
.found-topic small { color: var(--ink-soft); }

/* 右下角小幫手 */
.help { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 45; display: flex; flex-direction: column; align-items: flex-end; gap: 0.625rem; }
.help-fab { width: 4rem; height: 4rem; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow-lg); padding: 0.375rem; }
.help-fab img { width: 100%; height: 100%; object-fit: contain; }
.help-tip { position: absolute; right: 4.625rem; bottom: 1rem; background: #fff; border-radius: 0.75rem; padding: 0.4375rem 0.75rem; box-shadow: var(--shadow); font-size: 0.8125rem; white-space: nowrap; }
.help-panel { width: min(22.5rem, calc(100vw - 2.5rem)); height: 27.5rem; background: #fff; border-radius: 1rem; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.help-h { display: flex; align-items: center; gap: 0.625rem; padding: 0.75rem 0.875rem; background: var(--primary); color: #fff; }
.help-h img { width: 2.25rem; height: 2.125rem; object-fit: contain; background: #fff; border-radius: 50%; padding: 2px; }
.help-h b { display: block; }
.help-h small { color: rgba(255, 255, 255, .85); }
.help-x { margin-left: auto; border: 0; background: none; color: #fff; font-size: 1.375rem; }
.help-log { flex: 1; overflow-y: auto; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; background: #f6f8fc; }
.help-log .msg { max-width: 88%; padding: 0.5rem 0.6875rem; border-radius: 0.75rem; font-size: 0.875rem; }
.help-log .msg p { margin: 0; }
.help-log .msg .zh { color: var(--ink-soft); font-size: 0.8125rem; margin-top: 0.1875rem; }
.help-log .bot { background: #fff; align-self: flex-start; border: 1px solid var(--line); }
.help-log .user { background: var(--primary); color: #fff; align-self: flex-end; }
.help-form { display: flex; gap: 0.375rem; padding: 0.625rem; border-top: 1px solid var(--line); }
.help-form input { flex: 1; border: 1.5px solid var(--line); border-radius: 0.625rem; padding: 0.5rem 0.625rem; font: 0.875rem var(--sans); }
.help-form .btn-sm { margin: 0; }

.toast { position: fixed; left: 50%; bottom: 1.75rem; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 0.5625rem 1.125rem; border-radius: 62.4375rem; z-index: 70; font-size: 0.875rem; }

@media (max-width: 1100px) { .fn-grid, .fn-grid.fn-five { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  body.app .nav-links { display: flex; }
  body.app .nav-links .keep-lg { display: none; }
  body.app .menu-toggle { display: none; }
  .uname { display: none; }
}
@media (max-width: 600px) {
  .fn-grid, .fn-grid.fn-five { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: 1fr; }
  .stepper .l small { display: none; }
  .help-tip { display: none; }
}
.fn.f-board { --c: var(--coral); --cs: var(--coral-soft); }
.fn.f-assistant { --c: var(--primary); --cs: var(--primary-soft); }
.fn.f-write { --c: var(--amber); --cs: var(--amber-soft); }
.fn.f-feedback { --c: var(--violet); --cs: var(--violet-soft); }

/* =========================================================
   AI 機器人頁
   ========================================================= */
.bot-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1.125rem; }
.bt-back { color: var(--ink-soft); text-decoration: none; font-weight: 700; margin-right: 0.375rem; font-size: 0.875rem; }
.bt { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.875rem; border-radius: 62.4375rem; border: 1.5px solid var(--line); background: #fff; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 0.875rem; }
.bt small { color: var(--ink-soft); font-weight: 400; }
.bt:hover { border-color: var(--c); }
.bt.on { background: var(--c); border-color: var(--c); color: #fff; }
.bt.on small { color: rgba(255, 255, 255, .85); }
.bt-n { width: 1.375rem; height: 1.375rem; border-radius: 0.4375rem; display: grid; place-items: center; background: var(--cs); color: var(--c); font-size: 0.75rem; }
.bt.on .bt-n { background: rgba(255, 255, 255, .25); color: #fff; }
.demo-pill { margin-left: auto; font-size: 0.7812rem; font-weight: 700; padding: 0.25rem 0.625rem; border-radius: 62.4375rem; background: var(--amber-soft); color: #7a5209; }

.bot-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.125rem; }
.bot-card { position: relative; padding: 1.375rem 1.25rem; text-decoration: none; color: var(--ink); border-top: 0.3125rem solid var(--c); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.bot-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.bc-n { width: 2.125rem; height: 2.125rem; border-radius: 0.625rem; background: var(--cs); color: var(--c); display: grid; place-items: center; font-weight: 800; margin-bottom: 0.625rem; }
.bot-card h3 { margin: 0; font: 800 1.1875rem var(--display); }
.bot-card .zh { margin: 0 0 0.5rem; color: var(--c); font-weight: 700; }
.bot-card p { margin: 0 0 0.25rem; font-size: 0.875rem; }
.bot-card .pz { color: var(--ink-soft); font-size: 0.8438rem; margin-bottom: 1rem; }
.bc-go { margin-top: auto; background: var(--c); color: #fff; }

.chat-layout { display: grid; grid-template-columns: 16.875rem 1fr; gap: 1.125rem; align-items: start; }
.chat-side { padding: 1rem; position: sticky; top: 6.75rem; }
.chat-side .btn { width: 100%; background: var(--c); }
.chat-side h3 { font-size: 0.875rem; margin: 1.125rem 0 0.5rem; }
.history { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow-y: auto; }
.history a { display: block; padding: 0.5rem 0.625rem; border-radius: 0.625rem; text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.history a:hover { background: #f6f8fc; }
.history a.on { background: var(--cs); border-color: var(--c); }
.history b { display: block; font-size: 0.8125rem; }
.history small { display: block; font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-main { display: flex; flex-direction: column; height: calc(100vh - 5.75rem - 11.875rem); min-height: 32.5rem; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.125rem; border-bottom: 1px solid var(--line); background: var(--cs); }
.chat-head img { width: 2.625rem; height: 2.5rem; object-fit: contain; }
.chat-head b { display: block; }
.chat-head small { display: block; }
.chat-log { flex: 1; overflow-y: auto; padding: 1.125rem; display: flex; flex-direction: column; gap: 0.875rem; background: #fbfcfe; }
.m { display: flex; gap: 0.625rem; max-width: 92%; }
.m.user { align-self: flex-end; }
.m .av { width: 2.25rem; height: 2.125rem; object-fit: contain; flex: none; margin-top: 2px; }
.m .mb { background: #fff; border: 1px solid var(--line); border-radius: 0.25rem 1rem 1rem 1rem; padding: 0.625rem 0.875rem; min-width: 0; }
.m.user .mb { background: var(--c); color: #fff; border: 0; border-radius: 1rem 0.25rem 1rem 1rem; white-space: pre-wrap; }
.m .en { margin: 0; }
.m .zh { margin: 0.25rem 0 0; color: var(--ink-soft); font-size: 0.875rem; }
.typing .mb { color: var(--ink-soft); font-size: 0.875rem; }
.dots { display: inline-flex; gap: 0.1875rem; margin-right: 0.375rem; }
.dots i { width: 0.375rem; height: 0.375rem; border-radius: 50%; background: var(--c); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }

.chat-form { display: flex; gap: 0.625rem; padding: 0.75rem 0.875rem; border-top: 1px solid var(--line); background: #fff; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 0.75rem; padding: 0.625rem 0.75rem; font: 0.9375rem/1.5 var(--sans); max-height: 10rem; }
.chat-form textarea:focus { outline: 0; border-color: var(--c); box-shadow: 0 0 0 0.25rem var(--cs); }
.chat-form .btn { background: var(--c); }

/* 對話卡片 */
.cc { margin-top: 0.625rem; border-radius: 0.75rem; background: #f6f8fc; padding: 0.75rem 0.875rem; font-size: 0.875rem; }
.cc-h { font-weight: 800; font-size: 0.7812rem; color: var(--c); text-transform: none; margin-bottom: 0.5rem; }
.cc-h em { font-weight: 400; color: var(--ink-soft); }
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.625rem; }
.choice { border: 1.5px solid var(--c); background: #fff; color: var(--c); border-radius: 0.625rem; padding: 0.4375rem 1rem; font-weight: 800; }
.choice:hover { background: var(--c); color: #fff; }
.cc-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.625rem; }
.opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.opts li { display: flex; gap: 0.625rem; background: #fff; border-radius: 0.625rem; padding: 0.5rem 0.625rem; border: 1px solid var(--line); }
.opts li > b { width: 1.625rem; height: 1.625rem; border-radius: 0.5rem; background: var(--cs); color: var(--c); display: grid; place-items: center; flex: none; }
.opts small { display: block; color: var(--ink-soft); }
.fbk { font-weight: 800; }
.fbk.ok { background: var(--teal-soft); color: #0b6f68; }
.fbk.no { background: var(--coral-soft); color: #a8382d; }
.fbk .choices { font-weight: 400; }
.score { display: flex; align-items: center; gap: 1rem; background: var(--cs); }
.score b { font: 800 2.5rem var(--display); color: var(--c); }
.score b small { font-size: 1.125rem; color: var(--ink-soft); }
.ideas-h { margin: 0 0 0.375rem; font-weight: 700; font-size: 0.8125rem; }
.ideas { margin: 0; padding-left: 1.125rem; color: var(--ink-soft); }
.outline dl { margin: 0; display: grid; grid-template-columns: 10rem 1fr; gap: 0.375rem 0.75rem; }
.outline dt { font-weight: 800; }
.outline dt small { display: block; font-weight: 400; }
.outline dd { margin: 0; background: #fff; border-radius: 0.5rem; padding: 0.375rem 0.625rem; border: 1px solid var(--line); }

.summary .ov { margin: 0 0 0.75rem; }
.summary .ov small, .gaps small, .focus small, .dim p small { display: block; color: var(--ink-soft); }
.claims { display: flex; flex-direction: column; gap: 0.625rem; }
.claim { background: #fff; border: 1px solid var(--line); border-radius: 0.625rem; padding: 0.625rem 0.75rem; }
.claim-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; margin-bottom: 0.375rem; }
.claim-h small { color: var(--ink-soft); }
.claim ul { list-style: none; margin: 0; padding-left: 0.875rem; border-left: 2px solid var(--line); }
.claim li { margin: 0.375rem 0; }
.claim li small { display: block; color: var(--ink-soft); font-size: 0.7812rem; }
.pill-s { display: inline-block; font-size: 0.6875rem; font-weight: 800; padding: 1px 0.4375rem; border-radius: 0.375rem; margin-right: 0.375rem; color: #fff; }
.pill-s.cl { background: #2f5f98; } .pill-s.ev { background: #25795a; } .pill-s.co { background: #b8581f; } .pill-s.re { background: #a12a46; }
.warn { color: #b8581f; }
.claim .warn { margin: 0.375rem 0 0; }
.qs { margin-top: 0.625rem; }
.qs ul { margin: 0.25rem 0 0; padding-left: 1.125rem; }
.gaps { margin-top: 0.75rem; border-radius: 0.625rem; padding: 0.625rem 0.75rem; background: var(--amber-soft); }
.gaps.ok { background: var(--teal-soft); }
.gaps ul { margin: 0.375rem 0 0; padding-left: 1.125rem; }
.gaps li { margin-bottom: 0.25rem; }

.analysis .offtopic { background: var(--coral); color: #fff; font-weight: 800; border-radius: 0.5rem; padding: 0.5rem 0.75rem; margin-bottom: 0.625rem; }
.an-stats { display: flex; flex-wrap: wrap; gap: 0.875rem; align-items: center; margin-bottom: 0.625rem; }
.focus { background: var(--amber-soft); border-radius: 0.625rem; padding: 0.625rem 0.75rem; margin-bottom: 0.625rem; }
.focus ol { margin: 0.375rem 0 0; padding-left: 1.25rem; }
.dims { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.dim { background: #fff; border: 1px solid var(--line); border-left: 0.25rem solid var(--rc); border-radius: 0.625rem; padding: 0.5rem 0.625rem; }
.dim-h { display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start; }
.dim-h b small { display: block; font-weight: 400; color: var(--ink-soft); }
.dim .rate { flex: none; font-size: 0.7188rem; font-weight: 800; padding: 2px 0.5rem; border-radius: 62.4375rem; background: var(--rs); color: var(--rc); }
.dim p { margin: 0.375rem 0 0; font-size: 0.8438rem; }
.r-good { --rc: #0f9f95; --rs: var(--teal-soft); }
.r-fair { --rc: #c78a12; --rs: var(--amber-soft); }
.r-needs { --rc: #d6493d; --rs: var(--coral-soft); }
.cover { margin-top: 0.625rem; }
.cover div { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0.375rem 0 0.25rem; }
.cover span { font-size: 0.7812rem; padding: 0.1875rem 0.5625rem; border-radius: 62.4375rem; }
.cover .in { background: var(--teal-soft); color: #0b6f68; }
.cover .out { background: #eef1f7; color: var(--ink-soft); }

/* =========================================================
   寫作區
   ========================================================= */
.page-wide { max-width: 87.5rem; }
.write-layout { display: grid; grid-template-columns: 21.25rem 1fr; gap: 1.125rem; align-items: start; }
.toolkit { position: sticky; top: 6.75rem; max-height: calc(100vh - 8rem); display: flex; flex-direction: column; overflow: hidden; }
.tk-h { padding: 0.875rem 1rem 0.5rem; }
.tk-h small { margin-left: 0.375rem; }
.tk-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.25rem; padding: 0 0.75rem 0.625rem; border-bottom: 1px solid var(--line); }
.tk-tabs button { border: 0; background: #f2f4f9; border-radius: 0.5rem; padding: 0.375rem 0.25rem; font-weight: 700; font-size: 0.8125rem; color: var(--ink-soft); }
.tk-tabs button small { display: block; font-size: 0.6875rem; }
.tk-tabs button[aria-selected="true"] { background: var(--amber); color: #fff; }
.tk-tabs button[aria-selected="true"] small { color: rgba(255, 255, 255, .9); }
.tk-body { padding: 0.75rem 1rem 1rem; overflow-y: auto; font-size: 0.8438rem; }
.tk-claim { border-left: 0.1875rem solid #2f5f98; padding-left: 0.625rem; margin-bottom: 0.75rem; }
.tk-claim p { margin: 2px 0; }
.tk-claim small { display: block; color: var(--ink-soft); }
.tk-ev { color: #25795a; } .tk-co { color: #b8581f; } .tk-re { color: #a12a46; }
.tk-empty { background: #f6f8fc; border-radius: 0.625rem; padding: 0.75rem; color: var(--ink-soft); margin-bottom: 0.625rem; }
.tk-field { display: block; margin-bottom: 0.625rem; }
.tk-field span { display: block; font-weight: 800; font-size: 0.7812rem; margin-bottom: 0.1875rem; }
.tk-field textarea, #notesInput { width: 100%; border: 1.5px solid var(--line); border-radius: 0.5rem; padding: 0.4375rem 0.5625rem; font: 0.8438rem/1.5 var(--sans); resize: vertical; }
.tk-field textarea:focus, #notesInput:focus { outline: 0; border-color: var(--amber); }
.link-sm { display: inline-block; margin-top: 0.375rem; font-size: 0.8125rem; font-weight: 700; }

.editor { display: flex; flex-direction: column; overflow: hidden; }
.ed-h { display: flex; justify-content: space-between; align-items: center; gap: 0.625rem; padding: 0.75rem 1.125rem; border-bottom: 1px solid var(--line); font-size: 0.875rem; }
.ed-notice { padding: 0.625rem 1.125rem; background: var(--teal-soft); color: #0b6f68; font-size: 0.875rem; }
.ed-notice.warn { background: var(--amber-soft); color: #7a5209; }
#essay { min-height: calc(100vh - 5.75rem - 18.75rem); height: 35rem; border: 0; resize: vertical; padding: 1.375rem 1.625rem; font: 1.0625rem/1.85 Georgia, "Times New Roman", "Noto Serif TC", serif; color: var(--ink); }
#essay:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--amber-soft); }
#essay[readonly] { background: #fafbfd; }
.ed-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.75rem 1.125rem; border-top: 1px solid var(--line); background: #fff; }
.ed-info { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.wc-bar { width: 7.5rem; height: 0.4375rem; border-radius: 6.1875rem; background: #eef1f7; overflow: hidden; display: inline-block; }
.wc-bar i { display: block; height: 100%; background: var(--amber); border-radius: 6.1875rem; transition: width .2s; }
.wc-bar i.ok { background: var(--teal); }
.ed-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.check-list { list-style: none; padding: 0; margin: 0 0 0.75rem; }
.check-list li { padding: 0.375rem 0.625rem; border-radius: 0.5rem; margin-bottom: 0.375rem; font-size: 0.875rem; }
.check-list .ok { background: var(--teal-soft); color: #0b6f68; }
.check-list .no { background: var(--amber-soft); color: #7a5209; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.modal-actions .btn { width: auto; }

/* =========================================================
   評分與回饋
   ========================================================= */
.fb-layout { display: grid; grid-template-columns: 1fr 18.75rem; gap: 1.125rem; margin-bottom: 1.625rem; align-items: start; }
.fb-teacher, .fb-status { padding: 1.25rem 1.375rem; border-top: 0.3125rem solid var(--violet); }
.fb-assessments { display: grid; gap: 1rem; }
.fb-essay-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; }
.fb-status { border-top-color: var(--amber); }
.fb-h { display: flex; justify-content: space-between; gap: 0.625rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.fb-score { display: flex; align-items: baseline; gap: 0.375rem; margin-bottom: 0.875rem; }
.fb-score b { font: 800 3.25rem var(--display); color: var(--violet); }
.fb-score span { color: var(--ink-soft); font-size: 1.125rem; }
.rubric { width: 100%; border-collapse: collapse; font-size: 0.875rem; margin-bottom: 0.875rem; }
.rubric th, .rubric td { text-align: left; padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.rubric th { background: var(--violet-soft); font-size: 0.8125rem; }
.fb-comments { background: #f6f8fc; border-radius: 0.625rem; padding: 0.75rem 0.875rem; }
.fb-comments p { margin: 0.375rem 0 0; white-space: pre-wrap; }
.fb-empty { display: flex; gap: 1rem; align-items: center; }
.fb-empty img { width: 4.375rem; height: 4.125rem; object-fit: contain; flex: none; }
.fb-empty p { margin: 0.25rem 0 0; color: var(--ink-soft); }
.st { font-weight: 800; margin: 0 0 0.25rem; }
.st.ok { color: var(--teal); } .st.warn { color: #b8581f; } .st.draft { color: var(--ink-soft); }
.fb-status .btn { width: 100%; margin-top: 0.5rem; }
.an-item { padding: 0; margin-bottom: 0.625rem; overflow: hidden; }
.an-item summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; }
.an-item[open] summary { border-bottom: 1px solid var(--line); }
.an-item > p, .an-item > ul, .an-item > a { margin: 0.625rem 1rem; font-size: 0.875rem; }
.an-item > ul { padding-left: 1.125rem; }
.an-item li { margin-bottom: 0.25rem; }
.an-pills { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.an-pills i { font-style: normal; font-size: 0.7188rem; font-weight: 700; padding: 2px 0.4375rem; border-radius: 0.375rem; background: var(--rs); color: var(--rc); }

/* =========================================================
   手冊、關於
   ========================================================= */
.doc-steps { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.25rem; }
.doc-step { display: flex; gap: 1rem; padding: 1.125rem 1.25rem; border-left: 0.3125rem solid var(--c); }
.doc-step .n { flex: none; min-width: 2.5rem; height: 2.5rem; padding: 0 0.5rem; border-radius: 0.75rem; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 800; }
.doc-step h2, .doc-block h2, .doc-note h2 { margin: 0 0 0.375rem; font: 800 1.125rem var(--display); }
.doc-step p, .doc-block p { margin: 0; font-size: 0.9062rem; }
.doc-step code { background: #eef1f7; padding: 1px 0.375rem; border-radius: 0.3125rem; }
.doc-note { display: flex; gap: 1rem; align-items: center; padding: 1.125rem 1.25rem; background: var(--primary-soft); border: 0; }
.doc-note img { width: 4.5rem; height: 4.25rem; object-fit: contain; flex: none; }
.doc-note p { margin: 0; }
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.125rem; }
.doc-block { padding: 1.25rem; }
.doc-block .pz { color: var(--ink-soft); margin-top: 0.5rem; font-size: 0.875rem; }
.genre-list { list-style: none; margin: 0; padding: 0; }
.genre-list li { display: flex; gap: 0.5rem; align-items: center; padding: 0.375rem 0; border-bottom: 1px dashed var(--line); font-size: 0.875rem; }
.genre-list .pill { margin-left: auto; }
body.app { display: flex; flex-direction: column; min-height: 100vh; }
body.app > main { flex: 1; width: 100%; }

@media (max-width: 1000px) {
  .chat-layout, .write-layout, .fb-layout { grid-template-columns: 1fr; }
  .chat-side, .toolkit { position: static; max-height: none; }
  .history { max-height: 10rem; }
  .bot-cards, .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .dims { grid-template-columns: 1fr; }
  .outline dl { grid-template-columns: 1fr; }
  .chat-main { height: 70vh; }
  .m { max-width: 100%; }
  #essay { padding: 1rem; font-size: 1rem; }
}
.page-banner .tag-light { background: #fff; color: var(--gc); }
@media (max-width: 900px) {
  body.app .nav-links .dd { display: block; }
  body.app .nav-links .keep-lg { display: none; }
}
@media (max-width: 1000px) {
  .write-layout .editor { order: -1; }
  #essay { min-height: 22.5rem; height: 52vh; }
}

/* 自適應：格線中的子元素可以縮小，避免長文字把版面撐破 */
.chat-layout > *, .write-layout > *, .fb-layout > *, .hero-inner > *, .fn-grid > *,
.topic-grid > *, .bot-cards > *, .about-grid > *, .features > *, .flow > *, .need-grid > *, .page-banner-inner > * { min-width: 0; }
.m .mb { overflow-wrap: anywhere; }
.page-banner h1, .topic-card h3 { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .page { padding-left: 1rem; padding-right: 1rem; }
  .bot-tabs { gap: 0.375rem; }
  .bt { padding: 0.4375rem 0.75rem; font-size: 0.8125rem; }
  .chat-side { padding: 0.75rem; }
}

/* ===== 教師端：研究設定 ===== */
.rs-intro { padding: 1.25rem 1.5rem; }
.rs-years { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 0.75rem; }
.rs-y { border-radius: 0.75rem; padding: 0.75rem 2.75rem 0.75rem 0.875rem; border: 1.5px solid var(--line); position: relative; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.rs-y[aria-pressed="false"] { background: #fff !important; border-style: dashed; opacity: .7; }
.rs-y:focus-visible { outline: 2px solid var(--yc); outline-offset: 2px; }
.rs-sw { position: absolute; top: .8rem; right: .8rem; width: 1.9rem; height: 1.1rem; border-radius: 1rem; background: #cbd5e1; }
.rs-sw::after { content: ""; position: absolute; top: .15rem; left: .15rem; width: .8rem; height: .8rem; border-radius: 50%; background: #fff; transition: left .15s; }
.rs-y[aria-pressed="true"] .rs-sw { background: var(--yc); }
.rs-y[aria-pressed="true"] .rs-sw::after { left: .95rem; }
.rs-ysec { margin-bottom: 1.5rem; }
.rs-yh { display: flex; align-items: center; gap: .375rem; margin: 0 0 .25rem; font: 800 1.0625rem var(--display); }
.rs-ysec > p { margin: 0 0 .75rem; }
.rs-tool small b { color: var(--ink); }
@media (max-width: 720px) { .rs-years { grid-template-columns: 1fr; } }
.rs-y b { display: block; font: 800 0.9375rem var(--display); }
.rs-y span { font-size: 0.8125rem; color: var(--ink-soft); }
.rs-y.y1, .rs-yb.y1 { --yc: var(--amber); --ys: var(--amber-soft); }
.rs-y.y2, .rs-yb.y2 { --yc: var(--teal); --ys: var(--teal-soft); }
.rs-y.y3, .rs-yb.y3 { --yc: var(--violet); --ys: var(--violet-soft); }
.rs-y { background: var(--ys); border-color: var(--yc); }
.rs-list { display: grid; gap: 1.25rem; }
.rs-empty { padding: 1.25rem; }
.rs-topic { padding: 1.25rem 1.5rem; min-width: 0; }
.rs-th h3 { margin: 0.25rem 0; font: 800 1.125rem/1.35 var(--display); overflow-wrap: anywhere; }
.rs-meta { margin: 0; font-size: 0.8125rem; color: var(--ink-soft); }
.rs-preset { margin: 1rem 0 0.25rem; max-width: 32rem; }
.rs-preset select, .rs-ctl select { width: 100%; padding: 0.5rem 0.625rem; border-radius: 0.625rem; border: 1.5px solid var(--line); background: #fff; font: inherit; }
.rs-note { margin: 0.25rem 0 0.875rem; font-size: 0.875rem; color: var(--ink-soft); }
.rs-flags { border-top: 1px solid var(--line); }
.rs-flag { display: grid; grid-template-columns: minmax(0, 1fr) 13rem; gap: 1rem; align-items: center; padding: 0.75rem 0.25rem; border-bottom: 1px solid var(--line); }
.rs-flag.over { background: var(--amber-soft); }
.rs-fl b { font-size: 0.9375rem; }
.rs-fl small { display: block; color: var(--ink-soft); font-size: 0.8125rem; margin-top: 0.125rem; }
.rs-fl small em { color: #9a5b00; font-style: normal; font-weight: 700; }
.rs-yb { display: inline-block; background: var(--ys); color: var(--yc); font-weight: 800; font-size: 0.75rem; padding: 0.0625rem 0.4375rem; border-radius: 0.375rem; margin-right: 0.25rem; }
.rs-st { font-size: 0.7188rem; font-weight: 700; padding: 0.0625rem 0.5rem; border-radius: 62rem; margin-left: 0.25rem; white-space: nowrap; }
.rs-st.ok { background: #e3f5ea; color: #1f7a45; }
.rs-st.pv { background: var(--teal-soft); color: var(--teal); }
.rs-st.rv { background: #eef0f4; color: #6b7280; }
.rs-ctl { justify-self: end; width: 100%; display: flex; justify-content: flex-end; }
.rs-switch { position: relative; width: 3rem; height: 1.625rem; display: inline-block; }
.rs-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.rs-switch span { position: absolute; inset: 0; background: #cdd3df; border-radius: 62rem; transition: .2s; cursor: pointer; }
.rs-switch span::before { content: ""; position: absolute; width: 1.25rem; height: 1.25rem; left: 0.1875rem; top: 0.1875rem; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.rs-switch input:checked + span { background: var(--primary); }
.rs-switch input:checked + span::before { transform: translateX(1.375rem); }
.rs-switch input:focus-visible + span { outline: 3px solid var(--primary-soft); }
.rs-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
.rs-actions .btn { margin: 0; }
.rs-actions .btn:disabled { opacity: .45; cursor: default; }
.rs-hist { margin-top: 0.875rem; font-size: 0.8125rem; color: var(--ink-soft); }
.rs-hist ul { margin: 0.5rem 0 0; padding-left: 1.25rem; }
@media (max-width: 720px) {
  .rs-years { grid-template-columns: minmax(0, 1fr); }
  .rs-flag { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .rs-ctl { justify-content: flex-start; }
  .rs-topic, .rs-intro { padding: 1rem; }
}

/* ===== 第三年：歷程儀表板 ===== */
.db-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.25rem; }
.db-card { padding: 1.25rem 1.5rem; min-width: 0; }
.db-card h2 { margin: 0 0 0.75rem; font: 800 1.125rem var(--display); }
.db-bars { display: grid; gap: 0.625rem; }
.db-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.75rem; align-items: center; font-size: 0.875rem; }
.db-track { display: grid; gap: 0.25rem; }
.db-bar { height: 0.75rem; border-radius: 0.375rem; background: var(--c); min-width: 2px; }
.db-bar.grp { opacity: .35; }
.db-bar-l { font-size: 0.75rem; color: var(--ink-soft); }
.db-legend { display: flex; gap: 1rem; font-size: 0.8125rem; color: var(--ink-soft); margin-top: 0.75rem; }
.db-legend i { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 0.1875rem; background: var(--primary); vertical-align: -0.0625rem; margin-right: 0.25rem; }
.db-legend i.grp { opacity: .35; }
.db-div { display: flex; gap: 1rem; flex-wrap: wrap; }
.db-div div { flex: 1 1 8rem; background: var(--bg); border-radius: 0.75rem; padding: 0.75rem; }
.db-div b { display: block; font: 800 1.5rem var(--display); }
.db-div span { font-size: 0.8125rem; color: var(--ink-soft); }
.db-time { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; max-height: 20rem; overflow: auto; }
.db-time li { display: flex; gap: 0.5rem; align-items: baseline; font-size: 0.875rem; }
.db-time .chip { color: #fff; background: var(--c); font-size: 0.75rem; font-weight: 700; padding: 0.0625rem 0.5rem; border-radius: 62rem; white-space: nowrap; }
.db-time time { color: var(--ink-soft); font-size: 0.75rem; white-space: nowrap; }
.db-form .field { margin-bottom: 0.75rem; }
.db-form textarea { width: 100%; min-height: 5rem; }
@media (max-width: 860px) { .db-grid { grid-template-columns: minmax(0, 1fr); } }

/* ===== 管理端 ===== */
.ad-tabs { margin-bottom: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ad-tabs button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.ad-card { padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; min-width: 0; overflow-x: auto; }
.ad-card h2 { margin: 0 0 0.75rem; font: 800 1.125rem var(--display); }
.ad-h { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.ad-inline { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ad-inline input { flex: 1 1 16rem; }
.ad-card input, .ad-card select, .ad-card textarea { font: inherit; padding: 0.5rem 0.625rem; border-radius: 0.625rem; border: 1.5px solid var(--line); background: #fff; max-width: 100%; }
.ad-card textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 0.8125rem; }
.ad-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.75rem 1rem; align-items: end; }
.ad-form .field { margin: 0; }
.ad-form .field input, .ad-form .field select { width: 100%; }
.ad-form .ad-wide { grid-column: span 2; }
.ad-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }
.ad-actions .btn { margin: 0; }
.ad-teachers { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.875rem; margin-bottom: 0.75rem; }
.ad-teachers small { color: var(--ink-soft); }
.ad-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.ad-table th { text-align: left; color: var(--ink-soft); font-weight: 700; border-bottom: 1.5px solid var(--line); padding: 0.5rem; white-space: nowrap; }
.ad-table td { border-bottom: 1px solid var(--line); padding: 0.5rem; vertical-align: top; }
.ad-table tr.ad-off td { color: #9aa3b2; }
.ad-editrow td { background: var(--bg); }
.ad-row-actions { white-space: nowrap; }
.ad-row-actions .btn { margin: 0 0.25rem 0 0; }
.ad-chip { display: inline-block; background: var(--primary-soft); border-radius: 62rem; padding: 0.0625rem 0.5rem; margin: 0 0.25rem 0.25rem 0; font-size: 0.8125rem; }
.ad-x { color: #b42318; }
.ad-new { margin-top: 0.875rem; }
.ad-new summary { cursor: pointer; font-weight: 700; color: var(--primary); margin-bottom: 0.75rem; }
.ad-filter { font-size: 0.875rem; }
.ad-err { color: #b42318; font-size: 0.8125rem; }
@media (max-width: 720px) { .ad-form .ad-wide { grid-column: auto; } .ad-card { padding: 1rem; } }
.ad-table .btn { white-space: nowrap; } .ad-table td.nw { white-space: nowrap; }

/* 回上一頁 Back */
.nav-links .nav-back { border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-weight: 700; font-size: 0.875rem; padding: 0.4375rem 0.875rem; border-radius: 62.4375rem; white-space: nowrap; }
.nav-links .nav-back:hover { background: var(--primary-soft); color: var(--primary-ink); border-color: var(--primary-soft); }
.nav-links .nav-back[hidden] { display: none; }
@media (max-width: 720px) { .nav-links .nav-back .nb-t { display: none; } .nav-links .nav-back { padding: 0.4375rem 0.75rem; } }

/* 更改密碼 */
.pw-card { max-width: 28rem; margin: 0 auto; padding: 1.5rem; display: grid; gap: 0.75rem; }
.pw-card .field input { width: 100%; }
.pw-note { margin: 0; background: var(--amber-soft); border-radius: 0.625rem; padding: 0.75rem 1rem; font-weight: 700; }

/* ===== 學生名單 ===== */
.ro-top { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }
.ro-class { margin: 0; min-width: 16rem; }
.ro-class select { width: 100%; }
.ro-layers { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.8125rem; color: var(--ink-soft); background: var(--bg); border-radius: 0.625rem; padding: 0.625rem 0.875rem; margin-bottom: 0.75rem; }
.ro-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.ro-filters input { flex: 1 1 14rem; }
.ro-scroll { overflow-x: auto; margin-top: 0.5rem; }
.ro-g { padding: 0.25rem 0.375rem !important; font-size: 0.8125rem; }
.ro-howto ol { margin: 0 0 0.75rem; padding-left: 1.25rem; line-height: 1.9; }
.ro-howto details { margin: 0.5rem 0; }
.ro-howto summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.ro-warn { background: var(--amber-soft); border-radius: 0.625rem; padding: 0.625rem 0.875rem; font-size: 0.875rem; margin: 0.75rem 0; }
.ro-upl { display: flex; gap: 0.75rem; align-items: end; flex-wrap: wrap; }
.ro-upl .field { margin: 0; }
.ro-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: 0.5rem; margin: 1rem 0 0.5rem; }
.ro-sum div { background: var(--bg); border-radius: 0.75rem; padding: 0.625rem 0.75rem; }
.ro-sum div.bad { background: #fdecea; }
.ro-sum b { display: block; font: 800 1.375rem var(--display); }
.ro-sum span { font-size: 0.8125rem; color: var(--ink-soft); }
.ro-err { background: #fdecea; border-radius: 0.75rem; padding: 0.75rem 1rem; margin: 0.75rem 0; font-size: 0.875rem; }
.ro-err table { background: #fff; margin-top: 0.5rem; }
.ro-newg { background: var(--teal-soft); border-radius: 0.75rem; padding: 0.75rem 1rem; margin: 0.75rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; font-size: 0.875rem; }
.ro-newg small { width: 100%; color: var(--ink-soft); }
.rs-st.err { background: #fdecea; color: #b42318; }
.ro-creds { border: 2px solid var(--amber); }
.ro-chk label { display: flex; gap: 0.375rem; align-items: center; font-weight: 600; }

/* 討論摘要：資料時間與來源貼文連結 */
.cc.summary .asof { font-size: 0.75rem; color: var(--ink-soft); background: var(--bg); border-radius: 0.375rem; padding: 0.25rem 0.5rem; margin: -0.25rem 0 0.5rem; }
.cc.summary a.src { color: inherit; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.cc.summary a.src:hover { color: var(--c); text-decoration-style: solid; }

/* ---------- 任務管理 ---------- */
.mg-page .ad-card { margin-bottom: 1rem; }
.mg-top { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: end; }
.mg-sel { flex: 1 1 22rem; margin: 0; min-width: 0; }
.mg-sel select { width: 100%; }
.mg-status { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; flex: 1 1 100%; }
.mg-phase { font-weight: 800; font-size: 0.8125rem; border-radius: 62rem; padding: 0.2rem 0.7rem; background: var(--teal-soft); color: var(--teal); }
.mg-phase.ph-writing { background: var(--violet-soft); color: var(--violet); }
.mg-phase.ph-ended { background: #eceff3; color: #475569; }
.mg-acc { font-size: 0.8125rem; font-weight: 700; }
.mg-acc.ok { color: #1f7a45; } .mg-acc.ro { color: #b45309; }
.mg-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem 1rem; }
.mg-form .field { margin: 0; }
.mg-form .mg-wide { grid-column: 1 / -1; }
.mg-form textarea, .mg-form input, .mg-form select { width: 100%; }
.mg-phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0.5rem 0; }
.mg-ph { border: 1.5px solid var(--line); background: #fff; border-radius: 0.75rem; padding: 0.625rem; text-align: left; cursor: pointer; display: grid; }
.mg-ph small { color: var(--ink-soft); }
.mg-ph.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary-soft); }
.mg-gstats { display: flex; flex-wrap: wrap; gap: 0.375rem 1rem; font-size: 0.8125rem; margin: 0.5rem 0; color: var(--ink-soft); }
.mg-gstats b { color: var(--ink); }
.mg-gstats .warn, .warn { color: #b45309; }
.mg-add { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.mg-add input { flex: 1 1 12rem; }
.mg-snap { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 0.75rem; }
.mg-snap ol { padding-left: 1.25rem; display: grid; gap: 0.5rem; }
.mg-snap p { margin: 0.125rem 0 0; font-size: 0.8125rem; white-space: pre-wrap; }
.mg-chk { border: 1px solid var(--line); border-radius: 0.625rem; margin: 0.5rem 0; padding: 0.5rem 0.75rem; }
.mg-chk summary { display: flex; gap: 0.5rem; align-items: center; cursor: pointer; }
.mg-chk .mg-cnt { margin-left: auto; font-size: 0.8125rem; color: var(--ink-soft); }
.mg-chk .mg-ic { width: 1.25rem; text-align: center; font-weight: 800; }
.mg-chk.lv-ok .mg-ic { color: #1f7a45; } .mg-chk.lv-warn .mg-ic { color: #b45309; } .mg-chk.lv-error .mg-ic { color: #b42318; }
.mg-chk.lv-error { border-color: #fca5a5; background: #fff7f7; }
.mg-chk ul { font-size: 0.8125rem; padding-left: 1.25rem; margin: 0.375rem 0; display: grid; gap: 0.25rem; overflow-wrap: anywhere; }
.mg-rp-bar, .mg-rp-ctl { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; margin-bottom: 0.5rem; }
.mg-rp-ctl input[type=range] { flex: 1 1 12rem; }
.mg-act { font-size: 0.8125rem; display: inline-flex; gap: 0.25rem; align-items: center; }
.mg-rp-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr); gap: 0.75rem; }
.mg-board { width: 100%; height: 28rem; background: radial-gradient(#d9dee7 1px, transparent 1px) 0 0 / 16px 16px, #f8fafc; border: 1px solid var(--line); border-radius: 0.75rem; }
.mg-board .rp-topic { fill: #1e293b; } .mg-board .rp-tt { fill: #fff; font: 700 14px var(--body, sans-serif); }
.mg-board .rp-ln { stroke: #94a3b8; stroke-width: 2; }
.mg-board .rp-n text { fill: #fff; } .mg-board .rp-sc { font-size: 10px; opacity: 0.85; } .mg-board .rp-ti { font: 700 12px sans-serif; } .mg-board .rp-au { font-size: 10px; opacity: 0.85; }
.mg-board .rp-n.cur rect { stroke: #f59e0b; stroke-width: 5; }
.mg-board .rp-n.miss rect { fill: #94a3b8 !important; stroke-dasharray: 6 4; stroke: #475569; stroke-width: 2; }
.mg-tl { list-style: none; margin: 0; padding: 0; max-height: 28rem; overflow: auto; border: 1px solid var(--line); border-radius: 0.75rem; font-size: 0.78rem; }
.mg-tl li { display: grid; grid-template-columns: auto auto 1fr; gap: 0 0.5rem; padding: 0.375rem 0.625rem; border-bottom: 1px solid var(--line); cursor: pointer; opacity: 0.45; border-left: 3px solid transparent; }
.mg-tl li.past { opacity: 1; } .mg-tl li.cur { background: #fffbeb; }
.mg-tl li.a-student { border-left-color: var(--primary); } .mg-tl li.a-teacher { border-left-color: var(--violet); } .mg-tl li.a-system { border-left-color: #94a3b8; }
.mg-tl .tl-t { color: var(--ink-soft); white-space: nowrap; } .mg-tl .tl-k { font-weight: 800; white-space: nowrap; }
.mg-tl li.miss .tl-b em { color: #b45309; }
.mg-act.a-student { color: var(--primary); } .mg-act.a-teacher { color: var(--violet); } .mg-act.a-system { color: #475569; }
@media (max-width: 760px) {
  .mg-form, .mg-phases { grid-template-columns: 1fr; }
  .mg-rp-body { grid-template-columns: 1fr; }
  .mg-board { height: 18rem; }
}
.mg-form textarea { font: inherit; }

/* ---------- KB moves 編碼 ---------- */
.cd-page .ad-card { margin-bottom: 1rem; }
.cd-top .field { margin: 0 0 0.5rem; } .cd-top select { width: 100%; }
.cd-draft { display: inline-block; font-size: 0.72rem; font-weight: 800; color: #9a3412; background: #fff7ed; border: 1px solid #fdba74; border-radius: 62rem; padding: 0 0.5rem; }
.cd-prog { height: 0.5rem; background: var(--bg); border-radius: 62rem; overflow: hidden; margin-top: 0.5rem; }
.cd-prog div { height: 100%; background: var(--teal); }
.cd-nav { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.5rem; font-size: 0.875rem; }
.cd-ctx { font-size: 0.8125rem; color: var(--ink-soft); margin: 0 0 0.25rem; overflow-wrap: anywhere; }
.cd-unit h4 { margin: 0.25rem 0; }
.cd-body { white-space: pre-wrap; line-height: 1.7; background: var(--bg); border-radius: 0.5rem; padding: 0.625rem 0.75rem; overflow-wrap: anywhere; }
.cd-body mark { background: #fde68a; padding: 0.05rem 0.1rem; border-radius: 0.2rem; }
.cd-text { font-size: 1rem; line-height: 1.6; margin: 0.25rem 0 0.5rem; overflow-wrap: anywhere; }
.cd-lbl { display: block; font-size: 0.72rem; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.02em; margin: 0.625rem 0 0.25rem; }
.cd-cols, .cd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0 1rem; }
.cd-sc { display: inline-block; background: var(--c); color: #fff; font-size: 0.75rem; font-weight: 700; border-radius: 0.375rem; padding: 0.05rem 0.45rem; margin-right: 0.25rem; }
.cd-rat { display: block; margin-top: 0.125rem; }
.cd-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.375rem; }
.cd-code { border: 1.5px solid var(--line); background: #fff; border-radius: 0.625rem; padding: 0.4rem 0.5rem; display: grid; text-align: left; cursor: pointer; }
.cd-code small { color: var(--ink-soft); font-size: 0.75rem; }
.cd-code.hi { border-style: dashed; }
.cd-code.on { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 0 0 2px var(--teal-soft); border-style: solid; }
.cd-subs { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.375rem; }
.cd-sub { border: 1px solid var(--line); background: #fff; border-radius: 62rem; padding: 0.2rem 0.65rem; font-size: 0.8125rem; cursor: pointer; }
.cd-sub.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.cd-def { margin: 0.375rem 0; }
.cd-chk { display: inline-flex; gap: 0.375rem; align-items: center; font-size: 0.8125rem; margin: 0.375rem 1rem 0.375rem 0; }
.cd-note { width: 100%; margin: 0.25rem 0 0.5rem; }
.cd-act { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.cd-coders { border: 1px solid var(--line); border-radius: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; padding: 0.5rem 0.75rem; }
.cd-coders label, .cd-edit label { font-size: 0.8125rem; display: inline-flex; gap: 0.25rem; align-items: center; margin-right: 0.75rem; }
.cd-edit { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 0.75rem; }
.cd-adj.open { border-left: 4px solid #f59e0b; }
.cd-adjf { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.cd-adjf input { flex: 1 1 14rem; }
.cd-flags { font-size: 0.8125rem; color: #9a3412; padding-left: 1.25rem; }
.cd-res td { vertical-align: top; font-size: 0.8125rem; }
.cd-res td:nth-child(2) { min-width: 16rem; }
.cd-q { border-bottom: 1px solid var(--line); padding: 0.5rem 0; }
.cd-q.done { opacity: 0.6; } .cd-q p { margin: 0 0 0.25rem; overflow-wrap: anywhere; }
.cd-qf { display: flex; gap: 0.5rem; flex-wrap: wrap; } .cd-qf input { flex: 1 1 14rem; }
.cd-cat { border: 1px solid var(--line); border-radius: 0.625rem; padding: 0.625rem; margin: 0 0 0.625rem; display: grid; gap: 0.375rem; min-width: 0; }
.cd-cat-h { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
.cd-cat-h input { flex: 1 1 8rem; min-width: 0; } .cd-cat-h .cd-in-code { flex: 0 0 5rem; font-weight: 800; }
.cd-cat textarea { width: 100%; font: inherit; }
.tk-mat { border-bottom: 1px solid var(--line); padding: 0.5rem 0; font-size: 0.8125rem; display: grid; gap: 0.125rem; }
.tk-mat p { margin: 0.125rem 0; white-space: pre-wrap; color: var(--ink-soft); max-height: 6.5rem; overflow: auto; }
.tk-mk { justify-self: start; font-size: 0.68rem; font-weight: 800; border-radius: 62rem; padding: 0 0.45rem; background: var(--teal-soft); color: var(--teal); }
.tk-mk.reading { background: var(--violet-soft); color: var(--violet); }
.tk-mat .link-btn { justify-self: start; font-size: 0.75rem; }

/* ---------- 遷移分析、研究匯出 ---------- */
.tr-page .ad-card, .ex-page .ad-card { margin-bottom: 1rem; }
.tr-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; }
.tr-grid .ad-card { margin: 0 0 1rem; }
.tr-row { cursor: pointer; } .tr-row.on td { background: var(--primary-soft); }
.tr-rule { font-size: 0.8125rem; } .tr-rule ul { margin: 0.25rem 0 0; padding-left: 1.25rem; color: var(--ink-soft); }
.tr-reads { list-style: none; padding: 0; margin: 0 0 0.5rem; display: grid; gap: 0.375rem; font-size: 0.8125rem; }
.tr-reads input { width: 5rem; }
.tr-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.tr-head h3 { margin: 0; }
.tr-ix { display: grid; grid-template-columns: repeat(3, auto); gap: 0 1.25rem; align-items: end; }
.tr-ix > div { display: grid; text-align: center; } .tr-ix b { font: 800 1.5rem var(--display); } .tr-ix small { color: var(--ink-soft); font-size: 0.72rem; }
.tr-ix p { grid-column: 1 / -1; margin: 0.25rem 0 0; }
.tr-essay { white-space: pre-wrap; line-height: 1.85; background: var(--bg); border-radius: 0.625rem; padding: 0.875rem 1rem; margin: 0.5rem 0; overflow-wrap: anywhere; user-select: text; }
.tr-el { border-radius: 0.25rem; padding: 0.05rem 0.1rem; cursor: pointer; border-bottom: 2px solid; }
.st-d { background: #dcfce7; border-color: #16a34a; } .st-c { background: #e0f2fe; border-color: #0284c7; }
.st-p { background: #fef3c7; border-color: #d97706; } .st-u { background: #f1f5f9; border-color: #94a3b8; }
.tr-legend { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.tr-card { border: 1px solid var(--line); border-radius: 0.625rem; padding: 0.625rem 0.75rem; margin-bottom: 0.625rem; }
.tr-card-h { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.tr-card blockquote { margin: 0.375rem 0; padding-left: 0.75rem; border-left: 3px solid var(--line); font-size: 0.875rem; overflow-wrap: anywhere; }
.tr-st { font-size: 0.72rem; font-weight: 800; border-radius: 62rem; padding: 0.05rem 0.5rem; border: 1px solid; }
.tr-links { list-style: none; padding: 0; margin: 0.25rem 0; display: grid; gap: 0.375rem; font-size: 0.8125rem; }
.tr-links li { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; overflow-wrap: anywhere; }
.tr-links .ln-note { flex: 1 1 10rem; }
.ln-add select[name=src] { flex: 1 1 14rem; min-width: 0; max-width: 100%; }
.ex-note { background: var(--bg); border-radius: 0.625rem; padding: 0.75rem 1rem; font-size: 0.875rem; }
.ex-note p { margin: 0 0 0.5rem; }
.ex-files { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; font-size: 0.8125rem; margin-bottom: 0.5rem; }
.ex-dict td { font-size: 0.8125rem; vertical-align: top; }
@media (max-width: 860px) { .tr-grid { grid-template-columns: 1fr; } .tr-ix { grid-template-columns: repeat(3, 1fr); } }
.nav-me { display: inline-flex; align-items: center; gap: 0.375rem; }
.nav-links .dd-btn { white-space: nowrap; }
.nav-landing .nav-links > a.keep-lg[href="./"] { display: none; } /* 左上角貓頭鷹就是回首頁 */
@media (max-width: 1560px) { .nav-landing .nav-links a, .nav-landing .nav-links .dd-btn { padding-left: 0.625rem; padding-right: 0.625rem; } }
@media (max-width: 1366px) { .nav-landing:has(.nav-me) .uname { display: none; } }
@media (max-width: 1600px) { .nav-landing:has(.nav-me) .logo-text { font-size: 1.25rem; } .nav-landing:has(.nav-me) .nav-links > a.keep-lg { display: none; } }
@media (max-width: 1360px) { .nav-landing .logo-text { font-size: 1.125rem; } .nav-landing .nav-links a, .nav-landing .nav-links .dd-btn { font-size: 0.8438rem; padding-left: 0.5rem; padding-right: 0.5rem; } }
@media (max-width: 1240px) { .nav-landing:has(.nav-me) .logo-text .lt-abbr { display: none; } }
/* 四大功能的按鈕：一律一行；太長時由 topic.js 自動縮小字級 */
.fn-actions .btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 0.75rem; padding-right: 0.75rem; }

/* 主題頁：一個畫面放得下（進度＋四大功能），不用往下捲 */
.topic-page { padding-top: 0.875rem; padding-bottom: 1rem; }
.topic-page .block { margin-bottom: 0.875rem; }
.topic-page .progress-card { padding: 0.625rem 1.25rem 0.75rem; }
.topic-page .pc-h { margin-bottom: 0.25rem; }
.topic-page .pc-owl { min-height: 2.5rem; }
.topic-page .fn { display: grid; grid-template-columns: 2.75rem 1fr; grid-template-rows: auto auto auto auto 1fr; column-gap: 0.75rem; align-content: stretch; padding: 1rem 1.125rem 1rem; }
.topic-page .fn .ic { grid-row: 1 / 3; width: 2.75rem; height: 2.75rem; border-radius: 0.75rem; margin: 0; align-self: center; }
.topic-page .fn .ic svg { width: 1.5rem; height: 1.5rem; }
.topic-page .fn h3 { grid-column: 2; font-size: 1.0625rem; line-height: 1.2; padding-right: 2rem; align-self: end; }
.topic-page .fn .zh { grid-column: 2; margin: 0 0 0.5rem; font-size: 0.8438rem; }
.topic-page .fn > p:not(.zh), .topic-page .fn .fn-actions { grid-column: 1 / -1; }
.topic-page .fn p { font-size: 0.8438rem; line-height: 1.45; }
.topic-page .fn .pz { font-size: 0.8125rem; margin-bottom: 0.75rem; }
.topic-page .fn .fn-actions { align-self: end; }
.topic-page .fn-n { top: 0.75rem; right: 0.875rem; width: 1.75rem; height: 1.75rem; font-size: 0.875rem; }
/* 主題頁進度卡：再扁一點 */
.topic-page .progress-card { padding: 0.375rem 1.125rem 0.5rem; }
.topic-page .pc-h { margin-bottom: 0; }
.topic-page .pc-h > b { font-size: 0.9375rem; }
.topic-page .pc-owl { min-height: 0; }
.topic-page .pc-owl .owl-live { width: 2.125rem; height: 2.125rem; }
.topic-page .pc-owl .bubble { padding: 0.2rem 0.75rem; font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-page .pc-owl .bubble .zh { display: inline; margin-left: 0.375rem; font-size: 0.75rem; }
.topic-page .progress-card .stepper .b { width: 1.375rem; height: 1.375rem; font-size: 0.6875rem; }
.topic-page .progress-card .stepper li::before { top: 0.6875rem; }
.topic-page .progress-card .stepper .l { margin-top: 0.125rem; font-size: 0.75rem; line-height: 1.2; }
.mt-kinds { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0.25rem 0 0.75rem; }
.mt-kinds button { border: 1.5px solid var(--line); background: #fff; border-radius: 62rem; padding: 0.3rem 0.8rem; cursor: pointer; font: inherit; font-size: 0.8438rem; }
.mt-kinds button.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); font-weight: 700; }
.mt-editf { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 0.75rem; }
.mt-editf textarea, .mg-form textarea { font: inherit; }
/* CAWS Bot：找學習資料 */
.help-tabs { display: flex; border-bottom: 1px solid var(--line); }
.help-tabs button { flex: 1; border: 0; background: #fff; padding: 0.5rem; font: inherit; font-size: 0.8125rem; font-weight: 700; color: var(--ink-soft); cursor: pointer; border-bottom: 2px solid transparent; }
.help-tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
.help-find { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.help-find[hidden], .help-log[hidden], .help-form[hidden] { display: none; }
.hf-res { flex: 1; overflow: auto; padding: 0.5rem 0.75rem; font-size: 0.8125rem; order: 2; }
.hf-form { order: 1; border-bottom: 1px solid var(--line); }
.hf-tip { color: var(--ink-soft); line-height: 1.5; }
.hf-item { border: 1px solid var(--line); border-radius: 0.625rem; padding: 0.5rem 0.625rem; margin-bottom: 0.5rem; }
.hf-item p { margin: 0.25rem 0; white-space: pre-wrap; color: var(--ink); line-height: 1.45; overflow-wrap: anywhere; }
.hf-item a { font-size: 0.75rem; }
.hf-src { font-size: 0.72rem; color: var(--ink-soft); text-align: center; }
.topic-page { padding-bottom: 0; }
.topic-page .block:last-child { margin-bottom: 0; }
/* 寫作助理第二部分：左側討論摘要 */
.side-summary { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 0.75rem; max-height: 55vh; overflow: auto; }
.side-summary h3 { margin: 0 0 0.25rem; font-size: 0.9375rem; }
.ss-list { padding-left: 1.125rem; margin: 0.5rem 0; font-size: 0.8125rem; display: grid; gap: 0.5rem; }
.ss-list ul, .ss-plain { list-style: none; padding-left: 0.5rem; margin: 0.25rem 0 0; font-size: 0.78rem; color: var(--ink-soft); display: grid; gap: 0.2rem; }
.ss-co { color: #b45309; } .ss-re { color: var(--teal); margin-left: 0.5rem; }
.hist-more details summary { list-style: none; cursor: pointer; font-size: 0.8125rem; font-weight: 700; color: var(--primary); padding: 0.375rem 0.625rem; border: 1px dashed var(--line); border-radius: 0.5rem; text-align: center; }
.hist-more details summary::-webkit-details-marker { display: none; }
.hist-more details[open] summary i { display: inline-block; transform: rotate(180deg); }
.hist-more details ul { margin-top: 0.375rem; padding: 0; }
.cc-links .cc-go { font-size: 1rem; padding: 0.75rem 1.25rem; box-shadow: 0 6px 16px rgba(47,91,211,.25); }
/* 下拉選單：每個項目的標題與說明都只占一行 */
.dd-menu:not(.dd-wide) { width: max-content; max-width: calc(100vw - 2rem); }
.dd-menu:not(.dd-wide) .dd-item b, .dd-menu:not(.dd-wide) .dd-item small { white-space: nowrap; }

/* ---------- 閱讀材料（B13） ---------- */
.rd-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.rd-list, .rd-notes { position: sticky; top: 12px; max-height: calc(100vh - 140px); overflow: auto; }
.rd-list h3, .rd-notes h3 { margin: 0 0 8px; font-size: 1rem; }
.rd-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rd-item { width: 100%; text-align: left; display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line, #e3e3e3); border-radius: 10px; background: transparent; cursor: pointer; font: inherit; color: inherit; }
.rd-item.on { border-color: var(--brand, #3b6); background: var(--brand-soft, #eef8f0); }
.rd-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line, #e3e3e3); padding-bottom: 8px; margin-bottom: 10px; }
.rd-head h2 { margin: 0 0 4px; font-size: 1.2rem; }
.rd-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rd-body { line-height: 1.75; max-height: calc(100vh - 230px); overflow: auto; padding-right: 6px; }
.rd-page { border-bottom: 1px dashed var(--line, #ddd); padding: 6px 0 12px; }
.rd-page h4 { margin: 0 0 4px; font-size: .8rem; color: var(--muted, #888); }
.rd-para { position: relative; padding-left: 34px; }
.rd-pn { position: absolute; left: 0; font-size: .72rem; color: var(--muted, #999); user-select: none; }
.rd-orig iframe { width: 100%; height: 70vh; border: 1px solid var(--line, #ddd); border-radius: 8px; }
.rd-orig summary { cursor: pointer; margin-bottom: 8px; }
.rd-grab { position: absolute; z-index: 50; }
.rn-form { display: grid; gap: 6px; margin-bottom: 10px; }
.rn-quote blockquote, .rn-list blockquote { margin: 0 0 4px; padding: 4px 8px; border-left: 3px solid var(--brand, #3b6); background: rgba(0,0,0,.03); font-size: .9rem; }
.rn-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.rn-list li { border: 1px solid var(--line, #e3e3e3); border-radius: 10px; padding: 8px; }
.rn-list p { margin: 4px 0; }
.mt-groups label { margin-right: 8px; white-space: nowrap; }
.read-refs { margin-top: 8px; font-size: .9rem; }
@media (max-width: 1000px) { .rd-layout { grid-template-columns: 1fr; } .rd-list, .rd-notes { position: static; max-height: none; } }
.rd-list, .rd-main, .rd-notes { padding: .875rem 1rem; }
.rn-acts .link-btn { background: none; border: 0; padding: 0; color: var(--brand-ink, #2563eb); cursor: pointer; font: inherit; text-decoration: underline; }
.rd-link { display: inline-block; margin-top: .375rem; }
.help-fab { cursor: grab; touch-action: none; }
.help.dragging .help-fab { cursor: grabbing; box-shadow: 0 10px 28px rgba(0,0,0,.28); transform: scale(1.06); }
.tc-foot { margin-top: 0.75rem; display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem; }
.tc-foot .tc-go { margin-top: 0; }
.tc-withdraw { margin-right: auto; background: #fff4e5; color: #b45309; border: 1.5px solid #f59e0b; font-weight: 700; }
.tc-withdraw:hover { background: #fde7c4; }
.rs-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .875rem; }
.rs-tool { display: grid; gap: .25rem; padding: 1rem 1.125rem; text-decoration: none; color: inherit; }
.rs-tool:hover { box-shadow: var(--shadow-lg); }
.rs-tool small { color: var(--muted); }
/* 教師首頁 */
.tt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 1rem; }
.tt-card { padding: 1.125rem 1.25rem; display: grid; gap: .5rem; }
.tt-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.4; }
.tt-top { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.tt-grade { display: grid; grid-template-columns: 1fr auto; gap: .375rem .75rem; align-items: center; padding: .75rem .875rem; border-radius: .75rem; background: #eef4ff; border: 1.5px solid #c7d7fe; color: inherit; text-decoration: none; }
.tt-grade:hover { background: #e2ecff; }
.tt-grade small { display: block; color: var(--muted); }
.tt-bar { grid-column: 1 / -1; height: .375rem; background: #d6e2ff; border-radius: 99px; overflow: hidden; order: 3; }
.tt-bar i { display: block; height: 100%; background: var(--primary); }
.tt-badge { background: #f59e0b; color: #fff; font-weight: 800; border-radius: 99px; padding: .2rem .625rem; font-size: .8rem; white-space: nowrap; }
.tt-links { display: flex; flex-wrap: wrap; gap: .375rem; }
.tt-boards { margin: 0; }
/* 評分 */
.gr-bar { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; padding: .75rem 1rem; margin-bottom: 1rem; }
.gr-bar .field { min-width: 10rem; }
.gr-bar #grTopic { max-width: 34rem; }
.gr-bar #grCounts { margin-left: auto; align-self: center; }
.gr-layout { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.gr-list { padding: .625rem; max-height: calc(100vh - 220px); overflow: auto; position: sticky; top: 12px; }
.gr-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .375rem; }
.gr-row { width: 100%; text-align: left; display: grid; gap: .125rem; padding: .5rem .625rem; border-radius: .625rem; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; color: inherit; }
.gr-row.on { border-color: var(--primary); background: #eef4ff; }
.gr-st { font-size: .78rem; font-weight: 700; }
.gr-st.todo { color: #b45309; } .gr-st.ok { color: #047857; } .gr-st.ret { color: #7c3aed; } .gr-st.mute { color: var(--muted); }
.gr-main { padding: 1rem 1.25rem; }
.gr-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: .5rem; margin-bottom: .75rem; }
.gr-head h2 { margin: 0; font-size: 1.15rem; }
.gr-nav { display: flex; gap: .375rem; }
.gr-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.25rem; }
.gr-essay { font-family: Georgia, 'Times New Roman', serif; line-height: 1.8; max-height: calc(100vh - 300px); overflow: auto; padding-right: .5rem; }
.gr-form { display: grid; gap: .75rem; align-content: start; }
.gr-form .rubric input[type=number] { width: 4.25rem; }
.gr-form .rubric input:not([type]) { width: 100%; }
.gr-acts { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.gr-ret { color: #7c3aed; border-color: #c4b5fd; }
@media (max-width: 1100px) { .gr-layout, .gr-split { grid-template-columns: 1fr; } .gr-list { position: static; } }
.ad-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .75rem; }
.ad-roles > div { border: 1px solid var(--line); border-radius: .75rem; padding: .75rem .875rem; display: grid; gap: .25rem; }
.ad-roles small { color: var(--muted); line-height: 1.6; }
.gr-form .rubric td.nowrap { white-space: nowrap; }
.gr-form .rubric input { border: 1px solid var(--line); border-radius: .375rem; padding: .25rem .375rem; font: inherit; }
.gr-form .rubric input[type=number] { width: 3.75rem; }
/* 分析模組 */
.an-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.an-head h3 { margin: 0 0 .25rem; }
.an-rules { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.an-tag { display: inline-block; font-size: .72rem; font-weight: 800; border-radius: 99px; padding: .05rem .45rem; }
.an-tag.ok { background: #d1fae5; color: #047857; } .an-tag.draft { background: #fef3c7; color: #b45309; } .an-tag.use { background: #dbeafe; color: #1d4ed8; } .an-tag.ai { background: #ede9fe; color: #6d28d9; }
.an-chip { display: inline-block; border-radius: .5rem; padding: .1rem .45rem; margin: .1rem 0; font-size: .82rem; }
.an-chip.ok { background: #ecfdf5; border: 1px solid #a7f3d0; } .an-chip.pend { background: #fffbeb; border: 1px dashed #f59e0b; }
.an-rule { border: 1px solid var(--line); border-radius: .75rem; padding: .5rem .75rem; margin-top: .5rem; display: grid; gap: .5rem; }
.an-rule summary { cursor: pointer; }
.an-rule textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; width: 100%; }
.an-seg { display: grid; gap: .375rem; }
.mg-tabs { display: flex; gap: .375rem; flex-wrap: wrap; }
.mg-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: .375rem .875rem; font: inherit; cursor: pointer; }
.mg-tabs button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.tr-ai { display: inline-flex; gap: .375rem; align-items: center; }
.tr-el.ai-pend { outline: 2px dashed #8b5cf6; outline-offset: 1px; }
.in-h { margin: .5rem 0 .75rem; font-size: 1.1rem; }
.in-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.in-bars { display: grid; gap: .375rem; margin: .5rem 0; }
.in-bar { display: grid; grid-template-columns: 11rem 1fr 2rem; gap: .5rem; align-items: center; font-size: .85rem; }
.in-bar i { height: .75rem; border-radius: .25rem; display: block; }
.in-bar i.ok { background: #10b981; } .in-bar i.pend { background: repeating-linear-gradient(45deg, #fcd34d, #fcd34d 4px, #fff7d6 4px, #fff7d6 8px); border: 1px dashed #f59e0b; }
.in-ex { margin: .375rem 0; } .in-ex blockquote, .in-pair blockquote { margin: .25rem 0; padding: .375rem .625rem; border-left: 3px solid #10b981; background: #f8fafc; font-size: .88rem; }
.in-ex footer { font-size: .78rem; color: var(--muted); }
.in-pair blockquote.src { border-left-color: #6366f1; }
.rs-tool.rs-main { border: 1.5px solid var(--primary); background: #eef4ff; }
.cd-set { display: grid; gap: .375rem; margin: .5rem 0 .75rem; }
.rs-switch-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.cd-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.cd-pick fieldset { border: 1px solid var(--line); border-radius: .75rem; padding: .5rem .75rem; display: grid; gap: .375rem; }
.cd-opt { display: block; line-height: 1.4; }
/* 各端首頁的功能入口 */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .875rem; margin-bottom: 1.25rem; }
.hub-card { display: grid; gap: .3rem; padding: 1rem 1.125rem; text-decoration: none; color: inherit; border: 1.5px solid transparent; }
.hub-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.hub-card small { color: var(--muted); line-height: 1.55; }
.hub-h { font-size: 1.1rem; margin: .5rem 0 .75rem; }
.hub-h small { font-weight: 400; color: var(--muted); font-size: .85rem; }
.can-do { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .5rem 1.5rem; padding: .875rem 1.125rem; margin-bottom: 1rem; }
.can-do > div > b { display: block; margin-bottom: .2rem; }
.can-do ul { margin: 0; padding-left: 1.1rem; font-size: .88rem; line-height: 1.6; }
.can-do .no { color: var(--muted); }
.rs-det summary { cursor: pointer; font-weight: 700; padding: .375rem 0; } .rs-det[open] summary { margin-bottom: .5rem; }
.man-tabs { margin-bottom: 1rem; }
.man-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tt-card { position: relative; }
.tt-acts { position: absolute; top: .875rem; right: 1rem; display: flex; gap: .625rem; font-size: .82rem; }
.tt-acts .link-btn, .tt-cacts .link-btn { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--primary); }
.link-btn.danger, .btn.danger { color: #b91c1c; }
.tt-cacts { display: flex; gap: .375rem; flex-wrap: wrap; }
.tt-arch { opacity: .7; }
.tt-archived { margin-top: .75rem; } .tt-archived summary { cursor: pointer; font-weight: 700; color: var(--muted); margin-bottom: .5rem; }
.tt-acts a.link-btn { text-decoration: none; }
.help-fab img { pointer-events: none; -webkit-user-drag: none; user-select: none; }
.help-h { cursor: move; touch-action: none; user-select: none; }
.help-h .help-x { cursor: pointer; }
/* 第一次使用導覽 */
.tour { position: fixed; inset: 0; z-index: 200; }
.tour-hole { position: fixed; border-radius: .875rem; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .55); outline: 3px solid #fbbf24; transition: all .25s ease; pointer-events: none; }
.tour-tip { position: fixed; background: #fff; border-radius: 1rem; padding: 1rem 1.125rem .875rem; box-shadow: 0 18px 40px rgba(0,0,0,.25); display: grid; gap: .375rem; transition: left .25s ease, top .25s ease, opacity .2s; }
.tour-tip .tour-n { color: var(--muted); font-weight: 700; }
.tour-tip .tour-t { font-size: 1.05rem; }
.tour-tip .tour-x { margin: 0; line-height: 1.6; color: var(--ink-soft); }
.tour-btns { display: flex; justify-content: space-between; align-items: center; margin-top: .375rem; }
.tour-skip { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; text-decoration: underline; }
.tour-arrow { position: absolute; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); }
.tour-tip[data-side="right"] .tour-arrow { left: -7px; margin-top: -7px; }
.tour-tip[data-side="left"] .tour-arrow { right: -7px; margin-top: -7px; }
.tour-tip[data-side="bottom"] .tour-arrow { top: -7px; margin-left: -7px; }
.tour-tip[data-side="top"] .tour-arrow { bottom: -7px; margin-left: -7px; }
.tour-btns { gap: .5rem; } .tour-btns span { display: flex; gap: .375rem; } .tour-btns button, .tour-skip { white-space: nowrap; }
.tour-tip { box-sizing: border-box; } .tour-tip > * { min-width: 0; } .tour-x { overflow-wrap: anywhere; }
/* 教師首頁：功能分類 */
.t-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem; }
.t-cat { display: grid; align-content: start; gap: .3rem; padding: .875rem 1rem; }
.t-cat b { font-size: 1rem; margin-bottom: .2rem; }
.t-cat a { color: var(--primary); text-decoration: none; font-size: .9rem; }
.t-cat a::before { content: '› '; color: var(--muted); }
.t-cat a:hover { text-decoration: underline; }
/* 教師首頁：五步教學流程（橫向） */
.t-flow { list-style: none; margin: .25rem 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .375rem; counter-reset: none; }
.t-flow li a { position: relative; display: grid; gap: .1rem; justify-items: center; text-align: center; padding: .5rem .25rem .45rem; border-radius: .625rem; border: 1.5px solid var(--line); background: #f8fafc; color: inherit; text-decoration: none; height: 100%; box-sizing: border-box; }
.t-flow li:not(:last-child) a::after { content: ''; position: absolute; right: -.45rem; top: 1.05rem; width: .5rem; height: 2px; background: var(--line); }
.t-flow .tf-n { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800; background: #e2e8f0; color: var(--ink-soft); }
.t-flow b { font-size: .82rem; line-height: 1.25; }
.t-flow small { font-size: .7rem; color: var(--muted); line-height: 1.3; }
.t-flow em { font-style: normal; font-size: .68rem; font-weight: 800; color: #b45309; }
.t-flow li.done a { border-color: #a7f3d0; background: #ecfdf5; }
.t-flow li.done .tf-n { background: #10b981; color: #fff; }
.t-flow li.next a { border-color: #f59e0b; background: #fffbeb; box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }
.t-flow li.next .tf-n { background: #f59e0b; color: #fff; }
.t-flow li.todo a { opacity: .75; }
.t-flow li a:hover { border-color: var(--primary); opacity: 1; }
.tt-boards.flash { background: #fef3c7; border-radius: .5rem; transition: background .3s; }
@media (max-width: 560px) { .t-flow { grid-template-columns: 1fr; } .t-flow li:not(:last-child) a::after { display: none; } }
.tt-grid { grid-template-columns: repeat(auto-fill, minmax(34rem, 1fr)); }
.t-flow b { white-space: nowrap; }
@media (max-width: 640px) { .tt-grid { grid-template-columns: 1fr; } }
/* 首頁：登入後依身分的卡片 */
.need-card.role-card { display: grid; gap: .625rem; align-content: start; }
.role-card h2 { margin: 0; }
.role-card .sub { margin: 0; }
.role-go { justify-self: stretch; text-align: center; margin: .25rem 0; }
.role-sum { margin: .25rem 0; font-size: 1rem; }
.role-sum .hot, .role-list .hot { color: #b45309; }
.role-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.role-list li { border: 1px solid var(--line); border-radius: .625rem; padding: .5rem .75rem; display: grid; gap: .1rem; }
.role-list a { color: inherit; font-weight: 700; text-decoration: none; }
.role-list a span { color: var(--primary); margin-right: .25rem; }
.role-list a:hover { color: var(--primary); }
.role-list small { color: var(--muted); }
.role-quick { display: flex; gap: .5rem; flex-wrap: wrap; }
.role-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.role-three .btn { text-align: center; }
@media (max-width: 1100px) { .nav-landing .nav-links > a.role-lk { font-size: .78rem; padding-left: .4rem; padding-right: .4rem; } }
/* 任務管理 → 成員：每列操作 */
.mg-ops { white-space: nowrap; }
.mg-ops .link-btn { background: none; border: 0; padding: 2px 6px; color: #2c5fd6; cursor: pointer; font: inherit; font-size: .9rem; }
.mg-ops .link-btn:hover { text-decoration: underline; }
.mg-edf { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mg-edf input { padding: 6px 8px; }
/* 學習資料：給哪些小組（勾選框橫排） */
.field .mt-groups { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.field .mt-groups label { display: inline-flex !important; align-items: center; gap: 4px; width: auto !important; margin: 0; font-weight: 500; white-space: nowrap; }
.field .mt-groups input[type=checkbox] { width: auto !important; margin: 0; }
.field .mt-groups small { flex-basis: 100%; }
/* 學生：老師提醒鈴鐺 */
.bell-dd { position: relative; }
.nav-bell { position: relative; background: none; border: 0; font-size: 1.35rem; cursor: pointer; padding: 4px 8px; }
.bell-dd.has .nav-bell { animation: bellShake 1.2s ease 2; }
.bell-n { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5322d; color: #fff; font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.bell-menu { width: min(340px, 90vw); max-height: 60vh; overflow: auto; }
.bell-item p { margin: 4px 0; white-space: pre-wrap; }
.bell-item.unread { background: #fff3f2; border-left: 3px solid #e5322d; }
@keyframes bellShake { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-15deg); } 40% { transform: rotate(13deg); } 60% { transform: rotate(-9deg); } 80% { transform: rotate(6deg); } }

/* Topic-card notifications: each count is an unread message, not a status dot. */
.tc-content{display:block;color:inherit;text-decoration:none}.topic-bell{position:relative;display:grid;place-items:center;min-width:44px;min-height:44px;border:1px solid #e0e6ef;border-radius:50%;background:#f6f8fc;font-size:1.3rem;cursor:pointer;flex-shrink:0}.topic-bell-count{position:absolute;top:-8px;right:-10px;display:grid;place-items:center;min-width:28px;height:28px;padding:0 6px;border-radius:50%;background:#d92d32;color:white;font:700 15px/1 system-ui;box-shadow:0 0 0 3px white}.topic-notice-dialog{width:min(560px,calc(100vw - 32px));max-height:80vh;border:1px solid #dfe5ee;border-radius:16px;padding:0;color:var(--ink);box-shadow:0 20px 80px #14284633}.topic-notice-dialog::backdrop{background:#13243c66}.topic-notice-dialog header{display:flex;gap:1rem;justify-content:space-between;align-items:flex-start;padding:1.25rem;border-bottom:1px solid var(--line)}.topic-notice-dialog h2{font-size:1.1rem;margin:0}.topic-notice-dialog header p{font-size:.8rem;color:var(--muted);margin:.5rem 0 0}.topic-notice-list{padding:.75rem;display:grid;gap:.6rem}.topic-notice-item{display:block;padding:1rem;border:1px solid #e0e6ef;border-radius:10px;color:inherit;text-decoration:none;background:#f8faff}.topic-notice-item:hover{border-color:var(--primary)}.topic-notice-item p{white-space:pre-wrap;overflow-wrap:anywhere;margin:.5rem 0;font-size:.9rem}.topic-notice-item small{display:block;color:var(--muted);font-size:.75rem}.topic-notice-item>span{display:block;color:var(--primary);font-size:.8rem;font-weight:650;margin-top:.7rem}.topic-bell:focus-visible,.topic-notice-item:focus-visible{outline:3px solid var(--primary);outline-offset:3px}
.bell-n{min-width:26px;height:26px;line-height:26px;border-radius:50%;font-size:14px;padding:0 5px}
.ro-reset { margin: .5rem 0; padding: .6rem .8rem; border: 1px solid #b7d7c2; background: #effaf2; border-radius: 10px; }
.ro-reset code { font-size: 1rem; font-weight: 700; }
.ro-school { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .75rem; align-items: end; }
.ro-gtop { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.ro-gtop .field { min-width: 10rem; }
.ro-gtop #gCount { width: 6rem; }
.ro-gsum { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.ro-gpill { border: 1px solid var(--line, #d8dee9); border-radius: 999px; padding: .15rem .7rem; font-size: .9rem; background: #fff; }
.ro-gbtns { display: flex; flex-wrap: wrap; gap: .3rem; }
.ro-gbtn { min-width: 2.4rem; padding: .3rem .6rem; border: 1px solid var(--line, #d8dee9); border-radius: 8px; background: #fff; font-weight: 700; cursor: pointer; }
.ro-gbtn:hover { border-color: var(--primary, #2f5fe0); }
.ro-gbtn.on { background: var(--primary, #2f5fe0); border-color: var(--primary, #2f5fe0); color: #fff; }
.ro-gbtn.none { font-weight: 500; }
.ro-gbtn.none.on { background: #6b7280; border-color: #6b7280; }
td.err, .err { color: var(--danger, #c0392b); }
/* 學生「我的主題」：左邊進行中、右邊已完成，一個畫面看完 */
.home-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.home-cols > .block { margin: 0; min-width: 0; }
.home-cols .topic-grid { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .home-cols { grid-template-columns: minmax(0, 1fr); } .home-cols > .block + .block { margin-top: 1.25rem; } }
/* 小幫手（學生端）：這一頁、回報問題 */
.help-tabs { display: flex; gap: .25rem; padding: .4rem .5rem 0; background: #f6f8fc; border-bottom: 1px solid var(--line); }
.help-tabs button { border: 0; background: none; padding: .45rem .6rem; font-size: .82rem; font-weight: 700; color: var(--ink-soft); border-bottom: 3px solid transparent; position: relative; cursor: pointer; }
.help-tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
.help-view { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; background: #f6f8fc; }
.help-view[hidden] { display: none; }
.help-steps { margin: .6rem .75rem .25rem 1.9rem; padding: 0; font-size: .84rem; line-height: 1.45; }
.help-steps li { margin-bottom: .3rem; }
.help-sub { margin: .5rem .75rem .25rem; font-size: .78rem; font-weight: 700; color: var(--ink-soft); }
.help-qs { display: flex; flex-wrap: wrap; gap: .3rem; padding: 0 .75rem; }
.help-q { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .25rem .65rem; font-size: .8rem; cursor: pointer; text-align: left; }
.help-q:hover { border-color: var(--primary); color: var(--primary); }
.help-guide .help-log { flex: 1 0 auto; background: transparent; }
.help-guide .help-log:empty { display: none; }
.help-more { margin: 0 .75rem .5rem; font-size: .75rem; color: var(--ink-soft); }
.help-rform { display: flex; flex-direction: column; gap: .45rem; padding: .7rem .75rem; font-size: .84rem; }
.help-rform select, .help-rform textarea { width: 100%; border: 1.5px solid var(--line); border-radius: .6rem; padding: .45rem .55rem; font: .86rem var(--sans, inherit); margin-top: .2rem; }
.help-rform button { align-self: flex-start; }
.help-mine { padding: 0 .75rem .75rem; }
.help-rep { background: #fff; border: 1px solid var(--line); border-radius: .6rem; padding: .45rem .6rem; margin-bottom: .4rem; font-size: .8rem; }
.help-rep p { margin: .2rem 0 0; }
.help-rep.resolved { border-color: #b7d7c2; }
.help-reply { background: #effaf2; border-radius: .4rem; padding: .3rem .45rem; }
.help-dot { position: absolute; top: 2px; right: 2px; width: .7rem; height: .7rem; border-radius: 50%; background: #e11d48; border: 2px solid #fff; }
.help-tabs .help-dot { top: .25rem; right: 0; width: .55rem; height: .55rem; }
.help-fab { position: relative; }
/* 教師首頁：學生回報 */
.hi-card h2 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.hi-badge { background: #e11d48; color: #fff; border-radius: 999px; padding: .1rem .6rem; font-size: .85rem; }
.hi-list { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.hi-item { border: 1px solid var(--line); border-left: 4px solid #e11d48; border-radius: .6rem; padding: .55rem .75rem; background: #fff; }
.hi-item.resolved { border-left-color: #16a34a; }
.hi-text { margin: .3rem 0; white-space: pre-wrap; }
.hi-reply { display: flex; gap: .5rem; flex-wrap: wrap; }
.hi-reply input { flex: 1 1 18rem; border: 1.5px solid var(--line); border-radius: .5rem; padding: .35rem .55rem; }
.hi-done { margin: .25rem 0 0; font-size: .85rem; color: #15803d; }
.hl-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .6rem; }
.hl-tiles > div { background: #f6f8fc; border-radius: .7rem; padding: .6rem .8rem; display: flex; flex-direction: column; }
.hl-tiles b { font-size: 1.5rem; }
.hl-tiles span { color: var(--ink-soft); font-size: .85rem; }
.ro-note { background: #eef4ff; border: 1px solid #c9d8fb; border-radius: .6rem; padding: .55rem .8rem; margin: 0; }
/* 教師首頁：新增任務四步驟（班級 → 教學內容 → 討論 → 評量） */
.tn-card { padding: 1rem 1.15rem 1.15rem; }
.tn-h { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.tn-h h2 { margin: 0; font: 800 1.25rem var(--display); }
.tn-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.tn-step { position: relative; display: flex; flex-direction: column; gap: .45rem; padding: .85rem .9rem; border: 1.5px solid var(--line); border-radius: .9rem; background: #fff; min-width: 0; }
.tn-step:not(:last-child)::after { content: '→'; position: absolute; right: -.8rem; top: 1rem; color: #94a3b8; font-weight: 800; }
.tn-step > b { font-size: 1.02rem; }
.tn-n { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; background: #eef2f8; color: var(--ink-soft); }
.tn-step.done { border-color: #b7d7c2; }
.tn-step.done .tn-n { background: #16a34a; color: #fff; }
.tn-step.next { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .15); }
.tn-step.next .tn-n { background: #f59e0b; color: #fff; }
.tn-step.off { opacity: .55; }
.tn-step select { width: 100%; border: 1.5px solid var(--line); border-radius: .6rem; padding: .45rem .55rem; font: inherit; background: #fff; }
.tn-info { margin: 0; font-size: .88rem; color: var(--ink-soft); }
.tn-info .warn { color: #b45309; font-weight: 700; }
.tn-links { display: flex; flex-wrap: wrap; gap: .25rem .75rem; }
.tn-links a { color: var(--primary); text-decoration: none; font-size: .9rem; }
.tn-links a:hover { text-decoration: underline; }
.tn-step .btn { align-self: flex-start; }
@media (max-width: 1000px) { .tn-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tn-step::after { display: none; } }
@media (max-width: 560px) { .tn-steps { grid-template-columns: minmax(0, 1fr); } }
/* 我的班級與任務：班級三項、任務三項 */
.tc-class .block-h h2 small { font: 500 .9rem var(--sans, inherit); color: var(--ink-soft); margin-left: .4rem; }
.tc-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-bottom: .9rem; }
.tt-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.tt-tile { display: grid; grid-template-columns: auto 1fr; gap: .15rem .6rem; align-items: center; padding: .7rem .8rem; border: 1.5px solid var(--line); border-radius: .8rem; background: #fff; color: var(--ink); text-decoration: none; min-width: 0; }
.tt-tile:hover { border-color: var(--primary); background: #f4f7ff; }
.tt-tile .tt-ic { font-size: 1.35rem; grid-row: span 2; }
.tt-tile b { display: block; font-size: .95rem; }
.tt-tile small { display: block; color: var(--ink-soft); font-size: .8rem; line-height: 1.35; }
.tt-tile .tt-badge, .tt-tile .tt-bar { grid-column: 2; justify-self: start; margin-top: .2rem; }
.tt-tile .tt-bar { width: 100%; }
.tt-tile.hot { border-color: #f59e0b; background: #fffbeb; }
.tt-tile.done { border-color: #b7d7c2; }
.tc-acts .tt-tile { background: #f8fafc; }
.tc-acts .tt-tile.hot { background: #fffbeb; }
@media (max-width: 900px) { .tc-acts, .tt-tiles { grid-template-columns: minmax(0, 1fr); } }
.ro-err { margin-top: .75rem; padding: .7rem .9rem; border: 1.5px solid #f3b4b4; background: #fff5f5; border-radius: .7rem; color: #9b1c1c; }
.ro-err p { margin: .25rem 0 0; color: #7f1d1d; }
/* 閱讀關卡、理解測驗 */
.rd-gate { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: .9rem; padding: .8rem 1rem; border-radius: .9rem; border: 1.5px solid #f59e0b; background: #fffbeb; }
.rd-gate span { flex: 1 1 24rem; color: var(--ink-soft); }
.rd-gate.ok { border-color: #86efac; background: #f0fdf4; }
.rd-done-bar { margin: 1rem 0 .5rem; display: flex; justify-content: flex-end; }
.rd-quiz { margin-top: 1rem; padding: 1rem 1.1rem; border-radius: .9rem; background: #f6f8fc; border: 1px solid var(--line); }
.rd-quiz h3 { margin: 0 0 .6rem; }
.rd-quiz-done { margin: 0 0 .6rem; color: #15803d; font-weight: 700; }
.rq-list { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .9rem; }
.rq-q { margin: 0 0 .45rem; font-weight: 700; }
.rq-opts { display: flex; flex-direction: column; gap: .35rem; }
.rq-opt { text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: .6rem; padding: .45rem .65rem; cursor: pointer; font: inherit; }
.rq-opt:hover:not(:disabled) { border-color: var(--primary); }
.rq-opt.picked { border-color: #f59e0b; background: #fffbeb; }
.rq-opt.right { border-color: #16a34a; background: #f0fdf4; }
.rq-opt:disabled { cursor: default; }
.rq-hint { margin: .4rem 0 0; color: #b45309; }
.rq-res { margin: .4rem 0 0; color: var(--ink-soft); }
.rq.ok .rq-res { color: #15803d; }
.rq textarea { width: 100%; border: 1.5px solid var(--line); border-radius: .6rem; padding: .45rem .6rem; font: inherit; margin-bottom: .35rem; }
.rq-mine { margin: 0; color: #15803d; }
/* 參考文章側欄 */
.ref-tab { position: relative; right: auto; top: auto; z-index: 44; display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .6rem .45rem; border: 0; border-radius: .8rem 0 0 .8rem; background: var(--primary); color: #fff; font-weight: 800; cursor: pointer; box-shadow: var(--shadow-lg); writing-mode: vertical-rl; letter-spacing: .1em; }
.ref-tab span { font-size: .9rem; }
.ref-tab.on { background: #1e3a8a; }
.ref-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: min(560px, 94vw); background: #fff; box-shadow: -12px 0 32px rgba(15, 23, 42, .18); display: flex; flex-direction: column; }
.ref-drawer[hidden] { display: none; }
.ref-h { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; background: var(--primary); color: #fff; }
.ref-h small { color: rgba(255,255,255,.85); flex: 1; }
.ref-x { border: 0; background: none; color: #fff; font-size: 1.5rem; cursor: pointer; }
.ref-body { flex: 1; min-height: 0; }
.ref-body iframe { width: 100%; height: 100%; border: 0; }
body.ref-open .ref-tabs { right: min(560px, 94vw); }
/* 側欄裡的閱讀頁：只留文章與筆記 */
.rd-embed .nav, .rd-embed #bannerSlot, .rd-embed .help, .rd-embed .to-top { display: none !important; }
.rd-embed .page { padding: .6rem; max-width: none; margin-top: 0; }
.rd-embed .tour, .rd-embed .tour-tip { display: none !important; }
body.rd-embed { padding-top: 0 !important; }
.rd-embed .rd-layout { display: block; }
.rd-embed .rd-list { margin-bottom: .6rem; }
.rd-embed .rd-list .rd-items { display: flex; flex-wrap: wrap; gap: .3rem; }
.rd-embed .rd-notes { margin-top: .6rem; }
.rd-embed .rd-list, .rd-embed .rd-notes { position: static; max-height: none; }
/* 任務步驟：建立任務 → 設定組別 → 閱讀文件與測驗 → 開放給學生 → 進行與評分 */
.ts-steps { list-style: none; margin: .25rem 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; }
.ts-steps li a { position: relative; display: grid; gap: .1rem; justify-items: center; text-align: center; padding: .55rem .3rem .5rem; border: 1.5px solid var(--line); border-radius: .7rem; background: #fff; color: var(--ink); text-decoration: none; height: 100%; }
.ts-steps li a:hover { border-color: var(--primary); }
.ts-steps b { font-size: .84rem; line-height: 1.25; }
.ts-steps small { font-size: .72rem; color: var(--ink-soft); line-height: 1.3; }
.ts-steps em { font-style: normal; font-size: .7rem; font-weight: 800; color: #b45309; }
.ts-n { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-grid; place-items: center; font-size: .8rem; font-weight: 800; background: #eef2f8; color: var(--ink-soft); }
.ts-steps li.done a { border-color: #a7f3d0; background: #f0fdf4; }
.ts-steps li.done .ts-n, .tn-class.done .ts-n { background: #16a34a; color: #fff; }
.ts-steps li.next a { border-color: #f59e0b; background: #fffbeb; box-shadow: 0 0 0 3px rgba(245, 158, 11, .15); }
.ts-steps li.next .ts-n, .tn-class.next .ts-n, .tn-empty .ts-n { background: #f59e0b; color: #fff; }
.tt-unpub { background: #fef3c7; color: #92400e; border-radius: 99px; padding: .1rem .55rem; font-size: .78rem; font-weight: 700; }
.tn-row { display: grid; grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr); gap: .9rem; align-items: start; }
.tn-class { display: flex; flex-direction: column; gap: .45rem; padding: .8rem .9rem; border: 1.5px solid var(--line); border-radius: .9rem; background: #fff; }
.tn-class.done { border-color: #a7f3d0; }
.tn-class.next { border-color: #f59e0b; }
.tn-class select { width: 100%; border: 1.5px solid var(--line); border-radius: .6rem; padding: .45rem .55rem; font: inherit; background: #fff; }
.tn-class small { color: var(--ink-soft); }
.tn-cur { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .45rem; font-size: .92rem; }
.tn-empty { display: flex; align-items: center; gap: .8rem; padding: .8rem .9rem; border: 1.5px solid #f59e0b; border-radius: .9rem; background: #fffbeb; }
.tn-empty > div { flex: 1; } .tn-empty p { margin: .2rem 0 0; }
@media (max-width: 1000px) { .tn-row { grid-template-columns: 1fr; } .ts-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ts-steps { grid-template-columns: 1fr 1fr; } }
.ro-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .8rem; padding: .7rem .9rem; border-radius: .7rem; background: #f6f8fc; }
/* 出題編輯、開放給學生 */
.qz-edit { margin-top: .8rem; background: #f8fafc; }
.qz-list { padding-left: 1.3rem; display: flex; flex-direction: column; gap: .8rem; }
.qz { display: flex; flex-direction: column; gap: .35rem; }
.qz-row { display: flex; gap: .4rem; align-items: center; }
.qz-row .qz-q { flex: 1; }
.qz input:not([type=radio]), .qz select { border: 1.5px solid var(--line); border-radius: .5rem; padding: .35rem .5rem; font: inherit; background: #fff; }
.qz-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
.qz-opts label { display: flex; align-items: center; gap: .35rem; }
.qz-opts .qz-o { flex: 1; min-width: 0; }
.op-check { list-style: none; padding: 0; margin: .4rem 0 .8rem; display: flex; flex-direction: column; gap: .35rem; }
.op-check li.ok { color: #15803d; } .op-check li.todo { color: #b45309; }
.op-gate { display: block; margin-bottom: .7rem; }
.op-q { padding-left: 1.2rem; }
@media (max-width: 700px) { .qz-opts { grid-template-columns: 1fr; } }

/* 閱讀關卡開關（老師決定學生是否要先閱讀＋測驗） */
.gate-sw { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: .75rem; background: #f8fafc; margin: .6rem 0; }
.gate-sw.on { background: #fffbeb; border-color: #fcd34d; }
.gate-sw-l { font-weight: 700; font-size: .9rem; }
.gate-sw-b { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.gate-sw-b button { border: 0; background: transparent; padding: .35rem .8rem; font: inherit; font-size: .82rem; cursor: pointer; color: var(--ink-soft); }
.gate-sw-b button + button { border-left: 1px solid var(--line); }
.gate-sw-b button[aria-pressed="true"] { background: var(--primary); color: #fff; font-weight: 700; }
.gate-sw-s { flex-basis: 100%; color: var(--ink-soft); font-size: .78rem; }

/* 學校名單匯入：讀完檔案後的確定列 */
.sc-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: .75rem; padding: .75rem 1rem; border: 2px solid var(--primary); border-radius: .75rem; background: #eff4ff; }
.sc-confirm p { margin: 0; flex: 1 1 18rem; }
.sc-confirm small { flex-basis: 100%; }

/* 教師首頁：四個大方框（舊版 CAWS 風格：編號、大圖示、步驟名稱、說明、小任務、按鈕） */
.th-top { display: flex; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.th-owl { width: 4.5rem; height: auto; flex: none; }
.th-say { flex: 1; margin: 0; padding: .85rem 1.1rem; border: 1.5px solid var(--ink); border-radius: 1rem; background: #f6f4f1; font-size: 1.05rem; font-weight: 700; font-style: italic; }
.th-pick { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0 0 1rem; font-weight: 700; }
.th-pick select { margin-left: .4rem; min-width: 16rem; }
.th-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1100px) { .th-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .th-grid { grid-template-columns: 1fr; } .th-pick select { min-width: 0; width: 100%; } }
.th-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1.5px solid var(--ink); border-radius: 1.25rem; padding: 1rem 1rem 1.1rem; }
.th-card.next { border: 3px solid var(--primary); box-shadow: 0 0 0 4px rgba(47, 95, 224, .12); }
.th-n { position: absolute; top: .8rem; left: .8rem; width: 2.2rem; height: 2.2rem; border: 3px solid var(--ink); border-radius: .45rem; display: grid; place-items: center; font-size: 1.25rem; font-weight: 800; }
.th-tag { position: absolute; top: .9rem; right: .9rem; font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; }
.th-tag.ok { background: #dcfce7; color: #166534; }
.th-tag.next { background: #dbeafe; color: #1e40af; }
.th-tag.opt { background: #f1f5f9; color: #475569; }
.th-ic { display: grid; place-items: center; margin: 1.6rem 0 .5rem; }
.th-ic svg { width: 6rem; height: 5rem; fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.th-card h3 { margin: 0; text-align: center; font-size: 1.3rem; font-style: italic; }
.th-en { margin: .1rem 0 .3rem; text-align: center; font-size: .78rem; color: var(--ink-soft); }
.th-d { margin: 0 0 .6rem; text-align: center; font-size: .9rem; color: var(--ink-soft); }
.th-sub { list-style: none; margin: 0 0 .75rem; padding: .6rem 0 0; border-top: 1px solid var(--line); font-size: .86rem; line-height: 1.55; flex: 1; }
.th-sub li { display: flex; gap: .45rem; padding: .12rem 0; }
.th-sub li > span { flex: none; width: 1.1rem; height: 1.1rem; margin-top: .15rem; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 800; border: 1.5px solid #cbd5e1; color: #94a3b8; }
.th-sub li.th-ok > span { background: #16a34a; border-color: #16a34a; color: #fff; }
.th-sub li.th-warn > span { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.th-sub li.th-link { display: block; }
.th-sub li.th-link a { font-weight: 700; }
.th-hot { color: #b45309; }
.th-go { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.th-go .btn { min-width: 6.5rem; justify-content: center; }
.th-mini { margin: .55rem 0 0; text-align: center; font-size: .78rem; color: var(--ink-soft); }
.th-tasks { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; margin: 0 0 .5rem; }
.th-task { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: .2rem .7rem; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.th-task.on { border-color: var(--primary); background: var(--primary); color: #fff; }
.th-open { display: flex; border: 1.5px solid var(--line); border-radius: .6rem; overflow: hidden; margin: 0 0 .35rem; }
.th-open button { flex: 1; border: 0; background: #fff; padding: .35rem .3rem; font: inherit; font-size: .76rem; cursor: pointer; color: var(--ink-soft); }
.th-open button + button { border-left: 1.5px solid var(--line); }
.th-open button.on { background: var(--primary); color: #fff; font-weight: 700; }
.th-state { margin: 0 0 .25rem; font-size: .8rem; text-align: center; color: var(--ink-soft); }
.th-state.ok { color: #166534; font-weight: 700; }
.th-arch { margin: 0; padding-left: 1.2rem; line-height: 1.9; }

.ro-gauto { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; padding: .75rem 1rem; margin: .5rem 0 .75rem; border: 1.5px dashed var(--line); border-radius: .75rem; background: #f8fafc; }
.ro-gauto input { width: 4.5rem; margin: 0 .25rem; }
.th-pick select { padding: .45rem 2rem .45rem .7rem; border: 1.5px solid var(--line); border-radius: .6rem; font: inherit; font-weight: 700; background-color: #fff; }

/* 教師首頁：一頁放得下（較矮的橫幅、較小的圖示） */
body.th-home .page-banner { padding-top: .5rem; padding-bottom: .5rem; }
body.th-home .page-banner h1 { margin: 0; }
body.th-home .page { padding-top: .75rem; padding-bottom: 1rem; }
body.th-home .th-top { margin-bottom: .6rem; gap: .75rem; flex-wrap: wrap; }
body.th-home .th-owl { width: 3rem; }
body.th-home .th-say { padding: .5rem .9rem; font-size: .95rem; }
body.th-home .th-pick { margin: 0; }
body.th-home .th-card { padding: .7rem .8rem .8rem; }
body.th-home .th-n { width: 1.8rem; height: 1.8rem; font-size: 1rem; top: .6rem; left: .6rem; }
body.th-home .th-tag { top: .65rem; right: .65rem; }
body.th-home .th-ic { margin: .25rem 0 .2rem; }
body.th-home .th-ic svg { width: 4rem; height: 3.3rem; stroke-width: 4.5; }
body.th-home .th-card h3 { font-size: 1.12rem; }
body.th-home .th-en { margin: 0; }
body.th-home .th-d { margin: .1rem 0 .35rem; font-size: .82rem; }
body.th-home .th-sub { padding-top: .4rem; margin-bottom: .5rem; font-size: .82rem; line-height: 1.4; }
body.th-home .th-go .btn { padding: .35rem .8rem; min-width: 5.5rem; }
body.th-home .th-tasks { margin-bottom: .3rem; }
body.th-home .th-mini { margin-top: .35rem; }
body.th-home #helpInbox { margin-top: 1rem; }

/* 所有任務頁 */
.tk-pick { margin-bottom: 1rem; }
.tk-list { display: grid; gap: 1rem; }
.tk-card { padding: 1rem 1.25rem; border: 1.5px solid var(--line); }
.tk-card.on { border: 2.5px solid var(--primary); }
.tk-card.tk-arch { opacity: .75; }
.tk-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.tk-code { font-size: 1.05rem; }
.tk-st { font-size: .82rem; color: var(--ink-soft); }
.tk-st.ok { color: #166534; font-weight: 700; }
.tk-st.off { color: #b45309; }
.tk-cur { font-size: .75rem; font-weight: 700; padding: .1rem .55rem; border-radius: 999px; background: #dbeafe; color: #1e40af; }
.tk-q { margin: .5rem 0 .4rem; font-size: 1.15rem; line-height: 1.4; overflow-wrap: anywhere; }
.tk-facts { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: .88rem; color: var(--ink-soft); }
.tk-acts { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }

/* 學生任務頁：任務前準備（閱讀文章）橫條 */
.rd-strip { display: flex; align-items: center; gap: 1rem; padding: .85rem 1.1rem; margin: 0 0 1rem; border-radius: 1rem; border: 2px solid #c7d2fe; background: #eef2ff; }
.rd-strip.must { border-color: #f59e0b; background: #fffbeb; }
.rd-strip.done { border-color: #bbf7d0; background: #f0fdf4; padding: .55rem 1.1rem; }
.rd-strip-ic { font-size: 1.6rem; flex: none; }
.rd-strip.done .rd-strip-ic { width: 1.8rem; height: 1.8rem; border-radius: 50%; background: #16a34a; color: #fff; display: grid; place-items: center; font-size: 1rem; font-weight: 800; }
.rd-strip-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.rd-strip-t b { font-size: 1.02rem; }
.rd-strip-t small { color: var(--ink-soft); font-size: .86rem; }
.rd-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: #cbd5e1; margin-left: .2rem; vertical-align: middle; }
.rd-dot.on { background: #16a34a; }
@media (max-width: 640px) { .rd-strip { flex-wrap: wrap; } .rd-strip .btn { width: 100%; justify-content: center; } }
.ref-tab .ref-n { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; border-radius: 999px; background: #f59e0b; color: #fff; font-size: .72rem; margin-top: .25rem; }

/* 任務總覽：左邊（題目＋課堂進度｜閱讀關卡）、右邊（開放給學生＋學生與分組），各欄往上貼齊，不留空白 */
.ov-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.ov-main, .ov-side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
/* 中間的卡片用「兩欄往下排」：高的卡片旁邊不會留一大片空白；只有一張卡（閱讀回應任務）就用整欄 */
.ov-sub { columns: 2; column-gap: 1rem; }
.ov-sub > .ov-tile { break-inside: avoid; margin: 0 0 1rem; display: block; width: 100%; }
.ov-sub > .ov-tile[hidden] { display: none; }
.ov-sub.ov-sub-one { columns: 1; }
@media (max-width: 1100px) { .ov-grid { grid-template-columns: 1fr; } .ov-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
@media (max-width: 700px) { .ov-sub { columns: 1; } .ov-side { grid-template-columns: 1fr; } }
.ov-tile { padding: 1rem 1.15rem; margin: 0; border: 1.5px solid var(--line); }
.ov-tile h3 { margin: 0 0 .6rem; font-size: 1.05rem; }
.ov-h { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.ov-h h3 { margin: 0; }
.ov-question { margin: .5rem 0 .4rem; font-size: 1.25rem; font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; }
.ov-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; color: var(--ink-soft); font-size: .9rem; }
.ov-facts .ov-wide { flex-basis: 100%; }
.ov-form { margin-top: .9rem; padding-top: .9rem; border-top: 1px dashed var(--line); }
.ov-big { margin: 0 0 .6rem; font-weight: 800; font-size: 1.05rem; color: var(--ink-soft); }
.ov-big.ok { color: #166534; }
.th-open.ov-col { flex-direction: column; }
.th-open.ov-col button + button { border-left: 0; border-top: 1.5px solid var(--line); }
.th-open.ov-col button { padding: .5rem .7rem; text-align: left; font-size: .86rem; }
.ov-phases { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .4rem; }
.ov-ph { width: 100%; display: flex; gap: .6rem; align-items: center; text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: .7rem; padding: .45rem .7rem; font: inherit; cursor: pointer; }
.ov-ph b { display: block; font-size: .9rem; }
.ov-ph small { display: block; font-size: .76rem; color: var(--ink-soft); }
.ov-ph-ic { font-size: 1.3rem; }
.ov-ph.past { opacity: .6; }
.ov-ph.on { border-color: var(--primary); background: #eff4ff; box-shadow: inset 4px 0 0 var(--primary); opacity: 1; }
.ov-auto { display: flex; gap: .45rem; align-items: center; font-size: .85rem; color: var(--ink-soft); }
.ov-rule { width: 100%; border-collapse: collapse; font-size: .78rem; margin: .4rem 0 .5rem; }
.ov-rule th, .ov-rule td { border: 1px solid var(--line); padding: .3rem .4rem; text-align: left; vertical-align: top; }
.ov-rule tr.on td, .ov-rule tr.on th { background: #fffbeb; font-weight: 700; }
.ov-link { margin: .3rem 0 0; font-size: .86rem; }
.ov-tile .gate-sw { margin: 0; }
.rd-ready { margin: -.4rem 0 1rem; padding: .6rem 1rem; border-radius: .75rem; background: #dcfce7; color: #166534; font-weight: 700; text-align: center; }
.fn.fn-go { box-shadow: 0 0 0 4px #22c55e, 0 10px 30px rgba(34, 197, 94, .25); animation: fnGo 1.2s ease-in-out 3; }
@keyframes fnGo { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .fn.fn-go { animation: none; } }

/* 大一點的勾選框：框在最左邊，說明一行 */
.chk-field { display: flex; flex-direction: column; gap: .4rem; }
.chk-title { font-weight: 700; font-size: .8438rem; }
.chk-line { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border: 1.5px solid var(--line); border-radius: .75rem; background: #fff; cursor: pointer; font-weight: 600; }
.chk-line:hover { border-color: var(--primary); }
.chk-line input[type="checkbox"] { width: 1.5rem; height: 1.5rem; flex: none; margin: 0; accent-color: var(--primary); cursor: pointer; }
.chk-line > span { white-space: nowrap; overflow-wrap: anywhere; }
@media (max-width: 900px) { .chk-line > span { white-space: normal; } }

/* 加入閱讀文章：兩個方框（1 來源｜2 設定），選填收起來 */
.mt-import h3 { margin-bottom: .75rem; }
.mt-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; align-items: stretch; }
@media (max-width: 900px) { .mt-grid { grid-template-columns: 1fr; } }
.mt-box { border: 2px solid var(--line); border-radius: 1rem; padding: .9rem 1rem 1rem; background: #fbfcfe; display: flex; flex-direction: column; gap: .7rem; }
.mt-box .field { margin: 0; }
.mt-step { margin: 0; display: flex; align-items: center; gap: .5rem; font-weight: 800; }
.mt-step span { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .85rem; }
.mt-import .mt-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0; }
.mt-import .mt-kinds button { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .55rem .4rem; border: 2px solid var(--line); border-radius: .8rem; background: #fff; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; }
.mt-import .mt-kinds button b { font-size: 1.35rem; }
.mt-import .mt-kinds button.on { border-color: var(--primary); background: #eff4ff; color: var(--primary); }
.mt-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; min-height: 8rem; padding: 1rem; border: 2.5px dashed #94a3b8; border-radius: .9rem; background: #fff; text-align: center; cursor: pointer; }
.mt-drop:hover, .mt-drop.over { border-color: var(--primary); background: #eff4ff; }
.mt-drop.has { border-style: solid; border-color: #16a34a; background: #f0fdf4; }
.mt-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mt-drop-ic { font-size: 1.6rem; }
.mt-drop small { color: var(--ink-soft); }
.mt-seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: .6rem; overflow: hidden; background: #fff; }
.mt-seg label { cursor: pointer; }
.mt-seg input { position: absolute; opacity: 0; pointer-events: none; }
.mt-seg span { display: block; padding: .4rem 1.1rem; font-weight: 700; }
.mt-seg label + label span { border-left: 1.5px solid var(--line); }
.mt-seg input:checked + span { background: var(--primary); color: #fff; }
.mt-seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: -3px; }
.mt-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.mt-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-size: .85rem; font-weight: 600; cursor: pointer; }
.mt-chip:has(input:checked) { border-color: var(--primary); background: #eff4ff; color: var(--primary); }
.mt-more { margin: .9rem 0 0; border: 1.5px dashed var(--line); border-radius: .8rem; padding: .55rem .9rem; }
.mt-more summary { cursor: pointer; font-weight: 700; color: var(--ink-soft); }
.mt-more .mg-form { margin-top: .7rem; }
.mt-submit { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: 1rem; }
.mt-chip { white-space: nowrap; }
.field .mt-chip input[type="checkbox"] { width: 1.05rem; height: 1.05rem; padding: 0; margin: 0; border: 0; box-shadow: none; accent-color: var(--primary); flex: none; }

/* 🖍 螢光筆 */
mark.rd-hl, .rn-hls mark { background: #fde68a; color: inherit; border-radius: .2rem; padding: 0 .05rem; cursor: pointer; }
mark.rd-hl:hover { background: #fcd34d; }
.rd-hlbtn { border: 1.5px solid var(--line); background: #fff; }
.rd-hlbtn.on { background: #fde68a; border-color: #f59e0b; color: #78350f; font-weight: 800; }
.rd-grab { position: absolute; z-index: 60; display: flex; gap: .25rem; padding: .3rem; border-radius: .7rem; background: #1e293b; box-shadow: 0 8px 24px rgba(15, 23, 42, .25); }
.rd-grab[hidden] { display: none; }
.rd-grab button { border: 0; border-radius: .5rem; padding: .4rem .7rem; background: transparent; color: #fff; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.rd-grab button:hover { background: rgba(255, 255, 255, .15); }
.rd-grab button[data-a="hl"] { background: #fde68a; color: #78350f; }
.rn-hls { margin: .6rem 0; border: 1.5px solid #fcd34d; border-radius: .7rem; padding: .4rem .7rem; background: #fffbeb; }
.rn-hls summary { cursor: pointer; font-weight: 700; }
.rn-hls ul { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .45rem; }
.rn-hls li { font-size: .88rem; line-height: 1.5; }
.rn-edit { margin: .35rem 0; display: grid; gap: .35rem; }
.rn-edit[hidden] { display: none; }
.rn-edit textarea { width: 100%; border: 1.5px solid var(--line); border-radius: .5rem; padding: .4rem .5rem; font: inherit; font-size: .88rem; }
.rn-edit .btn { justify-self: start; }
.rn-list li.rn-new { animation: rnNew 1.6s ease-out; }
@keyframes rnNew { from { background: #fef3c7; } to { background: transparent; } }
.rn-mine { margin: .3rem 0; }

/* 右側的兩個標籤（📖 參考文章、📝 我的筆記）與側欄裡的「我的筆記」 */
.ref-tabs { position: fixed; right: 0; top: 34%; z-index: 44; display: flex; flex-direction: column; gap: .4rem; }
.ref-tab-n { background: #f59e0b; }
.ref-tab-n.on { background: #b45309; }
.ref-sw { display: inline-flex; background: rgba(255, 255, 255, .15); border-radius: .6rem; padding: .15rem; }
.ref-sw button { border: 0; background: transparent; color: #fff; font: inherit; font-weight: 700; font-size: .88rem; padding: .3rem .7rem; border-radius: .45rem; cursor: pointer; }
.ref-sw button.on { background: #fff; color: var(--primary); }
.ref-read, .ref-notes { height: 100%; }
.ref-read[hidden], .ref-notes[hidden] { display: none; }
.ref-notes { overflow: auto; padding: .8rem 1rem 1.2rem; }
.ref-mt { margin: 0 0 1rem; }
.ref-mt h4 { margin: 0 0 .4rem; font-size: 1rem; }
.ref-lbl { margin: .5rem 0 .3rem; font-weight: 700; font-size: .85rem; color: var(--ink-soft); }
.ref-notes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.ref-notes li { border: 1px solid var(--line); border-radius: .6rem; padding: .5rem .65rem; font-size: .9rem; line-height: 1.5; background: #fff; }
.ref-notes li blockquote { margin: 0 0 .3rem; padding-left: .6rem; border-left: 3px solid #22c55e; color: var(--ink); }
.ref-notes li mark { background: #fde68a; border-radius: .2rem; }
.ref-notes li p { margin: .2rem 0; }
.ref-meta { display: flex; justify-content: space-between; align-items: center; margin-top: .2rem; }
.ref-empty { text-align: center; color: var(--ink-soft); margin: 2rem 0; line-height: 1.8; }
.ref-tip { margin-top: .8rem; }

/* 名單管理：新增學生、每位學生修改／移出 */
.ro-add { margin: .5rem 0 .8rem; border: 1.5px dashed var(--line); border-radius: .8rem; padding: .5rem .9rem; background: #fbfcfe; }
.ro-add summary { cursor: pointer; font-weight: 800; color: var(--primary); }
.ro-add-f { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; margin: .6rem 0 .3rem; }
.ro-add-f .field { margin: 0; min-width: 10rem; }
.ro-acts { white-space: nowrap; }
.ro-seatc { white-space: nowrap; }
.ro-seat { width: 3.6rem; padding: .25rem .35rem; border: 1.5px solid var(--line); border-radius: .4rem; font: inherit; font-weight: 700; }

/* 🌐 參考網站（只放連結）：老師加入表單、學生閱讀頁／參考抽屜 */
.mt-lkgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; align-items: start; }
.mt-lkgrid .mt-lkwide { grid-column: 1 / -1; }
.mt-lkgrid textarea { width: 100%; }
@media (max-width: 760px) { .mt-lkgrid { grid-template-columns: 1fr; } }
.rd-sec { margin: 14px 0 6px; font-size: .92rem; color: var(--ink-2, #445); }
.rd-sec small { display: block; font-weight: 400; color: var(--muted, #778); }
.rd-item.rd-link { border-style: dashed; }
.rd-site { border: 1px solid var(--line, #e3e3e3); border-radius: 14px; padding: 18px 20px; background: #f7f9ff; display: grid; gap: 10px; }
.rd-site p { margin: 0; line-height: 1.6; }
.rd-site .rd-url { font-size: .85rem; color: var(--muted, #778); word-break: break-all; }
.rd-site .btn { justify-self: start; }
.ref-sites { padding: 12px; display: grid; gap: 10px; overflow: auto; }
.ref-site { border: 1px solid var(--line, #e3e3e3); border-radius: 12px; padding: 10px 12px; background: #fff; display: grid; gap: 6px; }
.ref-site b { font-size: .95rem; }
.ref-site p { margin: 0; font-size: .86rem; line-height: 1.5; color: var(--ink-2, #445); }
.ref-site a { justify-self: start; }
.rd-gate-sites { margin-left: auto; white-space: nowrap; font-weight: 600; }
.ref-sites[hidden] { display: none; }
.ref-sites { height: 100%; align-content: start; }
.rd-item.rd-link small { display: block; }
/* 🔤 英中翻譯 */
.rd-trbtn.on { background: #e0ecff; border-color: #4f6fd1; color: #2a47a8; }
.rd-trtip { position: absolute; z-index: 9000; max-width: 320px; padding: 8px 12px; border-radius: 10px; background: #1f2a44; color: #fff; font-size: .9rem; line-height: 1.45; box-shadow: 0 6px 20px rgba(0,0,0,.25); pointer-events: none; }
.rd-trtip b { font-size: 1rem; }
.rd-trtip small { color: #b9c6e8; }
.rd-trtip span { display: block; margin-top: 3px; }
.rd-trtip[hidden] { display: none; }
/* 任務流程小視窗（貓頭鷹指揮家）：一次顯示完整，不用捲動；依螢幕大小自動縮放（--phs 由 app.js 微調） */
.ph-dlg { --phs: 1; border: none; border-radius: 22px; padding: 0; width: min(960px, 96vw); max-height: 96vh; max-height: 96dvh; overflow: hidden; box-shadow: 0 24px 60px rgba(20,30,60,.35); font-size: calc(clamp(12px, 1.9vh, 16px) * var(--phs)); }
.ph-dlg[open] { display: grid; grid-template-columns: minmax(150px, 24%) 1fr; }
.ph-dlg::backdrop { background: rgba(20,28,48,.55); }
.ph-side { background: linear-gradient(180deg,#eef3ff,#dfe8ff); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.2em .8em; }
.ph-owl { width: 100%; max-width: min(210px, 30vh); height: auto; }
.ph-say { margin: .4em 0 0; text-align: center; font-weight: 700; color: #34508f; line-height: 1.45; }
.ph-main { padding: 1.4em 1.6em 1.2em; display: flex; flex-direction: column; min-width: 0; }
.ph-main h2 { margin: 0 0 .35em; font-size: 1.45em; }
.ph-q { margin: 0 0 .7em; padding: .45em .75em; border-left: 4px solid #4f6fd1; background: #f5f8ff; border-radius: 6px; font-weight: 600; color: #1f2a44; }
.ph-lead { margin: 0 0 .55em; color: #3d4a5c; }
.ph-steps { list-style: none; margin: 0 0 .7em; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .5em; }
.ph-steps li { display: flex; gap: .6em; align-items: center; padding: .55em .7em; border-radius: 12px; background: #fff; border: 1px solid #e3e6ee; min-width: 0; }
.ph-n { flex: none; width: 1.65em; height: 1.65em; border-radius: 50%; background: #4f6fd1; color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .9em; }
.ph-ic { font-size: 1.3em; flex: none; }
.ph-steps b { display: block; }
.ph-steps small { color: #5b6378; line-height: 1.4; display: block; font-size: .85em; }
.ph-tip { margin: 0 0 .8em; font-size: .88em; color: #6a5520; background: #fffbea; border: 1px solid #f2d27a; padding: .5em .8em; border-radius: 10px; line-height: 1.5; }
.ph-acts { display: flex; justify-content: flex-end; margin-top: auto; }
.ph-acts .btn { font-size: 1.05em; padding: .6em 1.5em; }
.ph-arm { transform-origin: 166px 128px; animation: ph-conduct 1.6s ease-in-out infinite; }
.ph-notes { animation: ph-float 2.4s ease-in-out infinite; }
@keyframes ph-conduct { 0%,100% { transform: rotate(0deg); } 30% { transform: rotate(-14deg); } 60% { transform: rotate(8deg); } }
@keyframes ph-float { 0%,100% { transform: translateY(0); opacity: .9; } 50% { transform: translateY(-6px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ph-arm, .ph-notes { animation: none; } }
@media (max-width: 760px) { .ph-steps { grid-template-columns: 1fr; } }
@media (max-width: 600px), (max-height: 420px) and (orientation: landscape) {
  .ph-dlg[open] { grid-template-columns: 1fr; }
  .ph-side { flex-direction: row; gap: .6em; padding: .6em 1em; }
  .ph-owl { width: auto; height: min(90px, 14vh); max-width: none; }
  .ph-say br { display: none; }
}
@media (max-height: 420px) and (orientation: landscape) { .ph-dlg[open] { grid-template-columns: minmax(110px, 18%) 1fr; } .ph-side { flex-direction: column; } .ph-steps { grid-template-columns: 1fr 1fr; } }
/* 上方收合（AI 機器人、寫作區）：選單和標題列收起來，對話區變大；按「▾」拉下來 */
.top-pull { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 1100; border: 1px solid #c9d3ea; border-top: 0; border-radius: 0 0 12px 12px; background: #fff; color: #2a47a8; font-weight: 700; font-size: .85rem; padding: .25rem 1rem .35rem; box-shadow: 0 4px 12px rgba(20,30,60,.12); cursor: pointer; }
body:not(.top-min) .top-pull { top: 5.75rem; }
body.top-min { padding-top: 1.9rem !important; }
body.top-min .nav-fixed { transform: translateY(-110%); transition: transform .22s ease; }
body.top-min.top-open .nav-fixed { transform: none; }
body.top-min #bannerSlot { display: none; }
body.top-min.top-open #bannerSlot { display: block; position: fixed; left: 0; right: 0; top: var(--navh, 5.75rem); z-index: 1050; box-shadow: 0 10px 24px rgba(20,30,60,.25); }
body.top-min.top-open .top-pull { top: calc(var(--navh, 5.75rem) + var(--bannerh, 0px)); }
body.top-min .chat-main { height: calc(100vh - 7.5rem); height: calc(100dvh - 7.5rem); min-height: 20rem; }
@media (max-width: 560px) { body:not(.top-min) .top-pull { top: 4.375rem; } }
/* 寫作助理：大綱表單（一步一張） */
.cc.of { display: grid; gap: .6rem; }
.of-stance { display: flex; flex-wrap: wrap; gap: .4rem; }
.of-stance label { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem; border: 1px solid #c9d3ea; border-radius: 999px; cursor: pointer; background: #fff; font-weight: 600; }
.of-stance input:checked + span { color: #2a47a8; }
.of-stance label:has(input:checked) { background: #e8eeff; border-color: #4f6fd1; }
.of-f { display: grid; gap: .3rem; }
.of-l { font-weight: 700; } .of-l small { font-weight: 400; color: #5b6378; }
.of-f textarea { width: 100%; box-sizing: border-box; border: 1px solid #c9d3ea; border-radius: 10px; padding: .5rem .65rem; font: inherit; resize: vertical; }
.of-ideas { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; } .of-ideas small { width: 100%; color: #6a5520; }
.of-idea { border: 1px dashed #e0b84a; background: #fffbea; border-radius: 8px; padding: .2rem .55rem; font-size: .85rem; cursor: pointer; text-align: left; }
.of-idea:hover { background: #fff3c4; }
.of-go { display: flex; align-items: center; gap: .6rem; } .of-err { color: #b03a2e; font-size: .85rem; }
.of-idea.on { background: #e8eeff; border: 1px solid #4f6fd1; color: #2a47a8; }
.of-idea.on::before { content: "✓ "; }
.cc.starters { display: grid; gap: .5rem; }
.st-tip { margin: 0; padding: .45rem .7rem; background: #f5f8ff; border-radius: 8px; font-size: .9rem; } .st-tip small { display: block; color: #5b6378; }
.st-list { display: grid; gap: .4rem; }
.st-item { text-align: left; border: 1px dashed #4f6fd1; background: #fff; border-radius: 10px; padding: .45rem .7rem; cursor: pointer; font: inherit; }
.st-item:hover { background: #eef3ff; } .st-item b { display: block; font-weight: 600; } .st-item small { color: #5b6378; }
.card-en { display: block; font-style: normal; font-size: .78em; font-weight: 600; color: #6b7390; letter-spacing: .01em; }
/* 右側參考資料標籤：窄、只有文字、可收起；頁面右邊留出位置，不擋內容和捲軸（115.11.6 測試回饋） */
.ref-tabs { top: 30%; gap: .3rem; align-items: flex-end; transition: transform .2s ease; }
.ref-tab { width: 1.75rem; padding: .55rem 0; font-size: .8rem; font-weight: 700; letter-spacing: .12em; border-radius: .55rem 0 0 .55rem; box-shadow: 0 2px 8px rgba(15,23,42,.18); line-height: 1.75rem; gap: 0; }
.ref-tab-s { background: #0f766e; }
.ref-tab-s.on { background: #134e4a; }
.ref-fold { width: 1.75rem; height: 1.6rem; border: 1px solid #c9d3ea; border-right: 0; border-radius: .55rem 0 0 .55rem; background: #fff; color: #2a47a8; font-weight: 800; font-size: 1rem; cursor: pointer; padding: 0; box-shadow: 0 2px 6px rgba(15,23,42,.12); }
body.has-ref { padding-right: 1.85rem; }
body.has-ref.ref-folded { padding-right: 0; }
body.ref-folded .ref-tabs { transform: translateX(1.75rem); }
body.ref-folded .ref-fold { transform: translateX(-1.75rem); width: 1.1rem; }
body.ref-open .ref-tabs { transform: none; }
body.ref-open .ref-fold { display: none; }
body.has-ref .help { right: 2.5rem; }
.ref-meta > span { display: inline-flex; gap: .5rem; align-items: center; }
.ref-use { font-weight: 700; }
/* 寫作區檢視設定：字體大小、行距（115.11.6 測試回饋 14） */
.ed-view { display: inline-flex; gap: .25rem; margin-left: auto; }
.ed-view button { border: 1px solid var(--line); background: #fff; border-radius: .45rem; padding: .15rem .5rem; font: inherit; font-size: .8rem; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.ed-view button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.ed-view button:disabled { opacity: .4; cursor: default; }
.an-pos { color: #15803d; }
.an-neg { color: #b91c1c; }

/* 研究者端 AI 設定：模型說明與申請金鑰視窗 */
.ai-model-desc{margin:-.25rem 0 .9rem;padding:.75rem .9rem;border-left:4px solid var(--primary);border-radius:8px;background:#f4f7fd;line-height:1.6}
.ai-key-guide-link{border:0;background:none;padding:0;color:var(--primary);font:inherit;text-decoration:underline;cursor:pointer}
.ai-key-dialog{position:relative;width:min(560px,calc(100vw - 32px));max-height:85vh;border:1px solid #dfe5ee;border-radius:16px;padding:1.25rem 1.25rem 1rem;color:var(--ink);box-shadow:0 20px 80px #14284633}
.ai-key-dialog::backdrop{background:#13243c66}
.ai-key-dialog h2{font-size:1.15rem;margin:0 2rem .5rem 0}
.ai-key-dialog ol{padding-left:1.3rem;line-height:1.7}
.ai-key-dialog-note{padding:.6rem .75rem;border-radius:8px;background:#fff7e8;color:#6b4a12}
.ai-key-dialog-note:empty{display:none}
.ai-key-dialog-actions{display:flex;flex-wrap:wrap;gap:.6rem;justify-content:flex-end;margin-top:1rem}
.ai-key-dialog-actions .btn{text-decoration:none}
.ai-key-dialog-close{position:absolute;top:.75rem;right:.75rem;min-width:44px;min-height:44px;border:0;background:none;font-size:1.1rem;cursor:pointer;color:var(--muted)}

/* 匯出頁的任務清單：題目在勾選框右邊正常換行，窄螢幕不會擠成一條窄欄 */
.cd-coders label.ex-topic{display:flex;align-items:flex-start;gap:.4rem;flex:1 1 100%;margin-right:0;line-height:1.5}
.cd-coders label.ex-topic input{margin-top:.3rem;flex:none}

/* 寫作頁的 A−／A+／行距按鈕：不換行，空間不夠時整組換到下一行 */
.ed-view{flex:none;flex-wrap:nowrap}.ed-view button{white-space:nowrap;min-height:2rem}

/* 研究者端：AI 用量與費用 */
.aiu-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:.5rem 1rem}
.aiu-head h2{margin:0}
.aiu-controls{display:flex;flex-wrap:wrap;align-items:flex-end;gap:.5rem}
.aiu-controls .field{margin:0;min-width:9rem}
.aiu-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr));gap:.75rem;margin:.75rem 0}
.aiu-tile{border:1px solid #dfe5ee;border-radius:12px;padding:.85rem 1rem;background:#fbfcfe;display:flex;flex-direction:column;gap:.1rem}
.aiu-tile strong{font-size:1.6rem;line-height:1.2}
.aiu-tile ul{list-style:none;margin:.4rem 0 0;padding:0;font-size:.9rem;line-height:1.6}
.aiu-label{font-weight:700;color:var(--muted)}
.aiu-warn{padding:.65rem .85rem;border-radius:8px;background:#fff7e8;color:#6b4a12;line-height:1.6}
.aiu-bad{color:#b42318;font-weight:600}
.aiu-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;margin-bottom:1rem}
.aiu-table{width:100%;border-collapse:collapse;font-size:.92rem}
.aiu-table th,.aiu-table td{padding:.5rem .6rem;border-bottom:1px solid #e8edf4;text-align:left;vertical-align:top;white-space:nowrap}
.aiu-table th{font-size:.82rem;color:var(--muted);font-weight:700}
.aiu-table td.num,.aiu-table th:not(:first-child){text-align:right}
.aiu-table td:first-child{white-space:normal;min-width:10rem}
.aiu-table code{font-size:.85em}
.aiu-prices{margin-top:.5rem}
.aiu-prices summary{cursor:pointer;font-weight:700;padding:.4rem 0}
.aiu-price-form{display:flex;flex-wrap:wrap;align-items:flex-end;gap:.5rem .75rem;margin:.5rem 0}
.aiu-price-form .field{margin:0;flex:1 1 10rem}
.aiu-price-form .actions{display:flex;flex-wrap:wrap;gap:.5rem}

.ai-help-toggle{display:flex;gap:.6rem;align-items:flex-start;margin:.9rem 0 .2rem;padding:.7rem .85rem;border:1px solid #dfe5ee;border-radius:10px;cursor:pointer}
.ai-help-toggle input{width:1.15rem;height:1.15rem;margin-top:.2rem;flex:none}
.ai-help-toggle span{display:flex;flex-direction:column;gap:.15rem}

/* AI 機器人只剩兩個（第一年）：方框變大、字變大 */
.bot-cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; max-width: 62rem; margin-inline: auto; }
.bot-cards.two .bot-card { padding: 2rem 1.9rem 1.7rem; border-top-width: 0.45rem; min-height: 19rem; }
.bot-cards.two .bc-n { width: 2.9rem; height: 2.9rem; font-size: 1.35rem; border-radius: 0.8rem; margin-bottom: 0.9rem; }
.bot-cards.two .bot-card h3 { font-size: 1.75rem; }
.bot-cards.two .bot-card .zh { font-size: 1.3rem; margin-bottom: 0.8rem; }
.bot-cards.two .bot-card p { font-size: 1.06rem; line-height: 1.6; }
.bot-cards.two .bot-card .pz { font-size: 1.02rem; }
.bot-cards.two .bc-go { font-size: 1.08rem; padding: 0.8rem 1.2rem; }
@media (max-width: 700px) { .bot-cards.two { grid-template-columns: minmax(0, 1fr); } .bot-cards.two .bot-card { min-height: 0; } }
.bc-lock { margin: 0.2rem 0 0.9rem !important; padding: 0.55rem 0.75rem; border-radius: 8px; background: #fff7e8; color: #6b4a12; font-weight: 600; }

/* 小組討論分析 */
.ga { margin-bottom: 1.25rem; }
.ga-card { padding: 1.4rem 1.5rem; border-top: 0.35rem solid var(--c); }
.ga-h { display: flex; gap: 0.9rem; align-items: flex-start; }
.ga-h .owl-img { width: 3.2rem; height: 3.2rem; flex: none; }
.ga-h h2 { margin: 0 0 0.2rem; font-size: 1.45rem; }
.ga-h h2 small { font-size: 0.95rem; color: var(--ink-soft); font-weight: 600; }
.ga-h p { margin: 0; line-height: 1.6; }
.ga h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.ga-req { margin-top: 1rem; padding: 0.9rem 1rem; border-radius: 12px; background: #f6f8fc; border: 1px solid #e3e8f1; }
.ga-req.ok { background: #f1faf4; border-color: #cfe9d8; }
.ga-req ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 0.4rem 1rem; }
.ga-req li { display: flex; gap: 0.5rem; align-items: baseline; padding: 0.35rem 0.5rem; border-radius: 8px; background: #fff; }
.ga-req li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ga-req li em { font-style: normal; font-size: 0.88rem; white-space: nowrap; }
.ga-req li.ok em { color: #1d7a45; } .ga-req li.no em { color: #b42318; font-weight: 700; }
.ga-req li.me { outline: 2px solid var(--cs); }
.ga-wait { margin: 0.6rem 0 0; color: #6b4a12; }
.ga-action { margin: 1rem 0 0.4rem; }
.ga-run { font-size: 1.05rem; padding: 0.75rem 1.3rem; }
.ga-err { color: #b42318; font-weight: 600; margin: 0.5rem 0 0; }
.ga-gate { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.2rem; justify-content: space-between; margin-top: 1rem; padding: 1.1rem 1.3rem; border-radius: 14px; border: 3px solid #f59e0b; background: #fff7e8; color: #7c2d12; }
.ga-gate.pass { border-color: #16a34a; background: #dcfce7; color: #14532d; }
.ga-gate.fail { border-color: #dc2626; background: #fef2f2; color: #7f1d1d; }
.ga-gate-mark { font-size: 2.6rem; line-height: 1; flex: 0 0 auto; }
.ga-gate-text { flex: 1 1 18rem; display: flex; flex-direction: column; gap: 0.2rem; line-height: 1.45; }
.ga-gate-text strong { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); font-weight: 800; letter-spacing: 0.01em; }
.ga-gate.pass .ga-gate-text strong { color: #15803d; }
.ga-gate.fail .ga-gate-text strong { color: #b91c1c; }
.ga-gate-text span { font-size: 1.08rem; font-weight: 600; }
.ga-gate-text em { font-style: normal; font-size: 0.92rem; opacity: 0.8; }
.ga-gate .btn { font-size: 1.1rem; padding: 0.75rem 1.3rem; }
.ga-result { margin-top: 0.8rem; border-top: 1px solid #e8edf4; padding-top: 0.8rem; }
.ga-checks { list-style: none; padding: 0; margin: 0.4rem 0 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 0.6rem; }
.ga-checks li { display: grid; grid-template-columns: 2rem 1fr; column-gap: 0.4rem; padding: 0.7rem 0.8rem; border-radius: 10px; border: 1px solid #e3e8f1; }
.ga-checks li span { grid-row: span 2; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; font-weight: 800; }
.ga-checks li.ok span { background: #d9f2e3; color: #1d7a45; } .ga-checks li.no span { background: #fde3e1; color: #b42318; }
.ga-checks li small { color: var(--ink-soft); }
.ga-missing { padding: 0.8rem 1rem; border-radius: 10px; background: #fff7e8; margin-bottom: 1rem; }
.ga-missing ul { margin: 0; padding-left: 1.2rem; line-height: 1.6; }
.ga-missing small, .ga-ov small { display: block; color: var(--ink-soft); }
.ga-ov { line-height: 1.6; }
.ga-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0.6rem 0; }
@media (max-width: 760px) { .ga-sides { grid-template-columns: minmax(0, 1fr); } }
.ga-sides ol { margin: 0; padding-left: 1.2rem; }
.ga-sides li { margin-bottom: 0.7rem; line-height: 1.5; }
.ga-sides li span, .ga-sides li small { display: block; font-size: 0.92rem; }
.ga-miss { color: #b42318; font-size: 0.92rem; }
.ga-src { font-size: 0.85rem; }
.ga-reb ul { margin: 0; padding-left: 1.2rem; line-height: 1.6; }
.ga-lock { padding: 1.2rem; border-radius: 12px; background: #fff7e8; color: #6b4a12; line-height: 1.6; }
.ga-lock .btn { margin-top: 0.4rem; }
.of-src select { width: 100%; min-height: 2.6rem; padding: 0.4rem 0.6rem; border-radius: 8px; border: 1px solid #cdd5e1; font: inherit; background: #fff; }

.ov-gate-form label { display: block; line-height: 2.2; }
.ov-gate-form input[type=number] { width: 4.2rem; min-height: 2.2rem; text-align: center; font-weight: 700; border: 1px solid #cdd5e1; border-radius: 8px; }

.mo-gatebox { margin: 0.2rem 0 0.8rem; padding: 0.6rem 0.75rem; border-radius: 10px; background: #f6f8fc; border: 1px solid #e3e8f1; }
.mo-gatebox p { margin: 0.3rem 0; }
.mo-gate { display: block; } .mo-gate.ok { color: #1d7a45; }
.mo-cks { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; }
.mo-ck { font-size: 0.85rem; padding: 0.1rem 0.45rem; border-radius: 999px; } .mo-ck.ok { background: #d9f2e3; color: #1d7a45; } .mo-ck.no { background: #fde3e1; color: #b42318; }

/* 討論分析：四項說明 */
.ga-four{margin:.2rem 0 1rem;padding:.75rem 1rem .75rem 2.2rem;background:#f5f7fb;border:1px solid #e2e7f0;border-radius:12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.35rem 1.5rem;font-size:1rem;line-height:1.5}
.ga-four li small{display:block;color:#6b7280;font-size:.85em}
@media (max-width:700px){.ga-four{grid-template-columns:1fr}}

/* 閱讀：還差什麼 */
.rd-todo{flex-basis:100%;margin:.4rem 0 0;padding-left:1.3rem;color:#9a3412;font-weight:600;line-height:1.6}
.rd-left{color:#c2410c}
.rd-quiz-left{margin:.4rem 0 .8rem;padding:.7rem .9rem;border-radius:10px;background:#fff7ed;border:2px solid #fb923c;color:#7c2d12;font-size:1.02rem}
.rq:has(.rq-hint){border:2px solid #fb923c;border-radius:10px;background:#fffbf5}

/* 閱讀關卡視窗（任務頁） */
.rg-count{margin:.2em 0 .6em;font-size:1.15em;font-weight:700;color:#7c2d12}
.rg-list{list-style:none;margin:0 0 .8em;padding:0;display:grid;gap:.5em}
.rg-list li{display:flex;gap:.7em;align-items:center;padding:.7em .9em;border-radius:12px;border:2px solid #fdba74;background:#fff7ed}
.rg-list li.ok{border-color:#86efac;background:#f0fdf4}
.rg-list b{display:block;line-height:1.35}
.rg-list small{display:block;color:#9a3412;font-weight:600;font-size:.9em}
.rg-list li.ok small{color:#15803d}
.rg-mk{font-size:1.4em;flex:none}
.rg-acts{gap:.6em}
.fn-readgo{margin-top:.4rem}
/* 寫作區左側：新版大綱 */
.tk-ol { display: grid; gap: .7rem; font-size: .98rem; line-height: 1.55; }
.tk-ol-edit { justify-self: start; }
#tkOutline .learning-copy-row { gap: .5rem; flex-wrap: wrap; align-items: center; }
.tk-ol section { border-left: 4px solid #c7d2fe; padding: .2rem 0 .2rem .7rem; }
.tk-ol h4 { margin: 0 0 .25rem; font-size: 1rem; color: #2f4bbf; }
.tk-ol p { margin: .15rem 0; }
.tk-ol ul { margin: .2rem 0; padding-left: 1rem; }
.tk-ol li { margin: .2rem 0; }
.tk-ol cite { font-style: normal; color: #64748b; font-size: .88em; }
.tk-ol-claim { font-weight: 700; }
.tk-ol-thesis { background: #f0fdf4; border-radius: 8px; padding: .3rem .5rem; }
/* 選單與標題收起後：閱讀、寫作大綱表、批改頁把空出來的高度給內容 */
body.top-min .rd-list, body.top-min .rd-notes { top: 2.2rem !important; max-height: calc(100vh - 2.8rem); max-height: calc(100dvh - 2.8rem); }
body.top-min .rd-body { max-height: calc(100vh - 9rem); max-height: calc(100dvh - 9rem); }
body.top-min .ol-ref { top: 2.2rem; max-height: calc(100vh - 2.8rem); max-height: calc(100dvh - 2.8rem); }
body.top-min .ol-bar { top: 2.2rem; }
body.top-min.grading-page .gr-essay { max-height: calc(100dvh - 200px) !important; }
@media (min-width: 1251px) and (min-height: 650px) { body.top-min.grading-page > main.page { height: calc(100dvh - 2.6rem) !important; } }
.rd-quiz.rd-flash { box-shadow: 0 0 0 4px rgba(245,158,11,.55); transition: box-shadow .4s; }
.top-tour { position: fixed; top: 0; right: 1rem; z-index: 1060; border: 1px solid #d5dbe7; border-top: 0; background: #fff; color: #2f4bbf; font-weight: 800; font-size: .95rem; padding: .3rem .9rem; border-radius: 0 0 12px 12px; box-shadow: 0 4px 12px rgba(20,30,60,.12); cursor: pointer; }
.top-tour:hover { background: #eef2ff; }

/* Essay formatting and reference controls */
.formatted-essay { white-space: pre-wrap; overflow-wrap: anywhere; }
#essayPreview { padding: 1rem; min-height: 16rem; font: inherit; }
.ed-format { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .5rem; }
.ed-format[hidden], #essayPreview[hidden], #essay[hidden] { display: none; }
body.board-drag-active, body.board-drag-active * { user-select: none !important; }
.ref-tabs { top: auto; bottom: 4.6rem; right: 1rem; flex-direction: row; align-items: flex-end; }
.ref-tabs .ref-tab { width: auto; padding: .35rem .55rem; line-height: 1.3; border-radius: .5rem; writing-mode: horizontal-tb; letter-spacing: normal; }
body.ref-folded:not(.ref-open) .ref-tabs { transform: none; }
body.ref-folded:not(.ref-open) .ref-tabs .ref-tab { display: none; }
body.ref-open .ref-tabs { display: none; }
body.ref-open .write-layout .toolkit { display: none; }
body.ref-open .write-layout { grid-template-columns: minmax(0, 1fr); }
body.ref-open .top-tour { display: none; }
.tk-body pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.learning-toolkit-quick { display: none; }
.topic-page .pc-links { display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.topic-page .pc-reading-link { white-space: normal; background: #eef8f7; }
body.top-min:not(.top-open):not(.ref-open) .learning-toolkit-quick { display: inline-flex; position: fixed; z-index: 42; top: 0; left: .25rem; background: white; padding: .2rem .4rem; }
@media (max-width: 660px) { body.top-min:not(.top-open):not(.ref-open) .learning-toolkit-quick { max-width: 27vw; white-space: normal; font-size: .65rem; } }
/* Shared task actions and a collapsed helper constrained to the visible viewport. */
.page-task-actions{display:flex;align-items:center;justify-content:flex-end;gap:.6rem;flex-wrap:wrap;margin-left:auto;flex:0 1 auto}.page-task-actions .btn{white-space:normal}
.help{max-width:calc(100vw - 24px)}.help .help-panel{width:min(360px,calc(100vw - 24px));height:min(440px,calc(var(--help-vh,100dvh) - 104px));max-height:calc(var(--help-vh,100dvh) - 104px);min-height:0}.help-view{min-height:0;overflow:auto}.help .help-tip{display:none!important;pointer-events:none}.help-fab{width:3.5rem;height:3.5rem}.help-panel[hidden]{display:none!important}
@media(max-width:600px){.page-task-actions{justify-content:flex-start;margin-left:0;width:100%}.page-task-actions .btn{min-height:40px}.help .help-panel{height:min(400px,calc(var(--help-vh,100dvh) - 100px))}}
.notes-save-conflict{border:1px solid #d9a94a;border-radius:8px;padding:.7rem;margin-top:.5rem;background:#fff8e8}.notes-save-conflict textarea{width:100%;box-sizing:border-box;margin:.4rem 0}.notes-save-conflict p{margin:0}
.chat-draft-actions{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin-left:auto}.chat-draft-actions [role=status]{font-size:.8rem}.gr-component textarea{width:100%;box-sizing:border-box;padding:.5rem;border:1px solid var(--line);border-radius:6px;font:inherit;resize:vertical}.gr-comment-label{display:block;margin:.5rem 0 .3rem;font-size:.85rem}.gr-criterion-comment{white-space:pre-wrap}
/* Keep task navigation available even when the larger page title is collapsed. */
body.top-min:not(.top-open) #bannerSlot{display:block}
body.top-min:not(.top-open) #bannerSlot .page-banner{padding:.4rem 1rem}
body.top-min:not(.top-open) #bannerSlot .page-banner-inner>div:first-child,body.top-min:not(.top-open) #bannerSlot .banner-cards{display:none}
body.top-min:not(.top-open) #bannerSlot .page-task-actions{display:flex;margin-left:auto}
.rubric td:last-child{white-space:pre-wrap;overflow-wrap:anywhere}
.help .help-panel{max-height:var(--help-panel-max,calc(var(--help-vh,100dvh) - 104px))}
.page-task-actions .ref-tabs{position:static!important;inset:auto!important;transform:none!important;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:.4rem;z-index:auto}
.page-task-actions .ref-tabs .ref-fold,.page-task-actions .ref-tabs .ref-tab{transform:none!important;width:auto!important;height:auto;min-height:38px;padding:.45rem .7rem;border:1px solid #c9d3ea;border-radius:.5rem;box-shadow:none;writing-mode:horizontal-tb;line-height:1.4;font-size:.8rem;letter-spacing:normal}
.page-task-actions .ref-tabs .ref-fold{background:#fff;color:#243b70}
.gr-form .gr-component textarea{min-height:5.25rem;height:5.25rem;max-height:14rem;font-size:.9rem;line-height:1.5}
/* A shared two-row banner: title and description first, ordered controls second. */
#bannerSlot .page-banner{padding:1rem clamp(16px,2.5vw,48px)}
#bannerSlot .page-banner-inner{display:grid!important;grid-template-columns:minmax(0,1fr);gap:.7rem;width:100%;max-width:1500px;margin:0 auto;align-items:start}
#bannerSlot .page-banner-copy{min-width:0;width:100%}
#bannerSlot .page-banner h1{font-size:clamp(1.3rem,1.6vw,1.65rem);line-height:1.4;margin:.25rem 0}
#bannerSlot .page-banner .lead{font-size:.9rem;line-height:1.6;margin:.3rem 0 0}
#bannerSlot .page-task-actions{display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:.5rem;margin:0;width:100%}
#bannerSlot .page-task-actions>.topic-banner-actions,#bannerSlot .page-task-actions>.section-tour-actions{display:contents}
#bannerSlot .page-task-actions>.page-topic-back{order:10}
#bannerSlot .page-task-actions .learning-toolkit-launch{order:20}
#bannerSlot .page-task-actions .ref-tabs{order:30}
#bannerSlot .page-task-actions>*{order:40}
#bannerSlot .page-task-actions .banner-cards{order:50;margin:0!important;align-self:auto!important}
#bannerSlot .page-task-actions .page-tour-action{order:60}
#bannerSlot .page-task-actions .btn{min-height:40px;display:inline-flex;align-items:center;justify-content:center;padding:.45rem .7rem;line-height:1.4;font-size:.85rem}
body.top-min:not(.top-open) #bannerSlot .banner-cards{display:inline-flex}
.top-tour{display:none!important}
@media(max-width:600px){#bannerSlot .page-banner{padding:.65rem .75rem}#bannerSlot .page-task-actions{justify-content:flex-start}#bannerSlot .page-task-actions .btn{font-size:.78rem;max-width:100%}}
.board-bar .board-task-actions{flex:1 0 100%;width:100%;margin:0;justify-content:flex-end;gap:.5rem}
.board-task-actions .ref-tabs{order:30}.board-task-actions .page-tour-action{order:60}
#bannerSlot .page-task-actions .topic-banner-actions>button{order:40}
@media(max-width:600px){.board-bar .board-task-actions{justify-content:flex-start}}

.bot-card.is-locked,.bt[aria-disabled="true"]{cursor:default;opacity:.65}.bot-card.is-locked:hover{transform:none;box-shadow:none}

/* Shared tour mark: readable red question on light and dark toolbars. */
.tour-question{display:inline-block;color:#e53935;font-size:1.6rem;font-weight:900;line-height:1;vertical-align:middle;flex-shrink:0}

/* Discussion summary headings share the same colors everywhere. */
.summary-heading{font-weight:800!important;font-size:1.12em;line-height:1.6}.summary-pro{color:#1d4ed8!important}.summary-con{color:#c05600!important}.summary-counter{color:#c62828!important}.discussion-summary{white-space:pre-wrap;overflow-wrap:anywhere;font-family:inherit;line-height:1.7}.discussion-summary .summary-heading{display:inline-block;margin-top:.45rem}.summary-point{font-weight:700}

/* Reference material bookmarks stay at the right edge, outside page actions. */
body.has-ref{padding-right:3rem}
body > .ref-tabs{position:fixed;top:25%;bottom:auto;right:0;z-index:44;display:flex;flex-direction:column;align-items:flex-end;gap:.4rem;transform:none!important}
body > .ref-tabs .ref-fold{display:none}
body > .ref-tabs .ref-tab{display:flex!important;writing-mode:vertical-rl;width:2.65rem;min-height:6.4rem;padding:.7rem .55rem;border-radius:.6rem 0 0 .6rem;font-size:1rem;font-weight:800;line-height:1.5;letter-spacing:.12em;box-shadow:0 2px 8px #172b4d26}
body.ref-open > .ref-tabs{display:flex;right:min(560px,94vw)}
@media(max-width:660px){body.has-ref{padding-right:2.35rem}body > .ref-tabs{top:23%;gap:.3rem}body > .ref-tabs .ref-tab{width:2.15rem;min-height:5.5rem;font-size:.85rem;padding:.5rem .35rem}body.ref-open > .ref-tabs{display:none}}

/* Center the complete bookmark stack on the viewport at every screen size. */
body > .ref-tabs{top:50%!important;bottom:auto!important;transform:translateY(-50%)!important}

/* Research navigation uses separate identity and task rows. */
.nav.nav-fixed.nav-research{height:auto!important;display:flex;flex-direction:column;align-items:stretch;padding:.55rem 1.2rem!important;gap:.4rem;min-width:0}
.nav.nav-research .logo{align-self:flex-start;max-width:100%;flex-shrink:0}
.nav.nav-research .logo-text{white-space:normal;font-size:1.15rem!important}
.nav.nav-research .nav-links{display:flex!important;position:static!important;width:100%;min-width:0;flex-wrap:wrap;gap:.25rem;border-top:1px solid #e2e8f0;padding-top:.4rem;background:transparent;max-height:none}
.nav.nav-research .nav-links>a.keep-lg{display:inline-flex!important}
.nav.nav-research .user-dd{display:block!important;margin-left:auto}
.nav.nav-research .compact-nav-links{display:none!important}
body.app.research-ui{padding-top:var(--nav-height)!important}
@media(max-width:660px){.nav.nav-fixed.nav-research{padding:.4rem .6rem!important}.nav.nav-research .logo-text{font-size:.95rem!important}.nav.nav-research .nav-links>a,.nav.nav-research .nav-back{font-size:.75rem;padding:.3rem .4rem}.nav.nav-research .logo-mark{max-height:44px}}
/* 首頁／關於頁導覽列：不論登入與否、視窗多窄（寬於 900px），「關於」都留在使用者按鈕／登入的左邊；窄於 900px 時收進 ☰ 選單 */
@media (min-width: 901px) { .nav-landing .nav-links > a.keep-lg[href="about.html"] { display: inline-block; } }
/* 未登入的手冊／關於頁（public.js 產生的導覽列）：沒有 ☰ 按鈕，所以「關於」與「登入」在任何寬度都要留著 */
.public-nav > .nav-links { display: flex; align-items: center; gap: .25rem; }
.public-nav > .nav-links > a.keep-lg[href="about.html"] { display: inline-block; }

/* 🏷 證據類型標註：草稿（淡黃虛線）→ 儲存後正式黃色＋句尾標籤 */
mark.rd-hl.rd-draft { background: #fef9c3; outline: 2px dashed #f59e0b; outline-offset: 1px; cursor: default; }
mark.rd-hl.rd-ann { background: #fde68a; }
.rd-tag { display: inline-block; margin: 0 .25rem 0 .15rem; padding: 0 .35rem; border-radius: .35rem; background: #1e293b; color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .02em; vertical-align: baseline; position: relative; top: -.25em; cursor: pointer; user-select: none; -webkit-user-select: none; white-space: nowrap; }
.rd-tag.none { background: #94a3b8; }
.rd-tag.rd-tag-note { background: #f59e0b; color: #fff; }
.rd-ev .ev-f textarea { font: inherit; padding: .35rem .5rem; border: 1px solid #cbd5e1; border-radius: .5rem; resize: vertical; }
.rd-ev { position: absolute; z-index: 70; width: min(330px, calc(100vw - 16px)); padding: .7rem; border-radius: .8rem; background: #fff; border: 1.5px solid #f59e0b; box-shadow: 0 10px 30px rgba(15, 23, 42, .25); display: grid; gap: .45rem; }
.rd-ev[hidden] { display: none; }
.rd-ev.dock { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; width: auto; max-height: 70vh; overflow: auto; }
.rd-ev .ev-h { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.rd-ev .ev-h small { color: #64748b; }
.rd-ev .ev-q { margin: 0; padding: .3rem .5rem; border-left: 3px solid #f59e0b; background: #fffbeb; font-size: .85rem; max-height: 5.5em; overflow: auto; }
.ev-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.ev-chip { border: 1.5px solid #cbd5e1; background: #fff; border-radius: .6rem; padding: .3rem .55rem; font: inherit; font-size: .85rem; cursor: pointer; }
.ev-chip b { font-weight: 800; }
.ev-chip.on { background: #1e293b; border-color: #1e293b; color: #fff; }
.ev-chip:focus-visible { outline: 3px solid #f59e0b; outline-offset: 1px; }
.rd-ev .ev-f { display: grid; gap: .15rem; font-size: .8rem; color: #475569; }
.rd-ev .ev-f input { font: inherit; padding: .35rem .5rem; border: 1px solid #cbd5e1; border-radius: .5rem; }
.rd-ev .ev-acts { display: flex; justify-content: flex-end; align-items: center; gap: .4rem; }
.rd-ev .ev-acts .ev-del { margin-right: auto; color: #b91c1c; }
.rn-ev { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-bottom: .2rem; }
.ev-b { display: inline-block; padding: 0 .4rem; border-radius: .35rem; background: #1e293b; color: #fff; font-size: .7rem; font-weight: 800; }
.ev-b.ev-none { background: #94a3b8; }
.rn-why { color: #475569; font-size: .85rem; }
blockquote.rn-ann { border-left-color: #f59e0b !important; background: #fffbeb !important; }

/* 回應時顯示對方貼文內容 */
.target-display .target-body{display:block;margin-top:8px;padding:8px 10px;border-radius:8px;background:rgba(255,255,255,.7);border:1px solid rgba(0,0,0,.08);font-size:.92rem;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere;max-height:260px;overflow:auto;font-weight:400;color:#1f2937}
.target-display .target-more{display:inline-block;margin-top:4px;font-size:.85rem}

/* 鷹架按鈕下方的白話說明 */
.scaffold-pick .chips button .sc-desc{display:block;margin-top:4px;font-size:.82rem;font-weight:400;line-height:1.45;color:#4b5563;white-space:normal;text-align:left}

/* 閱讀材料清單：目前顯示哪一篇 */
.rd-now{color:#1f7a3d;font-weight:700}

/* 快速前往（左下角）：一次跳到主頁或任務的任何一區 */
.qnav { position: fixed; left: 1rem; bottom: 1rem; z-index: 1050; }
.qnav-btn { border: 1px solid #c9d3ea; background: #fff; color: #2a47a8; font-weight: 800; font-size: .95rem; padding: .45rem .95rem; border-radius: 999px; box-shadow: 0 4px 14px rgba(20,30,60,.16); cursor: pointer; }
.qnav-btn:hover, .qnav-btn[aria-expanded="true"] { background: #2a47a8; color: #fff; border-color: #2a47a8; }
.qnav-menu { position: absolute; left: 0; bottom: calc(100% + .5rem); min-width: 12rem; display: grid; gap: .1rem; padding: .4rem; background: #fff; border: 1px solid #d5dbe7; border-radius: 14px; box-shadow: 0 10px 30px rgba(20,30,60,.2); }
.qnav-menu[hidden] { display: none; }
.qnav-menu a { display: flex; gap: .55rem; align-items: center; padding: .5rem .7rem; border-radius: 9px; color: #1e293b; font-weight: 700; text-decoration: none; }
.qnav-menu a:hover, .qnav-menu a:focus-visible { background: #eef2ff; color: #2a47a8; }
.qnav-menu a[aria-current="page"] { background: #f1f5f9; color: #64748b; pointer-events: none; }
.qnav-menu a[aria-current="page"]::after { content: "（目前）"; font-weight: 600; font-size: .8rem; }
@media print { .qnav { display: none; } }
.board-page ~ .qnav, body:has(.board-page) .qnav { bottom: 5.25rem; }
#rdMain { scroll-margin-top: 1rem; }
#rdMain.rd-flash { box-shadow: 0 0 0 4px rgba(59,91,219,.45); transition: box-shadow .4s; border-radius: 16px; }

/* 📋 問卷提醒（學生按「稍後再填」後，每一頁最上方） */
.sv-remind { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; background: #fef3c7; border: 2px solid #f59e0b; color: #78350f; border-radius: 12px; padding: .55rem .9rem; font-size: 1rem; }
.sv-remind-bar { max-width: 1200px; margin: .8rem auto 0; width: calc(100% - 2rem); box-sizing: border-box; }
.sv-remind-sub { color: #92400e; font-size: .88rem; }
.sv-remind .btn { margin-left: auto; }
.sv-remind-demo { margin: .6rem 0; }

/* 研究端小問號說明（research-help.js） */
.qh { display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem; margin-left: .3rem; padding: 0; border-radius: 50%; border: 1.5px solid #2563eb; background: #eff6ff; color: #1d4ed8; font: 800 .75rem/1 system-ui, sans-serif; vertical-align: middle; cursor: pointer; }
.qh:hover, .qh:focus-visible { background: #2563eb; color: #fff; outline: none; }
.qh-bar { display: flex; align-items: center; gap: .35rem; margin: 0 0 .6rem; font-size: .85rem; color: #475569; }
.qh-bar .qh { margin-left: 0; }
.qh-pop { position: absolute; z-index: 90; width: min(440px, calc(100vw - 16px)); max-height: 70vh; overflow: auto; padding: .8rem .9rem; border-radius: .8rem; background: #fff; border: 1.5px solid #2563eb; box-shadow: 0 12px 32px rgba(15, 23, 42, .25); font-size: .88rem; line-height: 1.55; color: #1e293b; }
.qh-pop.dock { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; width: auto; max-height: 60vh; }
.qh-pop .qh-h { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.qh-pop .qh-x { border: 0; background: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: #64748b; }
.qh-pop dl { margin: 0; }
.qh-pop dt { margin-top: .5rem; font-weight: 800; color: #1d4ed8; font-size: .8rem; }
.qh-pop dd { margin: .15rem 0 0; }
.kb-theory summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.kb-theory summary h3 { display: inline; margin: 0; }
.kb-theory h4 { margin: 1rem 0 .4rem; }
.kb-theory ul { padding-left: 1.2rem; }
/* 編碼頁：混淆矩陣、高層次子碼 */
.cd-mx th, .cd-mx td { text-align: center; min-width: 2.4rem; }
.cd-mx td.mx-d { background: #dcfce7; font-weight: 700; }
.cd-mx td.mx-x { background: #ffedd5; font-weight: 700; color: #9a3412; }
.cd-sub.hi { border-color: #7c3aed; }

/* 外部原始教材的提醒（W13：British Council 故事在外部網站，CAWS 的標註只能用在說明文字） */
.rd-extnote{margin:.5rem 0 .75rem;padding:.55rem .75rem;border-left:4px solid var(--amber,#f2b541);background:var(--paper,#fff8e8);border-radius:6px;line-height:1.55}
/* 學術閱讀與回應：子欄位作答（W14 起） */
.pf-wrap{display:grid;gap:.75rem;margin:.5rem 0 .25rem}
.pf-group{border:1px solid var(--line);border-radius:10px;padding:.6rem .8rem .8rem;margin:0;display:grid;gap:.6rem;min-width:0}
.pf-group legend{font-weight:700;padding:0 .35rem}
.pf-field{display:grid;gap:.25rem;min-width:0}
.pf-field select,.pf-field textarea{width:100%;max-width:100%;box-sizing:border-box}
.pf-hint{color:var(--muted,#777);line-height:1.45}
.pf-legacy{border-left:4px solid var(--amber,#f2b541);padding-left:.6rem}
.pf-warn{color:var(--coral,#c0392b);margin:0}
.pf-add{justify-self:start}
/* 任務頁的 Quick Check 自我檢核入口 */
.qc-entry{grid-column:1/-1}.qc-entry .qc-entry-row{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;justify-content:space-between}.qc-entry h3{margin:0 0 .3rem}

/* ✏️ 寫作頁拉出來的「引導問題」分頁（W13–W15 故事）：直接看、直接改，自動儲存 */
.ref-guide[hidden] { display: none; }
.ref-guide { height: 100%; overflow: auto; padding: .8rem 1rem 1.2rem; box-sizing: border-box; }
.ref-guide .ref-gm h4 { margin: .2rem 0 .3rem; }
.ref-guide .ref-gq { display: block; margin: .8rem 0; }
.ref-guide .ref-gq > span { display: block; font-weight: 600; margin-bottom: .3rem; line-height: 1.45; }
.ref-guide .ref-gq > span small { display: block; font-weight: 400; color: var(--ink-soft, #63728e); }
.ref-guide .ref-gq textarea { display: block; width: 100%; box-sizing: border-box; min-height: 5.5em; padding: .55rem .7rem; border: 1px solid #c9d3e6; border-radius: 8px; font: inherit; line-height: 1.6; resize: vertical; }
.ref-guide .ref-gcopy { font-size: .8rem; margin-left: .4rem; font-weight: 400; }
/* W13–W15 每一關完成後的「下一步」：閱讀頁讀完列、作答頁繳交提示 */
.rd-done-bar { gap: .6rem; align-items: center; flex-wrap: wrap; }
.ed-step-next { margin-top: .6rem; padding: .6rem .8rem; border-radius: 10px; background: var(--primary-soft); display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; font-weight: 700; }
.ed-step-next.wait { background: var(--amber-soft); }

/* 學術閱讀與回應的回饋：題目｜你的作答｜老師評語與建議｜分數 */
.fb-total{margin:0 0 .75rem;font-size:1.05rem}.fb-total span{font:800 1.6rem var(--display);color:var(--violet);margin-left:.35rem}
.fb-answers{font-size:.92rem;table-layout:fixed}
.fb-answers th.fb-q,.fb-answers td.fb-q{width:9.5rem}
.fb-answers th.fb-s,.fb-answers td.fb-s{width:5rem;white-space:nowrap}
.fb-answers td.fb-ans{background:#fbfcfe;overflow-wrap:anywhere}
.fb-answers td.fb-cm{overflow-wrap:anywhere}
.fb-next{display:block;margin-top:.6rem}
@media (max-width: 760px){
  .fb-answers,.fb-answers tbody,.fb-answers tr,.fb-answers td{display:block;width:auto!important}
  .fb-answers thead{display:none}
  .fb-answers tr{border-bottom:2px solid var(--line);padding:.4rem 0}
  .fb-answers td{border:0;padding:.3rem .2rem}
  .fb-answers td::before{content:attr(data-l);display:block;font-size:.75rem;font-weight:700;color:var(--ink-soft)}
}

/* 三關任務頁：老師發布評分後的入口 */
.pa-fb{grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:center;gap:.35rem 1rem;padding:.85rem 1.1rem;border-radius:14px;border:2px solid var(--violet);background:#f4f2ff;color:#2d2470;text-decoration:none}
.pa-fb:hover{background:#ebe7ff}
.pa-fb b{font-size:1.05rem}
.pa-fb span{font-weight:600}
.pa-fb.new{border-color:#e0533d;background:#fff3f0}
.pa-fb-new{background:#e0533d;color:#fff;border-radius:999px;padding:.1rem .55rem;font-size:.8rem}
.pa-fb-ans-link{display:inline-block;margin:.35rem 0 0;font-weight:700;font-size:.9rem;color:#4b3fb5}
.fb-layout.fb-one{grid-template-columns:1fr}
.fb-sub{margin:-.35rem 0 .6rem}
