/* =====================================================================
   數位簡報室 · 共用樣式(index.html 與 class.html 共用)
   設計語言沿用 info.html「行前安裝指南」:白紙底、聯合報藍 #00479D 實色、
   橘 #EB6120 點綴、IBM Plex Sans + Noto Sans TC、銳利小圓角、編輯部文件感。
   純淺色主題(無深色模式)。
   ===================================================================== */
html, body { margin: 0; }
* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  color-scheme: light;

  /* 聯合報品牌色(與 info.html 同步) */
  --navy: #00479D;
  --navy-deep: #003472;
  --navy-mid: #1A62B8;
  --navy-soft: #E8EFF8;
  --navy-tint: #F4F7FC;

  --orange: #EB6120;
  --orange-deep: #C44A13;
  --orange-soft: #FDEDE4;

  --ink: #12171D;
  --ink-soft: #2A323C;
  --ink-mid: #3D4650;
  --mute: #69737F;
  --faint: #98A2AE;

  --paper: #FFFFFF;
  --paper-sunk: #F4F7FB;
  --line: #DCE3EC;
  --line-light: #EAEFF5;

  --good: #10775B;
  --good-soft: #E1F1EC;
  --warn: #9A6A12;
  --warn-soft: #FFF7E8;
  --crit: #C0392B;
  --crit-soft: #FAE7E4;

  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", system-ui, -apple-system, sans-serif;
  --latin: "IBM Plex Sans", "Noto Sans TC", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, "Cascadia Mono", Consolas, monospace;

  --r-s: 4px; --r-m: 6px; --r-l: 8px;
}

body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.8;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-weight: 700; letter-spacing: .01em; margin: 0; text-wrap: balance; }
.num { font-family: var(--latin); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--navy-soft); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

/* ---------- 登入閘門 ---------- */
#appView { display: none; }
body.authed #appView { display: block; }
body.authed #loginView { display: none; }

/* ---------- masthead(聯合報藍實色橫幅,與 info.html 相同) ---------- */
.mast { background: var(--navy); color: #fff; }
.mast-in {
  max-width: 1360px; margin: 0 auto; padding: 15px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.mast-t { font-size: 16px; font-weight: 700; letter-spacing: .02em; line-height: 1.5; color: #fff; }
.mast-t i { font-style: normal; color: rgba(255,255,255,.45); font-weight: 400; margin: 0 9px; }
.mast-s { font-size: 12px; color: rgba(255,255,255,.72); line-height: 1.5; margin-top: 2px; }
.mast-m {
  font-family: var(--latin); font-size: 11px; font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; color: rgba(255,255,255,.6); white-space: nowrap;
}

/* ---------- 登入頁 ---------- */
.login { display: flex; min-height: 100vh; background: var(--paper); }
.login-brand {
  flex: 0 0 46%; color: #fff; display: flex; flex-direction: column;
  justify-content: space-between; padding: 56px; position: relative; overflow: hidden;
  background: var(--navy);
}
.login-brand::after {
  content: ""; position: absolute; right: -20%; bottom: -24%; width: 72%; aspect-ratio: 345 / 298;
  background: url("udn-mark.png") center/contain no-repeat;
  opacity: .06; filter: grayscale(1) brightness(3); pointer-events: none;
}
.lb-inner { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; height: 100%; width: 100%; max-width: 480px; }
.lb-logo { display: flex; align-items: center; gap: 18px; }
.lb-mark { box-sizing: content-box; height: 48px; width: auto; padding: 14px; background: #fff; border-radius: var(--r-l); }
.lb-org { font-weight: 700; font-size: 24px; letter-spacing: .2em; }
.lb-hero { margin-top: auto; }
.lb-hero::before { content: ""; display: block; width: 52px; height: 4px; background: var(--orange); margin-bottom: 26px; }
.lb-title { font-size: 50px; line-height: 1.15; font-weight: 900; letter-spacing: .005em; }
.lb-sysname { margin-top: 14px; font-size: 16px; font-weight: 500; letter-spacing: .06em; opacity: .82; }
.lb-foot {
  margin-top: auto; padding-top: 40px; font-family: var(--latin); font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase; opacity: .55;
}
.login-panel { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; background: var(--paper); }
.login-card {
  width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-l); padding: 34px 32px 30px; position: relative; overflow: hidden;
}
.login-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--navy); }
.lc-brandline { display: none; margin-bottom: 24px; }
.lc-mark { height: 40px; }
.lc-kick { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.lc-kick .b { height: 12px; width: 4px; background: var(--orange); flex: 0 0 auto; }
.lc-kick span {
  font-family: var(--latin); font-size: 11px; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--orange-deep);
}
.lc-head h2 { font-size: 22px; font-weight: 700; }
.lc-head p { margin: 6px 0 26px; font-size: 13px; color: var(--faint); }
.fld { display: block; margin-bottom: 16px; }
.fld span { display: block; font-family: var(--latin); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); margin-bottom: 7px; }
.fld input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-s);
  background: #fff; color: var(--ink); font-family: var(--sans); font-size: 14.5px;
  transition: border-color .14s, box-shadow .14s;
}
.fld input::placeholder { color: var(--faint); }
.fld input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-soft); }
.login-btn { width: 100%; justify-content: center; padding: 11px; font-size: 14.5px; margin-top: 6px; }
.lc-note { margin-top: 24px; font-size: 12.5px; color: var(--faint); line-height: 1.7; }
@media (max-width: 860px) {
  .login { flex-direction: column; min-height: 100vh; }
  .login-brand { display: none; }
  .lc-brandline { display: block; }
  .login-panel { padding: 44px 22px; align-items: flex-start; }
  .login-card { margin-top: 4vh; }
}

