:root {
  --primary-red: #FF5353;
  --gold: #FFD700;
  --bg-light: #FFF9F9;
}

/* 全網頁隱藏捲動條 */
html, body {
  scrollbar-width: none;
  -ms-overflow-style: none;
  background-color: var(--bg-light);
  font-family: "Microsoft JhengHei", sans-serif;
  margin: 0; padding: 0;
}
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

.table-header { text-align: center; padding: 15px; background: white; }
.back-btn { text-decoration: none; color: var(--primary-red); font-weight: bold; font-size: 1rem; }
.stage-label {
  background: var(--primary-red); color: white;
  padding: 8px 12px; border-radius: 40px; font-weight: bold;
  margin: 10px auto; max-width: 260px; font-size: 1.2rem;
}

.trigger-search-btn {
  background: white;
  color: var(--primary-red);
  border: 2px solid var(--primary-red);
  padding: 8px 20px;
  border-radius: 25px;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 10px;
  display: inline-flex; align-items: center; gap: 5px;
  transition: 0.3s;
}

/* 導覽區域 */
.navigation-wrapper { position: relative; width: 100%; background: white; border-top: 1px solid #eee; border-bottom: 1px solid #eee; }

/* 導覽按鈕：白底紅字 */
.nav-btn {
  position: absolute; top: 0; bottom: 0; width: 45px;
  background: rgba(255, 255, 255, 0.98); color: var(--primary-red);
  border: none; font-size: 1.4rem; font-weight: bold;
  z-index: 100; cursor: pointer; box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.left-btn { left: 0; border-right: 1px solid #eee; }
.right-btn { right: 0; border-left: 1px solid #eee; }

.map-viewport { width: 100%; overflow-x: auto; scroll-behavior: smooth; }

/* 核心置中大框框 */
.table-map {
  display: inline-flex; flex-direction: column;
  min-width: 100%; align-items: center; padding: 10px 0 30px 0;
}

/* 第 n 排置中標籤 + 左右分隔線 */
.row-divider {
  width: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--primary-red); font-weight: bold; font-size: 1rem;
  margin: 10px 0; white-space: nowrap;
}
.row-divider::before, .row-divider::after {
  content: ""; flex: 1; height: 1px; background: #FFDDDD; margin: 0 20px;
}

/* 每一排的容器 */
.row-container {
  display: flex; justify-content: center;
  gap: 15px; /* 緊湊橫向間距 */
  margin-bottom: 25px; /* 緊湊縱向間距 */
  padding: 0 60px;
}

/* 桌子卡片 */
.table-card { display: flex; flex-direction: column; align-items: center; width: 85px; flex-shrink: 0; }
.table-icon {
  width: 60px; height: 60px; background: #fff;
  border-radius: 50%; border: 2px solid var(--gold);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  margin-bottom: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}
.table-id-tag { font-size: 0.75rem; font-weight: bold; color: #888; }
.table-symbol { font-size: 1.1rem; line-height: 1; }

/* 長文字換行處理 */
.name-label { 
  font-size: 1rem; font-weight: 900; color: #111; 
  text-align: center; white-space: normal;
  line-height: 1.2; word-break: break-all;
}

/* 搜尋高亮：呼吸效果 */
.table-card.highlight .table-icon {
  border-color: #FFBE0B; background: #FFF9E6;
  animation: pulseShadow 1.5s infinite alternate;
}
.table-card.highlight .name-label { color: #FFBE0B; }

@keyframes pulseShadow {
  from { box-shadow: 0 0 5px rgba(255, 190, 11, 0.4); }
  to { box-shadow: 0 0 25px rgba(255, 190, 11, 1); }
}

/* 垂直對齊佔位符 */
.spacer { width: 85px; flex-shrink: 0; }

/* 彈窗樣式 */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; display: flex; justify-content: center; align-items: flex-start; padding-top: 80px; transition: 0.3s; }
.modal-overlay.hidden { opacity: 0; pointer-events: none; }
.modal-content { background: white; width: 85%; max-width: 350px; border-radius: 15px; padding: 25px; }
.modal-header { display: flex; justify-content: space-between; margin-bottom: 15px; color: var(--primary-red); }
.close-modal-btn { font-size: 2rem; color: #999; cursor: pointer; line-height: 1; }
.modal-body input { width: 100%; padding: 12px; border: 2px solid #eee; border-radius: 8px; margin-bottom: 15px; box-sizing: border-box; font-size: 1rem; }
.do-search-btn { width: 100%; padding: 12px; background: var(--primary-red); color: white; border: none; border-radius: 8px; font-weight: bold; }

.table-footer { text-align: center; padding: 40px; color: #BBB; font-size: 0.85rem; }