/* 基本設定 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
    "Microsoft JhengHei", sans-serif;
  background: #f5f5f5;
  color: #333;
}

/* 共用 view 容器 */
.view {
  max-width: 1024px;
  margin: 0 auto;
  min-height: 100vh;
}

/* --------------- 首頁：總覽 --------------- */

.view-home {
  padding: 24px 16px 32px;
}

.app-header {
  text-align: center;
  margin-bottom: 24px;
}

.app-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.app-header p {
  margin-top: 8px;
  font-size: 14px;
  color: #666;
}

/* 教室卡片排列 */
.rooms-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

/* 單一教室卡片（首頁用） */
.room-card {
  display: block;
  text-decoration: none;
  color: inherit;

  background: #ffffff;
  border-radius: 12px;
  padding: 16px 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.room-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.room-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.room-card-title {
  margin: 0;
  font-size: 18px;
}

.room-card p {
  margin: 4px 0;
  font-size: 15px;
}

/* 狀態 badge（首頁用） */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
}

.status-available {
  background: #e0f7e9;
  color: #137333;
}

.status-full {
  background: #ffe5e5;
  color: #c62828;
  font-size: 16px;
  font-weight: 700;
  padding: 6px 14px;
}

/* 剩餘人數少（5 人以下） */
.status-warning {
  background: #fff9c4;  /* 淡黃色底 */
  color: #f57f17;       /* 深黃色 / 橘色字 */
  font-weight: 600;
}

/* --------------- 詳細頁：iPad 滿版 --------------- */

.view-detail {
  background: #e0e0e0;
  padding: 0;
  display: flex;
  justify-content: center;
}

/* 這個區塊最大寬 768，直立 iPad 會剛好滿版 */
.detail-layout {
  max-width: 768px;
  width: 100%;
  /* min-height: 200vh; */
  background: #f7f7f7;
  display: flex;
  flex-direction: column;
}

/* 上方綠色列 */
.detail-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #2e7d32;
  color: #ffffff;
}

.back-button {
  text-decoration: none;
  color: #ffffff;
  font-size: 16px;
  margin-right: 12px;
}

.detail-title {
  margin: 0;
  font-size: 20px;
}

/* 中間內容置中 */
.detail-content {
  /* flex: 1; */
  padding: 23px 16px 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 24px;
}

/* 白色資訊卡片 */
.detail-info-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 135px 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  text-align: center;
}

.detail-subtitle {
  margin: 0 0 8px;
  font-size: 50px;
  color: #777;
}

.detail-main-number {
  margin: 0;
  font-size: 100px;
  font-weight: 700;
}

.detail-status-text {
  margin-top: 12px;
  font-size: 70px;
  color: #2e7d32;
}

.detail-status-text.full {
  color: #c62828;
}

/* 即將額滿：黃色 */
.detail-status-text.warning {
  color: #f57f17;
}

/* 底下整條大按鈕區 */
.detail-controls {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  display: flex;
}

.detail-btn {
  flex: 1;
  padding: 18px 0;
  border: none;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  touch-action: manipulation;
}

.detail-btn-minus {
  background: #2e7d32;
}

.detail-btn-plus {
  background: #43a047;
  border-left: 1px solid rgba(255, 255, 255, 0.4);
}

.detail-btn:active {
  transform: scale(0.97);
}

/* 歸零按鈕區塊 */
.detail-reset-wrapper {
  margin-top: 16px;
}

.detail-reset-btn {
  width: 100%;
  padding: 14px 0;
  border-radius: 10px;
  border: none;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  background: #f57c00; /* 橘色，跟 +1 / -1 區分 */
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.detail-reset-btn:active {
  transform: scale(0.97);
}


/* 手機小螢幕微調 */
@media (max-width: 600px) {
  .view-home {
    padding: 16px 10px 24px;
  }

  .app-header h1 {
    font-size: 22px;
  }

  .detail-info-card {
    padding: 24px 18px;
  }

  .detail-main-number {
    font-size: 32px;
  }

  .detail-btn {
    font-size: 20px;
    padding: 16px 0;
  }
}

/* 只讀用的卡片（官網嵌入用） */
.room-card.view-only {
  cursor: default;
}

.room-card.view-only:hover {
  transform: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* 地區顯示用 */
.region-block {
  margin-bottom: 24px;
}

.region-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: #333;
}