/* 入口卡:錯誤提示 / 最近班別 / 入口切換 */
.lc-err {
  margin-top: 12px; padding: 9px 12px; border-radius: var(--r-s); font-size: 13px;
  background: var(--crit-soft); color: var(--crit); border: 1px solid #F0C9C2;
}
.lc-mine { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.lc-mine-lab {
  font-family: var(--latin); font-size: 10.5px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 8px;
}
.mine-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; margin: 0 -11px;
  border-radius: var(--r-s); text-decoration: none; color: var(--ink-soft); transition: background-color .14s;
}
.mine-row:hover { background: var(--navy-tint); color: var(--navy); }
.mine-n { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mine-d { font-family: var(--latin); font-size: 12px; color: var(--faint); flex: none; }
.lc-alt { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; }
.linkbtn {
  border: 0; background: transparent; padding: 4px; font-family: var(--sans);
  font-size: 12.5px; color: var(--mute); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.linkbtn:hover { color: var(--navy); }

/* 公開手冊(不需密碼) */
.pub-docs { width: 100%; max-width: 400px; margin-top: 26px; }
.pub-lab {
  font-family: var(--latin); font-size: 10.5px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 9px;
  display: flex; align-items: center; gap: 10px;
}
.pub-lab::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pub-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; margin-bottom: 7px;
  border: 1px solid var(--line); border-radius: var(--r-l); background: #fff;
  text-decoration: none; color: var(--ink); transition: border-color .14s, background-color .14s;
}
.pub-row:last-child { margin-bottom: 0; }
.pub-row:hover { border-color: var(--navy); background: var(--navy-tint); }
.pub-ic { width: 28px; height: 28px; border-radius: var(--r-s); display: grid; place-items: center; flex: none; background: var(--navy-soft); color: var(--navy); }
.pub-ic svg { width: 15px; height: 15px; }
.pub-main { flex: 1; min-width: 0; line-height: 1.4; }
.pub-main b { display: block; font-size: 13.5px; font-weight: 700; }
.pub-main span { display: block; font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.pub-tag {
  flex: none; font-family: var(--latin); font-size: 9.5px; font-weight: 700; letter-spacing: .1em;
  padding: 2px 7px; border-radius: var(--r-s); background: var(--navy-soft); color: var(--navy);
}
.pub-tag.ta { background: var(--orange-soft); color: var(--orange-deep); }

/* ---------- 版型:masthead 下方為 側欄 + 主內容 ---------- */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: calc(100vh - 64px); }

.sidebar {
  background: var(--paper); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 20px 18px 17px; border-bottom: 1px solid var(--line); }
.brand-row { display: flex; align-items: center; gap: 11px; }
.brand-mark { height: 30px; width: auto; flex: none; }
.brand-txt { min-width: 0; line-height: 1.25; }
.brand .mast-name { font-size: 15px; font-weight: 700; color: var(--navy); }
.brand .sub { margin-top: 2px; font-family: var(--latin); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.nav { padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 1px; flex: 1; overflow-y: auto; }
.nav-label {
  font-family: var(--latin); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint); padding: 18px 10px 7px; font-weight: 600;
}
.nav a {
  position: relative; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--r-s);
  color: var(--ink-soft); text-decoration: none; font-size: 13.5px; font-weight: 500;
  border-left: 3px solid transparent; transition: background-color .14s, color .14s;
}
.nav a .ico { width: 16px; height: 16px; flex: none; color: var(--faint); stroke-width: 1.75; transition: color .14s; }
.nav a:hover { background: var(--navy-tint); color: var(--navy); }
.nav a:hover .ico { color: var(--navy); }
.nav a.active { background: var(--navy-tint); color: var(--navy); font-weight: 700; border-left-color: var(--navy); border-radius: 0 var(--r-s) var(--r-s) 0; }
.nav a.active .ico { color: var(--navy); stroke-width: 2.1; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.nav-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-date { font-family: var(--latin); font-size: 11px; font-weight: 600; color: var(--faint); flex: none; }
.nav a.active .nav-date { color: var(--navy); }
.nav-empty { padding: 8px 10px; font-size: 12.5px; color: var(--faint); }
.nav-tag {
  margin-left: auto; flex: none; font-family: var(--latin); font-size: 9.5px; font-weight: 700;
  letter-spacing: .1em; padding: 1.5px 6px; border-radius: var(--r-s);
  background: var(--paper-sunk); color: var(--mute); border: 1px solid var(--line);
}
.nav a:hover .nav-tag { border-color: var(--navy); color: var(--navy); }

.users { padding: 13px 16px; border-top: 1px solid var(--line); }
.users .u-label { font-family: var(--latin); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-bottom: 10px; }
.u-row { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.u-avatar { width: 26px; height: 26px; border-radius: var(--r-s); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff; flex: none; }
.u-meta { line-height: 1.3; min-width: 0; }
.u-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-role { font-size: 11px; color: var(--faint); }
.logout-btn {
  margin-top: 2px; width: 100%; padding: 8.5px; border: 1px solid var(--line); border-radius: var(--r-s);
  background: #fff; color: var(--ink-soft); font-size: 13px; font-weight: 500;
  transition: border-color .14s, color .14s, background-color .14s;
}
.logout-btn:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-tint); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar .tt { min-width: 0; }
.topbar h1 { font-size: 18px; font-weight: 700; }
.topbar .crumb {
  font-family: var(--latin); font-size: 10.5px; color: var(--orange-deep); font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; margin-bottom: 3px;
}
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--r-s);
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  font-size: 13px; font-weight: 500; line-height: 1.3; text-decoration: none;
  transition: background-color .14s, border-color .14s, color .14s;
}
.btn:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-tint); }
.btn .ico { width: 14.5px; height: 14.5px; stroke-width: 2; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--navy-deep); border-color: var(--navy-deep); color: #fff; }
.btn:active { transform: translateY(0.5px); }

