/* ==========================================================================
   沙梭釣魚天氣與潮汐智能判讀儀表板 - 專業海儀深色主題
   ========================================================================== */

:root {
  --bg-primary: #0a0f18;
  --bg-secondary: #111a2e;
  --bg-card: rgba(18, 28, 48, 0.75);
  --bg-card-hover: rgba(26, 40, 68, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.35);

  --accent-cyan: #38bdf8;
  --accent-teal: #2dd4bf;
  --accent-amber: #f59e0b;
  --accent-gold: #fbbf24;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-indigo: #6366f1;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.2);
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(56, 189, 248, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(45, 212, 191, 0.06) 0%, transparent 45%),
    linear-gradient(180deg, #070b12 0%, #0d1525 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: max(60px, env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
  touch-action: pan-y;
}

/* 頂部導航列 */
.app-header {
  width: 100%;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 15, 24, 0.85);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 24px;
  display: flex;
  justify-content: center;
}

.header-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow-glow);
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ffffff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 釣點選擇器與操作列 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.spot-select-wrapper {
  position: relative;
  min-width: 260px;
  display: flex;
  align-items: center;
}

.spot-icon {
  position: absolute;
  left: 12px;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 2;
  user-select: none;
}

.custom-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: rgba(13, 22, 39, 0.9);
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  color: var(--text-main);
  padding: 10px 48px 10px 38px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.custom-select:hover, .custom-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
  background: rgba(15, 27, 48, 0.98);
}

/* 顯眼大尺寸下拉圖示容器 */
.select-arrow-box {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.3), rgba(2, 132, 199, 0.15));
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
  transition: all 0.2s ease;
  z-index: 2;
}

.custom-select:hover ~ .select-arrow-box,
.custom-select:focus ~ .select-arrow-box {
  background: rgba(14, 165, 233, 0.5);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.6);
  transform: translateY(-50%) scale(1.05);
}

.select-arrow-icon {
  width: 20px;
  height: 20px;
  stroke-width: 3.5px;
}

/* 專業 UI 向量圖示系統 (取代 AI Emoji) */
.ui-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  vertical-align: -3px;
}

.ui-icon-fish {
  width: 26px;
  height: 26px;
  stroke: #ffffff;
}

.ui-icon-pin {
  width: 18px;
  height: 18px;
  stroke: var(--accent-cyan);
}

.ui-icon-wind {
  width: 17px;
  height: 17px;
  stroke: currentColor;
}

.ui-icon-calendar {
  width: 18px;
  height: 18px;
  stroke: var(--accent-cyan);
}

.ui-icon-bolt {
  width: 17px;
  height: 17px;
  stroke: var(--accent-gold);
  fill: rgba(251, 191, 36, 0.2);
}

.golden-icon .ui-icon-bolt {
  width: 30px;
  height: 30px;
  stroke: var(--accent-emerald);
  fill: rgba(16, 185, 129, 0.25);
  vertical-align: 0;
}

.ui-icon-wave {
  width: 18px;
  height: 18px;
  stroke: var(--accent-cyan);
}

.ui-icon-chart {
  width: 18px;
  height: 18px;
  stroke: #818cf8;
}

.ui-icon-target {
  width: 20px;
  height: 20px;
  stroke: var(--accent-cyan);
}

.ui-icon-bulb {
  width: 17px;
  height: 17px;
  stroke: var(--accent-cyan);
  fill: rgba(56, 189, 248, 0.2);
}

.btn-action {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-windy {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.2), rgba(245, 158, 11, 0.2));
  border-color: rgba(244, 63, 94, 0.4);
}

.btn-windy:hover {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.4), rgba(245, 158, 11, 0.4));
  border-color: var(--accent-rose);
  color: #fff;
}

/* 主要內容佈局 */
.main-container {
  width: 100%;
  max-width: 1400px;
  margin: 20px auto 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  min-width: 0;
  box-sizing: border-box;
}

/* 釣點資訊橫幅 */
.spot-banner {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-main);
  overflow: hidden;
}

.spot-meta h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.spot-meta p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.spot-details-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.meta-pill {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.meta-pill span {
  color: var(--text-dim);
  display: block;
  font-size: 0.72rem;
}

.meta-pill strong {
  color: #e2e8f0;
}

/* 七日分數縮圖切換列 (置於詳情正上方，直覺點選，無重置感) */
.week-strip-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(10, 18, 32, 0.9));
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.week-strip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.strip-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
}

