/* ============================================================
   全學期課程總覽 v1(2026-10-30):清單／週曆／月曆
   顏色全用 tutor.css 的變數,亮／暗模式自動跟隨;校區除了色條也有文字,不只靠顏色辨識
   ============================================================ */
.ov { padding-top: .5rem; --ov-a1: var(--tt-ink-2); --ov-a2: var(--tt-amber); }
.ov [hidden] { display: none !important; }

/* ── 頁首 ── */
.ov-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.ov-crumb { margin: 0 0 .35rem; font-size: .88rem; }
.ov-crumb a { color: var(--bs-link-color); text-decoration: none; }
.ov-crumb a:hover { text-decoration: underline; }
.ov-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900; margin: 0; color: var(--text-primary); }
.ov-sub { margin: .3rem 0 0; color: var(--text-secondary); }
.ov-stats { display: flex; gap: 1.8rem; margin: 0; }
.ov-stats div { display: flex; flex-direction: column-reverse; }
.ov-stats dt { font-size: .8rem; font-weight: 400; color: var(--text-light); }
.ov-stats dd { margin: 0; font-size: 1.6rem; font-weight: 900; line-height: 1.15; color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* ── 工具列 ── */
.ov-bar { position: sticky; top: 68px; z-index: 20; background: var(--tt-surface); border: 1px solid var(--tt-line); border-radius: 14px; padding: .75rem .9rem; display: grid; grid-template-columns: auto minmax(200px, 1fr); gap: .65rem .9rem; align-items: center; }
.ov-views { display: inline-flex; background: var(--tt-sunk); border-radius: 10px; padding: 3px; }
.ov-view { border: 0; background: transparent; color: var(--text-secondary); border-radius: 8px; padding: .36rem .85rem; font-size: .9rem; font-weight: 600; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.ov-view[aria-pressed="true"] { background: var(--tt-surface); color: var(--tt-ink); box-shadow: 0 1px 3px rgba(28, 35, 48, .16); }
.ov-search { margin: 0; min-width: 0; }
.ov-filters { grid-column: 1 / -1; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ov-n { margin-left: .35rem; font-size: .78rem; font-weight: 400; color: var(--text-light); font-variant-numeric: tabular-nums; }
.tt-fchip:has(input:checked) .ov-n { color: var(--tt-ink); }
.ov-toggle:has(input:focus-visible) { outline: 3px solid var(--tt-ink-3); outline-offset: 2px; }
.ov-scope { font-size: .88rem; color: var(--text-secondary); }
.ov-print { margin-left: auto; }
.ov-result { margin: .8rem .2rem .6rem; font-size: .86rem; color: var(--text-secondary); }

/* ── 清單:桌機像表格,手機變卡片 ── */
.ov-thead, .ov-row { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, .8fr) minmax(0, 1.2fr) minmax(0, .95fr) minmax(0, 2.6fr); gap: 1rem; }
.ov-thead { padding: .55rem 1.1rem; font-size: .8rem; font-weight: 700; color: var(--text-light); }
.ov-list { list-style: none; margin: 0; padding: 0; background: var(--tt-surface); border: 1px solid var(--tt-line); border-radius: 14px; overflow: hidden; }
.ov-row { padding: .95rem 1.1rem; border-top: 1px solid var(--tt-line); border-left: 4px solid var(--ov-a1); font-size: .93rem; color: var(--text-secondary); }
.ov-row:first-child { border-top: 0; }
.ov-row.area2 { border-left-color: var(--ov-a2); }
.ov-row:hover { background: var(--tt-ink-tint); }
.ov-row.is-ended { border-left-color: var(--tt-line-2); background: var(--tt-sunk); }
.ov-name { font-size: 1rem; font-weight: 700; margin: 0 0 .35rem; font-family: var(--tt-sans); letter-spacing: 0; }
.ov-link { border: 0; background: none; padding: 0; color: var(--text-primary); font-weight: 700; text-align: left; line-height: 1.4; }
.ov-link:hover { color: var(--tt-ink-2); text-decoration: underline; }
.ov-lab { display: none; }
.ov-c-teacher { color: var(--text-primary); }
.ov-c-time b { display: block; color: var(--text-primary); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-c-time small { color: var(--text-light); }
.ov-progress { font-size: .84rem; margin-bottom: .35rem; }
.ov-progress b { color: var(--tt-ink-2); }
.ov-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.ov-chip { font-size: .8rem; padding: .08rem .5rem; border-radius: 6px; background: var(--tt-ink-tint); color: var(--tt-ink); font-variant-numeric: tabular-nums; }
.ov-chip.is-past { background: var(--tt-sunk); color: var(--text-light); }
.ov-row.is-ended .ov-chip.is-past { background: var(--tt-surface); }
.ov-chip.is-next { background: var(--tt-ink-2); color: #fff; font-weight: 700; }
html.tutor-ui[data-theme="dark"] .ov-chip.is-next { background: #17786C; }
.ov-chip.is-today { background: var(--tt-amber); color: #fff; font-weight: 700; }
html.tutor-ui[data-theme="dark"] .ov-chip.is-today { background: var(--tt-amber); color: #12161C; }
.ov-more { border: 0; background: none; padding: 0; margin-top: .4rem; font-size: .8rem; color: var(--bs-link-color); text-decoration: underline; }
.ov-chips-past { margin-top: .35rem; }
.ov-chips-past[data-closed] { display: none; }

/* ── 週曆／月曆導覽 ── */
.ov-nav { display: flex; align-items: center; gap: .5rem; margin-bottom: .8rem; }
.ov-nav-title { font-size: 1.15rem; font-weight: 900; margin: 0 .3rem; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ov-arrow { border: 1px solid var(--tt-line-2); background: var(--tt-surface); color: var(--tt-ink-2); border-radius: 10px; width: 36px; height: 36px; font-size: 1.1rem; line-height: 1; }
.ov-arrow:disabled { opacity: .35; cursor: not-allowed; }
.ov-today { margin-left: auto; border: 1px solid var(--tt-line-2); background: var(--tt-surface); color: var(--text-primary); border-radius: 10px; padding: .36rem .85rem; font-size: .88rem; }

/* ── 週曆 ── */
.ov-strip { display: none; }
.ov-week { display: grid; grid-template-columns: var(--ov-cols, repeat(7, minmax(0, 1fr))); gap: .5rem; align-items: start; }
.ov-col { background: var(--tt-surface); border: 1px solid var(--tt-line); border-radius: 12px; min-width: 0; }
.ov-col.is-today { border-color: var(--tt-amber); }
.ov-col-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .4rem; padding: .55rem .6rem; border-bottom: 1px solid var(--tt-line); font-size: .78rem; color: var(--text-light); }
.ov-col-head b { font-size: .98rem; font-weight: 900; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ov-col.is-today .ov-col-head b { color: var(--tt-amber); }
.ov-col-body { display: flex; flex-direction: column; gap: .4rem; padding: .45rem; }
.ov-none { margin: .3rem 0; text-align: center; font-size: .78rem; color: var(--text-light); }
.ov-event { display: flex; flex-direction: column; gap: .12rem; text-align: left; width: 100%; border: 1px solid var(--tt-line); border-left: 3px solid var(--ov-a1); border-radius: 8px; background: var(--tt-surface); padding: .45rem .5rem; color: var(--text-secondary); font-size: .76rem; line-height: 1.35; overflow-wrap: anywhere; }
.ov-event.area2 { border-left-color: var(--ov-a2); }
.ov-event:hover { background: var(--tt-ink-tint); }
.ov-event.is-past { background: var(--tt-sunk); border-left-color: var(--tt-line-2); }
.ov-e-time { font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ov-e-name { font-size: .86rem; font-weight: 700; color: var(--text-primary); }
.ov-e-area { color: var(--text-light); }

/* ── 月曆 ── */
.ov-month { background: var(--tt-surface); border: 1px solid var(--tt-line); border-radius: 14px; overflow: hidden; }
.ov-mhead, .ov-mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ov-mhead span { padding: .45rem .6rem; font-size: .8rem; font-weight: 700; color: var(--text-light); border-bottom: 1px solid var(--tt-line); }
.ov-mcell { min-height: 118px; border: 0; border-right: 1px solid var(--tt-line); border-bottom: 1px solid var(--tt-line); background: transparent; padding: .4rem .45rem; text-align: left; display: flex; flex-direction: column; gap: .15rem; min-width: 0; color: var(--text-secondary); }
.ov-mcell:nth-child(7n) { border-right: 0; }
.ov-mcell.is-out { background: var(--tt-sunk); }
.ov-mcell.has:hover { background: var(--tt-ink-tint); }
.ov-mcell:disabled { cursor: default; color: var(--text-light); opacity: 1; }
.ov-mdate { font-weight: 700; font-size: .88rem; color: var(--text-primary); }
.ov-mcell:disabled .ov-mdate { font-weight: 400; color: var(--text-light); }
.ov-mcell.is-today .ov-mdate { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--tt-amber); color: #fff; }
html.tutor-ui[data-theme="dark"] .ov-mcell.is-today .ov-mdate { color: #12161C; }
.ov-mn { display: none; font-size: .72rem; font-weight: 700; color: var(--tt-ink-2); }
.ov-mitem { display: block; font-size: .72rem; line-height: 1.5; padding: 0 .3rem; border-left: 3px solid var(--ov-a1); background: var(--tt-ink-tint); color: var(--text-primary); border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-mitem.area2 { border-left-color: var(--ov-a2); background: var(--tt-amber-soft); }
.ov-mitem.is-past { border-left-color: var(--tt-line-2); background: var(--tt-sunk); color: var(--text-secondary); }
.ov-mmore { font-size: .72rem; color: var(--text-light); }

/* ── 明細視窗 ── */
.ov-dlg { margin: auto; width: min(560px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; border: 1px solid var(--tt-line); border-radius: 16px; padding: 1.3rem 1.4rem; background: var(--tt-surface); color: var(--text-primary); }
.ov-dlg::backdrop { background: rgba(15, 23, 42, .55); }
.ov-dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .6rem; }
.ov-dlg-head h2 { font-size: 1.25rem; font-weight: 900; margin: 0; line-height: 1.35; }
.ov-dlg-x { border: 0; background: var(--tt-sunk); color: var(--text-primary); width: 2.2rem; height: 2.2rem; border-radius: 50%; flex: none; }
.ov-dlg-info { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: .4rem .6rem; margin: 0 0 1rem; font-size: .94rem; }
.ov-dlg-info dt { font-weight: 400; color: var(--text-light); }
.ov-dlg-info dd { margin: 0; overflow-wrap: anywhere; }
.ov-dlg-h3 { font-size: .88rem; font-weight: 700; color: var(--text-light); margin: 0 0 .45rem; font-family: var(--tt-sans); }
.ov-dlg-cta { margin-top: 1.1rem; display: flex; justify-content: flex-end; }

/* ── 平板與手機 ── */
@media (max-width: 991.98px) {
    .ov-thead { display: none; }
    .ov-list { background: transparent; border: 0; border-radius: 0; overflow: visible; display: flex; flex-direction: column; gap: .7rem; }
    .ov-row, .ov-row:first-child { grid-template-columns: 4.2rem minmax(0, 1fr); gap: .3rem .6rem; background: var(--tt-surface); border: 1px solid var(--tt-line); border-left: 4px solid var(--ov-a1); border-radius: 12px; padding: .9rem 1rem; }
    .ov-row.area2 { border-left-color: var(--ov-a2); }
    .ov-row.is-ended { border-left-color: var(--tt-line-2); background: var(--tt-sunk); }
    .ov-c-main { grid-column: 1 / -1; margin-bottom: .25rem; }
    .ov-c-teacher, .ov-c-place, .ov-c-time, .ov-c-dates { grid-column: 1 / -1; display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: .6rem; align-items: baseline; }
    .ov-lab { display: block; font-size: .8rem; color: var(--text-light); }
    .ov-val { min-width: 0; }
    .ov-c-time small { margin-left: .5rem; }
    .ov-c-time b { display: inline; }
    /* 週曆:日期列＋當天課程 */
    .ov-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem; margin-bottom: .7rem; }
    .ov-sday { border: 1px solid var(--tt-line); background: var(--tt-surface); color: var(--text-secondary); border-radius: 10px; padding: .35rem 0; display: flex; flex-direction: column; align-items: center; line-height: 1.2; font-size: .74rem; }
    .ov-sday b { font-size: 1.05rem; font-weight: 900; color: var(--text-primary); }
    .ov-sday small { color: var(--tt-ink-2); font-weight: 700; }
    .ov-sday.is-today { border-color: var(--tt-amber); }
    .ov-sday.is-on { background: var(--text-primary); border-color: var(--text-primary); color: var(--tt-surface); }
    .ov-sday.is-on b, .ov-sday.is-on small { color: var(--tt-surface); }
    .ov-week { display: block; }
    .ov-col { display: none; }
    .ov-col.is-sel { display: block; }
    .ov-event { font-size: .86rem; padding: .7rem .8rem; }
    .ov-e-name { font-size: 1rem; }
    .ov-col-body { gap: .55rem; padding: .6rem; }
}
@media (max-width: 640px) {
    .ov-bar { position: static; grid-template-columns: 1fr; }
    .ov-views { display: flex; }
    .ov-view { flex: 1; justify-content: center; }
    .ov-filters .tt-fsep { display: none; }
    .ov-filters .tt-fchip { padding: .32rem .75rem; font-size: .86rem; }
    .ov-stats { width: 100%; justify-content: space-between; gap: .5rem; }
    .ov-stats dd { font-size: 1.35rem; }
    .ov-mhead span { padding: .35rem 0; text-align: center; }
    .ov-mcell { min-height: 58px; padding: .3rem 0; align-items: center; }
    .ov-mitem, .ov-mmore { display: none; }
    .ov-mn { display: block; }
}

/* ── 列印:只留內容,所有日期都印出來 ── */
@media print {
    html.tutor-ui .navbar-custom, .tt-footer, .tt-ak, .tt-toast, .ov-bar, .ov-crumb, .ov-more, .ov-today, .ov-arrow, .ov-strip { display: none !important; }
    html.tutor-ui .main-content { padding-top: 0; }
    body { background: #fff !important; }
    .ov-chips-past[data-closed] { display: flex; }
    .ov-row { break-inside: avoid; }
    .ov-event, .ov-col { break-inside: avoid; }
    .ov-col { display: block !important; }
    .ov-week { display: grid !important; }
}
@media (prefers-reduced-motion: reduce) { .ov * { transition: none; } }
