/* ===== 正式课表模块 ===== */
.schedule-module-header { align-items: flex-end; }
.schedule-term-picker { display:flex; align-items:center; gap:10px; min-width:300px; }
.schedule-term-picker label,.schedule-filter label { color:var(--text-secondary); font-size:12px; font-weight:600; white-space:nowrap; }
.schedule-term-picker .form-select { min-width:220px; }
.schedule-panel { margin-top:18px; }
.schedule-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; flex-wrap:wrap; }
.schedule-filter,.schedule-week-nav { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.schedule-filter .form-select { min-width:180px; }
.schedule-week-nav strong { font-size:13px; color:var(--text-secondary); margin-left:4px; }
.schedule-notice { display:flex; align-items:center; gap:12px; padding:12px 14px; border:1px solid #bae6fd; background:#f0f9ff; border-radius:var(--radius-sm); margin:14px 0; color:#0c4a6e; }
.schedule-notice svg { width:20px; height:20px; flex:none; }
.schedule-notice div { display:flex; flex:1; flex-direction:column; gap:2px; }
.schedule-notice span { font-size:12px; opacity:.85; }
.schedule-notice.muted { background:#f8fafc; border-color:var(--border); color:var(--text-secondary); }
.schedule-summary-row { display:flex; gap:20px; align-items:center; flex-wrap:wrap; min-height:38px; padding:9px 12px; margin-bottom:12px; background:#f8fafc; border:1px solid var(--border-light); border-radius:var(--radius-sm); color:var(--text-secondary); font-size:12px; }
.schedule-summary-row.compact { padding:0; margin:0; border:0; background:transparent; min-height:0; }
.schedule-highlight-key { margin-left:auto; color:var(--primary-dark); }
.schedule-highlight-key::before { content:''; display:inline-block; width:9px; height:9px; border-radius:2px; background:#d1fae5; border:1px solid #6ee7b7; margin-right:6px; }
.danger-text { color:var(--danger); }
.schedule-table-scroll { overflow:auto; border:1px solid var(--border); border-radius:var(--radius); background:#fff; box-shadow:0 1px 2px rgba(15,23,42,.04); }
.formal-schedule-table { width:100%; min-width:760px; border-collapse:separate; border-spacing:0; table-layout:fixed; }
.formal-schedule-table th,.formal-schedule-table td { border-right:1px solid var(--border-light); border-bottom:1px solid var(--border-light); padding:8px; vertical-align:top; text-align:left; height:76px; }
.formal-schedule-table tr:last-child>* { border-bottom:0; }
.formal-schedule-table tr>*:last-child { border-right:0; }
.formal-schedule-table thead th { position:sticky; top:0; z-index:2; height:auto; padding:10px; text-align:center; background:#f8fafc; color:var(--text-primary); font-size:13px; }
.formal-schedule-table thead th span,.formal-schedule-table .slot-column span { display:block; margin-top:3px; font-size:10px; font-weight:400; color:var(--text-tertiary); }
.formal-schedule-table .slot-column { width:108px; background:#f8fafc; text-align:center; vertical-align:middle; color:var(--text-secondary); }
.slot-color-dot,.slot-color-swatch{display:inline-block;width:9px;height:9px;margin-right:6px;border-radius:50%;background:var(--slot-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--slot-color) 14%,transparent)}
.slot-color-swatch{width:12px;height:12px;vertical-align:-1px}
.formal-schedule-table td { background:#fff; }
.formal-schedule-table tbody tr>td{border-top:3px solid color-mix(in srgb,var(--slot-color) 26%,transparent)}
.formal-schedule-table .is-past-day{background:color-mix(in srgb,var(--surface-muted) 86%,#d1d5db)!important;color:var(--text-tertiary)}
.formal-schedule-table td.is-past-day .my-course{filter:grayscale(.72);opacity:.62;box-shadow:none}
.schedule-free { display:flex; min-height:56px; align-items:center; justify-content:center; color:#c0c7d0; font-size:11px; font-weight:400; }
.schedule-mine-cell{position:relative}
.schedule-empty-action{display:flex;width:100%;min-height:56px;align-items:center;justify-content:center;padding:8px;border:1px dashed transparent;border-radius:8px;background:transparent;color:transparent;font:inherit;cursor:pointer;transition:color .16s,background .16s,border-color .16s,box-shadow .16s}
.schedule-empty-action:hover,.schedule-empty-action:focus-visible{border-color:color-mix(in srgb,var(--primary) 55%,var(--border));background:color-mix(in srgb,var(--primary) 9%,var(--surface-raised));color:var(--primary-dark);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary) 12%,transparent);outline:none}
@media (hover:none){.schedule-empty-action{border-color:color-mix(in srgb,var(--border) 72%,transparent);color:var(--text-tertiary)}}
.my-course { position:relative;display:block;width:100%;padding:8px;border:1px solid #dbe4ee;border-left:3px solid #94a3b8;border-radius:6px;background:#fff;margin:0 0 5px;text-align:left;font:inherit;overflow:hidden; }
.formal-schedule-table tbody .my-course{border-left-color:var(--slot-color);background:color-mix(in srgb,var(--slot-color) 7%,var(--surface-raised))}
.my-course:last-child { margin-bottom:0; }
.my-course.is-current-class { border-color:#6ee7b7; border-left-color:var(--primary); background:#ecfdf5; }
.my-course-subject { font-size:13px; font-weight:700; color:var(--text-primary); }
.my-course-class { font-size:11px; color:var(--text-secondary); margin-top:3px; }
.course-hover-label{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:6px;background:color-mix(in srgb,var(--primary) 88%,transparent);color:var(--on-primary,#fff);font-size:12px;font-weight:700;opacity:0;transition:opacity .16s}
.my-course:hover .course-hover-label,.my-course:focus-visible .course-hover-label{opacity:1}.my-course:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.schedule-state { display:inline-block; margin-left:5px; padding:1px 5px; border-radius:9px; background:#e0f2fe; color:#0369a1; font-size:9px; font-weight:600; }
.schedule-conflict-cell { background:#fff7ed !important; }
.schedule-conflict { margin-top:4px; color:#c2410c; font-size:10px; font-weight:700; }
.editable-cell { cursor:pointer; text-align:center !important; vertical-align:middle !important; transition:background .15s; }
.editable-cell:hover { background:#f0fdf4; }
.slot-color-control{display:flex;align-items:center;gap:12px;min-height:38px}.slot-color-control input[type="color"]{width:46px;height:34px;padding:2px;border:1px solid var(--border);border-radius:8px;background:var(--surface)}
.schedule-readonly .editable-cell,.schedule-readonly .my-course,.schedule-readonly .schedule-empty-action,.schedule-readonly .slot-timeline-block,.schedule-readonly .slot-resize-handle{pointer-events:none;cursor:default}
.schedule-readonly .schedule-settings-card button{pointer-events:none;opacity:.45}
.editable-cell strong,.editable-cell span:not(.schedule-free) { display:block; }
.editable-cell strong { font-size:13px; color:var(--text-primary); }
.editable-cell span:not(.schedule-free) { margin-top:4px; font-size:10px; color:var(--text-tertiary); }
.master-self-course { background:#ecfdf5 !important; box-shadow:inset 3px 0 var(--primary); }
.import-summary { display:flex; flex-direction:column; gap:5px; padding:14px; margin-bottom:14px; border-radius:var(--radius-sm); background:#f0fdf4; color:#166534; }
.import-summary span { font-size:12px; }
.schedule-import-warning { padding:10px 12px; border-radius:var(--radius-sm); background:#fff7ed; border:1px solid #fed7aa; color:#9a3412; font-size:12px; margin-bottom:12px; }
.schedule-import-success { padding:10px 12px; border-radius:var(--radius-sm); background:#f0fdf4; color:#166534; font-size:12px; }
.form-section-label { margin:14px 0 8px; padding-top:10px; border-top:1px solid var(--border-light); color:var(--text-secondary); font-size:12px; font-weight:700; }
.status-pill { display:inline-block; padding:3px 8px; border-radius:10px; background:#e0f2fe; color:#0369a1; font-size:11px; font-weight:600; }
.status-pill.success { background:#d1fae5; color:#047857; }
.settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.schedule-settings-card { min-width:0; }
.schedule-settings-card.wide { grid-column:1/-1; }
.schedule-settings-card .card-title { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.schedule-meta { margin:0; display:grid; grid-template-columns:1fr 1.5fr .7fr; gap:10px; }
.schedule-meta div { padding:10px; border-radius:var(--radius-sm); background:#f8fafc; }
.schedule-meta dt { font-size:10px; color:var(--text-tertiary); }
.schedule-meta dd { margin:4px 0 0; font-size:12px; font-weight:600; color:var(--text-primary); }
.weekday-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.check-chip { cursor:pointer; padding:5px 10px; border:1px solid var(--border); border-radius:14px; color:var(--text-secondary); font-size:11px; }
.formal-schedule-table td.self-teacher-course{background:color-mix(in srgb,var(--primary) 11%,var(--surface))}.formal-schedule-table td.self-teacher-course strong,.formal-schedule-table td.self-teacher-course span{color:var(--primary)}
.check-chip input { display:none; }
.check-chip.active { border-color:#6ee7b7; background:#ecfdf5; color:#047857; font-weight:600; }
.subject-chip-list { display:flex; flex-wrap:wrap; gap:7px; }
.subject-chip-list span { padding:5px 10px; border:1px solid var(--border-light); border-radius:12px; background:#f8fafc; font-size:11px; }
.teacher-mapping-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.teacher-mapping-grid label { display:flex; align-items:center; gap:8px; padding:8px; border:1px solid var(--border-light); border-radius:var(--radius-sm); }
.teacher-mapping-grid label>span { width:80px; font-size:12px; font-weight:600; }
.teacher-mapping-grid .form-select { min-width:0; }
.checkbox-label { display:flex; align-items:center; gap:7px; font-size:13px; color:var(--text-secondary); }

@media (max-width: 900px) {
  .settings-grid { grid-template-columns:1fr; }
  .schedule-settings-card.wide { grid-column:auto; }
  .teacher-mapping-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .schedule-module-header { align-items:stretch; }
  .schedule-term-picker { min-width:0; width:100%; align-items:stretch; flex-direction:column; gap:5px; }
  .schedule-term-picker .form-select { min-width:0; width:100%; }
  .schedule-toolbar { align-items:stretch; }
  .schedule-toolbar>.flex,.schedule-week-nav { width:100%; }
  .schedule-highlight-key { margin-left:0; }
  .schedule-meta { grid-template-columns:1fr; }
  .teacher-mapping-grid { grid-template-columns:1fr; }
}