.strip-hint {
  font-size: 0.74rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

/* 7 日縮圖網格 - 7 個等寬按鈕，嚴格自適應，嚴禁溢出 */
.week-score-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  width: 100%;
  box-sizing: border-box;
}

.strip-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 8px 1px 6px 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
  color: inherit;
  font-family: inherit;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-width: 0;
}

.strip-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(56, 189, 248, 0.4);
}

.strip-item:active {
  transform: scale(0.94);
}

.strip-item.active {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.3), rgba(2, 132, 199, 0.12));
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.strip-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 3px;
  background: var(--accent-cyan);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 0 6px var(--accent-cyan);
}

.strip-item.is-best {
  border-color: rgba(251, 191, 36, 0.45);
}

.strip-weekday {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.strip-date {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
  margin-top: 1px;
  margin-bottom: 3px;
}

.strip-score-badge {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  padding: 2px 4px;
  border-radius: 8px;
  font-weight: 900;
  margin-bottom: 2px;
  border: 1px solid transparent;
  width: 90%;
  box-sizing: border-box;
}

.strip-score-val {
  font-size: 0.95rem;
  line-height: 1;
}

.strip-rank-char {
  font-size: 0.65rem;
  font-weight: 800;
}

.strip-energy-text {
  font-size: 0.62rem;
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
}

.strip-weather-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-top: 3px;
  font-size: 0.62rem;
  color: #94a3b8;
  width: 100%;
  white-space: nowrap;
}

.strip-weather-row .ui-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.strip-rain-pop {
  font-weight: 700;
  font-size: 0.62rem;
  color: #38bdf8;
}

.strip-rain-pop.high-rain {
  color: #f87171;
}

.strip-best-badge {
  position: absolute;
  top: 1px;
  right: 2px;
  color: var(--accent-gold);
  font-size: 0.6rem;
  font-weight: 900;
  line-height: 1;
}

/* 每日天氣預報與下雨機率詳情列 */
.week-weather-bar {
  margin-top: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: #e2e8f0;
  box-sizing: border-box;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.wwb-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  flex-wrap: wrap;
}

.wwb-day-label {
  color: #94a3b8;
  font-size: 0.78rem;
}

.wwb-weather-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.07);
  padding: 3px 8px;
  border-radius: 6px;
  color: #f1f5f9;
  font-weight: 700;
}

.wwb-weather-badge .ui-icon {
  width: 15px;
  height: 15px;
}

.wwb-rain-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.wwb-rain-badge.is-wet {
  background: rgba(244, 63, 94, 0.14);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.35);
}

.wwb-rain-badge .ui-icon {
  width: 13px;
  height: 13px;
}

.wwb-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #94a3b8;
  font-size: 0.78rem;
  flex-wrap: wrap;
}

.wwb-temp, .wwb-precip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wwb-temp .ui-icon, .wwb-precip .ui-icon {
  width: 13px;
  height: 13px;
  color: var(--accent-cyan);
}

/* 評級顏色 */
.rank-s {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25), rgba(16, 185, 129, 0.05));
  border-color: var(--accent-emerald) !important;
  color: var(--accent-emerald);
}

.rank-a {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25), rgba(56, 189, 248, 0.05));
  border-color: var(--accent-cyan) !important;
  color: var(--accent-cyan);
}

.rank-b {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25), rgba(245, 158, 11, 0.05));
  border-color: var(--accent-amber) !important;
  color: var(--accent-amber);
}

.rank-c {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.05));
  border-color: var(--accent-indigo) !important;
  color: var(--accent-indigo);
}

.rank-d {
  background: radial-gradient(circle, rgba(244, 63, 94, 0.2), rgba(244, 63, 94, 0.05));
  border-color: var(--accent-rose) !important;
  color: var(--accent-rose);
}

/* 儀表板主要分析區域 (雙欄) */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 100%;
  }
}

/* 圖表與時段卡片 */
.chart-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-main);
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

#tideInfoBadge {
  word-break: break-word;
  white-space: normal;
  line-height: 1.5;
}

.golden-windows-box,
.score-reason-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
}

.score-reason-box.rank-s,
.score-reason-box.rank-a {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(15, 23, 42, 0.75) 100%);
}