.content { padding: 30px 32px 90px; max-width: 1100px; margin: 0 auto; width: 100%; }

/* ---------- kicker(橘短槓 + 大寫小標,info.html 的 .kick) ---------- */
.kick { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.kick .b { height: 12px; width: 4px; background: var(--orange); flex: 0 0 auto; }
.kick span {
  font-family: var(--latin); font-size: 11px; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--orange-deep);
}

/* ---------- facts 條(藍色上緣粗線的資料列) ---------- */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 2px solid var(--navy); border-bottom: 1px solid var(--line);
  margin: 0;
}
.fact { padding: 15px 20px 15px 0; border-right: 1px solid var(--line-light); min-width: 0; }
.fact:last-child { border-right: 0; }
.fact dt, .fact .k {
  font-family: var(--latin); font-size: 10.5px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--faint); margin: 0 0 4px;
}
.fact dd, .fact .v { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--ink-soft); line-height: 1.5; }
.fact .v small { font-weight: 500; color: var(--mute); font-size: 12px; }

/* ---------- 統計列(facts 風格,index 用) ---------- */
.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 2px solid var(--navy); border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}
.stat { padding: 17px 22px 15px 0; border-right: 1px solid var(--line-light); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat .k { font-family: var(--latin); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.stat .v { font-family: var(--latin); font-size: 27px; font-weight: 700; margin-top: 7px; line-height: 1.1; color: var(--ink); }
.stat .v small { font-size: 12.5px; color: var(--mute); font-family: var(--sans); font-weight: 500; margin-left: 4px; }
.stat .d { font-size: 12.5px; color: var(--faint); margin-top: 6px; }

/* ---------- 章節標題(info.html 的 .sec-h:粗線 + 編號 + 標題) ---------- */
.sec { padding-top: 44px; }
.sec:first-child { padding-top: 0; }
.sec-h { margin-bottom: 20px; }
.sec-h .rule { display: block; height: 3px; background: var(--navy); margin-bottom: 15px; }
.sec-t { display: flex; align-items: baseline; gap: 14px; }
.sec-t em {
  font-family: var(--latin); font-style: normal; font-size: 13px; font-weight: 700;
  color: var(--orange); letter-spacing: .08em; flex: 0 0 auto;
}
.sec-t h2 { font-size: 20px; font-weight: 700; letter-spacing: .01em; margin: 0; color: var(--ink); }
.sec-t .cnt { margin-left: auto; font-family: var(--latin); font-size: 12px; font-weight: 600; color: var(--mute); white-space: nowrap; }
.sec-note { font-size: 13px; color: var(--faint); margin: -12px 0 18px; }

/* index 的區塊標題沿用同語言 */
.section-head { margin: 4px 0 18px; }
.section-head .rule { display: block; height: 3px; background: var(--navy); margin-bottom: 15px; }
.section-head h2 { font-size: 20px; font-weight: 700; }
.section-head p { margin: 6px 0 0; font-size: 13.5px; color: var(--mute); }

/* ---------- 篩選 ---------- */
.filters { display: flex; gap: 7px; flex-wrap: wrap; }
.filter {
  font-size: 12.5px; font-weight: 500; padding: 5.5px 13px; border-radius: var(--r-s);
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  transition: background-color .14s, border-color .14s, color .14s;
}
.filter:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-tint); }
.filter.active { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }

