/* 週三直播記錄
 *
 * 大面積用無彩度的灰(亮、暗都是),顏色只給強調:按鈕、進度、目前這一段、封面。
 * 強調色是橘(亮 #c2560a / 暗 #ffa75a),要換色只改 --accent / --on-accent / --sun / --lava。
 * 亮/暗/跟隨系統三段切換,存在 localStorage 的 wed_theme,跟 blog 同一個 key 名。
 * 深色那組寫兩次是必要的:一次給「系統深色且沒手動選亮色」,一次給「手動選了深色」。
 * 區塊靠底色和陰影分層,不畫外框;外框只留給輸入框。
 */
:root {
  --fg: #171717; --muted: #737373; --bg: #f5f5f5; --card: #ffffff; --soft: #ececec;
  --border: #e4e4e4; --accent: #c2560a; --on-accent: #ffffff;
  --accent-weak: color-mix(in srgb, var(--accent) 9%, var(--card));
  --sun: #f59e0b; --lava: #ea580c; --all: #64748b;
  --bad-bg: #fbf1ef; --bad: #a4362c; --bad-fg: #7d2b23;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 10px 28px -16px rgba(0,0,0,.2);
  --shadow-lift: 0 2px 4px rgba(0,0,0,.07), 0 20px 44px -18px rgba(0,0,0,.3);
  --r: 14px; --r-sm: 10px; --ease: cubic-bezier(.2, .7, .2, 1);
  --gut: clamp(1rem, 3.5vw, 3rem); --maxw: 46rem; --maxw-wide: 96rem; --hh: 3.5rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fg: #f1f1f1; --muted: #a3a3a3; --bg: #0f0f0f; --card: #1a1a1a; --soft: #262626;
    --border: #2e2e2e; --accent: #ffa75a; --on-accent: #1a1208; --sun: #ffb347; --lava: #f5731f; --all: #8b9bb0;
    --bad-bg: #2a1614; --bad: #ff8a80; --bad-fg: #ffb4ab;
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 28px -16px rgba(0,0,0,.7);
    --shadow-lift: 0 1px 0 rgba(255,255,255,.05) inset, 0 22px 46px -18px rgba(0,0,0,.85);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fg: #f1f1f1; --muted: #a3a3a3; --bg: #0f0f0f; --card: #1a1a1a; --soft: #262626;
  --border: #2e2e2e; --accent: #ffa75a; --on-accent: #1a1208; --sun: #ffb347; --lava: #f5731f; --all: #8b9bb0;
  --bad-bg: #2a1614; --bad: #ff8a80; --bad-fg: #ffb4ab;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 28px -16px rgba(0,0,0,.7);
  --shadow-lift: 0 1px 0 rgba(255,255,255,.05) inset, 0 22px 46px -18px rgba(0,0,0,.85);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.6; font-size: 15px; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
img { max-width: 100%; height: auto; }
.ic { flex: none; vertical-align: -.18em; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  /* 只用 backwards:動畫結束後不能留著 transform,否則 main 會變成 fixed 小視窗的定位基準,小視窗就跟著頁面捲走 */
  main { animation: rise .4s var(--ease) backwards; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } }
}

main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut) 5rem; }
main.wide { max-width: var(--maxw-wide); }

