/* =====================================================================
   tchcourse 課程資訊模組樣式
   主題色由 PHP 以 CSS 變數輸出在 #tc-app 上（--tc-accent 等）
   ===================================================================== */
@keyframes tcFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tc {
  --tc-accent: #ff91ce; --tc-accent2: #ffc1e2; --tc-deep: #8a114e; --tc-link: #e61e84;
  --tc-soft: #fff4fa; --tc-soft2: #ffe9f5; --tc-fill1: #ff91ce; --tc-fill2: #ffa6d6; --tc-fill3: #ffb6dc; --tc-fill4: #ffc8e6;
  --tc-ring: rgba(255,145,206,.35); --tc-bg: #f8fafc; --tc-font: 1.05rem; --tc-width: 1000px; --tc-radius: 18px;
  --tc-card: #fff; --tc-text: #2d3540; --tc-muted: #5f6b7a; --tc-line: #e8ecf1;
  --tc-ok: #2e7d32; --tc-ok-bg: #edf8ee; --tc-danger: #c62828; --tc-danger-bg: #fdecee; --tc-warn: #b26a00; --tc-warn-bg: #fff6e0;
  --tc-shadow: 0 8px 24px rgba(15,23,42,.06);
  box-sizing: border-box;
  width: 100%; max-width: var(--tc-width); margin: 16px auto 28px;
  color: var(--tc-text); background: var(--tc-bg);
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, -apple-system, sans-serif;
  font-size: var(--tc-font); line-height: 1.6;
  padding: 12px; border-radius: calc(var(--tc-radius) + 6px);
  text-align: left;
}
.tc *, .tc *::before, .tc *::after { box-sizing: border-box; }
.tc a { color: var(--tc-link); text-decoration: none; font-weight: 700; }
.tc a:hover { text-decoration: underline; }
.tc button { font: inherit; color: inherit; }
.tc table { border-collapse: collapse; width: 100%; margin: 0; }
.tc h2, .tc h3 { margin: 0; line-height: 1.3; }
.tc [hidden] { display: none !important; }
.tc small { font-size: .8em; }
.tc-muted { color: var(--tc-muted); }
.tc-sm { font-size: .88em; }
.tc-mt { margin-top: 18px; }
.tc-grow { flex: 1; }