/* ---------- 課程管理總表 ---------- */
.mt-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-l); }
table.mtable { width: 100%; border-collapse: collapse; min-width: 960px; background: #fff; }
.mtable th {
  text-align: left; font-family: var(--latin); font-size: 10.5px; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase; color: #fff; background: var(--navy);
  padding: 12px 16px; white-space: nowrap;
}
.mtable td { padding: 13px 16px; border-bottom: 1px solid var(--line-light); font-size: 13.5px; vertical-align: middle; white-space: nowrap; color: var(--ink-mid); }
.mtable tbody tr { cursor: pointer; transition: background-color .12s; }
.mtable tbody tr:nth-child(even) td { background: var(--navy-tint); }
.mtable tbody tr:hover td { background: var(--navy-soft); }
.mtable tbody tr:last-child td { border-bottom: 0; }
.mt-daynum { display: inline-block; line-height: 1.25; }
.mt-daynum { font-family: var(--latin); font-size: 15px; font-weight: 700; color: var(--navy); }
.mt-daynum small { display: block; font-family: var(--sans); font-size: 10.5px; font-weight: 500; color: var(--mute); }
.mt-name .n { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--ink); }
.mt-name .m { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.tdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.lv-pill {
  font-family: var(--latin); font-size: 10px; font-weight: 700; letter-spacing: .06em;
  padding: 2px 8px; border-radius: var(--r-s); flex: none; color: #fff;
}
.lv-pill.general { background: var(--navy); }
.lv-pill.exec { background: var(--orange-deep); }
.mt-tas { color: var(--ink-mid); }
.pass-code {
  font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: .04em;
  background: var(--navy-soft); color: var(--navy-deep); border: 1px solid #C7D9EE;
  padding: 3px 9px; border-radius: var(--r-s); cursor: copy; white-space: nowrap;
}
.pass-code:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.ready-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: var(--r-s); white-space: nowrap;
}
.ready-chip.ok { background: var(--good-soft); color: var(--good); }
.ready-chip.part { background: var(--warn-soft); color: var(--warn); }
.ready-chip.none { background: var(--paper-sunk); color: var(--mute); border: 1px dashed var(--line); }