/* ── 站頭 ── */
header.top {
  position: sticky; top: 0; z-index: 40; height: var(--hh);
  display: flex; align-items: center; gap: 1.25rem; padding: 0 var(--gut);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
header.top .brand { display: flex; align-items: center; gap: .6rem; color: var(--fg); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
header.top .brand:hover { text-decoration: none; }
header.top .logo { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 9px; color: #fff; background: linear-gradient(145deg, var(--sun), var(--lava)); box-shadow: 0 4px 10px -4px var(--lava); }
header.top .logo .ic { margin-left: 1px; }
header.top nav { display: flex; gap: .15rem; flex: 1; margin-left: .75rem; }
header.top nav a { color: var(--muted); padding: .35rem .85rem; border-radius: 999px; font-size: .93rem; transition: background .18s, color .18s; }
header.top nav a:hover { color: var(--fg); background: var(--soft); text-decoration: none; }
header.top nav a.on { color: var(--fg); background: var(--soft); font-weight: 600; }
header.top .who { display: flex; align-items: center; gap: .6rem; font-size: .9rem; color: var(--muted); }
.avatar { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; color: var(--on-accent); background: linear-gradient(145deg, var(--sun), var(--lava)); font-weight: 700; font-size: .85rem; }
.nm { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embedlink { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--muted); margin-left: auto; }
@media (max-width: 720px) {
  :root { --hh: 5.6rem; }
  header.top { align-content: center; flex-wrap: wrap; gap: .3rem .6rem; padding-top: .35rem; padding-bottom: .35rem; }
  header.top .brand { white-space: nowrap; font-size: 1rem; }
  header.top .who { margin-left: auto; white-space: nowrap; }
  header.top .who .btn { white-space: nowrap; }
  header.top nav { order: 3; flex: 0 0 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; }
  header.top nav a { white-space: nowrap; padding: .3rem .7rem; font-size: .88rem; }
  .nm { display: none; }
}

/* ── 按鈕 ── */
button { font: inherit; color: var(--fg); cursor: pointer; }
.btn, button.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .5rem 1.15rem; border-radius: 999px; border: 0; font-size: .95rem; font-weight: 600;
  background: var(--accent); color: var(--on-accent); transition: transform .15s var(--ease), box-shadow .15s, filter .15s;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 8px 18px -8px var(--accent); }
.btn.ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--border); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.btn.small { padding: .3rem .95rem; font-size: .88rem; }
.btn.big { padding: .75rem 1.6rem; font-size: 1rem; }
button.soft, .navbtns button, .opts button, .b2 {
  display: inline-flex; align-items: center; gap: .4rem; padding: .42rem .95rem; border-radius: 999px; border: 0;
  background: var(--soft); font-size: .9rem; font-weight: 500; transition: background .15s, transform .15s var(--ease);
}
button.soft:hover, .navbtns button:hover:not(:disabled), .opts button:hover { background: color-mix(in srgb, var(--soft) 70%, var(--accent) 14%); }
button.primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.07); }
button:disabled { opacity: .4; cursor: default; }
button.tg[aria-pressed="true"] { background: var(--accent-weak); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.iconbtn { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); transition: background .15s, color .15s; }
.iconbtn:hover { background: var(--soft); color: var(--fg); }
.linkbtn { border: 0; background: none; padding: 0 .2rem; color: var(--muted); font-size: .88rem; text-decoration: underline; }
.linkbtn:hover { color: var(--accent); }
.btn.line { background: #06c755; color: #fff; }

.sect { margin: 2.4rem 0 .9rem; font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.msg { color: var(--muted); padding: 1rem 0; }
.notice { margin: 1rem 0; padding: .7rem 1.1rem; background: var(--soft); border-radius: var(--r-sm); }
.pagetitle { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: 2rem 0 0; }

/* ── 首頁 首屏 ── */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding: clamp(1.5rem, 4vw, 3.4rem) 0 1.5rem; }
.eyebrow { margin: 0 0 .6rem; color: var(--accent); font-weight: 600; font-size: .88rem; letter-spacing: .1em; }
.hero h1 { font-size: clamp(1.9rem, 3.5vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; text-wrap: balance; }
.hero .sub { color: var(--muted); font-size: 1.05rem; margin: 1.1rem 0 1.4rem; max-width: 34rem; }
.stats { display: flex; gap: 1.8rem; margin-bottom: 1.6rem; }
.stats div { display: flex; align-items: baseline; gap: .35rem; }
.stats b { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: .88rem; }
.cta { display: flex; gap: .7rem; flex-wrap: wrap; }
.heroVideo { position: relative; aspect-ratio: 16/9; border-radius: 20px; overflow: hidden; background: #0a0a0a; box-shadow: var(--shadow-lift); }
.heroVideo iframe, .previewBtn { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.previewBtn { background-size: cover; background-position: center; border: 0; border-radius: 0; padding: 0; }
.previewBtn::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(0,0,0,.7)); }
.previewBtn .tri { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: 4.4rem; height: 4.4rem; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--sun), var(--lava)); box-shadow: 0 10px 30px -8px var(--lava); transition: transform .2s var(--ease); }
.previewBtn .tri .ic { margin-left: 3px; }
.previewBtn:hover .tri { transform: translate(-50%, -50%) scale(1.1); }
.previewBtn .cap { position: absolute; left: 1.2rem; bottom: 1rem; right: 1.2rem; color: #fff; text-align: left; font-weight: 600; font-size: 1rem; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }

/* ── 篩選列(黏在站頭下面) ── */
.filters { position: sticky; top: var(--hh); z-index: 30; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 calc(var(--gut) * -1) 1.1rem; padding: .7rem var(--gut); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.chip { padding: .3rem 1rem; border: 0; border-radius: 10px; background: var(--soft); font-size: .9rem; font-weight: 500; transition: background .15s, color .15s; }
.chip:hover { background: color-mix(in srgb, var(--soft) 75%, var(--fg) 12%); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.legend { color: var(--muted); font-size: .8rem; margin-left: .6rem; }
@media (max-width: 720px) { .legend { display: none; } }

/* ── 場次卡 ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); gap: 1.6rem 1.25rem; }
.course { position: relative; background: var(--card); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.course:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.course[hidden] { display: none; }
.cover { position: relative; display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 16/9; padding: .9rem 1.05rem; color: #fff; overflow: hidden; isolation: isolate; }
.cover::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(0,0,0,.5), transparent 38%), linear-gradient(transparent 62%, rgba(0,0,0,.4)); }
.cover::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.34) no-repeat center; opacity: 0; transition: opacity .25s; display: grid; }
.cover .ov { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transform: scale(.85); transition: opacity .25s, transform .25s var(--ease); z-index: 2; }
.cover .ov span { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--sun), var(--lava)); box-shadow: 0 10px 24px -8px var(--lava); }
.cover .ov .ic { margin-left: 2px; }
.course:hover .cover::after { opacity: 1; }
.course:hover .cover .ov { opacity: 1; transform: none; }
.cover .no { align-self: flex-start; font-size: .76rem; font-weight: 600; letter-spacing: .04em; padding: .12rem .55rem; border-radius: 6px; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); font-variant-numeric: tabular-nums; }
.cover .big { font-size: clamp(2.3rem, 3.2vw, 3rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 2px 14px rgba(0,0,0,.18); }
.cover .dur { position: absolute; right: .6rem; bottom: .6rem; z-index: 3; background: rgba(0,0,0,.72); color: #fff; font-size: .74rem; font-weight: 600; padding: .05rem .45rem; border-radius: 6px; font-variant-numeric: tabular-nums; }
.cover .pg { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.25); z-index: 3; }
.cover .pg i { display: block; height: 100%; background: #fff; }
.cbody { padding: .85rem 1rem 1.05rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.course h2 { font-size: 1.02rem; font-weight: 650; line-height: 1.35; }
.course h2 a { color: var(--fg); }
.course h2 a:hover { color: var(--accent); text-decoration: none; }
.cbody .meta { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .82rem; }
.cbody .meta .sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }
.need { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.lv { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; color: var(--fg); white-space: nowrap; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.dots i.on { background: var(--accent); }
.bar2 { height: 4px; border-radius: 2px; background: var(--soft); overflow: hidden; }
.bar2 i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), var(--lava)); width: 0; transition: width .4s var(--ease); }
details { margin-top: .2rem; }
details summary { display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; color: var(--muted); font-size: .82rem; list-style: none; padding: .15rem 0; }
details summary::-webkit-details-marker { display: none; }
details summary:hover { color: var(--accent); }
details[open] summary .ic { transform: rotate(180deg); }
ol.mini { list-style: none; margin: .4rem 0 0; padding: 0; font-size: .86rem; }
ol.mini a { display: flex; gap: .6rem; align-items: center; padding: .38rem 0; color: var(--fg); }
ol.mini a:hover { color: var(--accent); text-decoration: none; }
ol.mini .t { flex: 1; } ol.mini .d { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.mk { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--soft); color: var(--muted); font-size: .7rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.mk.ok { background: var(--accent); color: var(--on-accent); }

/* 載入中的骨架 */
.sk { background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.sk .a { aspect-ratio: 16/9; } .sk .l { height: .8rem; border-radius: 6px; margin: .85rem 1rem 0; } .sk .l.s { width: 55%; margin-bottom: 1.05rem; }
.sk .a, .sk .l { background: linear-gradient(100deg, var(--soft) 30%, color-mix(in srgb, var(--soft) 60%, var(--card)) 50%, var(--soft) 70%) 0 0 / 220% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* 繼續上次的進度 */
.resume { display: flex; align-items: center; gap: 1.1rem; padding: .7rem 1.1rem .7rem .7rem; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); color: var(--fg); max-width: 40rem; transition: transform .2s var(--ease), box-shadow .2s; }
.resume:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.rthumb { position: relative; width: 9.5rem; aspect-ratio: 16/9; border-radius: 10px; background: #0a0a0a center/cover; flex: none; overflow: hidden; }
.rthumb .pg { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0,0,0,.4); } .rthumb .pg i { display: block; height: 100%; background: var(--accent); }
.rtext { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.4; } .rtext small { color: var(--muted); } .rtext b { font-weight: 650; }

.how { margin-top: 3rem; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.1rem; margin-top: 1rem; }
.steps div { background: var(--card); border-radius: var(--r); padding: 1.2rem 1.25rem; box-shadow: var(--shadow); }
.steps b { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--accent-weak); color: var(--accent); font-size: .9rem; }
.steps h3 { margin: .6rem 0 .25rem; font-size: 1rem; font-weight: 650; } .steps p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.65; }

/* ── 登入彈窗 + 訪客提示條 ── */
.loginDlg { border: 0; border-radius: 22px; padding: 2.1rem 1.9rem 1.7rem; width: min(26rem, calc(100vw - 2rem)); box-shadow: 0 30px 80px rgba(0,0,0,.4); background: var(--card); color: var(--fg); }
.loginDlg::backdrop { background: rgba(20,14,8,.6); backdrop-filter: blur(6px); }
.loginDlg h2 { font-size: 1.35rem; font-weight: 750; margin-bottom: .4rem; }
.loginDlg .why { margin: 0 0 1rem; color: var(--muted); font-size: .93rem; }
.loginDlg .x { position: absolute; top: .7rem; right: .7rem; display: grid; place-items: center; width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: none; color: var(--muted); padding: 0; }
.loginDlg .x:hover { background: var(--soft); color: var(--fg); }
.perks { margin: 0 0 1.3rem; padding: 0; list-style: none; font-size: .92rem; }
.perks li { display: flex; gap: .6rem; align-items: baseline; margin: .4rem 0; } .perks .ic { color: var(--accent); }
.loginDlg .btn.big { display: flex; margin-bottom: .6rem; }
.loginDlg .fine { margin: .9rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.6; }
.guestbar { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 1rem; padding: .5rem .55rem .5rem 1.2rem; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: .9rem; box-shadow: 0 14px 40px -10px rgba(0,0,0,.5); max-width: calc(100vw - 2rem); }
.guestbar .btn { background: var(--bg); color: var(--fg); }
body:has(.guestbar) { padding-bottom: 4.5rem; }
.gate { text-align: center; padding: 2.6rem 1rem; color: var(--muted); background: var(--soft); border-radius: var(--r); }
.gate .btn { margin-top: .8rem; }

/* ── 單場頁 ── */
.course-page { padding-top: 1.4rem; }
.lesson { display: grid; grid-template-columns: minmax(0, 1fr) 26rem; gap: 1.75rem; align-items: start; }
@media (max-width: 1060px) { .lesson { grid-template-columns: 1fr; gap: 1.2rem; } .mainCol { display: contents; } }
.mainCol { position: relative; min-width: 0; }
/* 影片黏在站頭正下方,內容在下面捲。高度限制在螢幕一半左右,才留得出看內容的空間。 */
.pslot { position: sticky; top: var(--hh); z-index: 6; width: min(100%, calc(54vh * 16 / 9)); aspect-ratio: 16 / 9; }
.player { position: absolute; inset: 0; background: #000; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lift); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.minibar { display: none; }
/* 縮小:固定在右下角,同一個 iframe 所以不會中斷播放 */
.player.mini { position: fixed; inset: auto 1.2rem 1.2rem auto; width: min(23rem, 62vw); height: auto; aspect-ratio: 16/9; z-index: 50; border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.5); animation: pop .25s var(--ease); }
.player.mini .minibar { display: flex; position: absolute; top: 0; left: 0; right: 0; z-index: 2; align-items: center; gap: .5rem; padding: .35rem .55rem; background: linear-gradient(rgba(0,0,0,.8), transparent); color: #fff; font-size: .78rem; opacity: 0; transition: opacity .15s; }
.player.mini:hover .minibar { opacity: 1; }
.minibar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.minibar button { padding: .12rem .6rem; font-size: .75rem; border: 0; border-radius: 999px; background: rgba(255,255,255,.92); color: #171717; }
@keyframes pop { from { transform: translateY(14px) scale(.97); opacity: 0; } }
@media (max-width: 1060px) { .player.mini { inset: auto .7rem .7rem auto; width: 55vw; } }

.titlebar { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: 1.2rem 0 .5rem; flex-wrap: wrap; }
.kicker { color: var(--accent); font-size: .82rem; font-weight: 650; letter-spacing: .02em; }
#title { margin: .15rem 0 0; font-size: 1.55rem; font-weight: 750; letter-spacing: -.02em; }
.navbtns { display: flex; gap: .5rem; }
.opts { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: .3rem 0 .6rem; }
.auto { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .86rem; margin: 0; }
.auto input { accent-color: var(--accent); }

.ptabs { display: flex; gap: .1rem; margin: 1.1rem 0 1.3rem; overflow-x: auto; scrollbar-width: none; box-shadow: 0 1px 0 var(--border); }
.ptabs button { display: inline-flex; align-items: center; gap: .45rem; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: .8rem 1rem; color: var(--muted); font-size: .92rem; font-weight: 500; white-space: nowrap; transition: color .15s; }
.ptabs button[hidden] { display: none; }
.ptabs button:hover { color: var(--fg); }
.ptabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); font-weight: 650; }
.ptabs button[aria-selected="true"] .ic { color: var(--accent); }
.tp[hidden] { display: none; }
.summary { margin: 0 0 1.2rem; font-size: 1.02rem; line-height: 1.8; max-width: 46rem; }
#meta { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.6rem; font-size: .92rem; margin: 0 0 1.4rem; }
#meta dt { color: var(--muted); } #meta dd { margin: 0; font-variant-numeric: tabular-nums; display: flex; align-items: center; }
.nextcard { width: 100%; max-width: 46rem; text-align: left; display: flex; flex-direction: column; gap: .1rem; padding: 1rem 1.2rem; border: 0; border-radius: var(--r); background: var(--accent-weak); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 40%, transparent); transition: transform .2s var(--ease); }
.nextcard:hover { transform: translateY(-2px); }
.nextcard small { color: var(--accent); font-weight: 600; } .nextcard b { font-weight: 650; } .nextcard .d { color: var(--muted); font-size: .84rem; }

/* 逐字稿 */
.trbar { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: .7rem; font-size: .86rem; color: var(--muted); }
.trbar input[type=search] { flex: 1; min-width: 12rem; padding: .5rem .9rem; border: 0; border-radius: 999px; font: inherit; background: var(--soft); color: inherit; }
.trbar input[type=checkbox] { accent-color: var(--accent); }
.trlist { max-height: 60vh; overflow-y: auto; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); padding: .35rem 0; }
.cue { display: flex; gap: 1rem; width: 100%; text-align: left; border: 0; border-radius: 0; background: none; padding: .42rem 1.1rem; line-height: 1.6; font-size: .95rem; }
.cue[hidden] { display: none; }
.cue:hover { background: var(--soft); }
.cue.on { background: var(--accent-weak); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.cue .ct { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; flex: none; padding-top: .2rem; min-width: 2.4rem; }

/* 右側這一場的章節(像播放清單,每段有縮圖) */
.side { position: sticky; top: calc(var(--hh) + .9rem); border-radius: var(--r); background: var(--card); overflow: hidden; box-shadow: var(--shadow); }
@media (max-width: 1060px) { .side { position: static; } }
.sidehead { padding: .9rem 1rem .8rem; display: flex; flex-direction: column; gap: .55rem; box-shadow: 0 1px 0 var(--border); }
.sidehead select { width: 100%; padding: .5rem .7rem; border: 0; border-radius: var(--r-sm); background: var(--soft); color: inherit; font: inherit; font-size: .9rem; font-weight: 600; }
.prog small { color: var(--muted); font-size: .78rem; }
ol.toc { position: relative; list-style: none; margin: 0; padding: .35rem 0; max-height: calc(100vh - 13rem); overflow-y: auto; }
ol.toc button { width: 100%; text-align: left; display: flex; gap: .8rem; align-items: center; border: 0; border-radius: 0; background: none; padding: .5rem 1rem; transition: background .15s; }
ol.toc button:hover { background: var(--soft); }
ol.toc button[aria-current="true"] { background: var(--accent-weak); }
.th { position: relative; width: 7.6rem; aspect-ratio: 16/9; flex: none; border-radius: 8px; overflow: hidden; background: #0a0a0a center/cover; }
.th .dur { position: absolute; right: .3rem; bottom: .3rem; background: rgba(0,0,0,.75); color: #fff; font-size: .68rem; font-weight: 600; padding: 0 .35rem; border-radius: 4px; font-variant-numeric: tabular-nums; }
.th .pg { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0,0,0,.4); } .th .pg i { display: block; height: 100%; background: var(--accent); }
.th .st { position: absolute; left: .3rem; top: .3rem; display: grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; }
.th .st.ok { background: var(--accent); color: var(--on-accent); }
.th .lk { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; }
.tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; line-height: 1.35; }
.tx .t { font-size: .88rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tx .n { color: var(--muted); font-size: .76rem; display: flex; align-items: center; gap: .35rem; }
ol.toc button[aria-current="true"] .n { color: var(--accent); font-weight: 600; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: .8rem; } .eq i { width: 2px; background: currentColor; border-radius: 1px; animation: eq 1s ease-in-out infinite; } .eq i:nth-child(2) { animation-delay: .2s; } .eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: .8rem; } }