.score-reason-box.rank-b {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(15, 23, 42, 0.75) 100%);
}

.score-reason-box.rank-c {
  border-color: rgba(99, 102, 241, 0.45);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(15, 23, 42, 0.75) 100%);
}

.score-reason-box.rank-d {
  border-color: rgba(244, 63, 94, 0.45);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12) 0%, rgba(15, 23, 42, 0.75) 100%);
}

/* 頂部 Header 列：分數等級 + 黃金時段 */
.srb-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.srb-score-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.srb-badge-num-row {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.srb-badge-num {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
}

.srb-badge-unit {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.srb-badge-rank {
  font-size: 0.75rem;
  font-weight: 800;
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* 各等級配色 */
.rank-s .srb-badge-num, .rank-a .srb-badge-num { color: #34d399; }
.rank-s .srb-badge-rank, .rank-a .srb-badge-rank { background: rgba(52, 211, 153, 0.2); color: #34d399; }

.rank-b .srb-badge-num { color: #fbbf24; }
.rank-b .srb-badge-rank { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }

.rank-c .srb-badge-num { color: #818cf8; }
.rank-c .srb-badge-rank { background: rgba(129, 140, 248, 0.2); color: #818cf8; }

.rank-d .srb-badge-num { color: #fb7185; }
.rank-d .srb-badge-rank { background: rgba(251, 113, 133, 0.2); color: #fb7185; }

.srb-window-info {
  flex: 1;
  min-width: 0;
}

.srb-window-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-emerald);
}

.srb-window-title .ui-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.golden-hours {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  word-break: break-word;
  white-space: normal;
  line-height: 1.4;
  margin-top: 2px;
}

/* 分數成因解析區塊 */
.srb-reasons-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.srb-reasons-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.srb-reasons-title .ui-icon {
  width: 14px;
  height: 14px;
  color: var(--accent-cyan);
}

.srb-reasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.srb-reason-card {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  border-left: 3px solid #64748b;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.srb-reason-card.is-positive {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.srb-reason-card.is-negative {
  border-left-color: #f43f5e;
  background: rgba(244, 63, 94, 0.08);
}

.srb-reason-card.is-neutral {
  border-left-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.srb-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.srb-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
}

.srb-card-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.is-positive .srb-card-badge {
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
}

.is-negative .srb-card-badge {
  background: rgba(244, 63, 94, 0.22);
  color: #fb7185;
}

.is-neutral .srb-card-badge {
  background: rgba(56, 189, 248, 0.22);
  color: #38bdf8;
}

.srb-card-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.srb-verdict {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #e2e8f0;
  border: 1px dashed rgba(255, 255, 255, 0.15);
}

/* 24小時視覺化時間軸表格/甘特圖 */
/* 24小時視覺化時間軸表格 (純上下滑瀏覽) */
.timeline-visual-wrapper {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden !important;
  overflow-y: auto;
  max-height: 520px;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.timeline-table {
  width: 100% !important;
  border-collapse: collapse;
  min-width: 0 !important;
  table-layout: fixed;
  font-size: 0.82rem;
}

.timeline-table th, .timeline-table td {
  padding: 8px 3px;
  text-align: center;
  border-bottom: 1px solid var(--border-glass);
  box-sizing: border-box;
}

.timeline-table th {
  color: var(--text-dim);
  font-weight: 700;
  background: #0d1627 !important;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hour-cell {
  font-weight: 700;
  color: var(--text-muted);
}

.score-pill-sm {
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.78rem;
  display: inline-block;
}

.wave-pill {
  color: #60a5fa;
  font-weight: 600;
}

.wind-pill {
  color: #34d399;
}

.tide-pill {
  color: #f472b6;
  font-size: 0.75rem;
}

/* 波浪能量 (kW/m) 狀態發光徽章 */
.energy-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.energy-clean {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.energy-good {
  background: rgba(45, 212, 191, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.4);
  color: #2dd4bf;
}

.energy-warn {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}

.energy-danger {
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.5);
  color: #f43f5e;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.25);
}

/* 潮汐區塊包裝與滿潮/乾潮大字卡 */
.tide-section-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 6px;
}

.tide-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tide-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tide-phase-tag {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 4px 12px;
  border-radius: 14px;
}

/* 乾潮、滿潮大字卡網格 (醒目時間專區) */
.tide-extremes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  width: 100%;
}

.tide-extreme-card {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tide-extreme-card.is-high {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(2, 132, 199, 0.1));
  border: 1.5px solid rgba(56, 189, 248, 0.55);
}

.tide-extreme-card.is-low {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(225, 29, 72, 0.1));
  border: 1.5px solid rgba(244, 63, 94, 0.55);
}

.tide-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tide-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.tide-extreme-card.is-high .tide-card-badge {
  color: #38bdf8;
}

.tide-extreme-card.is-low .tide-card-badge {
  color: #f43f5e;
}

.tide-card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.tide-extreme-card.is-high .tide-card-dot {
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
}

.tide-extreme-card.is-low .tide-card-dot {
  background: #f43f5e;
  box-shadow: 0 0 10px #f43f5e;
}

.tide-card-height {
  font-size: 0.85rem;
  font-weight: 700;
}

.tide-extreme-card.is-high .tide-card-height {
  color: #bae6fd;
}

.tide-extreme-card.is-low .tide-card-height {
  color: #fecdd3;
}

/* 放大乾潮與滿潮時間文字 */
.tide-card-time {
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
  line-height: 1.2;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* 潮汐曲線 SVG 容器 */
.tide-chart-container {
  width: 100%;
  height: 190px;
  position: relative;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 8px;
  border: 1px solid var(--border-glass);
}

/* 裝備與釣法指導面板 (側欄) */
.advisor-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.advice-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-main);
}

.advice-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-cyan);
}

.tackle-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tackle-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
}

.tackle-label {
  color: var(--text-muted);
  min-width: 75px;
}

.tackle-value {
  color: #f1f5f9;
  font-weight: 600;
  text-align: right;
}

.tactics-box {
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid var(--accent-cyan);
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.5;
  margin-top: 10px;
}

.tackle-shop-link {
  color: #fb923c;
  font-size: 0.76rem;
  margin-left: 6px;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
  transition: color 0.15s ease;
}

.tackle-shop-link:hover {
  color: #fdba74;
}

/* 好物購買連結專區 */
.shop-section {
  margin-top: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-main);
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.shop-section-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.shop-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-section-title .ui-icon-bag {
  color: #fb923c;
  width: 20px;
  height: 20px;
}

.shop-section-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.shop-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.shop-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.88) 100%);
  border: 1px solid rgba(251, 146, 60, 0.28);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.shop-card:hover {
  border-color: rgba(251, 146, 60, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(251, 146, 60, 0.18);
}

.shop-card-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #ea580c, #f97316);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 12px;
  border-bottom-left-radius: 10px;
  letter-spacing: 0.5px;
}