/* ---------- 交件用雲端資料夾(班別頁,接在講義區之後) ---------- */
.share-note { margin: -6px 0 0; }
.share-note h5 {
  font-family: var(--latin); font-size: 10.5px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; margin: 0 0 10px; color: var(--navy);
}
.share-note p { margin: 0 0 10px; font-size: 14.5px; color: var(--ink-mid); line-height: 1.8; }
.share-note p:last-child { margin-bottom: 0; }
.share-note code {
  font-family: var(--mono); font-size: 13px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-s); padding: 2px 8px; color: var(--navy-deep);
}

/* ---------- 總表:上課頁欄位與說明盒 ---------- */
.hint-box {
  background: var(--navy-tint); border-left: 3px solid var(--navy);
  padding: 18px 22px; margin: 0 0 18px;
}
.hint-box h4 {
  margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--navy-deep);
}
.hint-box p { margin: 0 0 8px; font-size: 13.5px; color: var(--ink-mid); line-height: 1.8; max-width: 80ch; }
.hint-act { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.hint-url code {
  font-family: var(--mono); font-size: 13px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 3px 9px; color: var(--navy-deep); margin-left: 4px;
  display: inline-block; word-break: break-all;
}

.mt-lesson { white-space: nowrap; }
.mt-lesson .mini {
  display: inline-flex; align-items: center; font-family: inherit; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--r-s);
  background: #fff; color: var(--ink-mid); cursor: pointer; text-decoration: none;
  transition: border-color .14s, color .14s, background .14s;
}
.mt-lesson .mini + .mini { margin-left: 6px; }
.mt-lesson .mini:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-tint); }
.mt-open .btn { padding: 5.5px 12px; font-size: 12.5px; }

/* ---------- 班別頁 hero ---------- */
.class-hero { margin-bottom: 10px; }
.ch-title { font-size: clamp(26px, 3.6vw, 38px); font-weight: 900; line-height: 1.25; letter-spacing: .005em; margin: 0 0 14px; }
.ch-lede { font-size: 15px; color: var(--ink-mid); margin: 0 0 28px; max-width: 62ch; }
.ch-lede b { color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--r-s); }