/* 留言、助教、聊天 */
input, textarea, select { font: inherit; color: inherit; }
#commentForm textarea, .noteform textarea { width: 100%; min-height: 4.5rem; padding: .75rem .95rem; border: 0; border-radius: var(--r-sm); background: var(--soft); resize: vertical; }
#commentForm textarea:focus, .noteform textarea:focus, .send input:focus, #tutorForm input:focus { outline: none; box-shadow: 0 0 0 2px var(--accent); }
#commentForm button { margin-top: .6rem; }
#commentList { margin-top: 1.2rem; }
#commentList .row { padding: .95rem 0; white-space: pre-wrap; box-shadow: 0 1px 0 var(--border); }
#commentList .name { font-size: .86rem; color: var(--muted); margin-bottom: .15rem; }
#commentList .host { padding: .95rem 1.1rem; box-shadow: none; background: var(--accent-weak); border-radius: var(--r-sm); margin: .4rem 0 .9rem; }
#commentList .host .name { color: var(--accent); font-weight: 600; }

#tutor { display: flex; flex-direction: column; height: 60vh; }
#tutor[hidden] { display: none; }
#tutorLog { flex: 1; overflow-y: auto; padding-right: .2rem; }
#tutorLog:empty::before { content: "問這場錄影的內容。AI 讀過整場逐字稿,沒講到的它會說不知道。"; display: block; color: var(--muted); font-size: .9rem; line-height: 1.7; }
#tutorLog .row, .log .row { margin: .7rem 0; font-size: .95rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
#tutorLog .me, .log .me { color: var(--muted); }
#tutorLog .me::before, .log .me::before { content: "你　"; }
#tutorLog .ai, .log .ai { padding: .7rem 1rem; background: var(--accent-weak); border-radius: var(--r-sm); }
#tutorLog .bad, .log .bad { padding: .7rem 1rem; background: var(--bad-bg); border-radius: var(--r-sm); color: var(--bad-fg); }
#tutorForm, .send { display: flex; gap: .5rem; margin-top: .8rem; }
#tutorForm input, .send input { flex: 1; padding: .6rem 1rem; border: 0; border-radius: 999px; background: var(--soft); font-size: .95rem; }
#tutorForm input:disabled, .send input:disabled { opacity: .6; }
.bar { display: flex; gap: .6rem; align-items: center; margin-bottom: .6rem; color: var(--muted); font-size: .88rem; }
.bar select { padding: .4rem .7rem; border: 0; border-radius: var(--r-sm); background: var(--soft); }
.log { flex: 1; overflow-y: auto; padding-right: .2rem; }
.log:empty::before { content: attr(data-empty); display: block; color: var(--muted); font-size: .9rem; line-height: 1.7; }
.log .who { color: var(--muted); font-size: .8rem; margin-right: .5rem; } .log .mine .who { color: var(--accent); }
.log .del { margin-left: .5rem; padding: 0 .4rem; font-size: .78rem; border: 0; background: var(--soft); border-radius: 6px; }
.hint { color: var(--muted); font-size: .84rem; min-height: 1.3em; margin-top: .3rem; }
#chatPane { display: flex; flex-direction: column; height: 60vh; }
#chatPane[hidden] { display: none; }
.pane { display: flex; flex-direction: column; height: 70vh; max-width: var(--maxw); } .pane[hidden] { display: none; }
.tabs { display: flex; gap: .4rem; margin: 1.2rem 0 .9rem; }
.tabs button { padding: .4rem 1rem; border: 0; border-radius: 999px; background: var(--soft); font-weight: 500; }
.tabs button[aria-selected="true"] { background: var(--fg); color: var(--bg); }

