/* ============================================================
   房间管理页 - 独立样式文件
   政务风格，深蓝（藏青蓝）主色调，亮蓝色点缀，白色背景
   CSS REM 布局，根 100px，最小文字 0.22rem
   ============================================================ */

/* ---------- 全局重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 100px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background-color: #f0f2f5;
  color: #333;
  min-height: 100vh;
  font-size: 0.22rem;
}

a { text-decoration: none; color: inherit; }

/* ---------- 顶部导航栏（政务风格） ---------- */
.gov-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: 0.8rem; line-height: 0.8rem;
  background: linear-gradient(135deg, #0d2137 0%, #1a3a5c 40%, #1e4a6e 100%);
  color: #fff; z-index: 999;
  display: flex; align-items: center;
  box-shadow: 0 0.02rem 0.12rem rgba(13,33,55,.35);
}
.gov-header .back-btn {
  width: 0.4rem; height: 0.4rem; text-align: center; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.gov-header .back-btn:active { opacity: .7; }
.gov-header .back-btn svg { width: 0.4rem; height: 0.4rem; fill: none; stroke: #fff; stroke-width: 2.2; }
.gov-header h1 {
  flex: 1; font-size: 0.22rem; font-weight: 600; letter-spacing: 0.02rem;
  text-align: center; padding-right: 0.5rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gov-header::after {
  content: ''; display: block;
  position: absolute; bottom: 0; left: 0; right: 0; height: 0.02rem;
  background: linear-gradient(90deg, #2196F3, #64B5F6, #2196F3);
}

/* ---------- 主体 ---------- */
.main-body {
  padding-top: 1rem; padding-bottom: 0.3rem; max-width: 6rem; margin: 0 auto;
}

/* ---------- 房屋摘要卡片 ---------- */
.house-summary {
  margin: 0.14rem 0.14rem 0.1rem;
  padding: 0.14rem 0.16rem;
  background: linear-gradient(135deg, #1a3a5c, #234b73);
  border-radius: 0.1rem; color: #fff;
  box-shadow: 0 0.03rem 0.1rem rgba(26,58,92,.25);
}
.house-summary .summary-addr {
  font-size: 0.22rem; font-weight: 600; line-height: 1.4;
  word-break: break-all;
}
.house-summary .summary-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.08rem;
}
.house-summary .summary-status {
  font-size: 0.22rem; color: rgba(255,255,255,.7);
}
.house-summary .summary-count {
  font-size: 0.22rem; color: rgba(255,255,255,.7);
}
.house-summary .summary-count em {
  font-style: normal; color: #64B5F6; font-weight: 700;
}

/* ---------- 房间列表 ---------- */
.room-list {
  margin: 0 0.14rem;
}

/* 房间卡片 */
.room-card {
  display: flex; align-items: center;
  padding: 0.14rem 0.16rem;
  background: #fff; border-radius: 0.1rem;
  box-shadow: 0 0.02rem 0.06rem rgba(0,0,0,.05);
  margin-bottom: 0.1rem;
}

/* 房间号区域 */
.room-card .room-left {
  flex: 1; display: flex; align-items: center; gap: 0.1rem;
}
.room-card .room-no {
  width: 0.5rem; height: 0.5rem;
  background: linear-gradient(135deg, #e3edf7, #f0f4f9);
  border-radius: 0.08rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.22rem; font-weight: 700; color: #1a3a5c;
}
.room-card .room-info {
  display: flex; flex-direction: column; gap: 0.03rem;
}
.room-card .room-name {
  font-size: 0.22rem; font-weight: 600; color: #333;
}
.room-card .room-status-text {
  font-size: 0.22rem;
}

/* 出租状态标签 */
.room-status-tag {
  display: inline-block; padding: 0.02rem 0.08rem;
  border-radius: 0.04rem; font-size: 0.22rem;
}
.room-status-tag.tag-empty { background: #e8f5e9; color: #2e7d32; }
.room-status-tag.tag-rented { background: #fff3e0; color: #e65100; }

/* 操作按钮 */
.room-card .room-actions {
  flex-shrink: 0;
}
.room-card .room-actions .action-btn {
  display: inline-block; padding: 0.06rem 0.14rem;
  border-radius: 0.06rem; font-size: 0.22rem; font-weight: 500;
  cursor: pointer; transition: all .2s ease;
}
.room-card .room-actions .action-btn:active { opacity: .8; transform: translateY(0.01rem); }
.room-card .room-actions .btn-checkin {
  background: linear-gradient(135deg, #1565C0, #2196F3);
  color: #fff;
  box-shadow: 0 0.02rem 0.06rem rgba(25,118,210,.3);
}
.room-card .room-actions .btn-tenant {
  background: #e8edf3; color: #455a64;
}

/* ---------- 空状态 ---------- */
.room-empty {
  text-align: center; padding: 0.6rem 0.2rem;
  background: #fff; border-radius: 0.1rem;
  margin: 0 0.14rem;
}
.room-empty .empty-icon {
  width: 0.56rem; height: 0.56rem; margin: 0 auto 0.14rem;
  background: #e8edf3; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.room-empty .empty-icon svg { width: 0.28rem; height: 0.28rem; fill: none; stroke: #90a4ae; stroke-width: 2; }
.room-empty p { font-size: 0.22rem; color: #90a4ae; }

/* ---------- 底部链接 ---------- */
.footer-link {
  display: block; text-align: center;
  margin: 0.16rem 0.14rem 0;
  padding: 0.12rem 0;
  background: #fff; border-radius: 0.08rem;
  font-size: 0.22rem; color: #1565C0; font-weight: 500;
  box-shadow: 0 0.01rem 0.04rem rgba(0,0,0,.04);
}
.footer-link:active { background: #f5f7fa; }

/* ---------- 取消报备按钮 ---------- */
.summary-cancel {
  display: inline-block; padding: 0.04rem 0.12rem;
  background: rgba(255,255,255,.15); border-radius: 0.04rem;
  font-size: 0.22rem; color: #fff; cursor: pointer;
  transition: background .2s ease;
}
.summary-cancel:active { background: rgba(255,255,255,.25); }

/* ---------- 新增房间按钮 ---------- */
.add-room-section {
  margin: 0 0.14rem;
}
.btn-add-room {
  width: 100%; height: 0.46rem; border: none; border-radius: 0.08rem;
  font-size: 0.22rem; font-weight: 600; cursor: pointer;
  background: linear-gradient(135deg, #1565C0, #2196F3);
  color: #fff; letter-spacing: 0.02rem;
  box-shadow: 0 0.03rem 0.1rem rgba(25,118,210,.25);
  transition: all .2s ease;
}
.btn-add-room:active { transform: translateY(0.01rem); opacity: .9; }

/* ---------- 新增房间弹窗 ---------- */
.dialog-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.dialog-box {
  width: 80%; max-width: 4rem;
  background: #fff; border-radius: 0.12rem;
  overflow: hidden; box-shadow: 0 0.08rem 0.3rem rgba(0,0,0,.2);
}
.dialog-title {
  padding: 0.18rem 0.16rem 0.12rem;
  font-size: 0.22rem; font-weight: 700; color: #1a3a5c;
  text-align: center; border-bottom: 0.01rem solid #eef2f7;
}
.dialog-body {
  padding: 0.16rem;
}
.dialog-input {
  width: 100%; height: 0.42rem!important;
  padding: 0 0.1rem; border: 0.015rem solid #dde4ec;
  border-radius: 0.06rem; font-size: 0.22rem; color: #333;
  outline: none; background: #fafbfd;
}
.dialog-input:focus {
  border-color: #2196F3; box-shadow: 0 0 0 0.03rem rgba(33,150,243,.12);
  background: #fff;
}
.dialog-footer {
  display: flex; border-top: 0.01rem solid #eef2f7;
}
.dialog-btn {
  flex: 1; height: 0.46rem; border: none;
  font-size: 0.22rem; font-weight: 600; cursor: pointer;
  transition: background .2s ease;
}
.dialog-btn-cancel { background: #f5f5f5; color: #666; }
.dialog-btn-cancel:active { background: #e8e8e8; }
.dialog-btn-ok {
  background: linear-gradient(135deg, #1565C0, #2196F3);
  color: #fff;
}
.dialog-btn-ok:active { opacity: .85; }
