/* 宿舍考勤 · 房间维度卡片（电脑端与手机端共用，视觉与宿舍分配卡片一致） */
.da-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 12px; color: #5a6b8c; margin: 0 2px 12px;
}
.da-legend span { display: inline-flex; align-items: center; gap: 5px; }
.da-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.da-legend i.green { background: #14a06f; }
.da-legend i.blue { background: #2f5bd7; }
.da-legend i.red { background: #d9534f; }
.da-legend i.gray { background: #b6bfd2; }

.da-bed-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.da-status {
  font-size: 10.5px; line-height: 1.6; padding: 0 6px; border-radius: 20px;
  font-weight: 600; white-space: nowrap;
}
.da-status.green { background: #e8f8f1; color: #14a06f; }
.da-status.blue { background: #eef3ff; color: #2f5bd7; }
.da-status.red { background: #fdecec; color: #d9534f; }
.da-status.gray { background: #f2f4f8; color: #8a97b0; }

.da-bed-extra { font-size: 10.5px; color: #e9832a; line-height: 1.5; margin-top: 2px; }
.da-note { color: #909399; }
.da-room-ops { flex: 0 0 auto; }
.da-room-btn {
  border: 1px solid #2f5bd7; background: #fff; color: #2f5bd7; border-radius: 8px;
  font-size: 12px; font-weight: 600; padding: 5px 10px; cursor: pointer;
  white-space: nowrap; transition: background .15s, box-shadow .15s;
}
.da-room-btn:hover { background: #f0f5ff; }
.da-room-btn:disabled { opacity: .6; cursor: default; }

.dorm-bed.clickable:hover { border-color: #b9cdf3; background: #e8efff; }

.da-sk-line {
  height: 10px; border-radius: 5px; margin-bottom: 7px;
  background: linear-gradient(90deg, #eef1f7 25%, #f7f9fd 37%, #eef1f7 63%);
  background-size: 400% 100%; animation: daSk 1.3s ease infinite;
}
.da-sk-line.w40 { width: 40%; }
.da-sk-line.w60 { width: 60%; }
.da-sk-line.w70 { width: 70%; }
@keyframes daSk {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* 周记录 / 月记录 / 年记录 切换（学生端、家长端） */
.da-hist-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.da-seg { display: inline-flex; background: #f2f4f8; border-radius: 8px; padding: 2px; }
.da-seg button {
  border: 0; background: transparent; color: #5a6b8c; font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.da-seg button.active { background: #2f5bd7; color: #fff; }
.da-hist-nav { display: flex; align-items: center; gap: 10px; }
.da-hist-title { flex: 1; text-align: center; font-weight: 600; font-size: 13.5px; }
.da-nav-text { font-size: 13px; color: #606a7b; margin: 0 4px; white-space: nowrap; }

/* 线性格子：周 7 格、月整月日历、年 12 个月 */
.da-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.da-grid-head { margin-bottom: 6px; }
.da-grid-hd { text-align: center; font-size: 12px; color: #8a97b0; font-weight: 600; }

.da-cell {
  border: 1px solid #e5e8f0; border-radius: 10px; background: #fbfcff;
  padding: 8px 4px; text-align: center; min-width: 0;
}
.da-cell.green { border-color: #bfe9d8; background: #f0fbf6; }
.da-cell.blue { border-color: #c9d8fb; background: #f2f6ff; }
.da-cell.red { border-color: #f6c9c8; background: #fef4f4; }
.da-cell.gray { border-color: #e2e6ef; background: #f7f8fa; }
.da-cell-wd { font-size: 12px; color: #7a8699; }
.da-cell-day { font-size: 14px; font-weight: 700; margin: 2px 0; }
.da-cell-st { font-size: 12px; font-weight: 600; }
.da-cell.green .da-cell-st { color: #14a06f; }
.da-cell.blue .da-cell-st { color: #2f5bd7; }
.da-cell.red .da-cell-st { color: #d9534f; }
.da-cell.gray .da-cell-st { color: #8a97b0; }
.da-cell-none { color: #b6bfd2; font-weight: 400; }
.da-cell-sub {
  font-size: 11px; color: #8a97b0; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.da-cell-cal { min-height: 76px; }
.da-cell-blank { border: 0; background: transparent; }

.da-year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.da-month-cell {
  border: 1px solid #e5e8f0; border-radius: 10px; padding: 10px 12px;
  background: #fbfcff; cursor: pointer; transition: border-color .15s, background .15s;
}
.da-month-cell:hover { border-color: #b9cdf3; background: #f4f7ff; }
.da-month-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.da-month-st { font-size: 12px; color: #5a6b8c; line-height: 1.6; }
.da-month-muted { color: #8a97b0; }
.da-month-bad { color: #d9534f; font-weight: 600; }

/* 手机端紧凑版：缩小字号与内边距，两列床位更贴合屏幕 */
@media (max-width: 480px) {
  .dorm-grid { gap: 10px; }
  .dorm-card { padding: 11px 11px 9px; border-radius: 11px; }
  .dorm-card-head { margin-bottom: 9px; gap: 6px; }
  .dorm-no { font-size: 15.5px; line-height: 1.3; }
  .dorm-meta { font-size: 11px; line-height: 1.5; margin-top: 2px; }
  .dorm-teacher { font-size: 11.5px; line-height: 1.5; margin-top: 2px; }
  .dorm-beds { gap: 6px; }
  .dorm-bed { padding: 6px 8px; border-radius: 7px; gap: 0; }
  .dorm-bed-no { font-size: 10px; }
  .dorm-bed-name { font-size: 12.5px; line-height: 1.3; }
  .dorm-bed-sub { font-size: 10px; line-height: 1.35; }
  .da-legend { gap: 9px; font-size: 11px; margin-bottom: 9px; }
  .da-status { font-size: 10px; padding: 0 5px; line-height: 1.5; }
  .da-bed-extra { font-size: 10px; line-height: 1.35; margin-top: 1px; }
  .da-room-btn { font-size: 11px; padding: 4px 7px; border-radius: 7px; }
  .da-grid { gap: 4px; }
  .da-cell { border-radius: 8px; padding: 5px 2px; }
  .da-cell-wd { font-size: 10px; }
  .da-cell-day { font-size: 12.5px; margin: 1px 0; }
  .da-cell-st { font-size: 10px; }
  .da-cell-sub { font-size: 9.5px; margin-top: 2px; }
  .da-cell-cal { min-height: 58px; }
  .da-year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .da-month-cell { padding: 8px; }
  .da-month-name { font-size: 13px; margin-bottom: 2px; }
  .da-month-st { font-size: 10.5px; line-height: 1.5; }
  .da-seg button { padding: 4px 10px; }
}

/* 小屏手机：进一步压缩，避免文字换行挤压 */
@media (max-width: 360px) {
  .dorm-no { font-size: 15px; }
  .dorm-meta { font-size: 10.5px; }
  .dorm-teacher { font-size: 11px; }
  .dorm-bed-name { font-size: 12px; }
  .da-room-btn { font-size: 10.5px; padding: 3px 6px; }
  .da-cell-wd { font-size: 9.5px; }
  .da-cell-day { font-size: 11.5px; }
  .da-cell-st { font-size: 9.5px; }
  .da-cell-sub { font-size: 9px; }
  .da-seg button { padding: 4px 8px; font-size: 11px; }
  .da-year-grid { gap: 6px; }
}
