/* ==================== 公共样式 ==================== */
:root {
  --primary: #2b5ce6;
  --primary-dark: #1e46b8;
  --gold: #c9a063;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2733;
  --text-2: #6b7686;
  --text-3: #9aa4b2;
  --line: #e6eaf2;
  --green: #18a058;
  --orange: #f0a020;
  --red: #e5484d;
  --purple: #7c5cd6;
  --blue: #2b5ce6;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(31, 45, 92, .08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: 13px; cursor: pointer;
  transition: all .15s; white-space: nowrap; line-height: 1.4;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #c93b40; color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #eef1f8; color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.field label .req { color: var(--red); margin-left: 2px; }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; outline: none; transition: border .15s; background: #fff; color: var(--text);
  font-family: inherit;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43, 92, 230, .1); }
.form-row { display: flex; gap: 12px; }
.form-row .field { flex: 1; }

/* ---------- 表格 ---------- */
.table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 720px; }
.tbl th {
  text-align: left; padding: 12px 14px; font-size: 12px; color: var(--text-2);
  background: #f8fafd; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 600;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #f8fafe; }
.tbl .ops { display: flex; gap: 6px; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; line-height: 1.5; white-space: nowrap;
}
.badge.green { background: #e8f7ee; color: var(--green); }
.badge.orange { background: #fdf3e2; color: var(--orange); }
.badge.red { background: #fdecec; color: var(--red); }
.badge.blue { background: #e8eefc; color: var(--blue); }
.badge.purple { background: #f0ebfc; color: var(--purple); }
.badge.gray { background: #eef1f6; color: var(--text-2); }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 28, 45, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .15s ease;
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 480px; max-height: 90vh;
  display: flex; flex-direction: column; animation: slideUp .2s ease; box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.modal-wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-x { border: none; background: none; font-size: 20px; cursor: pointer; color: var(--text-3); line-height: 1; padding: 4px; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-10px);
  background: #232a38; color: #fff; padding: 10px 22px; border-radius: 24px; font-size: 13px;
  z-index: 200; opacity: 0; transition: all .25s; pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-error { background: var(--red); }

/* ---------- 工具 ---------- */
.empty { text-align: center; color: var(--text-3); padding: 40px 0; font-size: 13px; }
.money { color: #d4380d; font-weight: 600; }
.loading { text-align: center; color: var(--text-3); padding: 60px 0; }
.sub-text { color: var(--text-3); font-size: 12px; }

/* ---------- 房态颜色 ---------- */
.st-clean { background: #e8f7ee; color: var(--green); }
.st-dirty { background: #fdf3e2; color: var(--orange); }
.st-occupied { background: #e8eefc; color: var(--blue); }
.st-repair { background: #fdecec; color: var(--red); }
.room-chip {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 64px; height: 56px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: transform .1s, box-shadow .1s; gap: 2px;
}
.room-chip small { font-size: 10px; font-weight: 400; opacity: .85; }
.room-chip:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.12); }