.shop-card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

.shop-product-info {
  flex: 1;
  min-width: 260px;
}

.shop-brand {
  font-size: 0.74rem;
  color: #fb923c;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.shop-product-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 8px;
}

.shop-product-desc {
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 12px;
}

.shop-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shop-card.is-featured {
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.82) 0%, rgba(20, 30, 48, 0.92) 100%);
  box-shadow: 0 4px 22px rgba(251, 191, 36, 0.12);
}

.shop-card.is-featured:hover {
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 8px 28px rgba(251, 191, 36, 0.22);
}

.shop-card.is-featured .shop-card-badge {
  background: linear-gradient(135deg, #d97706, #f59e0b);
}

.shop-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.shop-tag.highlight {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fbbf24;
  font-weight: 700;
}

.shop-tag.price {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-weight: 800;
}

.shop-action-area {
  flex-shrink: 0;
}

.btn-shop-buy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ea580c 0%, #ee4d2d 100%);
  color: #ffffff !important;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(238, 77, 45, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-shop-buy:hover {
  background: linear-gradient(135deg, #f97316 0%, #ff5722 100%);
  box-shadow: 0 6px 22px rgba(238, 77, 45, 0.55);
  transform: translateY(-2px);
}

.btn-shop-buy:active {
  transform: scale(0.97);
}

.btn-shop-buy .ui-icon {
  width: 17px;
  height: 17px;
}

/* 頁尾版權與免責說明 */
.app-footer {
  margin-top: 28px;
  padding: 20px 16px;
  text-align: center;
  font-size: 0.78rem;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}





/* 響應式優化 - 針對 iPhone 16 Plus (430px) 與現代行動裝置專屬調校 */
@media (max-width: 768px) {
  body {
    padding-bottom: max(50px, env(safe-area-inset-bottom));
  }

  .app-header {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: 12px;
  }

  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .logo-area {
    gap: 10px;
  }

  .logo-icon {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .logo-title {
    font-size: 1.12rem;
  }

  .logo-subtitle {
    font-size: 0.7rem;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .spot-select-wrapper {
    min-width: unset;
    width: 100%;
  }

  .custom-select {
    padding: 10px 44px 10px 36px;
    font-size: 0.92rem;
    height: 44px;
  }

  .btn-windy {
    padding: 10px 14px;
    font-size: 0.82rem;
    white-space: nowrap;
    height: 42px;
  }

  /* 釣點資訊橫幅在 iPhone 上的緊湊流暢佈局 */
  .main-container {
    width: 100%;
    max-width: 100%;
    padding: 0 14px;
    margin: 16px auto 0 auto;
    gap: 18px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .spot-banner {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 16px;
    gap: 14px;
  }

  .spot-meta h2 {
    font-size: 1.25rem;
  }

  .spot-meta p {
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .spot-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .meta-pill {
    padding: 8px 10px;
  }

  .meta-pill:last-child {
    grid-column: 1 / -1;
  }

  .meta-pill span {
    font-size: 0.68rem;
  }

  .meta-pill strong {
    font-size: 0.8rem;
  }

  /* 七日出釣分數縮圖 - 手機版緊湊適配 */
  .week-strip-wrapper {
    padding: 8px 6px;
    gap: 6px;
  }

  .week-score-strip {
    gap: 3px;
  }

  .strip-item {
    padding: 6px 1px 4px 1px;
    border-radius: 8px;
  }

  .strip-weekday {
    font-size: 0.76rem;
  }

  .strip-date {
    font-size: 0.62rem;
    margin-bottom: 2px;
  }

  .strip-score-val {
    font-size: 0.88rem;
  }

  .strip-rank-char {
    font-size: 0.6rem;
  }

  .strip-energy-text {
    font-size: 0.58rem;
  }

  .strip-weather-row {
    margin-top: 2px;
    font-size: 0.58rem;
    gap: 1px;
  }

  .strip-weather-row .ui-icon {
    width: 11px;
    height: 11px;
  }

  .strip-rain-pop {
    font-size: 0.58rem;
  }

  .week-weather-bar {
    padding: 6px 8px;
    font-size: 0.74rem;
    gap: 6px;
  }

  .wwb-left {
    width: 100%;
    justify-content: space-between;
  }

  .wwb-right {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  /* 圖表卡片 */
  .chart-panel {
    padding: 16px;
    gap: 16px;
  }

  .golden-windows-box {
    padding: 12px 14px;
    gap: 10px;
  }

  .golden-icon {
    font-size: 24px;
  }

  .golden-title {
    font-size: 0.78rem;
  }

  .golden-hours {
    font-size: 0.98rem;
  }

  .tide-extremes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .tide-extreme-card {
    padding: 8px 12px;
  }

  .tide-card-time {
    font-size: 1.45rem;
  }

  .tide-chart-container {
    height: 165px;
    padding: 6px;
  }

  /* 24 小時海況表格 - 純上下滑瀏覽 (絕不左右晃動) */
  .timeline-visual-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    max-height: 480px;
    overflow-y: auto;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  .timeline-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
    font-size: 0.74rem;
  }

  .timeline-table th, .timeline-table td {
    padding: 8px 2px;
  }

  /* 裝備建議卡片 */
  .advice-card {
    padding: 16px;
  }

  .tackle-item {
    font-size: 0.82rem;
  }

  .tactics-box {
    font-size: 0.82rem;
  }

  /* 好物購買專區 - 行動裝置適配 */
  .shop-section {
    padding: 16px;
    margin-top: 20px;
    gap: 14px;
  }

  .shop-card {
    padding: 16px 14px;
  }

  .shop-card-content {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .shop-product-info {
    min-width: 0;
  }

  .shop-product-name {
    font-size: 1.05rem;
  }

  .shop-action-area {
    width: 100%;
  }

  .btn-shop-buy {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    box-sizing: border-box;
  }
}
