:root{color-scheme:dark;--bg:#07101f;--surface:#0b1628;--raised:#101e33;--border:#243650;--text:#f7fbff;--muted:#a7b8cf;--accent:#67d5ff;--highlight:#173650;--warm:#e9ba62}
*{box-sizing:border-box;letter-spacing:0}body{margin:0;background:var(--bg);color:var(--text);font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif}body[data-theme="light"]{color-scheme:light;--bg:#f2f6fb;--surface:#fff;--raised:#eaf1f8;--border:#d2deea;--text:#172d43;--muted:#52667b;--accent:#086d96;--highlight:#e3f2f8;--warm:#936000}button,input,select{font:inherit}button,a,input,select{touch-action:manipulation}button,a{ -webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{opacity:.4;cursor:not-allowed}[hidden]{display:none!important}a{color:inherit}button,input,select,a,summary{outline-offset:4px}:focus-visible{outline:2px solid var(--accent)}button{color:inherit}h1,h2,p{margin:0}.muted{color:var(--muted)}
.icon{display:inline-block;width:18px;height:18px;flex:0 0 18px;background:currentColor;mask:var(--icon) center/contain no-repeat;-webkit-mask:var(--icon) center/contain no-repeat}.icon-search{--icon:url('/assets/icons/search.svg')}.icon-archive{--icon:url('/assets/icons/archive.svg')}.icon-theme{--icon:url('/assets/icons/sun.svg')}body[data-theme="light"] .icon-theme{--icon:url('/assets/icons/moon.svg')}.icon-return{--icon:url('/assets/icons/undo-2.svg')}.icon-close{--icon:url('/assets/icons/x.svg')}.icon-chevron{--icon:url('/assets/icons/chevron-down.svg')}.icon-prev{--icon:url('/assets/icons/chevron-left.svg')}.icon-next{--icon:url('/assets/icons/chevron-right.svg')}
.topbar,.container{width:100%;max-width:1360px;margin:auto;padding-left:28px;padding-right:28px}.topbar{height:68px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border);gap:12px}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;font-size:18px}.brand-mark{display:grid;place-items:center;width:32px;height:32px;border-radius:6px;background:var(--accent);color:var(--bg);font-weight:700}.topbar-actions{display:flex;align-items:center;gap:12px}.live-indicator{font-size:12px;color:var(--muted)}.live-indicator::before{content:'';display:inline-block;width:6px;height:6px;border-radius:50%;margin-right:6px;background:#42bda0}.btn,.icon-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:38px;border:1px solid var(--border);border-radius:6px;background:var(--surface);font-size:13px;text-decoration:none;padding:7px 12px}.btn:hover,.icon-btn:hover{border-color:var(--accent);background:var(--highlight)}.btn-primary{background:var(--accent);border-color:var(--accent);color:var(--bg);font-weight:600}.btn-primary:hover{background:var(--accent);filter:brightness(1.08)}.icon-btn{width:38px;padding:0;flex-shrink:0}
.page-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:18px 0 10px;min-height:68px}h1{font-size:25px;line-height:1.3}.week-info{display:flex;align-items:center;flex-wrap:wrap;gap:10px 14px;padding:0 0 16px;font-size:13px}.info-item{display:flex;align-items:center;gap:4px;min-width:0}.info-item strong{font-weight:500;overflow-wrap:anywhere}.info-label{font-size:12px;color:var(--muted);flex-shrink:0}.info-sep{width:1px;height:12px;background:var(--border);flex-shrink:0}.info-dates{margin-left:auto;color:var(--muted);flex-wrap:wrap;gap:12px 24px}.week-badge{color:var(--accent);font-weight:600;white-space:nowrap}.schedule-panel{min-width:0}.schedule-scroll{overflow:auto;border:1px solid var(--border);border-radius:8px}.schedule-grid{display:grid;grid-template-columns:64px repeat(5,minmax(0,1fr));gap:2px;background:var(--border);min-width:650px}.schedule-header{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:52px;background:var(--raised);font-size:13px;text-align:center}.schedule-header small{font-size:11px;color:var(--muted)}.schedule-header.is-today{background:var(--highlight);box-shadow:inset 0 3px var(--accent);color:var(--accent)}.period-label{min-height:66px;font-size:12px}.period-label.morning{box-shadow:inset 3px 0 var(--warm)}.period-label.afternoon{box-shadow:inset 3px 0 var(--accent)}.schedule-session-divider{grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:12px;min-height:25px;font-size:11px;font-weight:600;background:var(--bg);color:var(--accent)}.schedule-session-divider::before,.schedule-session-divider::after{content:'';height:1px;width:48px;background:currentColor;opacity:.4}.schedule-session-divider.morning{color:var(--warm)}.schedule-cell{min-width:0;min-height:66px;padding:8px 12px;background:var(--surface);display:flex;flex-direction:column;justify-content:center;gap:3px;overflow-wrap:anywhere;transition:filter .15s ease,background-color .15s ease,box-shadow .15s ease}.course-cell{background:var(--course-bg);border-left:3px solid var(--course-line)}.course-name{font-size:18px;line-height:1.3;font-weight:650}.course-teacher,.schedule-cell small{font-size:12px;color:var(--muted)}.empty-cell{align-items:center;color:var(--border)}
.course-tone-0{--course-bg:#123247;--course-line:#67d5ff}.course-tone-1{--course-bg:#153731;--course-line:#63d5b3}.course-tone-2{--course-bg:#352f21;--course-line:#e9ba62}.course-tone-3{--course-bg:#382737;--course-line:#df8fc5}.course-tone-4{--course-bg:#27324a;--course-line:#9eaeea}.course-tone-5{--course-bg:#38282c;--course-line:#f08c91}.course-tone-6{--course-bg:#283626;--course-line:#9bd26e}.course-tone-7{--course-bg:#332d40;--course-line:#c69bea}
body[data-theme="light"] .course-tone-0{--course-bg:#e8f5fa;--course-line:#159ac4}body[data-theme="light"] .course-tone-1{--course-bg:#e9f6f0;--course-line:#269d79}body[data-theme="light"] .course-tone-2{--course-bg:#fff5df;--course-line:#c98a17}body[data-theme="light"] .course-tone-3{--course-bg:#faedf6;--course-line:#bd559d}body[data-theme="light"] .course-tone-4{--course-bg:#edf0fc;--course-line:#6579c8}body[data-theme="light"] .course-tone-5{--course-bg:#fceef0;--course-line:#d85b65}body[data-theme="light"] .course-tone-6{--course-bg:#f0f7e6;--course-line:#70a93e}body[data-theme="light"] .course-tone-7{--course-bg:#f3ecfa;--course-line:#9365bd}
.history-menu{margin-top:18px;border-top:1px solid var(--border);border-bottom:1px solid var(--border);scroll-margin-top:12px}.history-menu>summary{display:flex;align-items:center;gap:10px;min-height:60px;cursor:pointer;list-style:none}.history-menu>summary::-webkit-details-marker{display:none}.history-menu>summary>.icon:first-child{color:var(--accent)}.history-menu>summary strong{font-size:15px}.history-menu>summary .muted{font-size:12px}.history-menu>summary .icon-chevron{margin-left:auto;transition:transform .15s}.history-menu[open]>summary .icon-chevron{transform:rotate(180deg)}.archive-workspace{padding-bottom:18px}.archive-filters{display:grid;grid-template-columns:1.4fr 1.6fr 1.3fr 1.2fr auto;gap:12px;padding:4px 0 18px;border-bottom:1px solid var(--border)}.filter{min-width:0}.filter label{display:block;font-size:12px;color:var(--muted);margin-bottom:6px}.filter input,.filter select,.sort-control select{width:100%;min-width:0;height:40px;padding:7px 10px;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--text);font-size:13px;text-overflow:ellipsis}.filter input::placeholder{color:var(--muted)}.search-control{grid-column:1/-1;max-width:600px;width:100%}.search-field{display:flex;align-items:center;border:1px solid var(--border);border-radius:6px;background:var(--surface);padding-left:12px;color:var(--muted)}.search-field input{border:none;background:none}.search-field .icon-btn{border:none;height:38px;min-height:38px}.filter-commands{display:flex;gap:8px;align-items:end}.filter-commands .btn{height:40px;white-space:nowrap}.results-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:15px 0;color:var(--muted);font-size:12px}.sort-control{display:flex;align-items:center;gap:8px;white-space:nowrap}.sort-control select{width:112px;height:34px;padding:4px 8px}.archive-results{min-height:100px}.archive-group{margin-bottom:14px}.archive-group h2{font-size:13px;color:var(--muted);font-weight:500;padding:8px 0}.archive-rows{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:24px}.archive-row{display:grid;grid-template-columns:minmax(0,1fr) auto 18px;align-items:center;gap:12px;min-height:76px;padding:12px 10px;border-bottom:1px solid var(--border);text-decoration:none}.archive-row:hover{background:var(--raised)}.archive-row.selected{background:var(--highlight);box-shadow:inset 3px 0 var(--accent)}.archive-class{min-width:0}.archive-class strong{display:block;font-size:14px;font-weight:500;overflow-wrap:anywhere}.archive-class small{display:block;font-size:12px;color:var(--muted);margin-top:3px}.row-status{font-size:11px;color:var(--accent);white-space:nowrap}.archive-row>.icon{color:var(--muted)}.pagination{display:flex;justify-content:space-between;align-items:center;gap:10px;padding-top:12px}.pagination form{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--muted)}.pagination input{width:50px;height:36px;text-align:center;background:var(--surface);border:1px solid var(--border);border-radius:4px;color:var(--text)}.empty-state{grid-column:1/-1;text-align:center;color:var(--muted);padding:32px 12px;background:var(--surface)}.empty-state .btn{margin-top:12px}.notice{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:var(--raised);border:1px solid var(--border);border-radius:6px;padding:12px 18px;z-index:50;max-width:calc(100% - 32px);box-shadow:0 5px 20px #0003}.site-footer{padding:20px;text-align:center;color:var(--muted);font-size:11px}
@media(min-width:1000px){.schedule-header{min-height:48px}.period-label,.schedule-cell{min-height:66px}.summary-board{grid-template-columns:repeat(3,minmax(0,1fr));column-gap:28px}}
@media(max-width:1000px){.archive-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.search-control{max-width:none}.archive-rows{grid-template-columns:1fr}.info-dates{margin-left:0}}
@media(max-width:600px){.topbar,.container{padding-left:14px;padding-right:14px}.topbar{height:58px}.brand{font-size:16px;gap:7px}.topbar-actions{gap:6px}.live-indicator,#printSchedule{display:none}.print-menu{display:none}.page-heading{min-height:58px;padding:14px 0 8px}h1{font-size:21px}.week-info{gap:5px 16px;font-size:12px;padding-bottom:12px}.info-label{font-size:11px}.info-dates{flex-basis:100%;font-size:11px;gap:10px}.schedule-grid{grid-template-columns:50px repeat(5,minmax(108px,1fr));min-width:600px}.schedule-cell{padding:7px 8px;min-height:62px}.course-name{font-size:16px}.schedule-header{min-height:44px}.period-label{min-height:62px;font-size:11px;position:sticky;left:0;z-index:1}.corner-label{position:sticky;left:0;z-index:1}.course-teacher{font-size:11px}.history-menu{margin-top:14px}.history-menu>summary{min-height:54px}.archive-filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.search-control{grid-column:1/-1}.filter input,.filter select{font-size:16px}.filter-commands{grid-column:1/-1}.filter-commands .btn{flex:1}.archive-row{grid-template-columns:minmax(0,1fr) auto 16px;gap:6px;padding:10px 6px}.archive-class small{font-size:11px}.pagination{flex-wrap:wrap}.pagination form{order:3;flex-basis:100%;justify-content:center}.pagination>.btn{flex:1}.summary-board{grid-template-columns:1fr}.summary-item{min-height:46px;padding:10px 0}}
.search-field:focus-within{outline:2px solid var(--accent);outline-offset:2px}.search-field input:focus{outline:none}
@media(max-width:600px){.schedule-session-divider{justify-content:flex-start;padding-left:60px}.schedule-session-divider::before{width:22px}}
@media(hover:hover){
  .course-cell:hover{filter:brightness(1.16);box-shadow:inset 0 0 0 2px var(--course-line);z-index:1}
  body[data-theme="light"] .course-cell:hover{filter:brightness(.96)}
  .empty-cell:hover{background:var(--highlight);color:var(--muted)}
}

.schedule-activity-label{font-size:12px;color:var(--muted)}.schedule-activity-label small{font-size:11px}.schedule-activity-cell{grid-column:2/-1;min-height:66px;padding:8px 12px;display:flex;align-items:center;justify-content:center;background:var(--raised);color:var(--text);font-weight:600;border-bottom:1px solid var(--border)}.schedule-activity-cell.morning{box-shadow:inset 3px 0 var(--warm)}.schedule-activity-cell.midday,.schedule-activity-cell.afternoon{box-shadow:inset 3px 0 var(--accent)}
@media print{.schedule-activity-cell{background:#fff;color:#111;box-shadow:none}.schedule-activity-label{color:#111}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

/* 时间列需要完整容纳“08:30 - 09:10”这类起止时间。 */
.schedule-grid{grid-template-columns:112px repeat(5,minmax(0,1fr));min-width:700px}
.period-label{padding:6px 4px;font-size:14px;line-height:1.25;white-space:nowrap}
.period-label strong{font-size:14px;line-height:1.25}
.period-label small,.schedule-activity-label small{font-size:13px;line-height:1.25;white-space:nowrap}
@media(max-width:600px){.schedule-grid{grid-template-columns:94px repeat(5,minmax(108px,1fr));min-width:634px}.period-label{padding:5px 3px;font-size:12px}.period-label strong{font-size:13px}.period-label small,.schedule-activity-label small{font-size:12px}}
@media print{.schedule-grid{grid-template-columns:112px repeat(5,minmax(0,1fr));min-width:0}.period-label,.period-label strong,.period-label small,.schedule-activity-label small{font-size:12px}}
.course-summary{margin-top:8px;padding-top:18px;border-top:1px solid var(--border)}.summary-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:0 0 4px}.summary-head h2{font-size:15px;font-weight:600}.summary-board{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:32px}.summary-item{display:flex;align-items:center;gap:10px;min-width:0;min-height:50px;padding:11px 4px;background:none;border:0;border-bottom:1px solid var(--border);box-shadow:none}.summary-dot{width:7px;height:7px;border-radius:50%;flex:0 0 7px;background:var(--course-line)}.summary-copy{min-width:0;flex:1}.summary-copy strong{display:block;font-size:14px;font-weight:500;overflow-wrap:anywhere}.summary-copy span{display:block;margin-top:2px;font-size:12px;color:var(--muted);overflow-wrap:anywhere}.summary-item b{flex-shrink:0;font-size:20px;font-weight:650;line-height:1;font-variant-numeric:tabular-nums;color:var(--text)}.summary-item b small{margin-left:3px;font-size:11px;font-weight:500;color:var(--muted)}
@page{size:A4 portrait;margin:10mm}
@media print{
  html,body{width:100%;min-width:0;background:#fff;color:#111;font-size:12px}
  body{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .topbar-actions,.history-menu,#pageNotice,.site-footer,#returnCurrent{display:none!important}
  .topbar,.container{width:100%;max-width:none;padding:0}
  .topbar{border:0;height:auto;margin-bottom:6px}
  .brand{font-size:16px}
  .brand-mark{width:26px;height:26px;background:#111;color:#fff}
  .page-heading{padding:0 0 5px;min-height:0}
  .page-heading h1{font-size:20px;line-height:1.25}
  .week-info{gap:4px 12px;padding-bottom:7px;color:#333;font-size:11px}
  .info-label{font-size:10px;color:#555}
  .info-dates{gap:8px 14px}
  .schedule-scroll{overflow:visible;border:0}
  .schedule-grid{width:100%;min-width:0;grid-template-columns:136px repeat(5,minmax(0,1fr));gap:0;background:#fff;border-top:1px solid #222;border-left:1px solid #222}
  .schedule-header,.schedule-cell,.schedule-session-divider,.schedule-activity-cell{background:#fff;color:#111;box-shadow:none;border-right:1px solid #222;border-bottom:1px solid #222;filter:none}
  .schedule-header{min-height:0;padding:6px 4px;font-size:11px}
  .schedule-header.is-today{background:#f0f0f0;color:#111}
  .period-label{min-height:48px;padding:4px;font-size:11px;white-space:nowrap}
  .period-label strong{font-size:12px;line-height:1.2}
  .period-label small,.schedule-activity-label small{font-size:10px;line-height:1.2;color:#444}
  .schedule-cell{min-height:48px;padding:5px 8px;gap:2px}
  .course-cell{background:#fff;border-left:1px solid #222;color:#111}
  .course-name{font-size:13px;line-height:1.2}
  .course-teacher,.schedule-cell small,.muted,.info-label,.summary-copy span,.summary-item b small{color:#555;font-size:10px}
  .schedule-session-divider{min-height:20px;padding:3px 8px;font-size:10px}
  .schedule-activity-cell{grid-column:2/-1;min-height:48px;padding:5px 8px;color:#111;font-size:12px}
  .course-summary{margin-top:10px;border-top-color:#222;break-inside:avoid}
  .summary-head h2{font-size:13px}
  .summary-head .muted{font-size:10px}
  .summary-item{min-height:34px;padding:6px 4px;background:none;border:0;border-bottom:1px solid #ccc;color:#111;max-width:none}
  .summary-copy strong{font-size:11px}
  .summary-dot{background:#222}
  .empty-cell{color:#bbb}
  .schedule-session-divider::before,.schedule-session-divider::after{background:#222;opacity:1}
  .schedule-header,.schedule-cell,.schedule-activity-cell{break-inside:avoid}
}

/* 加宽时间列，并移除时间/公共时段左侧的装饰竖线。 */
.schedule-grid{grid-template-columns:136px repeat(5,minmax(0,1fr));min-width:724px}
.period-label.morning,.period-label.afternoon{box-shadow:none}
.schedule-activity-cell.morning,.schedule-activity-cell.midday,.schedule-activity-cell.afternoon{box-shadow:none}
@media(max-width:600px){.schedule-grid{grid-template-columns:116px repeat(5,minmax(108px,1fr));min-width:666px}}
@media print{.schedule-grid{grid-template-columns:136px repeat(5,minmax(0,1fr));min-width:0}}
.course-pinyin{display:block;min-height:1.15em;font-size:11px;color:var(--muted);line-height:1.15;letter-spacing:.01em;overflow-wrap:anywhere;word-break:break-word}

/* 打印菜单：整页课表，或放进书包的 11cm×7cm 卡片。 */
.print-menu{position:relative}
.print-panel{position:absolute;top:calc(100% + 6px);right:0;z-index:20;display:flex;flex-direction:column;gap:2px;min-width:196px;padding:6px;border:1px solid var(--border);border-radius:8px;background:var(--surface);box-shadow:0 8px 24px #0004}
.print-option{display:flex;align-items:center;width:100%;min-height:36px;padding:6px 10px;border:0;border-radius:6px;background:transparent;color:inherit;font-size:13px;text-align:left}
.print-option:hover{background:var(--highlight)}
.print-pinyin{display:flex;align-items:center;gap:8px;margin:2px 2px 0;padding:8px 10px 6px;border-top:1px solid var(--border);color:var(--muted);font-size:12px;cursor:pointer}
.print-pinyin input{width:15px;height:15px;margin:0;accent-color:var(--accent)}

/* 屏幕上按真实尺寸预览，方便核对能不能塞进书包。 */
.bag-card{box-sizing:border-box;width:11cm;height:7cm;margin:16px 0 4px;padding:1mm;overflow:hidden;border:1px dashed var(--border);border-radius:2mm;background:#fff;color:#111;font-family:"Microsoft YaHei","PingFang SC","Noto Sans CJK SC",sans-serif}
.bag-grid{display:grid;grid-template-columns:7.6mm repeat(5,minmax(0,1fr));grid-template-rows:6.2mm repeat(var(--bag-rows,6),minmax(0,1fr));gap:0;height:100%;border-top:1px solid #222;border-left:1px solid #222}
.bag-corner,.bag-day,.bag-period,.bag-cell{display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;overflow:hidden;border-right:1px solid #222;border-bottom:1px solid #222;text-align:center}
.bag-corner,.bag-day,.bag-period{color:#fff;font-weight:700}
.bag-corner{background:#334155}
.bag-grid>.bag-day:nth-child(2){background:#1d4ed8}
.bag-grid>.bag-day:nth-child(3){background:#0f766e}
.bag-grid>.bag-day:nth-child(4){background:#c2410c}
.bag-grid>.bag-day:nth-child(5){background:#6d28d9}
.bag-grid>.bag-day:nth-child(6){background:#be123c}
.bag-period:nth-child(7){background:#1e3a8a}
.bag-period:nth-child(13){background:#0e7490}
.bag-period:nth-child(19){background:#047857}
.bag-period:nth-child(25){background:#b45309}
.bag-period:nth-child(31){background:#7e22ce}
.bag-period:nth-child(37){background:#9f1239}
.bag-period:nth-child(43){background:#1d4ed8}
.bag-period:nth-child(49){background:#0f766e}
.bag-period{background:#334155}
.bag-corner,.bag-day{font-size:12pt}
.bag-period{font-size:13pt}
.bag-cell{flex-direction:column;gap:0;padding:0 .3mm;line-height:1.05}
.bag-cell b{display:block;max-width:100%;font-size:14pt;font-weight:650;line-height:1.05;white-space:nowrap}
.bag-cell.is-mid b{font-size:10pt}
.bag-cell.is-long b{font-size:9pt;white-space:normal;overflow-wrap:anywhere;line-height:1.05}
.bag-cell small{display:block;max-width:100%;color:#444;font-size:7.5pt;font-weight:500;line-height:1.02;letter-spacing:-.02em;white-space:nowrap}
.bag-cell small.is-mid{font-size:6pt}
.bag-cell small.is-long{font-size:5.2pt;letter-spacing:-.04em;white-space:normal;overflow-wrap:anywhere}
.bag-card.with-pinyin .bag-cell b{font-size:11pt}
.bag-card.with-pinyin .bag-cell.is-mid b{font-size:8.5pt}
.bag-card.with-pinyin .bag-cell.is-long b{font-size:7.5pt}
.bag-empty{color:#bbb;font-size:10pt}
.bag-empty-note{grid-column:1/-1;display:flex;align-items:center;justify-content:center;color:#777;font-size:10pt}

@media print{
  /* 固定 A4，卡片贴在左上角。自定义小纸张会被浏览器居中，四周留白裁不掉。 */
  body[data-print="card"]{margin:0}
  body[data-print="card"] .topbar,
  body[data-print="card"] .page-heading,
  body[data-print="card"] .week-info,
  body[data-print="card"] .schedule-panel,
  body[data-print="card"] .course-summary,
  body[data-print="card"] .history-menu,
  body[data-print="card"] .site-footer,
  body[data-print="card"] #pageNotice{display:none!important}
  body[data-print="card"] .container{position:absolute;top:0;left:0;width:11cm;max-width:11cm;height:7cm;padding:0;margin:0}
  body[data-print="card"] .bag-card{display:block!important;width:11cm;height:7cm;margin:0;border:1px solid #222;border-radius:0;-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