/* ---------- 按鈕 ---------- */
.tc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px; border: 1px solid transparent;
  background: var(--tc-card); color: var(--tc-text); font-weight: 800; font-size: .92rem;
  cursor: pointer; transition: background .15s, box-shadow .15s, transform .1s; text-decoration: none !important; line-height: 1.3;
}
.tc-btn:active { transform: translateY(1px); }
.tc-btn:focus-visible, .tc-tab:focus-visible, .tc-view-btn:focus-visible, .tc-cell:focus-visible { outline: 3px solid var(--tc-ring); outline-offset: 2px; }
.tc-btn-primary { background: var(--tc-accent); color: #fff !important; box-shadow: 0 4px 12px var(--tc-ring); }
.tc-btn-primary:hover { filter: brightness(.95); }
.tc-btn-soft { background: var(--tc-soft2); color: var(--tc-deep) !important; }
.tc-btn-soft:hover { background: var(--tc-accent2); }
.tc-btn-ghost { background: var(--tc-card); border-color: var(--tc-line); color: var(--tc-text) !important; }
.tc-btn-ghost:hover { border-color: var(--tc-accent); color: var(--tc-deep) !important; }
.tc-btn-danger { background: var(--tc-danger-bg); color: var(--tc-danger) !important; }
.tc-btn-sm { padding: 4px 12px; font-size: .82rem; }
.tc-icon-only { padding: 8px 10px; }
.tc-select, .tc input[type=text], .tc input[type=date], .tc input[type=number], .tc input[type=time], .tc input[type=email], .tc input[type=url], .tc textarea, .tc select {
  font: inherit; font-size: .95rem; color: var(--tc-text); background: #fff;
  border: 1px solid #d5dbe3; border-radius: 10px; padding: 7px 10px; max-width: 100%;
}
.tc textarea { width: 100%; resize: vertical; line-height: 1.55; }
.tc input:focus, .tc textarea:focus, .tc select:focus { outline: none; border-color: var(--tc-accent); box-shadow: 0 0 0 3px var(--tc-ring); }

/* ---------- 頁首 ---------- */
.tc-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tc-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tc-who-pic { width: 44px; height: 44px; border-radius: 50%; background: var(--tc-soft2) center/cover no-repeat; border: 3px solid #fff; box-shadow: 0 4px 12px var(--tc-ring); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.tc-who-initial { color: var(--tc-deep); font-weight: 900; font-size: 1.1rem; }
.tc-who-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.tc-who-txt b { font-size: 1.1rem; }
.tc-who-txt small { color: var(--tc-muted); }
.tc-top-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* 編輯列 */
.tc-editbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; margin-bottom: 14px;
  background: #fff; border: 2px dashed var(--tc-accent2); border-radius: 14px; font-size: .9rem; }
.tc-editbar-hint { color: var(--tc-muted); }
.tc-editbar-links { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.tc-editbar-links a { padding: 4px 10px; border-radius: 999px; background: var(--tc-soft); color: var(--tc-deep); font-weight: 700; }
.tc-editbar-links a:hover { background: var(--tc-soft2); text-decoration: none; }
.tc-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 800; color: var(--tc-deep); user-select: none; }
.tc-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tc-switch-ui { width: 44px; height: 24px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background .2s; }
.tc-switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.tc-switch input:checked + .tc-switch-ui { background: var(--tc-accent); }
.tc-switch input:checked + .tc-switch-ui::after { transform: translateX(20px); }
.tc-switch input:focus-visible + .tc-switch-ui { box-shadow: 0 0 0 3px var(--tc-ring); }
.tc-edit-only { display: none !important; }
.tc.is-editing .tc-edit-only { display: inline-flex !important; }
.tc.is-editing div.tc-edit-only, .tc.is-editing .tc-edit-tip.tc-edit-only { display: block !important; }
.tc-edit-tip { padding: 8px 12px; margin: 0 0 12px; border-radius: 10px; background: var(--tc-warn-bg); color: #6b4a00; font-size: .88rem; }

/* 三大分頁 */
.tc-views { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; padding: 6px; background: #fff; border-radius: 16px; box-shadow: var(--tc-shadow); }
.tc-view-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 8px; border: 0; border-radius: 12px; background: transparent; font-weight: 900; font-size: 1.05rem; cursor: pointer; color: var(--tc-muted) !important; transition: all .2s; }
.tc-view-btn:hover { background: var(--tc-soft); color: var(--tc-deep) !important; }
.tc-view-btn.is-on { background: var(--tc-accent); color: #fff !important; box-shadow: 0 6px 16px var(--tc-ring); }
.tc-viewpanel { animation: tcFade .35s ease; }
.tc-viewpanel.is-off { display: none; }

/* ---------- 卡片、標題 ---------- */
.tc-card { background: var(--tc-card); border-radius: 16px; padding: 24px; box-shadow: var(--tc-shadow); margin-bottom: 16px; }
.tc-h-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.tc-h-row .tc-h { margin: 0; }
.tc-h { position: relative; padding-left: 16px; font-size: 1.55rem; font-weight: 900; color: var(--tc-deep); margin: 0 0 20px; }
.tc-h::before { content: ""; position: absolute; left: 0; top: .12em; bottom: .12em; width: 6px; border-radius: 4px; background: linear-gradient(180deg, var(--tc-accent), var(--tc-accent2)); }
.tc-h3 { font-size: 1.15rem; color: var(--tc-deep); margin: 16px 0 10px; }
.tc-empty { text-align: center; color: var(--tc-muted); padding: 36px 20px; }
.tc-content { line-height: 1.8; overflow-wrap: anywhere; }
.tc-content img { max-width: 100%; height: auto; }
.tc-content h3 { font-size: 1.15rem; margin: 18px 0 10px; color: var(--tc-text); }
.tc-content ul { padding-left: 1.3em; }
.tc-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: .78rem; font-weight: 700; }
.tc-badge { display: inline-block; padding: 5px 14px; border-radius: 999px; background: var(--tc-soft2); color: var(--tc-deep); font-weight: 800; font-size: .88rem; margin-bottom: 6px; }
.tc-tag { display: inline-block; padding: 3px 10px; border-radius: 8px; background: var(--tc-soft2); color: var(--tc-deep); font-weight: 800; font-size: .85rem; flex-shrink: 0; white-space: nowrap; }
.tc-tag-gray { background: #e2e8f0; color: #475569; }

/* 頁首大圖 */
.tc-hero { position: relative; overflow: hidden; border-radius: var(--tc-radius); padding: 30px 28px; margin-bottom: 18px; color: #fff;
  background: linear-gradient(135deg, var(--tc-accent) 0%, var(--tc-accent2) 100%); box-shadow: var(--tc-shadow); }
.tc-hero-glow { position: absolute; right: -10%; top: -40%; width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.3), transparent 65%); pointer-events: none; }
.tc-hero-in { position: relative; }
.tc-hero-title { font-size: 2.1rem; font-weight: 900; letter-spacing: 1px; line-height: 1.25; text-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tc-hero-sub { margin-top: 6px; font-size: 1.05rem; opacity: .96; }

/* 頁籤 */
.tc-tabwrap { position: sticky; top: 0; z-index: 30; background: var(--tc-bg); padding: 8px 0 2px; margin-bottom: 16px; }
.tc-standalone .tc-tabwrap { top: 0; }
.tc-tabbar { position: relative; display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 12px; }
.tc-tab { padding: 9px 18px; border-radius: 12px; border: 2px solid transparent; background: var(--tc-card); color: var(--tc-text) !important; font-weight: 800; font-size: 1rem; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.04); transition: all .2s; text-decoration: none !important; }
.tc-tab:hover { color: var(--tc-deep) !important; background: var(--tc-soft); }
.tc-tab.is-on { border-color: var(--tc-accent); background: var(--tc-soft); color: var(--tc-deep) !important; }
.tc-tab.is-hidden { opacity: .55; border-style: dashed; border-color: #cbd5e1; }
.tc-tab-add { border: 2px dashed var(--tc-accent2); color: var(--tc-deep) !important; background: transparent; box-shadow: none; }
.tc-tab-indicator { position: absolute; left: 0; top: 0; height: 4px; width: 0; border-radius: 4px; background: var(--tc-accent); transition: transform .3s cubic-bezier(.4,0,.2,1), width .3s; pointer-events: none; }
.tc-panel { display: none; }
.tc-panel.is-on { display: block; animation: tcFade .3s ease; }

/* 自我介紹 */
.tc-profile { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.tc-avatar { width: 120px; height: 120px; border-radius: 50%; background: var(--tc-soft2) center/cover no-repeat; border: 4px solid #fff; box-shadow: 0 8px 20px var(--tc-ring); flex-shrink: 0; }
.tc-avatar-initial { display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 900; color: var(--tc-deep); }
.tc-profile-txt { flex: 1; min-width: 220px; }
.tc-name { font-size: 1.6rem; font-weight: 900; margin-bottom: 6px; }
.tc-kv { display: grid; grid-template-columns: 120px 1fr; gap: 12px; margin-top: 24px; align-items: center; }
.tc-kv-k { font-weight: 800; color: var(--tc-deep); background: var(--tc-soft); padding: 6px 12px; border-radius: 8px; text-align: center; font-size: .95rem; }
.tc-kv-v { font-weight: 600; overflow-wrap: anywhere; }
.tc-note { padding: 16px 20px; border-left: 5px solid var(--tc-accent); background: var(--tc-soft); border-radius: 12px; margin-top: 20px; line-height: 1.75; }
.tc-note-h { display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--tc-deep); margin-bottom: 4px; font-size: 1.08rem; }
.tc-note-strong { border-left-width: 6px; padding: 20px; border-radius: 16px; }
.tc-note-strong b, .tc-note-strong strong { color: var(--tc-deep); }
.tc-note > .tc-content > :first-child, .tc-note-strong > :first-child { margin-top: 0; }
.tc-note > .tc-content > :last-child, .tc-note-strong > :last-child { margin-bottom: 0; }
.tc-hl { font-weight: 900; background: var(--tc-soft2); padding: 3px 10px; border-radius: 6px; }
.tc-certs { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.tc-cert { display: flex; align-items: flex-start; gap: 16px; padding: 18px; border-radius: 16px; background: #fff; border: 1px solid var(--tc-soft2); box-shadow: 0 4px 12px rgba(0,0,0,.03); transition: transform .25s, box-shadow .25s, border-color .25s; }
.tc-cert:hover { transform: translateY(-4px); border-color: var(--tc-accent); box-shadow: 0 12px 28px var(--tc-ring); }
.tc-cert-ico { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--tc-deep); background: linear-gradient(135deg, var(--tc-soft), var(--tc-soft2)); }
.tc-cert-name { font-weight: 800; line-height: 1.3; margin-bottom: 6px; }
.tc-cert-org { color: var(--tc-link); font-size: .86rem; font-weight: 700; }
.tc-cert-date { color: var(--tc-muted); font-size: .8rem; margin: 4px 0 8px; }

/* 規則清單 */
.tc-progress-text { margin-bottom: 14px; color: var(--tc-deep); font-weight: 800; }
.tc-rule { display: flex; gap: 12px; align-items: flex-start; padding: 13px 18px; margin-bottom: 10px; border-radius: 12px; background: #fff; border: 1px solid #eceff3; cursor: pointer; transition: all .2s; line-height: 1.7; }
.tc-rule:hover { border-color: var(--tc-accent2); }
.tc-rule-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #cbd5e1; flex-shrink: 0; margin-top: .25em; transition: all .2s; position: relative; }
.tc-rule.is-done { background: var(--tc-ok-bg); border-color: #c8e6c9; border-left: 6px solid var(--tc-ok); }
.tc-rule.is-done .tc-rule-dot { background: var(--tc-ok); border-color: var(--tc-ok); }
.tc-rule.is-done .tc-rule-dot::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* 課程計畫 */
.tc-plan-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.tc-plan-acts { display: flex; gap: 8px; margin-left: auto; }
.tc-seg { display: inline-flex; flex-wrap: wrap; background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 30px; padding: 4px; gap: 2px; }
.tc-seg-btn { padding: 7px 22px; border-radius: 24px; border: 0; background: transparent; color: var(--tc-muted); font-weight: 800; cursor: pointer; transition: all .25s; }
.tc-seg-btn.is-on { background: var(--tc-accent); color: #fff; box-shadow: 0 4px 12px var(--tc-ring); }
.tc-seg-sm .tc-seg-btn { padding: 5px 14px; font-size: .86rem; }
.tc-overview { margin-bottom: 22px; }
.tc-overview-t { font-weight: 800; margin-bottom: 10px; }
.tc-bar { display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: #f1f5f9; }
.tc-bar-round { border-radius: 13px; }
.tc-bar-seg { display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; min-width: 0; }
.tc-bar-seg.is-light, .tc-bar-seg0 { color: var(--tc-deep); }
.tc-bar-seg0 { background: var(--tc-soft2); }
.tc-bar-seg1 { background: var(--tc-fill1); }
.tc-bar-seg2 { background: var(--tc-fill2); }
.tc-bar-seg3 { background: var(--tc-fill3); color: var(--tc-deep); }
.tc-bar-seg4 { background: var(--tc-fill4); color: var(--tc-deep); }
.tc-plan-group { display: none; animation: tcFade .35s ease; }
.tc-plan-group.is-on { display: block; }
.tc-acc { border: 1px solid #eceff3; border-radius: 16px; overflow: hidden; margin-bottom: 12px; background: #fff; }
.tc-acc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; width: 100%; padding: 16px 20px; border: 0; background: #fafafa; text-align: left; cursor: pointer; font-weight: 800; transition: background .2s; }
.tc-acc-head:hover { background: var(--tc-soft); }
.tc-acc-stage { min-width: 160px; }
.tc-acc-topic { flex: 1; display: inline-flex; align-items: center; gap: 6px; color: var(--tc-link); }
.tc-acc-arrow { transition: transform .2s; color: var(--tc-muted); }
.tc-acc.is-open .tc-acc-arrow { transform: rotate(180deg); }
.tc-acc-body { display: none; padding: 18px 20px; border-top: 1px solid #eceff3; line-height: 1.8; }
.tc-acc.is-open .tc-acc-body { display: block; }
.tc-acc-line { display: flex; gap: 10px; align-items: flex-start; }
.tc-acc-line + .tc-acc-line { margin-top: 10px; }

/* 配分 */
.tc-grade-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 20px; }
.tc-grade { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: #fafafa; border: 1px solid #eceff3; }
.tc-grade-sw { width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0; }
.tc-grade-name { font-weight: 900; }
.tc-grade-desc { font-size: .86rem; color: var(--tc-muted); margin-top: 3px; }
.tc-grade-grid + .tc-note-strong { margin-top: 24px; }

/* 加扣分 */
.tc-pm { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; }
.tc-pm-box { border: 2px solid; border-radius: 16px; padding: 20px; background: #fafafa; }
.tc-pm-plus { border-color: #dcefdc; }
.tc-pm-minus { border-color: #f8dde0; }
.tc-pm-h { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.18rem; margin-bottom: 12px; }
.tc-pm-plus .tc-pm-h, .tc-pm-plus .tc-pm-item svg { color: var(--tc-ok); }
.tc-pm-minus .tc-pm-h, .tc-pm-minus .tc-pm-item svg { color: var(--tc-danger); }
.tc-pm-item { display: flex; align-items: flex-start; gap: 8px; line-height: 2; }
.tc-pm-item svg { flex-shrink: 0; margin-top: .55em; }

/* 步驟 */
.tc-steps-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tc-steps-head span { display: inline-flex; gap: 10px; align-items: center; }
.tc-steps-pct { color: var(--tc-deep); font-size: 1.1rem; }
.tc-steps-bar { height: 14px; border-radius: 7px; background: #e2e8f0; overflow: hidden; margin-bottom: 20px; }
.tc-steps-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--tc-accent2), var(--tc-accent)); transition: width .3s; }
.tc-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tc-step { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 16px; background: #fff; border: 2px solid #eceff3; cursor: pointer; transition: all .2s; }
.tc-step-no { width: 44px; height: 44px; border-radius: 50%; background: #f1f5f9; color: var(--tc-muted); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.2rem; flex-shrink: 0; transition: all .25s; }
.tc-step-t { font-weight: 900; color: var(--tc-deep); margin-bottom: 2px; }
.tc-step-d { color: var(--tc-muted); font-size: .94rem; }
.tc-step.is-done { background: var(--tc-soft); border-color: var(--tc-accent); }
.tc-step.is-done .tc-step-no { background: var(--tc-accent); color: #fff; box-shadow: 0 4px 12px var(--tc-ring); }

/* 情境切換 */
.tc-mode-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 18px; }
.tc-mode-btn { text-align: left; padding: 18px 20px; border-radius: 16px; background: #fff; border: 2px solid #eceff3; cursor: pointer; transition: all .2s; }
.tc-mode-btn.is-on { background: var(--tc-soft); border-color: var(--tc-accent); box-shadow: 0 4px 12px var(--tc-ring); }
.tc-mode-name { display: block; font-size: 1.15rem; font-weight: 900; color: var(--tc-deep); margin-bottom: 6px; }
.tc-mode-desc { display: block; color: var(--tc-muted); line-height: 1.6; font-size: .95rem; }
.tc-mode-panel { display: none; background: #fafafa; border-radius: 16px; padding: 22px; border: 1px solid #eceff3; animation: tcFade .3s ease; }
.tc-mode-panel.is-on { display: block; }
.tc-mode-title { font-size: 1.25rem; font-weight: 900; color: var(--tc-deep); margin-bottom: 10px; }
.tc-mode-cond { margin-bottom: 16px; }
.tc-mode-cond strong { color: var(--tc-danger); background: var(--tc-danger-bg); padding: 2px 6px; border-radius: 4px; }
.tc-mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.tc-mode-item { padding: 15px; border-radius: 12px; border-left: 5px solid; }
.tc-mode-lb { display: flex; align-items: center; gap: 6px; font-weight: 900; }
.tc-mode-tx { margin-top: 6px; }
.tc-k-ok { background: var(--tc-ok-bg); border-color: var(--tc-ok); } .tc-k-ok .tc-mode-lb { color: var(--tc-ok); }
.tc-k-no { background: var(--tc-danger-bg); border-color: var(--tc-danger); } .tc-k-no .tc-mode-lb { color: var(--tc-danger); }
.tc-k-warn { background: var(--tc-warn-bg); border-color: #f59e0b; } .tc-k-warn .tc-mode-lb { color: var(--tc-warn); }

/* 金句 */
.tc-quotes { background: #fafafa; border-radius: 16px; padding: 22px; border: 1px solid #eceff3; font-size: 1.12rem; font-weight: 600; }
.tc-quote { display: flex; gap: 12px; align-items: flex-start; line-height: 2; }
.tc-quote + .tc-quote { margin-top: 10px; }
.tc-quote-mk { color: var(--tc-accent); font-size: 1.5rem; line-height: 1.4; }

/* ---------- 課表 ---------- */
.tc-sch-head { text-align: center; margin-bottom: 16px; }
.tc-sch-school { font-size: 1.2rem; font-weight: 900; }
.tc-sch-title { font-size: 1.45rem; font-weight: 900; color: var(--tc-deep); }
.tc-sch-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
.tc-sch-table { table-layout: fixed; min-width: 620px; background: #fff; }
.tc-sch-table th, .tc-sch-table td { border: 1px solid #cfd6df; text-align: center; vertical-align: middle; }
.tc-sch-table thead th { background: var(--tc-soft); color: var(--tc-deep); font-weight: 900; padding: 10px 4px; font-size: .95rem; }
.tc-sch-table thead th.is-today { background: var(--tc-accent); color: #fff; }
.tc-sch-corner { width: 108px; font-size: .85rem !important; }
.tc-sch-period { background: #fafbfc; padding: 8px 4px; font-weight: 400; }
.tc-sch-period b, .tc-sch-break b { display: block; font-size: .95rem; }
.tc-sch-period small, .tc-sch-break small { display: block; color: var(--tc-muted); font-family: Verdana, sans-serif; font-weight: 700; font-size: .78rem; }
.tc-sch-break th { background: #f6f7f9; padding: 6px; font-weight: 400; }
.tc-sch-break th b, .tc-sch-break th small { display: inline; margin: 0 6px; }
.tc-cell { height: 74px; padding: 4px; position: relative; transition: background .2s; }
.tc-cell.has-class { background: var(--cell, var(--tc-soft)); }
.tc-cell-in { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.3; }
.tc-subj { font-weight: 800; font-size: 1rem; }
.tc-cls { font-size: .84rem; color: #3b4552; }
.tc-cell-note { font-size: .72rem; color: var(--tc-muted); }
.tc-topic { font-size: .72rem; color: var(--tc-deep); background: rgba(255,255,255,.75); border-radius: 6px; padding: 1px 6px; margin-top: 3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-sch-table td.is-today { box-shadow: inset 0 0 0 2px var(--tc-accent2); }
.tc-sch-table tr.is-now th.tc-sch-period { background: var(--tc-accent); color: #fff; }
.tc-sch-table tr.is-now th.tc-sch-period small { color: #fff; }
.tc-sch-table tr.is-now td.is-today { box-shadow: inset 0 0 0 3px var(--tc-accent); }
.tc-sch-break.is-now th { background: var(--tc-soft2); }
.tc.is-editing .tc-cell { cursor: pointer; }
.tc.is-editing .tc-cell:hover { box-shadow: inset 0 0 0 2px var(--tc-accent); background: var(--tc-soft); }
.tc.is-editing .tc-cell:not(.has-class):hover::after { content: "＋"; color: var(--tc-accent); font-size: 1.4rem; font-weight: 900; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.tc-sch-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.tc-sch-total { font-weight: 800; margin-right: 6px; }
.tc-sch-total b { color: var(--tc-deep); font-size: 1.2rem; }
.tc-sch-sum .tc-chip { color: var(--tc-text); }
.tc-sch-mobile { display: none; }
.tc-sch-mday { margin-bottom: 12px; border: 1px solid #eceff3; border-radius: 12px; overflow: hidden; }
.tc-sch-mday.is-today { border-color: var(--tc-accent); }
.tc-sch-mday-h { padding: 8px 12px; background: var(--tc-soft); color: var(--tc-deep); font-weight: 900; display: flex; justify-content: space-between; }
.tc-sch-mrow { display: flex; gap: 10px; padding: 8px 12px; border-top: 1px solid #f1f3f6; background: linear-gradient(90deg, var(--cell, #fff) 0 6px, #fff 6px); }
.tc-sch-mp { width: 92px; flex-shrink: 0; font-weight: 800; font-size: .9rem; padding-left: 6px; }
.tc-sch-mp small { display: block; color: var(--tc-muted); font-weight: 400; }
.tc-sch-mc em { display: block; font-style: normal; font-size: .8rem; color: var(--tc-deep); }
.tc-sch-mday:not(:has(.tc-sch-mrow)) { display: none; }

/* ---------- 進度 ---------- */
.tc-prog-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.tc-prog-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.tc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-fchip { min-height: 46px; justify-content: center; padding: 6px 14px; border-radius: 999px; border: 1px solid #dfe4ea; background: #fff; font-weight: 800; font-size: .9rem; cursor: pointer; transition: all .15s; display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; }
.tc-fchip small { font-weight: 400; color: var(--tc-muted); font-size: .72rem; }
.tc-fchip:hover { border-color: var(--tc-accent); }
.tc-fchip.is-on { background: var(--tc-accent); border-color: var(--tc-accent); color: #fff; }
.tc-fchip.is-on small { color: rgba(255,255,255,.85); }
.tc-thisweek { padding: 16px; border-radius: 14px; background: linear-gradient(135deg, var(--tc-soft), #fff); border: 2px solid var(--tc-soft2); margin-bottom: 16px; }
.tc-thisweek-h { font-weight: 900; color: var(--tc-deep); font-size: 1.1rem; margin-bottom: 10px; }
.tc-thisweek-h small { color: var(--tc-muted); font-weight: 700; }
.tc-thisweek-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tc-tw { background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.tc-tw-h { font-weight: 900; margin-bottom: 6px; display: flex; align-items: baseline; gap: 6px; }
.tc-tw-h small { color: var(--tc-muted); font-weight: 400; }
.tc-tw-i { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; margin-bottom: 4px; line-height: 1.5; }
.tc-tw-i .tc-tag { font-size: .72rem; padding: 1px 6px; }
.tc-tw-i.is-done > span:last-child::after { content: " ✓"; color: var(--tc-ok); font-weight: 900; }
.tc-tw-a { display: block; font-style: normal; color: var(--tc-ok); font-size: .82rem; }
.tc-prog-wrap { overflow: auto; max-height: 75vh; border-radius: 12px; border: 1px solid #cfd6df; -webkit-overflow-scrolling: touch; }
.tc-prog-table { font-size: .86rem; background: #fff; border-collapse: separate !important; border-spacing: 0; }
.tc-prog-table th, .tc-prog-table td { border-right: 1px solid #dde2e8; border-bottom: 1px solid #dde2e8; padding: 6px 6px; vertical-align: middle; text-align: center; line-height: 1.4; }
.tc-prog-table thead th { position: sticky; top: 0; z-index: 3; background: var(--tc-soft); color: var(--tc-deep); font-weight: 900; }
.tc-prog-table thead tr:nth-child(2) th { top: 44px; background: #fdf7fa; background: var(--tc-soft); font-size: .78rem; color: var(--tc-muted); font-weight: 800; }
.tc-cls-h { min-width: 120px; font-size: .95rem; height: 44px; }
.tc-cls-h small { display: block; font-weight: 400; color: var(--tc-muted); font-size: .75rem; }
.tc-wk-h, .tc-wk { position: sticky; left: 0; z-index: 2; width: 62px; min-width: 62px; background: #fafbfc; }
.tc-prog-table thead .tc-wk-h { z-index: 4; background: var(--tc-soft); }
.tc-wk b { display: block; font-size: 1rem; }
.tc-wk small { display: block; color: var(--tc-muted); font-size: .7rem; white-space: nowrap; font-weight: 400; }
.tc-now { display: inline-block; margin-top: 2px; padding: 0 6px; border-radius: 999px; background: var(--tc-accent); color: #fff; font-size: .68rem; font-weight: 800; }
.tc-pc { min-width: 110px; max-width: 220px; }
.tc-pc.first, .tc-col-h.first { border-left: 2px solid #c3cbd5; }
.tc-pc-p { overflow-wrap: anywhere; }
.tc-pc-a { margin-top: 4px; padding-top: 4px; border-top: 1px dashed #c8e6c9; color: var(--tc-ok); font-size: .8rem; overflow-wrap: anywhere; }
.tc-pc-a::before { content: "實際："; font-weight: 800; }
.tc-pc.is-done { background: var(--tc-ok-bg); }
.tc-pc.is-done .tc-pc-p::after { content: " ✓"; color: var(--tc-ok); font-weight: 900; }
.tc-pc.is-event { color: #8a94a3; background: #f8f9fb; }
.tc-wn { min-width: 150px; text-align: left !important; font-size: .8rem; color: #8a4a0b; background: #fffdf6; }
.tc-wn-h { min-width: 150px; }
.tc-wrow.is-exam th.tc-wk, .tc-wrow.is-exam td { background-image: linear-gradient(rgba(255,213,128,.18), rgba(255,213,128,.18)); }
.tc-wrow.is-current th, .tc-wrow.is-current td { background-color: var(--tc-soft); }
.tc-wrow.is-current th.tc-wk { background: var(--tc-accent); color: #fff; }
.tc-wrow.is-current th.tc-wk small { color: #fff; }
.tc-wrow.is-current td { border-top: 2px solid var(--tc-accent); border-bottom: 2px solid var(--tc-accent); }
.tc-prog-table[data-mode=plan] .tc-pc-a { display: none; }
.tc-prog-table[data-mode=actual] .tc-pc-p { display: none; }
.tc-prog-table[data-mode=actual] .tc-pc-a { border: 0; margin: 0; padding: 0; }
.tc-prog-table[data-mode=actual] .tc-pc-a::before { content: ""; }
.tc.is-editing .tc-pc, .tc.is-editing .tc-wn { cursor: pointer; }
.tc.is-editing .tc-pc:hover, .tc.is-editing .tc-wn:hover { box-shadow: inset 0 0 0 2px var(--tc-accent); background: var(--tc-soft); }
.tc.is-editing .tc-pc:empty::after, .tc.is-editing .tc-pc .tc-pc-p:empty::before { content: "＋"; color: #cbd5e1; }
.tc-pc.is-flash, .tc-cell.is-flash, .tc-wn.is-flash { animation: tcFlash 1s ease; }
@keyframes tcFlash { 0% { background: var(--tc-accent2); } 100% { } }
.tc-hide-col { display: none; }

/* ---------- 對話框 ---------- */
.tc-modal { position: fixed; inset: 0; z-index: 10000; background: rgba(15,23,42,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px 12px; overflow-y: auto; }
.tc-modal-box { width: 100%; max-width: 520px; background: #fff; border-radius: 18px; padding: 20px 22px; box-shadow: 0 24px 60px rgba(0,0,0,.25); animation: tcFade .2s ease; color: var(--tc-text); font-size: 1rem; }
.tc-modal-wide { max-width: 760px; }
.tc-modal-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 1.15rem; color: var(--tc-deep); }
.tc-x { border: 0; background: #f1f5f9; width: 34px; height: 34px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; line-height: 1; }
.tc-modal label { display: block; font-weight: 800; font-size: .9rem; margin-bottom: 12px; }
.tc-modal label input[type=text], .tc-modal label select, .tc-modal label textarea { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
.tc-modal label small { display: block; font-weight: 400; color: var(--tc-muted); margin-top: 2px; }
.tc-modal .tc-check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.tc-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.tc-span2 { grid-column: 1 / -1; }
.tc-color-row { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.tc-color-row input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid #d5dbe3; border-radius: 8px; background: #fff; }
.tc-color-row input[type=text] { margin-top: 0 !important; flex: 1; }
.tc-apply { padding: 10px 12px; border-radius: 10px; background: #f8fafc; margin-bottom: 8px; }
.tc-apply .tc-check { margin-bottom: 4px; }
.tc-modal-f { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.tc-share-grid { display: grid; grid-template-columns: 1fr 190px; gap: 20px; }
.tc-share-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tc-share-row label { margin: 0; width: 110px; flex-shrink: 0; }
.tc-share-row select { flex: 1; }
.tc-share-label { margin: 12px 0 4px !important; }
.tc-copy { display: flex; gap: 6px; }
.tc-copy input { flex: 1; min-width: 0; font-size: .85rem !important; }
.tc-share-btns { margin-top: 8px; }
.tc-share-qr { text-align: center; }
.tc-qr { width: 180px; height: 180px; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; background: #f8fafc; border-radius: 12px; }
.tc-qr img, .tc-qr canvas { width: 168px !important; height: 168px !important; }
.tc-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 10001; padding: 10px 20px; border-radius: 999px; background: #1f2937; color: #fff; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: tcFade .2s ease; }
.tc-toast.is-err { background: var(--tc-danger); }

/* ---------- 編輯頁 ---------- */
.tc-edit-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tc-edit-nav a { padding: 7px 14px; border-radius: 999px; background: #fff; color: var(--tc-text); font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,.05); }
.tc-edit-nav a.is-on { background: var(--tc-accent); color: #fff; }
.tc-edit-nav a:hover { text-decoration: none; }
.tc-form .tc-fr { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; align-items: start; margin-bottom: 14px; }
.tc-form .tc-fr > label { font-weight: 800; padding-top: 7px; }
.tc-form .tc-fr .tc-help { color: var(--tc-muted); font-size: .85rem; margin-top: 4px; white-space: pre-line; }
.tc-form input[type=text], .tc-form input[type=url], .tc-form input[type=email], .tc-form select { width: 100%; }
.tc-form .tc-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tc-form .tc-inline input[type=text], .tc-form .tc-inline input[type=number], .tc-form .tc-inline input[type=date] { width: auto; }
.tc-form-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 10px; border-top: 1px solid #eceff3; margin-top: 10px; }
.tc-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.tc-swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font-size: .8rem; font-weight: 700; }
.tc-swatch input { position: absolute; opacity: 0; }
.tc-swatch i { width: 54px; height: 34px; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 0 0 1px #d5dbe3; }
.tc-swatch input:checked + i { box-shadow: 0 0 0 3px var(--tc-deep); }
.tc-days label { display: inline-flex; gap: 4px; align-items: center; margin-right: 10px; font-weight: 600; }
.tc-etable { width: 100%; font-size: .92rem; }
.tc-etable th { background: var(--tc-soft); color: var(--tc-deep); padding: 8px; text-align: left; font-weight: 900; }
.tc-etable td { padding: 6px 8px; border-bottom: 1px solid #eceff3; vertical-align: middle; }
.tc-etable input[type=text], .tc-etable input[type=time] { width: 100%; }
.tc-etable .tc-w-sm { width: 90px; }
.tc-etable .tc-acts { white-space: nowrap; text-align: right; }
.tc-etable .tc-acts a, .tc-etable .tc-acts button { margin-left: 4px; }
.tc-mini-btn { border: 1px solid #d5dbe3; background: #fff; border-radius: 8px; padding: 3px 9px; cursor: pointer; font-weight: 800; color: var(--tc-text); }
.tc-mini-btn:hover { border-color: var(--tc-accent); }
.tc-mini-btn.tc-del { color: var(--tc-danger); }
.tc-preview-box { margin-top: 10px; padding: 14px; border-radius: 12px; background: #f8fafc; overflow: auto; max-height: 360px; font-size: .85rem; }
.tc-preview-box table td, .tc-preview-box table th { border: 1px solid #dde2e8; padding: 4px 6px; }
.tc-helpbox { padding: 12px 14px; border-radius: 12px; background: var(--tc-soft); color: var(--tc-text); margin-bottom: 14px; font-size: .9rem; line-height: 1.7; }
.tc-helpbox code { background: #fff; padding: 1px 6px; border-radius: 4px; color: var(--tc-deep); }
.tc-sem-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tc-sem-list a { padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid #dfe4ea; font-weight: 800; color: var(--tc-text); }
.tc-sem-list a.is-on { border-color: var(--tc-accent); background: var(--tc-soft); color: var(--tc-deep); }
.tc-sem-list a .tc-chip { margin-left: 4px; background: var(--tc-accent); color: #fff; }

/* 老師列表 */
.tc-tlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 16px; }
.tc-tcard { display: flex; gap: 12px; align-items: center; padding: 16px; background: #fff; border-radius: 16px; box-shadow: var(--tc-shadow); color: var(--tc-text) !important; border: 2px solid transparent; }
.tc-tcard:hover { border-color: var(--tc-accent); text-decoration: none !important; }
.tc-tcard span:last-child { display: flex; flex-direction: column; line-height: 1.4; }
.tc-tcard small { color: var(--tc-muted); font-weight: 400; }

/* ---------- 獨立展示頁 ---------- */
.tc-show-body .tc { margin: 0 auto; padding: 18px 16px 8px; border-radius: 0; min-height: 100vh; }
.tc-show-body .tc.tc-embed { min-height: 0; padding-top: 10px; }
.tc-show-foot { text-align: center; color: #94a3b8; font-size: .8rem; padding: 10px 0 20px; font-family: "Microsoft JhengHei", system-ui, sans-serif; }
.tc:fullscreen { max-width: none; overflow: auto; border-radius: 0; padding: 24px max(24px, calc((100vw - var(--tc-width)) / 2)); }
.tc:fullscreen .tc-prog-wrap { max-height: calc(100vh - 220px); }

/* ---------- 響應式 ---------- */
@media (max-width: 760px) {
  .tc { padding: 8px; font-size: calc(var(--tc-font) * .96); }
  .tc-card { padding: 18px 14px; }
  .tc-hero { padding: 24px 18px; }
  .tc-hero-title { font-size: 1.6rem; }
  .tc-h { font-size: 1.3rem; }
  .tc-tabbar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
  .tc-tabbar::-webkit-scrollbar { display: none; }
  .tc-tab { white-space: nowrap; flex-shrink: 0; padding: 8px 14px; font-size: .95rem; }
  .tc-view-btn { flex-direction: column; gap: 2px; font-size: .92rem; padding: 10px 4px; }
  .tc-kv { grid-template-columns: 96px 1fr; }
  .tc-bar { height: auto; min-height: 26px; }
  .tc-bar-seg { white-space: normal; text-align: center; font-size: .7rem; line-height: 1.25; padding: 4px 3px; }
  .tc-acc-stage { min-width: 0; width: 100%; }
  .tc-top-actions .tc-btn span { display: none; }
  .tc-editbar-links { margin-left: 0; }
  .tc-share-grid { grid-template-columns: 1fr; }
  .tc-form .tc-fr { grid-template-columns: 1fr; gap: 4px; }
  .tc-form-grid { grid-template-columns: 1fr; }
  .tc-sch[data-mobile=list] .tc-sch-wrap { display: none; }
  .tc-sch[data-mobile=list] .tc-sch-mobile { display: block; }
}
@media (max-width: 560px) {
  .tc-sch .tc-sch-wrap { display: none; }
  .tc-sch .tc-sch-mobile { display: block; }
  .tc.is-editing .tc-sch .tc-sch-wrap { display: block; }
  .tc.is-editing .tc-sch .tc-sch-mobile { display: none; }
}

/* ---------- 列印 ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body * { visibility: hidden; }
  #tc-app, #tc-app * { visibility: visible; }
  #tc-app { position: absolute; left: 0; top: 0; width: 100%; max-width: none; margin: 0; padding: 0; background: #fff !important; font-size: 11pt; }
  .tc-top-actions, .tc-editbar, .tc-views, .tc-tabwrap, .tc-modal, .tc-toast, .tc-prog-acts, .tc-prog-filter, .tc-plan-tools .tc-plan-acts, .tc-edit-only, .tc-edit-tip, .tc-steps-head button, .tc-show-foot { display: none !important; }
  .tc-card, .tc-hero { box-shadow: none !important; break-inside: avoid; }
  .tc-prog-wrap { max-height: none !important; overflow: visible !important; border: 0; }
  .tc-prog-table thead th { position: static; }
  .tc-wk-h, .tc-wk { position: static; }
  .tc-prog-table { font-size: 8pt; }
  .tc-panel { display: block !important; }
  .tc-acc-body { display: block !important; }
  .tc-sch-wrap { display: block !important; }
  .tc-sch-mobile { display: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