/* 講義與簡報 PDF */
.pdf { height: 78vh; background: var(--soft); border-radius: var(--r); overflow: hidden; }
.pdf iframe { width: 100%; height: 100%; border: 0; }
.pdflinks { display: flex; gap: 1.2rem; font-size: .92rem; margin: .6rem 0 0; }

/* ── 投票與回饋 ── */
.vsec { margin: 1.8rem 0; }
.vsec h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .3rem; }
.opt { display: flex; gap: .9rem; align-items: flex-start; padding: .95rem 1.1rem; margin: .55rem 0; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s; }
.opt:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.opt.on { background: var(--accent-weak); box-shadow: inset 0 0 0 1.5px var(--accent); }
.opt input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.obody { flex: 1; display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.ohead { display: flex; justify-content: space-between; gap: 1rem; } .cnt { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.uses { display: flex; flex-wrap: wrap; gap: .6rem; }
.uses .chip { border-radius: var(--r-sm); display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: .55rem .95rem; }
.uses .chip small { font-weight: 400; opacity: .75; font-size: .76rem; }
.heart { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1.2rem; border: 0; border-radius: 999px; background: var(--soft); font-weight: 600; }
.heart.on { background: var(--accent-weak); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.noteform { margin: 1rem 0; } .noteform label { display: block; font-size: .92rem; margin-bottom: .35rem; }
.noterow { display: flex; align-items: center; gap: .8rem; margin-top: .5rem; }
#hostNotes .row { padding: .75rem 0; white-space: pre-wrap; box-shadow: 0 1px 0 var(--border); }
#hostNotes .name { color: var(--muted); font-size: .84rem; }

/* ── 劇院模式 ── 整頁近黑、影片放大置中,影片邊緣透出一圈很淡的暖光(縮圖放大模糊)。不論亮暗主題一律是暗的。 */
html:has(body.theater), body.theater { overflow-x: clip; }
#glow { display: none; }
body.theater {
  --bg: #0f0f0f; --card: #1a1a1a; --soft: #262626; --border: #2e2e2e; --fg: #f1f1f1; --muted: #a3a3a3;
  --accent: #ffa75a; --on-accent: #1a1208; --sun: #ffb347; --lava: #f5731f; --bad-bg: #2a1614; --bad: #ff8a80; --bad-fg: #ffb4ab;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 28px -16px rgba(0,0,0,.7);
  --shadow-lift: 0 22px 46px -18px rgba(0,0,0,.85);
  color-scheme: dark;
}
body.theater main.course-page { max-width: 90rem; }
body.theater .lesson { grid-template-columns: 1fr; gap: 1.2rem; }
body.theater .pslot { width: min(100%, calc(64vh * 16 / 9)); margin-inline: auto; }
body.theater .player { border-radius: 14px; box-shadow: 0 0 0 1px rgba(255,255,255,.07), 0 24px 60px -24px #000; }
body.theater #glow {
  display: block; position: absolute; z-index: -1; inset: 0; pointer-events: none; transform: scale(1.07);
  background: center / cover; filter: blur(44px) saturate(1.5) brightness(1.15); opacity: .3; transition: background-image .6s;
}
body.theater .titlebar, body.theater .opts, body.theater .ptabs, body.theater .tp, body.theater .side { max-width: 62rem; margin-inline: auto; width: 100%; }
body.theater .titlebar { margin-top: 1.5rem; }
body.theater .side { position: static; }
body.theater ol.toc { max-height: none; }
body.theater header.top { background: color-mix(in srgb, var(--bg) 55%, transparent); border-bottom-color: transparent; }
@media (max-width: 1060px) { body.theater #glow { display: none; } }

/* ── 嵌入模式(?embed=1,例如放進格莉奇 OS 的視窗):只留一條小標列 ── */
html.embed { --hh: 2.6rem; }
html.embed header.top { position: static; }
html.embed header.top nav { display: none; }
html.embed .guestbar { display: none; }
html.embed body:has(.guestbar) { padding-bottom: 0; }
html.embed .course-page { padding-top: .6rem; }
html.embed .hero { padding-top: 1rem; }
html.embed .filters { top: 0; }

/* 底色一律無彩度灰;橘色只給強調(按鈕、進度、目前這一段、連結)。 */

header.top nav a.ext { display: inline-flex; align-items: center; gap: .3rem; }

.bmc { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .95rem; border-radius: 999px; background: #ffdd00; color: #171717; font-size: .86rem; font-weight: 700; white-space: nowrap; transition: filter .15s, transform .15s var(--ease); }
.bmc:hover { text-decoration: none; filter: brightness(.96); transform: translateY(-1px); }
@media (max-width: 720px) { .bmc span { display: none; } .bmc { padding: .35rem .6rem; } }

.th .st[hidden], .tp[hidden], .cue[hidden] { display: none; }

/* ── 投票頁、聊天頁:跟首頁同寬,左邊對齊 logo ── */
.pagetitle + .msg { margin: 0; padding: .4rem 0 1rem; max-width: 40rem; }
#hostNotes { max-width: 56rem; }
main.wide .pane { max-width: none; height: calc(100vh - 15rem); min-height: 26rem; padding: 1.1rem 1.25rem; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
main.wide .pane .send { margin-top: .9rem; }
main.wide .tabs { margin-top: 1rem; }

/* 已講過的場次 + 愛心 */
.past { list-style: none; margin: .6rem 0 0; padding: 0; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.past li { display: flex; align-items: center; gap: .9rem; padding: .6rem 1rem; box-shadow: 0 1px 0 var(--border); }
.past li:last-child { box-shadow: none; }
.past .dt { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; width: 2.8rem; flex: none; }
.past .pt { flex: 1; color: var(--fg); font-size: .93rem; } .past .pt:hover { color: var(--accent); text-decoration: none; }
.heart.small { padding: .25rem .7rem; font-size: .84rem; gap: .35rem; }

.uses { display: grid; gap: 0; }
.opt.uopt { width: 100%; border: 0; text-align: left; font: inherit; color: inherit; }

/* ── 投票頁(對照舊頁補回的元件) ── */
.vstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: .4rem 0 1.6rem; }
.vstats .stat { background: var(--card); border-radius: var(--r); padding: .9rem 1.1rem; box-shadow: var(--shadow); min-width: 0; }
.vstats .stat.hi { box-shadow: inset 0 0 0 1.5px var(--accent), var(--shadow); }
.vstats .k { color: var(--muted); font-size: .78rem; }
.vstats .v { font-size: 1.3rem; font-weight: 750; letter-spacing: -.01em; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vstats .s { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .vstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vcols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0 clamp(1.5rem, 4vw, 4rem); align-items: start; }
.vcols .vsec:first-child { margin-top: 0; }
@media (max-width: 900px) { .vcols { grid-template-columns: 1fr; } }
.rk { flex: none; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--soft); color: var(--muted); font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: .05rem; }
.rk.top { background: var(--accent-weak); color: var(--accent); }
.bar3 { display: flex; height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; margin-top: .25rem; }
.bar3 i { display: block; height: 100%; transition: width .4s var(--ease); }
.bar3 .o { background: var(--all); } .bar3 .m { background: var(--accent); }
.legend2 { display: flex; gap: 1rem; font-size: .78rem; color: var(--muted); margin: .2rem 0 .3rem; }
.legend2 span::before { content: ""; display: inline-block; width: .65rem; height: .65rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.legend2 .o::before { background: var(--all); } .legend2 .m::before { background: var(--accent); }
.sched { display: flex; align-items: baseline; gap: .9rem; padding: .8rem 1.1rem; margin: .5rem 0; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.sched .sd { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; } .sched .st { font-weight: 600; }
.fbcard { background: var(--card); border-radius: var(--r); padding: 1rem 1.2rem 1.1rem; box-shadow: var(--shadow); margin-top: 1.6rem; }
.fbcard h3 { margin: .1rem 0 .4rem; } .fbwho { color: var(--accent); font-size: .8rem; font-weight: 650; }
.pace { display: flex; gap: .5rem; margin: .2rem 0 .6rem; }
.ctin { width: 100%; margin-top: .5rem; padding: .6rem .9rem; border: 0; border-radius: var(--r-sm); background: var(--soft); font: inherit; }
.ctin:focus { outline: none; box-shadow: 0 0 0 2px var(--accent); }
/* 講過的:每場一張卡,有封面 */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.2rem; margin-top: .8rem; }
.pc { background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s; }
.pc:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.pimg { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--soft) center / cover; }
.pimg .pd { position: absolute; left: .6rem; top: .6rem; padding: .1rem .55rem; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: .76rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.pbody { padding: .7rem .9rem .85rem; display: flex; flex-direction: column; gap: .5rem; }
.pt { color: var(--fg); font-weight: 650; font-size: .95rem; line-height: 1.35; } .pt:hover { color: var(--accent); text-decoration: none; }
.pact { display: flex; align-items: center; justify-content: space-between; }
.plink { color: var(--muted); font-size: .82rem; } .plink:hover { color: var(--accent); }

/* 加入直播(Google Meet) */
.joinlive { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .95rem; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: .86rem; font-weight: 700; white-space: nowrap; transition: transform .15s var(--ease), filter .15s; }
.joinlive:hover { text-decoration: none; transform: translateY(-1px); filter: brightness(1.15); }
@media (max-width: 720px) { .joinlive span { display: none; } .joinlive { padding: .35rem .6rem; } }
.nextlive { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.2rem; padding: .9rem 1.1rem; max-width: 36rem; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.nextlive .nl-info { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.nextlive small { color: var(--accent); font-weight: 650; } .nextlive b { font-weight: 650; }

@media (max-width: 720px) {
  .guestbar { left: .75rem; right: .75rem; transform: none; max-width: none; border-radius: 16px; gap: .6rem; padding: .5rem .5rem .5rem .9rem; font-size: .82rem; }
  .guestbar .btn { white-space: nowrap; flex: none; }
}
@media (hover: none) { .cover .ov { opacity: 1; transform: none; } .cover .ov span { width: 2.6rem; height: 2.6rem; } }
.row.thinking { color: var(--muted); }
.row.thinking .dots { display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; animation: dots 1.4s steps(4, end) infinite; }
.row.thinking .wait { margin-left: .5rem; font-size: .8rem; opacity: .8; font-variant-numeric: tabular-nums; }
@keyframes dots { from { width: 0; } to { width: 1.2em; } }
@media (prefers-reduced-motion: reduce) { .row.thinking .dots { animation: none; } }

#aiLog .row.ai, #tutorLog .row.ai { position: relative; padding-left: 2.6rem; }
#aiLog .row.ai::before, #tutorLog .row.ai::before { content: ""; position: absolute; left: 0; top: .15rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--soft) url(glitch-avatar.webp) center / cover; }
#tabAi::before, button[data-tab="tutor"]::before { content: ""; display: inline-block; flex: none; width: 1.4em; height: 1.4em; margin-right: .4em; border-radius: 50%; background: var(--soft) url(glitch-avatar.webp) center / cover; vertical-align: -.35em; }
