/* 基础重置，统一全局样式，和首页样式保持兼容 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

/* 容器：完全移除左右边距，撑满整个屏幕宽度 */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 16px 0;
}

/* 返回头部：保留左右内边距，放大字体 */
.header {
  margin-bottom: 20px;
  padding: 0 16px 12px;
  border-bottom: 1px solid #eee;
}

.header a {
  display: inline-flex;
  align-items: center;
  color: #2563eb;
  text-decoration: none;
  font-size: 18px;
  padding: 4px 0;
}

/* 房源信息头部 */
.room-header {
  margin-bottom: 20px;
  padding: 0 16px;
}

.room-header h2 {
  font-size: 28px;
  margin-bottom: 8px;
  color: #222;
}

.room-meta {
  font-size: 18px;
  color: #666;
}

/* 图片画廊：撑满宽度，第一张图左侧紧贴屏幕，最后一张右侧紧贴屏幕 */
.gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin-bottom: 20px;
  padding: 0 0 10px 0;
  -webkit-overflow-scrolling: touch;
}

.gallery img:first-child {
  padding-left: 0;
}

.gallery img:last-child {
  padding-right: 0;
}

.gallery img {
  height: 240px;
  width: auto;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 0;
}

/* 房源描述：放大字体，保留最小边距 */
p {
  font-size: 19px;
  margin-bottom: 20px;
  padding: 0 16px;
}

/* 设施列表 */
.amenities {
  margin: 24px 0;
  padding: 0 16px;
}

.amenities h4 {
  font-size: 22px;
  margin-bottom: 12px;
  color: #222;
}

.amenities-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  list-style: none;
}

.amenities-list li {
  background: #fff;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 17px;
  color: #444;
}

/* 日历区域：保留最小左右边距，保证7列完整显示不挤压 */
.calendar-wrapper {
  margin: 24px 12px;
}

.calendar-wrapper h3 {
  font-size: 22px;
  margin-bottom: 16px;
  color: #222;
}

/* 日历星期标题 */
.calendar-week-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.calendar-week-header div {
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: #666;
  padding: 8px 0;
}

/* 日历格子容器 */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

/* 单个日期单元格：放大字体，保证每个格子显示完整 */
.cal-day {
  aspect-ratio: 1/1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 15px;
  padding: 2px;
}

.cal-day.empty {
  background: transparent;
}

.cal-day.available {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.cal-day.booked {
  background-color: #ffebee;
  color: #c62828;
}

.cal-day .date {
  font-weight: 500;
  margin-bottom: 2px;
}

.cal-day .status {
  font-size: 13px;
}

.cal-day .price {
  font-size: 13px;
}

/* 日历说明 */
.calendar-legend {
  margin-top: 16px;
  display: flex;
  gap: 20px;
  justify-content: center;
  font-size: 16px;
}

.legend-box {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 4px;
  border-radius: 2px;
  vertical-align: middle;
}

/* 预订表单：左右完全撑满无白边 */
.booking-form {
  margin: 24px 0 0;
  background: #fff;
  padding: 24px 16px;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.booking-form h3 {
  font-size: 22px;
  margin-bottom: 16px;
  color: #222;
}

/* 提示信息 */
.alert {
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 17px;
}

.alert-success {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.alert-error {
  background-color: #ffebee;
  color: #c62828;
}

/* 表单项：放大字体，全宽适配 */
.booking-form label {
  display: block;
  margin-bottom: 16px;
  font-size: 17px;
  color: #444;
}

.booking-form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 14px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 18px;
}

/* 提交按钮：默认预留加高空间，手机端会进一步加高 */
.booking-form button {
  display: block;
  width: 100%;
  background-color: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 16px 0;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.booking-form button:active {
  background-color: #1d4ed8;
}

/* --------------------------
   仅手机端调整：强制放大所有字体+加高提交按钮
--------------------------- */
@media screen and (max-width: 640px) {
  /* 强制放大所有元素字体，解决固定字号不生效的问题 */
  .header a {
    font-size: 20px !important;
  }
  .room-header h2 {
    font-size: 32px !important;
  }
  .room-meta {
    font-size: 19px !important;
  }
  p {
    font-size: 21px !important;
  }
  .amenities h4 {
    font-size: 24px !important;
  }
  .amenities-list li {
    font-size: 19px !important;
  }
  .calendar-wrapper h3 {
    font-size: 24px !important;
  }
  .calendar-week-header div {
    font-size: 17px !important;
  }
  .cal-day {
    font-size: 16px !important;
  }
  .cal-day .status, .cal-day .price {
    font-size: 14px !important;
  }
  .calendar-legend {
    font-size: 17px !important;
  }
  .booking-form h3 {
    font-size: 24px !important;
  }
  .alert {
    font-size: 19px !important;
  }
  .booking-form label {
    font-size: 19px !important;
  }
  .booking-form input {
    font-size: 20px !important;
    padding: 16px 12px !important;
  }

  /* 加高提交按钮（垂直方向加高，你可以根据需求调大/缩小数值） */
  .booking-form button {
    font-size: 20px !important;
    padding: 20px 0 !important;
  }
}

/* 平板及以上屏幕适配优化 */
@media screen and (min-width: 640px) {
  .container {
    padding: 24px 0;
  }

  .room-header h2 {
    font-size: 32px;
  }

  .gallery img {
    height: 320px;
  }

  p {
    font-size: 20px;
  }

  .amenities-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .cal-day {
    font-size: 16px;
  }

  .cal-day .status, .cal-day .price {
    font-size: 14px;
  }

  .booking-form {
    padding: 28px 24px;
  }
}

/* 桌面端适配：最大宽度限制，保持居中不拉伸，增加交互效果 */
@media screen and (min-width: 1024px) {
  .container {
    max-width: 900px;
  }
  .booking-form button:hover {
    background-color: #1d4ed8;
  }
  .cal-day.available:hover {
    opacity: 0.8;
  }
}