/* ---------- 課前引導:小節標題 / 當天流程表 / 提示框 ---------- */
.sub-h {
  font-size: 16px; font-weight: 700; margin: 30px 0 13px; color: var(--ink);
  padding-left: 13px; border-left: 3px solid var(--orange); line-height: 1.6;
}
.sec p { margin: 0 0 15px; color: var(--ink-mid); max-width: 66ch; }
.tw { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--r-l); }
table.rundown { border-collapse: collapse; width: 100%; font-size: 14.5px; min-width: 480px; background: #fff; }
table.rundown th {
  text-align: left; font-family: var(--latin); font-size: 10.5px; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase; color: #fff; background: var(--navy);
  padding: 11px 18px; white-space: nowrap;
}
table.rundown td { padding: 12px 18px; border-bottom: 1px solid var(--line-light); color: var(--ink-mid); vertical-align: top; }
table.rundown tr:last-child td { border-bottom: 0; }
table.rundown .rt { white-space: nowrap; color: var(--navy-deep); font-weight: 600; width: 1%; }
table.rundown td b { color: var(--ink); font-weight: 700; display: block; }
table.rundown .rd { display: block; font-size: 13px; color: var(--mute); margin-top: 3px; line-height: 1.7; }
table.rundown tr.rest td { background: var(--paper-sunk); }
table.rundown tr.rest td b { color: var(--mute); font-weight: 500; }
.tbl-note { font-size: 13px; color: var(--faint); margin: -12px 0 22px; }

.note { border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px 22px; margin: 0 0 18px; background: #fff; }
.note h5 {
  font-family: var(--latin); font-size: 10.5px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; margin: 0 0 10px; color: var(--mute);
}
.note ul { margin: 0; padding-left: 22px; color: var(--ink-mid); font-size: 14.5px; max-width: none; }
.note li { margin-bottom: 7px; line-height: 1.8; }
.note li:last-child { margin-bottom: 0; }
.note li::marker { color: var(--faint); }
.note.key { background: var(--navy-soft); border-color: #C7D9EE; }
.note.key h5 { color: var(--navy); }
.note.warn { background: var(--warn-soft); border-color: #F0DDB5; }
.note.warn h5 { color: var(--warn); }

/* ---------- 作業繳交 ---------- */
.assign { border: 1px solid var(--line); border-left: 3px solid var(--orange); border-radius: var(--r-l); padding: 20px 24px; background: #fff; }
.assign-t { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.assign-d { font-size: 14.5px; color: var(--ink-mid); margin: 0 0 16px; max-width: 66ch; }
.assign-act { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.assign-act .btn { padding: 9px 16px; font-size: 14px; }
.assign-hint { font-size: 12.5px; color: var(--faint); flex: 1; min-width: 200px; }

/* ---------- 事前準備(info.html 的 .check + .prog) ---------- */
.prog { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; }
.prog b { font-family: var(--latin); font-size: 12.5px; font-weight: 600; color: var(--mute); white-space: nowrap; }
.pbar { flex: 1; height: 6px; background: var(--paper-sunk); overflow: hidden; max-width: 300px; border-radius: 3px; }
.pbar i { display: block; height: 100%; background: var(--orange); transition: width .3s; }
.check { border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; margin: 0 0 16px; }
.check label {
  display: flex; gap: 14px; align-items: flex-start; padding: 15px 20px; background: #fff;
  cursor: pointer; border-bottom: 1px solid var(--line-light); transition: background .14s;
}
.check label:last-child { border-bottom: 0; }
.check label:hover { background: var(--navy-tint); }
.check input {
  appearance: none; width: 18px; height: 18px; flex: 0 0 auto; margin-top: 4px;
  border: 1.5px solid #B7C2CF; border-radius: var(--r-s); background: #fff;
  cursor: pointer; position: relative; transition: background .14s, border-color .14s;
}
.check input:checked { background: var(--navy); border-color: var(--navy); }
.check input:checked::after {
  content: ""; position: absolute; left: 5.5px; top: 1.5px; width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(42deg);
}
.check .c-main { flex: 1; min-width: 0; }
.check .c-t { font-size: 14.5px; font-weight: 700; color: var(--ink); line-height: 1.6; }
.check label.done .c-t { color: var(--faint); text-decoration: line-through; }
.check .c-d { font-size: 13px; color: var(--mute); margin-top: 2px; line-height: 1.7; }
.check .c-act { margin-top: 9px; display: flex; gap: 8px; align-items: center; }
.check .c-act .btn { padding: 4.5px 11px; font-size: 12px; }

/* ---------- 講義 / 素材列 ---------- */
.res-list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.res-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 18px; background: #fff;
  border-bottom: 1px solid var(--line-light); transition: background-color .14s;
}
.res-row:last-child { border-bottom: 0; }
a.res-row { text-decoration: none; color: inherit; }
a.res-row:hover { background: var(--navy-tint); }
.res-row.pending { background: var(--paper-sunk); }
.res-ic { width: 30px; height: 30px; border-radius: var(--r-s); display: grid; place-items: center; flex: none; color: #fff; }
.res-ic.doc { background: var(--navy); }
.res-ic.link { background: var(--orange-deep); }
.res-row.pending .res-ic { background: #fff; color: var(--faint); border: 1px solid var(--line); }
.res-ic svg { width: 15px; height: 15px; }
.res-main { flex: 1; min-width: 0; }
.res-title { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-row.pending .res-title { color: var(--ink-soft); }
.res-sub { font-size: 12px; color: var(--faint); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-flag {
  flex: none; font-family: var(--latin); font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: 3px 9px; border-radius: var(--r-s);
}
.res-flag.ready { background: var(--good-soft); color: var(--good); }
.res-flag.wait { background: var(--warn-soft); color: var(--warn); }

/* ---------- 課綱(info.html 的 .steps) ---------- */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; max-width: 70ch; }
.steps > li { counter-increment: s; position: relative; padding-left: 44px; margin-bottom: 22px; }
.steps > li:last-child { margin-bottom: 0; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 4px;
  width: 24px; height: 24px; background: var(--navy); color: #fff;
  font-family: var(--latin); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border-radius: var(--r-s);
}
.steps > li::after { content: ""; position: absolute; left: 11.5px; top: 32px; bottom: -14px; width: 1px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps > li > b { display: flex; align-items: baseline; gap: 10px; font-size: 15px; color: var(--ink); margin-bottom: 3px; font-weight: 700; line-height: 1.6; }
.steps .hrs { font-family: var(--latin); font-size: 11.5px; font-weight: 600; color: var(--orange-deep); white-space: nowrap; }
.steps .sd { font-size: 13.5px; color: var(--mute); line-height: 1.75; }

/* ---------- 授課團隊 ---------- */
.crew { border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; max-width: 560px; }
.crew-row { display: flex; align-items: center; gap: 13px; padding: 13px 18px; background: #fff; border-bottom: 1px solid var(--line-light); }
.crew-row:nth-child(even) { background: var(--navy-tint); }
.crew-row:last-child { border-bottom: 0; }
.crew-av { width: 32px; height: 32px; border-radius: var(--r-s); display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; flex: none; }
.crew-meta { line-height: 1.4; flex: 1; }
.crew-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.crew-role { font-family: var(--latin); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }

/* ---------- 上一班 / 下一班 ---------- */
.pager { display: flex; gap: 14px; margin-top: 54px; border-top: 3px solid var(--navy); padding-top: 18px; }
.pager a {
  flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; text-decoration: none;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); color: var(--ink);
  transition: border-color .14s, background-color .14s;
}
.pager a:hover { border-color: var(--navy); background: var(--navy-tint); }
.pager .dir { font-family: var(--latin); font-size: 10.5px; letter-spacing: .14em; color: var(--orange-deep); font-weight: 700; text-transform: uppercase; }
.pager .nm { font-size: 14px; font-weight: 700; }
.pager .next { text-align: right; align-items: flex-end; }
.pager .spacer { flex: 1; visibility: hidden; }

/* ---------- 其他 ---------- */
.role-pill {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--latin);
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 10px; border-radius: var(--r-s);
}
.role-pill.admin { background: var(--navy-soft); color: var(--navy); }
.role-pill.client { background: var(--orange-soft); color: var(--orange-deep); }
.topbar-pill { align-self: center; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(8px); opacity: 0;
  background: var(--navy-deep); color: #fff; padding: 10px 18px; border-radius: var(--r-m); font-size: 13px; font-weight: 500;
  z-index: 200; transition: opacity .16s, transform .16s; pointer-events: none; display: flex; align-items: center; gap: 9px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- 響應式 ---------- */
@media (max-width: 920px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; min-width: 0; }
  .brand { border-bottom: 0; border-right: 1px solid var(--line); flex: 1; }
  .nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; flex: none; width: 100%; border-top: 1px solid var(--line); padding: 8px 12px; gap: 6px; -webkit-overflow-scrolling: touch; }
  .nav a { flex: none; white-space: nowrap; justify-content: center; font-size: 13px; padding: 7px 13px; border: 1px solid var(--line); border-left-width: 1px; border-radius: var(--r-s); }
  .nav a.active { border-color: var(--navy); background: var(--navy); color: #fff; border-radius: var(--r-s); }
  .nav a.active .nav-date { color: rgba(255,255,255,.75); }
  .nav a.active::before { display: none; }
  .nav-label { display: none; }
  .nav-date { display: none; }
  .users { padding: 8px 14px; border-top: 1px solid var(--line); width: 100%; }
  .users .u-label, .users .u-row { display: none; }
  .logout-btn { margin: 0; max-width: 180px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding-right: 14px; }
  .stat .v { font-size: 22px; }
  .content, .topbar { padding-left: 20px; padding-right: 20px; }
  .topbar h1 { font-size: 16.5px; }
  .mast-in { padding: 13px 20px; }
  .mast-m { display: none; }
  .facts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .pager { flex-direction: column; }
  .pager .next { text-align: left; align-items: flex-start; }
  .facts { grid-template-columns: 1fr; }
  .fact { border-right: 0; border-bottom: 1px solid var(--line-light); }
  .fact:last-child { border-bottom: 0; }
}

@media print {
  .sidebar, .topbar, .filters, .pager, .mt-open, .mast { display: none !important; }
  .app { display: block; } .content { padding: 0; }
  body { background: #fff; }
}
