/* ===== 红十字课程排课管理 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --red: #c0392b;
  --red-dark: #96281b;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --line: #e2e5ea;
  --text: #2c3e50;
  --muted: #8a94a6;
  --blue: #2f6fdd;
  --green: #1e9e62;
  --amber: #e6a23c;
}
body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 52px;
  flex-shrink: 0;
}
.brand { font-size: 16px; font-weight: 700; color: var(--red); white-space: nowrap; }
.class-bar { display: flex; align-items: center; gap: 6px; }
.class-bar select {
  max-width: 320px; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 13px; background: #fff;
}
.tabs { margin-left: auto; display: flex; gap: 4px; }
.tab {
  border: none; background: none; padding: 8px 18px; cursor: pointer;
  font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent;
}
.tab.active { color: var(--red); border-bottom-color: var(--red); font-weight: 600; }

/* ---------- 按钮 ---------- */
.btn {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 13px; color: var(--text);
  transition: all .15s;
}
.btn:hover { border-color: var(--red); color: var(--red); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--red); }
.btn-ghost.danger:hover { color: #fff; background: #d9534f; border-color: #d9534f; }
.spacer { flex: 1; }

/* ---------- 视图 ---------- */
.view { display: none; flex: 1; overflow: hidden; }
.view.active { display: flex; }

/* ---------- 师资视图 ---------- */
#view-teachers.active { flex-direction: column; }
.teachers-layout { display: flex; flex: 1; overflow: hidden; gap: 0; }
.teachers-col {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  min-width: 0;
}
.teachers-col:first-child { border-right: 1px solid var(--line); }
.teachers-col .toolbar { flex-shrink: 0; }
.teachers-col .toolbar h3 { font-size: 14px; white-space: nowrap; }
.teachers-col .table-wrap { flex: 1; overflow: auto; }
.teachers-col .table-wrap table { min-width: 100%; }
.teachers-col .btn-sm-table { font-size: 12px; padding: 2px 8px; }

/* ---------- 排课视图 ---------- */
#view-schedule.active { display: flex; flex-direction: column; }
.schedule-top { display: flex; flex: 1; overflow: hidden; }
.schedule-wrap { flex: 1; overflow: auto; padding: 16px; }
.empty-hint { text-align: center; color: var(--muted); padding: 80px 0; font-size: 15px; }

.schedule-grid { border-collapse: collapse; width: 100%; background: var(--panel); table-layout: fixed; }
.schedule-grid th, .schedule-grid td { border: 1px solid var(--line); vertical-align: top; }
.schedule-grid thead th {
  background: #fafbfc; padding: 10px 6px; font-size: 14px; text-align: center;
}
.schedule-grid thead th .date-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.schedule-grid .slot-head {
  width: 84px; background: #fafbfc; text-align: center; padding: 8px 4px;
  font-weight: 600; font-size: 13px;
}
.schedule-grid .slot-head .cap { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 4px; }
.schedule-grid td.cell { min-height: 90px; height: 110px; padding: 4px; background: #fff; }
.schedule-grid td.cell.dragover { background: #fdeceb; outline: 2px dashed var(--red); outline-offset: -2px; }
.schedule-grid td.cell .cap-used { font-size: 11px; color: var(--muted); padding: 0 2px 4px; }
.schedule-grid td.cell .cap-used.full { color: var(--green); }
.schedule-grid td.cell .cap-used.over { color: var(--amber); }

/* 课程块 */
.block {
  background: #eef4ff; border: 1px solid #c8d9f5; border-left: 3px solid var(--blue);
  border-radius: 5px; padding: 5px 7px; margin-bottom: 4px; cursor: grab;
  font-size: 13px; position: relative;
}
.block.mode-实作 { background: #fdf1e8; border-color: #f3d3b8; border-left-color: #e07b39; }
.block.dragging { opacity: .45; }
.block .b-name { font-weight: 600; font-size: 14px; }
.block .b-meta { color: var(--muted); margin-top: 1px; font-size: 12px; }
.block .b-teachers { margin-top: 3px; color: #444; line-height: 1.55; white-space: pre-line; font-size: 13px; }
.block .b-teachers .none { color: #c0a020; }
.block .b-ops { position: absolute; top: 3px; right: 4px; display: none; gap: 2px; }
.block:hover .b-ops { display: flex; }
.block .b-ops button {
  border: none; background: rgba(255,255,255,.85); cursor: pointer;
  font-size: 13px; padding: 2px 7px; border-radius: 3px; color: var(--blue);
}
.block .b-ops button.del { color: var(--red); }

/* ---------- 右侧面板 ---------- */
.side-panel {
  width: 260px; flex-shrink: 0; border-left: 1px solid var(--line);
  background: var(--panel); overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 12px;
}
.panel { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; background: #fafbfc; border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: 13px; }
.muted { color: var(--muted); font-weight: 400; font-size: 11px; }
.card-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
#courseList.card-list { max-height: none; flex: 1; }
.card-list:empty::after { content: "空"; display: block; text-align: center; color: var(--muted); padding: 12px; font-size: 12px; }

.c-card {
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px;
  background: #fff; cursor: grab; font-size: 12px; position: relative;
}
.c-card:hover { border-color: var(--blue); }
.c-card.dragging { opacity: .45; }
.c-card .c-name { font-weight: 600; font-size: 13px; }
.c-card .c-meta { color: var(--muted); margin-top: 2px; }
.c-card .c-ops { position: absolute; top: 4px; right: 6px; display: none; gap: 4px; }
.c-card:hover .c-ops { display: flex; }
.c-card .c-ops a { cursor: pointer; font-size: 11px; color: var(--blue); text-decoration: none; }
.c-card .c-ops a.del { color: var(--red); }
.badge { display: inline-block; padding: 0 5px; border-radius: 3px; font-size: 11px; margin-left: 4px; }
.badge-理论 { background: #e8f0fe; color: var(--blue); }
.badge-实作 { background: #fdeee0; color: #d46b1f; }
.badge-level { background: #eef0f3; color: #555; }
.badge-done { background: #e8e8e8; color: #888; }
.c-card.c-done { opacity: .5; cursor: not-allowed; }
.c-card.c-done:hover { border-color: var(--line); }
.rate-note { padding: 6px 10px; font-size: 11px; color: var(--muted); border-top: 1px dashed var(--line); }

/* ---------- 工具条 & 表格 ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px 0; }
.tip { padding: 6px 16px 0; font-size: 12px; }
.table-wrap { flex: 1; overflow: auto; padding: 12px 16px; }
#view-students, #view-fees { flex-direction: column; }
.data-table { border-collapse: collapse; width: 100%; background: var(--panel); font-size: 13px; }
.data-table th, .data-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; }
.data-table th { background: #fafbfc; position: sticky; top: 0; }
.data-table td.l { text-align: left; }
.data-table tr.subtotal td { background: #faf6ec; font-weight: 600; }
.data-table tr.total td { background: #fdeceb; font-weight: 700; }
.fee-total { font-size: 15px; font-weight: 700; color: var(--red); }
.link { color: var(--blue); cursor: pointer; font-size: 12px; }
.link.del { color: var(--red); }

/* ---------- 弹窗 ---------- */
.form-row { display: flex; gap: 12px; }
.form-row label { flex: 1; }
.form-row label input, .form-row label select { width: 100%; }
.req { color: var(--red); font-weight: 700; }
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-mask[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 10px; padding: 20px; width: 420px;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.modal h3 { margin-bottom: 14px; font-size: 16px; }
.modal label { display: block; margin-bottom: 10px; font-size: 13px; color: #555; }
.modal input, .modal select, .modal textarea {
  width: 100%; margin-top: 4px; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 13px; font-family: inherit;
}
.modal .row2 { display: flex; gap: 10px; }
.modal .row2 label { flex: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.assign-list {
  border: 1px solid var(--line); border-radius: 6px; max-height: 180px;
  overflow-y: auto; padding: 6px 10px;
}
.assign-list label { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.assign-list input { width: auto; margin: 0; }
.fee-preview { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ---------- 多选搜索组件 ---------- */
.multi-select { width: 100%; }
.ms-selected { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; min-height: 28px; }
.ms-tag {
  background: #e3f2fd; color: #1565c0; padding: 3px 8px; border-radius: 12px;
  font-size: 12px; display: inline-flex; align-items: center; gap: 4px;
}
.ms-tag .ms-remove { cursor: pointer; font-weight: bold; color: #e53935; margin-left: 2px; }
.ms-tag .ms-remove:hover { color: #c62828; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #323232; color: #fff; padding: 10px 22px; border-radius: 6px;
  font-size: 13px; z-index: 200; box-shadow: 0 4px 14px rgba(0,0,0,.25);
}

/* ---------- 统计视图 ---------- */
#view-stats { flex-direction: column; }
.stats-wrap { flex: 1; overflow: auto; padding: 16px; }
.stats-filters {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  background: var(--panel); padding: 12px 16px; border-radius: 8px; border: 1px solid var(--line);
}
.stats-filters label { font-size: 13px; color: #555; display: flex; align-items: center; gap: 6px; }
.stats-filters select {
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; font-size: 13px; background: #fff;
}
.stats-cards {
  display: flex; gap: 14px; margin-bottom: 20px; flex-wrap: wrap;
}
.stat-card {
  flex: 1; min-width: 150px; background: var(--panel); border-radius: 8px;
  border: 1px solid var(--line); border-top: 3px solid var(--accent, var(--red));
  padding: 16px 20px; text-align: center;
}
.stat-val { font-size: 28px; font-weight: 700; color: var(--accent, var(--red)); }
.stat-unit { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.stat-label { font-size: 13px; color: #777; margin-top: 6px; }
.stats-sections { display: flex; flex-direction: column; gap: 20px; }
.stats-sec {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.stats-sec h3 { font-size: 14px; padding: 10px 16px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.stats-sec .data-table { border: none; }
.stats-sec .data-table th { position: static; }
.status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12px; font-weight: 500;
}

/* ---------- 首页看板 ---------- */
#view-dashboard { flex-direction: column; }
.dashboard-wrap { flex: 1; overflow: auto; padding: 16px; }
.dash-cards {
  display: flex; gap: 14px; margin-bottom: 20px; flex-wrap: wrap;
}
.dash-cards .stat-card {
  flex: 1; min-width: 130px; position: relative; padding: 14px 16px;
}
.stat-icon {
  position: absolute; top: 10px; right: 12px; font-size: 22px; opacity: .35;
}
.dash-grid {
  display: flex; gap: 16px; margin-bottom: 16px;
}
.dash-grid .dash-sec { flex: 1; }
.dash-sec {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  margin-bottom: 16px;
}
.dash-sec h3 { font-size: 14px; padding: 10px 16px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.dash-list { padding: 4px 0; max-height: 320px; overflow-y: auto; }
.dash-item {
  padding: 8px 16px; cursor: pointer; border-bottom: 1px solid #f0f0f0;
  transition: background .15s;
}
.dash-item:hover { background: #f8f9fb; }
.dash-item:last-child { border-bottom: none; }
.dash-item-main { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dash-item-name { font-weight: 600; font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-item-meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.dash-days { color: var(--red); font-weight: 500; }
.dash-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }

/* CSS柱状图 */
.dash-chart { padding: 16px; min-height: 180px; }
.bar-chart {
  display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-bottom: 4px;
}
.bar-group {
  flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%;
  justify-content: flex-end;
}
.bar-stack {
  width: 100%; max-width: 40px; height: 100%; display: flex; flex-direction: column;
  justify-content: flex-end; gap: 1px;
}
.bar {
  width: 100%; border-radius: 3px 3px 0 0; min-height: 2px; transition: height .3s;
}
.bar-classes { background: var(--red); }
.bar-students { background: var(--blue); }
.bar-label { font-size: 11px; color: var(--muted); margin-top: 4px; }
.chart-legend {
  display: flex; gap: 14px; justify-content: center; margin-top: 10px; font-size: 12px; color: #777;
}
.legend-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 3px; vertical-align: middle;
}

/* 类型分布条形图 */
.type-bars { padding: 8px 0; }
.type-bar-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 16px; font-size: 13px;
}
.type-bar-label { width: 100px; text-align: right; color: #555; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-bar-track { flex: 1; height: 20px; background: #f0f2f5; border-radius: 4px; overflow: hidden; }
.type-bar-fill { height: 100%; border-radius: 4px; transition: width .4s; }
.type-bar-count { width: 30px; font-weight: 600; color: #555; }

/* ---------- 培训日历 ---------- */
#view-calendar { flex-direction: column; }
.cal-wrap { flex: 1; overflow: auto; padding: 16px; }
.cal-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  background: var(--panel); padding: 12px 16px; border-radius: 8px; border: 1px solid var(--line);
}
.cal-title { font-size: 18px; font-weight: 700; min-width: 140px; text-align: center; }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px;
}
.cal-weekdays span {
  text-align: center; padding: 6px; font-size: 12px; font-weight: 600; color: #555;
  background: #fafbfc; border-radius: 4px;
}
.cal-weekdays .cal-weekend { color: var(--red); }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.cal-cell {
  min-height: 90px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 4px; font-size: 12px; overflow: hidden;
}
.cal-cell.cal-empty { background: transparent; border-color: transparent; }
.cal-cell.cal-today { border-color: var(--red); border-width: 2px; }
.cal-cell.cal-weekend-cell { background: #fefdfd; }
.cal-date { font-weight: 600; font-size: 13px; padding: 2px 4px; color: #555; }
.cal-today .cal-date { color: var(--red); }
.cal-event {
  margin-top: 2px; padding: 2px 4px; border-radius: 3px; background: #f8f9fb; font-size: 11px;
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background .15s;
}
.cal-event:hover { background: #eef4ff; }
.cal-event-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 3px;
  vertical-align: middle;
}

/* ---------- 考勤管理 ---------- */
#view-attendance { flex-direction: column; }
.att-wrap { flex: 1; overflow: auto; padding: 12px 16px; }
.att-legend {
  display: flex; align-items: center; gap: 4px; font-size: 12px; color: #555; margin: 0 4px;
}
.att-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px;
}
.att-dot.att-present { background: #1e9e62; }
.att-dot.att-absent { background: #e74c3c; }
.att-dot.att-late { background: #e6a23c; }
.att-table { font-size: 12px; }
.att-table th { font-size: 11px; padding: 4px; }
.att-date-head { background: #f0f4f8; font-size: 12px; }
.att-slot-head { font-size: 10px; color: var(--muted); font-weight: 400; }
.att-name { font-weight: 600; white-space: nowrap; }
.att-cell {
  cursor: pointer; padding: 2px !important; min-width: 32px; transition: background .1s;
}
.att-batch-cell { padding: 2px 4px !important; text-align: center; }
.att-batch-btn {
  font-size: 11px; padding: 2px 8px; background: #e8f5e9; color: #1e9e62;
  border: 1px solid #a5d6a7; border-radius: 4px; cursor: pointer;
  white-space: nowrap; transition: all .15s;
}
.att-batch-btn:hover { background: #c8e6c9; border-color: #66bb6a; }
.att-cell:hover { background: #eef4ff; }
.att-cell.att-modified { background: #fff8e1; }
.att-badge {
  display: inline-block; width: 24px; height: 24px; line-height: 24px; text-align: center;
  border-radius: 4px; font-size: 12px; font-weight: 600;
}
.att-badge-出席 { background: #d4edda; color: #155724; }
.att-badge-缺席 { background: #f8d7da; color: #721c24; }
.att-badge-迟到 { background: #fff3cd; color: #856404; }

/* ---------- 统计页图表 ---------- */
.stats-chart-row {
  display: flex; gap: 16px; margin-bottom: 20px;
}
.stats-chart-sec {
  flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.stats-chart-sec h3 { font-size: 14px; padding: 10px 16px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.stats-chart-body { padding: 16px; min-height: 200px; }

/* CSS甜甜圈图 */
.donut {
  width: 100px; height: 100px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.donut-hole {
  width: 60px; height: 60px; background: var(--panel); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-num { font-size: 20px; font-weight: 700; color: var(--text); }
.donut-label { font-size: 10px; color: var(--muted); }
.donut-legend { font-size: 13px; line-height: 2; color: #555; }
.donut-legend .legend-dot { margin-right: 6px; }

/* ---------- 可搜索下拉组件 ---------- */
.search-select { position: relative; display: inline-block; }
.search-select input {
  width: 100%; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 13px; background: #fff;
}
.search-select input:focus { outline: none; border-color: var(--red); }
.search-select-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 9999;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  max-height: 240px; overflow-y: auto; box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  margin-top: 2px;
}
.ss-item {
  padding: 7px 12px; cursor: pointer; font-size: 13px;
  border-bottom: 1px solid #f0f0f0; transition: background .1s;
}
.ss-item:hover { background: #f4f5f7; }
.ss-item.ss-selected { background: #fff3e0; color: var(--red); font-weight: 600; }
.ss-empty { padding: 12px; color: var(--muted); text-align: center; font-size: 13px; }

/* 顶栏班级搜索 */
#classSelectWrap { width: 240px; }
#classSelectInput { max-width: 240px; }

/* 弹窗内搜索 */
#assignMainWrap, #clsHeadWrap { width: 100%; }
#assignMainWrap input, #clsHeadWrap input { width: 100%; }

/* ---------- 排课页底部班级明细 ---------- */
.schedule-bottom {
  flex-shrink: 0; max-height: 40vh; overflow-y: auto;
  background: var(--panel); border-top: 2px solid var(--line); padding: 16px 20px 20px;
}
.schedule-bottom h3 {
  font-size: 15px; margin-bottom: 10px; color: var(--text);
}
.schedule-bottom .data-table { font-size: 13px; }
.status-select { cursor: pointer; font-size: 12px; border-radius: 4px; }

/* 复制排课弹窗 */
.copy-sched-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.copy-sched-item { display: flex; align-items: center; padding: 8px 4px; cursor: pointer; border-bottom: 1px solid #f5f5f5; font-size: 14px; }
.copy-sched-item:last-child { border-bottom: none; }
.copy-sched-item:hover { background: #f8f9fa; }
.copy-sched-item input[type="radio"] { margin-right: 8px; }
.copy-sched-badge { margin-left: 8px; background: #e8f5e9; color: #1e9e62; font-size: 11px; padding: 1px 6px; border-radius: 3px; }
.copy-sched-badge-muted { margin-left: 8px; color: var(--muted); font-size: 11px; }

/* ---------- 课程通知 ---------- */
.notify-text {
  width: 100%; min-height: 420px; max-height: 60vh;
  font-family: "Microsoft YaHei", "PingFang SC", monospace;
  font-size: 14px; line-height: 1.8;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 12px 16px; resize: vertical;
  background: #fafbfc; color: #333;
  white-space: pre; overflow-y: auto;
}

/* ---------- 学员备注 ---------- */
.student-inactive { opacity: 0.45; }
.student-inactive td { color: #999 !important; }
.remark-badge {
  display: inline-block; margin-left: 6px; font-size: 11px;
  padding: 1px 6px; border-radius: 3px;
  background: #fde2e2; color: #c0392b; vertical-align: middle;
}
.btn-remark { font-size: 12px; padding: 2px 8px; }
.remark-img-tag { font-size: 14px; margin-left: 2px; }
.remark-modal { max-width: 480px; }
.remark-presets { display: flex; gap: 8px; margin: 4px 0; }
.remark-presets .btn-preset {
  padding: 4px 16px; border-radius: 4px; cursor: pointer;
  font-size: 13px; border: 1px solid var(--line); background: #fff; color: #555;
}
.remark-presets .btn-preset.active {
  background: var(--red); color: #fff; border-color: var(--red);
}
.remark-input { margin-top: 4px; }
.remark-image-area { margin-top: 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.remark-preview { max-width: 200px; max-height: 150px; border-radius: 6px; border: 1px solid var(--line); }
.remark-no-img {
  width: 120px; height: 80px; border: 1px dashed var(--line); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px;
}
.btn-danger { background: #e74c3c; color: #fff; border-color: #e74c3c; }
.btn-danger:hover { background: #c0392b; }

/* existing modal styles (shared) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.modal-box {
  background: #fff; border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,.18);
  width: 90%; max-width: 520px; max-height: 80vh; overflow-y: auto;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-header h3 { font-size: 16px; margin: 0; }
.modal-close { font-size: 24px; background: none; border: none; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 16px 20px; }
.modal-body label { display: block; font-size: 13px; color: #555; margin-bottom: 4px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--line);
}

/* ================================================================
   打印样式 —— 学员页 & 授课费页
   ================================================================ */
@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  /* ---- 全局重置 ---- */
  body {
    height: auto !important;
    overflow: visible !important;
    background: white !important;
    font-size: 11px !important;
    display: block !important;
    color: #000 !important;
  }

  /* ---- 只显示活跃视图 ---- */
  main.view {
    display: none !important;
    flex: none !important;
    overflow: visible !important;
  }
  main.view.active {
    display: block !important;
  }

  /* ---- 精简顶栏：只留品牌名 + 班级名 ---- */
  .topbar {
    display: block !important;
    height: auto !important;
    background: white !important;
    border: none !important;
    border-bottom: 2px solid #000 !important;
    padding: 0 0 8px 0 !important;
    margin-bottom: 12px !important;
    text-align: center !important;
  }
  .topbar .brand {
    font-size: 16px !important;
    color: #000 !important;
    display: block !important;
    margin-bottom: 4px !important;
  }
  .topbar .class-bar {
    display: block !important;
  }
  .topbar .class-bar #classSelectInput {
    display: inline-block !important;
    border: none !important;
    background: none !important;
    font-size: 14px !important;
    font-weight: bold !important;
    text-align: center !important;
    padding: 0 !important;
    color: #000 !important;
    width: auto !important;
    min-width: 200px !important;
    height: auto !important;
    margin: 0 !important;
  }
  /* 隐藏顶栏中的其他元素 */
  .topbar .tabs,
  .topbar .class-bar .search-select-dropdown,
  .topbar .class-bar button,
  .topbar .class-bar .btn,
  .topbar > button,
  .topbar > .btn {
    display: none !important;
  }

  /* ---- 隐藏交互动效 ---- */
  .toolbar { display: none !important; }
  .tip { display: none !important; }
  .btn { display: none !important; }
  button.btn { display: none !important; }
  input[type="file"] { display: none !important; }
  .modal-overlay { display: none !important; }
  .search-select-dropdown { display: none !important; }
  .spacer { display: none !important; }

  /* ---- 保留关键信息 ---- */
  #studentCount {
    display: block !important;
    font-size: 12px !important;
    margin: 4px 0 8px !important;
    color: #555 !important;
  }
  #feeTotal {
    display: block !important;
    font-size: 14px !important;
    font-weight: bold !important;
    margin: 4px 0 8px !important;
    color: #000 !important;
  }

  /* ---- 表格适配 A4 ---- */
  .table-wrap {
    overflow: visible !important;
    padding: 0 !important;
    max-height: none !important;
    flex: none !important;
  }
  .data-table {
    font-size: 10px !important;
    width: 100% !important;
    border-collapse: collapse !important;
  }
  .data-table th,
  .data-table td {
    padding: 3px 4px !important;
    border: 1px solid #999 !important;
  }
  .data-table th {
    position: static !important;
    background: #e6e6e6 !important;
    color: #000 !important;
    font-weight: bold !important;
  }
  .data-table tr.subtotal td {
    background: #f0f0f0 !important;
    font-weight: 600 !important;
  }
  .data-table tr.total td {
    background: #e0e0e0 !important;
    font-weight: 700 !important;
  }

  /* 防止表格行跨页撕裂 */
  .data-table tr {
    page-break-inside: avoid;
  }

  /* ---- 隐藏下拉菜单 ---- */
  .search-select-dropdown { display: none !important; }
}
