* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: #f2f4f7;
  color: #222;
  font-size: 14px;
}
a { color: #1e6fd9; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; flex: none;
  background: #1c2534;
  color: #cfd6e0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  padding: 20px 18px;
  font-size: 17px; font-weight: 700; color: #fff;
  background: #8b0000;
  letter-spacing: 1px;
}
.sidebar nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.sidebar nav a {
  display: block;
  padding: 11px 20px;
  color: #cfd6e0;
  font-size: 14px;
}
.sidebar nav a:hover { background: #273349; color: #fff; text-decoration: none; }
.sidebar nav a.on { background: #8b0000; color: #fff; font-weight: 600; }
.sidebar .nav-group { padding: 14px 20px 4px; font-size: 12px; color: #6b7686; }
.side-foot {
  padding: 14px 18px;
  border-top: 1px solid #2c3748;
  font-size: 12.5px; color: #9aa5b4; line-height: 1.9;
}
.side-foot a { color: #cfd6e0; }

.main { flex: 1; padding: 22px 26px; min-width: 0; }

/* ---------- 通用 ---------- */
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.page-desc { color: #6b7280; font-size: 13px; margin-bottom: 18px; }

.card {
  background: #fff; border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  padding: 18px 20px; margin-bottom: 18px;
}
.card h3 { font-size: 15px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #eef0f3; }

.btn {
  display: inline-block; border: 1px solid #d4d8de;
  background: #fff; color: #333;
  padding: 7px 16px; border-radius: 6px;
  font-size: 13.5px; cursor: pointer; line-height: 1.4;
}
.btn:hover { background: #f6f7f9; }
.btn-primary { background: #8b0000; border-color: #8b0000; color: #fff; }
.btn-primary:hover { background: #a31212; }
.btn-danger { background: #fff; border-color: #d93025; color: #d93025; }
.btn-danger:hover { background: #fdecea; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13.5px; }
.flash-success { background: #e8f7ee; color: #1a7f37; border: 1px solid #b7e4c8; }
.flash-error { background: #fdecea; color: #b3261e; border: 1px solid #f5c6c2; }
.flash-warning { background: #fff7e6; color: #9a6700; border: 1px solid #f2d8a7; }

label { display: block; font-size: 13px; color: #555; margin: 10px 0 5px; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d4d8de;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #8b0000; box-shadow: 0 0 0 2px rgba(139,0,0,.12); }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-col { flex: 1; min-width: 220px; }

table.list { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.list th, table.list td { padding: 9px 10px; border-bottom: 1px solid #eef0f3; text-align: left; vertical-align: middle; }
table.list th { background: #f8f9fb; color: #555; font-weight: 600; white-space: nowrap; }
table.list tr:hover td { background: #fafbfc; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge-admin { background: #8b0000; color: #fff; }
.badge-user { background: #e8edf4; color: #46576e; }
.badge-heban { background: #8e24aa; color: #fff; font-weight: 600; }
.badge-free { background: #eef0f3; color: #6b7280; }

.muted { color: #9aa1a9; font-size: 12.5px; }
.empty { text-align: center; color: #9aa1a9; padding: 28px 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.stat .num { font-size: 26px; font-weight: 700; color: #8b0000; }
.stat .lab { font-size: 12.5px; color: #6b7280; margin-top: 4px; }

/* ---------- 登录页 ---------- */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(160deg, #8b0000 0%, #5c0a0a 100%);
}
.login-card {
  width: 360px; max-width: 92vw;
  background: #fff; border-radius: 12px;
  padding: 30px 30px 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.login-brand { text-align: center; font-size: 20px; font-weight: 700; color: #8b0000; margin-bottom: 18px; letter-spacing: 1px; }
.login-card label { margin-top: 12px; }
.login-card .btn { margin-top: 18px; padding: 10px; font-size: 15px; }
.login-tip { text-align: center; font-size: 12px; color: #9aa1a9; margin-top: 16px; }

/* ---------- 登记页 ---------- */
.date-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.date-row input[type=date] { max-width: 180px; }
.date-row .btn { flex: none; }
.range-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 12px; background: #f8f9fb; padding: 10px; border-radius: 8px; }
.range-box label { margin: 0; }
.range-box input[type=date] { width: 160px; }

.date-picker-area { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.selected-dates { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 28px; }
.date-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #8b0000; color: #fff;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px;
}
.date-chip-x { cursor: pointer; font-weight: 700; opacity: .8; }
.date-chip-x:hover { opacity: 1; }

.slot-checks { display: flex; gap: 12px; flex-wrap: wrap; padding: 4px 0; }
.slot-checks label { margin: 0; display: flex; align-items: center; gap: 5px; font-size: 14px; color: #333; cursor: pointer; }
.slot-checks input[type=checkbox] { width: 16px; height: 16px; accent-color: #8b0000; }

/* ---------- 楼栋/教室 ---------- */
.building-block { margin-bottom: 20px; }
.building-title { display: flex; align-items: center; gap: 10px; font-size: 15.5px; font-weight: 700; padding: 10px 14px; background: #f8f9fb; border-left: 4px solid #8b0000; border-radius: 6px; }
.room-list { margin: 10px 0 0 14px; display: flex; flex-wrap: wrap; gap: 10px; }
.room-item { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 7px 12px; font-size: 13.5px; }
.room-item .floor { color: #9aa1a9; font-size: 12px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.inline-form input[type=text], .inline-form input[type=number], .inline-form select { width: auto; min-width: 120px; }
.inline-form label { margin: 0; white-space: nowrap; }

/* ---------- 预设 ---------- */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.preset-card .add-form { display: flex; gap: 8px; margin-bottom: 12px; }
.preset-card .add-form input { flex: 1; }
.preset-list { max-height: 380px; overflow-y: auto; }
.preset-list .item { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-bottom: 1px solid #f0f1f3; font-size: 13.5px; }

/* ---------- 时间设置 ---------- */
.slot-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid #f0f1f3; }
.slot-row .sname { width: 90px; font-weight: 600; }
.slot-row input[type=time], .slot-row input[type=text] { width: 130px; }
.slot-row .muted { margin-left: 6px; }

/* ---------- 筛选条 ---------- */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .f-item { min-width: 160px; }
.filter-bar label { margin-bottom: 4px; }

.pager-note { margin-top: 12px; font-size: 12.5px; color: #6b7280; }

/* ---------- OCR图片识别 ---------- */
.hidden { display: none !important; }
.ocr-upload-area { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px; background: #f8f9fb; border-radius: 8px; }
.ocr-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ocr-table th, .ocr-table td { padding: 8px 8px; border-bottom: 1px solid #eef0f3; text-align: left; vertical-align: middle; }
.ocr-table th { background: #f8f9fb; color: #555; font-weight: 600; white-space: nowrap; }
.ocr-table tr:hover td { background: #fafbfc; }
.ocr-input { width: 100%; padding: 5px 8px; border: 1px solid #d4d8de; border-radius: 5px; font-size: 13px; font-family: inherit; background: #fff; }
.ocr-input:focus { outline: none; border-color: #8b0000; }
 
