/* ===== 全域變數：網站色彩、導覽列高度與陰影 ===== */
:root {
  color-scheme: dark;
  --nav: 60px;
  --sky: #4a91bd;
  --deep: #17445f;
  --card: rgba(18, 64, 91, 0.28);
  --card-strong: rgba(13, 52, 76, 0.44);
  --line: rgba(255, 255, 255, 0.22);
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.72);
  --faint: rgba(255, 255, 255, 0.52);
  --accent: #bcecff;
  --warm: #ffd66b;
  --shadow: 0 22px 60px rgba(0, 29, 49, 0.22);
}
/* ===== HTML 基礎設定：盒模型、頁面與背景 ===== */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 75% 0,
      rgba(255, 255, 255, 0.25),
      transparent 28rem
    ),
    linear-gradient(180deg, var(--sky), var(--deep) 58%, #09273a);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Noto Sans TC", sans-serif;
}
body:before,
body:after {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  content: "";
  filter: blur(12px);
  pointer-events: none;
}
body:before {
  top: 11rem;
  left: -8rem;
  width: 24rem;
  height: 24rem;
  background: rgba(147, 220, 255, 0.12);
}
body:after {
  right: -9rem;
  bottom: 5rem;
  width: 28rem;
  height: 28rem;
  background: rgba(28, 110, 157, 0.2);
}
body.is-rain {
  --sky: #587486;
  --deep: #263c4d;
}
body.is-night {
  --sky: #274a78;
  --deep: #101c35;
}
/* ===== weather.html 主內容容器與首頁天氣主視覺 ===== */
.weather-page {
  width: min(calc(100% - 24px), 1020px);
  margin: auto;
  padding: calc(var(--nav) + 32px) 0 72px;
}
.hero {
  min-height: 400px;
  padding: 34px 18px 38px;
  text-align: center;
}
.location,
.condition,
.hero-summary {
  margin: 0;
}
.location {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.location i {
  margin-right: 0.35rem;
}
.hero h1 {
  margin: 18px 0 0;
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.04em;
}
.hero-weather {
  margin-top: -5px;
  font:
    500 clamp(7.8rem, 25vw, 11rem)/1 Inter,
    sans-serif;
  letter-spacing: -0.1em;
}
.hero-weather sup {
  position: relative;
  top: 0.16em;
  margin-left: 0.08em;
  font-size: 0.28em;
  font-weight: 500;
  vertical-align: top;
}
.condition {
  font-size: 1.25rem;
  font-weight: 600;
}
.hero-summary {
  margin-top: 6px;
  font-size: 0.95rem;
  font-weight: 600;
}
.updated {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 17px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(10, 44, 66, 0.15);
  color: var(--muted);
  font-size: 0.7rem;
}
.updated i,
.live-pill i {
  color: var(--warm);
  font-size: 0.4rem;
}
.updated.ready i {
  color: #8bf0c0;
}
/* ===== 所有資訊卡片共用外觀與標題 ===== */
.glass-card {
  margin-top: 14px;
  padding: clamp(17px, 4vw, 25px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 23px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.14),
      rgba(255, 255, 255, 0.055)
    ),
    var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(135%);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
}
.card-head,
.card-foot,
.sun-times,
.moon-times {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.card-head {
  margin-bottom: 15px;
}
.card-head h2 {
  margin: 3px 0 0;
  font-size: 1.12rem;
  font-weight: 700;
}
.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.card-head small,
.card-head > a,
.card-foot,
.card-foot a {
  color: var(--faint);
  font-size: 0.68rem;
}
.card-head > a,
.card-foot a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
/* ===== 未來 24 小時：官方預報文字與逐時列表 ===== */
.forecast-copy {
  margin: 0 0 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}
.hourly {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 0 0 7px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
  scroll-snap-type: x proximity;
}
.hour {
  flex: 0 0 76px;
  padding: 9px 4px;
  text-align: center;
  scroll-snap-align: start;
}
.hour time,
.hour small {
  display: block;
  color: var(--faint);
  font-size: 0.62rem;
}
.hour i {
  margin: 12px 0;
  color: #fff;
  font-size: 1.35rem;
  text-shadow: 0 4px 16px rgba(0, 38, 66, 0.25);
}
.hour b {
  display: block;
  font:
    600 1.05rem Inter,
    sans-serif;
}
.hour.now {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
}
/* ===== 高雄林園降雨雷達 ===== */
.live-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.66rem;
}
.radar-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: #dce6eb;
  aspect-ratio: 1;
}
.radar-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.card-foot {
  margin-top: 11px;
}
/* ===== 未來十日預報 ===== */
.weekly {
  width: 100%;
}
.day {
  display: grid;
  grid-template-columns:
    minmax(48px, 0.75fr) 26px minmax(56px, 0.8fr) minmax(75px, 1.3fr)
    minmax(70px, 0.8fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 11px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.84rem;
}
.day:last-child {
  border: 0;
}
.day i {
  color: #fff;
  text-align: center;
}
.day small {
  color: #cdeeff;
  font-size: 0.68rem;
  white-space: nowrap;
}
.tempbar {
  height: 4px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
}
.tempbar span {
  display: block;
  height: 100%;
  border-radius: 9px;
  background: linear-gradient(90deg, #77c7ff, var(--warm), #ff9f65);
}
.temps {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.temps span {
  color: var(--faint);
}
.metric-grid,
.marine-grid,
.index-grid {
  display: grid;
  gap: 10px;
}
/* ===== 目前天氣：觀測指標 ===== */
.metric-grid {
  grid-template-columns: repeat(3, 1fr);
}
.metric,
.marine-grid article,
.life-index {
  position: relative;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(8, 46, 69, 0.18);
}
.metric i,
.marine-grid i {
  color: var(--accent);
  font-size: 0.9rem;
}
.metric span,
.metric b,
.metric small,
.marine-grid span,
.marine-grid b {
  display: block;
}
.metric span,
.marine-grid span {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.68rem;
}
.metric b {
  margin-top: 3px;
  font:
    600 clamp(1.25rem, 4vw, 1.7rem) Inter,
    "Noto Sans TC",
    sans-serif;
}
.metric small {
  margin-top: 5px;
  color: var(--faint);
  font-size: 0.6rem;
}
/* ===== 東港至小琉球航線：海況 ===== */
.marine-grid {
  grid-template-columns: repeat(4, 1fr);
}
.marine-grid b {
  margin-top: 4px;
  font-size: 0.9rem;
}
.marine-summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 11px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}
.marine-summary i {
  margin-top: 3px;
  color: var(--accent);
}
.marine-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.65;
}
.note {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 0.65rem;
  line-height: 1.65;
}
/* ===== 生活指數 ===== */
.index-grid {
  grid-template-columns: repeat(3, 1fr);
}
.life-index {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
}
.life-index > i {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
}
.life-index b,
.life-index small {
  display: block;
}
.life-index b {
  font-size: 0.78rem;
}
.life-index small {
  margin-top: 3px;
  color: var(--faint);
  font-size: 0.58rem;
}
.rating {
  display: flex;
  gap: 3px;
}
.rating i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}
.rating i.on {
  background: var(--warm);
  box-shadow: 0 0 8px rgba(255, 214, 107, 0.4);
}
/* ===== 日出日落與月亮資訊 ===== */
.astro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.sun-card,
.moon-card {
  height: auto;
}
.sun-times {
  color: var(--muted);
  font-size: 0.72rem;
}
.sun-times i {
  margin-right: 5px;
  color: var(--warm);
}
.sun-times b {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 1.2rem;
}
.sun-arc {
  position: relative;
  height: 90px;
  margin: 13px 12px 0;
  overflow: visible;
}
.sun-arc:before {
  position: absolute;
  right: 0;
  bottom: 10px;
  left: 0;
  height: 72px;
  border-top: 1px dashed rgba(255, 255, 255, 0.48);
  border-radius: 50% 50% 0 0;
  content: "";
}
.sun-arc:after {
  position: absolute;
  right: 0;
  bottom: 10px;
  left: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  content: "";
}
.celestial-body {
  position: absolute;
  z-index: 2;
  bottom: calc(10px + var(--body-y, 0px));
  left: var(--body-left, 50%);
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  transform: translate(-50%, 50%);
}
.celestial-body i {
  font-size: 20px;
}
.celestial-body.is-sun {
  color: #ffd84d;
  background: rgba(255, 216, 77, 0.12);
  box-shadow: 0 0 20px rgba(255, 216, 77, 0.6);
}
.celestial-body.is-moon {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.42);
}
.sun-card > p {
  margin: 4px 0 0;
  color: var(--faint);
  font-size: 0.65rem;
  text-align: center;
}
.moon-content {
  display: flex;
  align-items: center;
  gap: 18px;
}
.moon-visual {
  position: relative;
  width: 72px;
  height: 72px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: #f4f0d8;
  box-shadow: 0 0 25px rgba(244, 240, 216, 0.18);
}
.moon-visual:after {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(15, 36, 61, 0.88);
  content: "";
  transform: translateX(var(--moon-shift, 45%));
}
.moon-content span,
.moon-content b,
.moon-content small {
  display: block;
}
.moon-content span,
.moon-content small,
.moon-times {
  color: var(--faint);
  font-size: 0.65rem;
}
.moon-content b {
  margin: 4px 0;
  font-size: 1rem;
}
.moon-times {
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.moon-times b {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}
/* ===== 天氣警特報 ===== */
.no-alert {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px;
  border: 1px solid rgba(139, 240, 192, 0.22);
  border-radius: 17px;
  background: rgba(23, 130, 94, 0.12);
}
.no-alert > i {
  margin-top: 3px;
  color: #8bf0c0;
}
.no-alert b {
  font-size: 0.85rem;
}
.no-alert p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.6;
}
.alert-list {
  display: grid;
  gap: 9px;
}
.alert-item {
  padding: 14px;
  border-left: 3px solid var(--warm);
  border-radius: 10px;
  background: rgba(255, 184, 77, 0.1);
}
.alert-item b,
.alert-item p {
  display: block;
  margin: 0;
}
.alert-item p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.7rem;
}
/* ===== 資料來源 ===== */
.source-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.source-links a {
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: #fff;
  text-decoration: none;
}
.source-links b,
.source-links span {
  display: block;
}
.source-links b {
  font-size: 0.76rem;
}
.source-links span {
  margin-top: 4px;
  color: var(--faint);
  font-size: 0.6rem;
}
/* ===== 載入狀態與輔助提示 ===== */
.loading {
  width: 100%;
  color: var(--faint);
  font-size: 0.72rem;
  text-align: center;
}
.noscript {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 99;
  padding: 12px;
  border-radius: 12px;
  background: #7f1d1d;
  text-align: center;
}
:focus-visible {
  outline: 3px solid rgba(188, 236, 255, 0.75);
  outline-offset: 3px;
}
.moon-card {
  position: relative;
}
.moon-card:before {
  position: absolute;
  top: -70px;
  right: -55px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 241, 184, 0.12),
    rgba(188, 236, 255, 0.04) 45%,
    transparent 70%
  );
  content: "";
  pointer-events: none;
}
.moon-content {
  position: relative;
  gap: 20px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08),
    rgba(8, 46, 69, 0.12)
  );
}
.moon-visual {
  width: 92px;
  height: 92px;
  background:
    radial-gradient(
      circle at 68% 28%,
      rgba(190, 181, 146, 0.3) 0 4px,
      transparent 5px
    ),
    radial-gradient(
      circle at 55% 70%,
      rgba(190, 181, 146, 0.22) 0 6px,
      transparent 7px
    ),
    radial-gradient(
      circle at 38% 42%,
      rgba(255, 255, 255, 0.45) 0 3px,
      transparent 4px
    ),
    #f8f1cf;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18),
    0 0 32px rgba(255, 226, 139, 0.24),
    0 10px 24px rgba(0, 25, 43, 0.22);
}
.moon-content b {
  margin: 5px 0;
  font-size: 1.18rem;
}
.moon-content small {
  line-height: 1.5;
}
.moon-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  padding-top: 0;
  border-top: 0;
}
.moon-times > span {
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(8, 46, 69, 0.18);
}
.moon-times > span:last-child {
  text-align: right;
}
.moon-times b {
  margin-top: 4px;
  color: #fff;
  font-size: 0.78rem;
}
/* ===== 平板與手機版：720px 以下 ===== */
@media (max-width: 720px) {
  .weather-page {
    padding-top: calc(var(--nav) + 14px);
  }
  .hero {
    min-height: 365px;
    padding-top: 24px;
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .marine-grid {
    grid-template-columns: 1fr 1fr;
  }
  .index-grid {
    grid-template-columns: 1fr 1fr;
  }
  .astro-grid {
    grid-template-columns: 1fr;
  }
  .source-links {
    grid-template-columns: 1fr;
  }
}
/* ===== 小尺寸手機版：480px 以下 ===== */
@media (max-width: 480px) {
  .weather-page {
    width: calc(100% - 16px);
  }
  .glass-card {
    padding: 17px 13px;
    border-radius: 20px;
  }
  .hero-weather {
    font-size: 7.6rem;
  }
  .day {
    grid-template-columns: 45px 22px 58px minmax(50px, 1fr) 66px;
    gap: 5px;
    padding: 11px 0;
    font-size: 0.78rem;
  }
  .day small {
    font-size: 0.62rem;
  }
  .metric,
  .marine-grid article {
    padding: 14px 12px;
  }
  .index-grid {
    grid-template-columns: 1fr;
  }
  .card-head > a {
    max-width: 100px;
    text-align: right;
  }
  .live-pill {
    max-width: 95px;
    text-align: right;
  }
}

/* ===== 桌機版：雙欄整體佈局與未來十日 ===== */
@media (min-width: 900px) {
  .weather-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    width: min(calc(100% - 48px), 1180px);
  }
  .hero {
    grid-column: 1/-1;
    min-height: 355px;
    padding-top: 25px;
    padding-bottom: 28px;
  }
  .glass-card {
    margin-top: 0;
  }
  .hourly-card,
  .life-card,
  .astro-grid,
  .alerts-card,
  .sources {
    grid-column: 1/-1;
  }
  .radar-card,
  .daily-card,
  .current-card,
  .marine-card {
    min-width: 0;
  }
  .daily-card {
    display: flex;
    flex-direction: column;
  }
  .daily-card .card-head {
    flex: none;
  }
  .daily-card .weekly {
    display: grid;
    grid-template-rows: repeat(10, minmax(0, 1fr));
    flex: 1;
    min-height: 0;
  }
  .daily-card .day {
    grid-template-columns: 56px 28px 68px minmax(55px, 1fr) 74px;
    gap: 8px;
    padding: 0 2px;
    border-bottom-width: 2px;
    font-size: 0.9rem;
  }
  .daily-card .day i {
    font-size: 1rem;
  }
  .daily-card .day small {
    font-size: 0.68rem;
  }
  .daily-card .tempbar {
    height: 6px;
  }
  .current-card .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .marine-card .marine-grid {
    grid-template-columns: 1fr 1fr;
  }
}
/* ===== 桌機版：日月資訊與生活指數放大 ===== */
@media (min-width: 900px) {
  .astro-grid .glass-card {
    padding: 30px;
  }
  .astro-grid .card-head,
  .life-card .card-head {
    margin-bottom: 20px;
  }
  .astro-grid .card-head h2,
  .life-card .card-head h2 {
    font-size: 1.35rem;
  }
  .astro-grid .eyebrow,
  .life-card .eyebrow {
    font-size: 0.72rem;
  }
  .sun-times {
    font-size: 0.82rem;
  }
  .sun-times b {
    margin-top: 5px;
    font-size: 1.55rem;
  }
  .sun-arc {
    height: 116px;
    margin: 18px 10px 0;
  }
  .sun-arc:before {
    height: 92px;
  }
  .celestial-body {
    width: 38px;
    height: 38px;
  }
  .celestial-body i {
    font-size: 25px;
  }
  .sun-card > p {
    font-size: 0.76rem;
  }
  .moon-content {
    gap: 24px;
    padding: 20px;
  }
  .moon-visual {
    width: 112px;
    height: 112px;
  }
  .moon-content span,
  .moon-content small {
    font-size: 0.74rem;
  }
  .moon-content b {
    font-size: 1.4rem;
  }
  .moon-times {
    font-size: 0.72rem;
  }
  .moon-times > span {
    padding: 14px 16px;
  }
  .moon-times b {
    font-size: 0.9rem;
  }
  .life-card .index-grid {
    gap: 14px;
  }
  .life-index {
    grid-template-columns: 44px 1fr auto;
    gap: 14px;
    padding: 19px;
  }
  .life-index > i {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 1.05rem;
  }
  .life-index b {
    font-size: 0.9rem;
  }
  .life-index small {
    font-size: 0.68rem;
  }
  .rating {
    gap: 4px;
  }
  .rating i {
    width: 8px;
    height: 8px;
  }
  .life-card .note {
    margin-top: 16px;
    font-size: 0.72rem;
  }
}
/* ===== 桌機版：觀測指標與海況清晰化 ===== */
@media (min-width: 900px) {
  .current-card,
  .marine-card {
    padding: 30px;
  }
  .current-card .card-head,
  .marine-card .card-head {
    margin-bottom: 20px;
  }
  .current-card .card-head h2,
  .marine-card .card-head h2 {
    font-size: 1.35rem;
  }
  .current-card .eyebrow,
  .marine-card .eyebrow {
    font-size: 0.72rem;
  }
  .marine-card .card-head > a {
    font-size: 0.74rem;
  }
  .current-card .metric-grid,
  .marine-card .marine-grid {
    gap: 12px;
  }
  .current-card .metric,
  .marine-card .marine-grid article {
    padding: 18px;
    border-color: rgba(188, 236, 255, 0.2);
    background: linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.075),
      rgba(8, 46, 69, 0.24)
    );
  }
  .current-card .metric > i,
  .marine-card .marine-grid article > i {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: rgba(68, 207, 235, 0.13);
    font-size: 1rem;
  }
  .current-card .metric span,
  .marine-card .marine-grid span {
    margin-top: 13px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.75rem;
    font-weight: 600;
  }
  .current-card .metric b {
    margin-top: 5px;
    font-size: 1.85rem;
    line-height: 1.1;
  }
  .current-card .metric small {
    margin-top: 7px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.68rem;
  }
  .marine-card .marine-grid b {
    margin-top: 6px;
    color: #fff;
    font-size: 1.15rem;
  }
  .marine-card .marine-summary {
    gap: 14px;
    margin-top: 14px;
    padding: 15px 17px;
    border: 1px solid rgba(188, 236, 255, 0.12);
    background: rgba(255, 255, 255, 0.1);
  }
  .marine-card .marine-summary i {
    font-size: 1.05rem;
  }
  .marine-card .marine-summary p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.78rem;
  }
  .marine-card .note {
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.69rem;
  }
}
/* ===== 桌機版：觀測與海況的圖示、名稱同行 ===== */
@media (min-width: 900px) {
  .current-card .metric,
  .marine-card .marine-grid article {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 11px;
    align-items: center;
  }
  .current-card .metric > i,
  .marine-card .marine-grid article > i {
    grid-column: 1;
    grid-row: 1;
  }
  .current-card .metric > span,
  .marine-card .marine-grid article > span {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
  }
  .current-card .metric > b,
  .marine-card .marine-grid article > b {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .current-card .metric > small {
    grid-column: 1/-1;
    grid-row: 3;
  }
}
/* ===== 桌機版：紫外線危險等級標籤 ===== */
@media (min-width: 900px) {
  .current-card .metric > #uv + small {
    position: absolute;
    right: 18px;
    bottom: 18px;
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 5px 9px;
    border: 1px solid rgba(255, 214, 107, 0.22);
    border-radius: 9px;
    background: rgba(255, 214, 107, 0.1);
    color: #ffe28f;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
  }
}
/* ===== 紫外線指數卡片 ===== */
.uv-metric {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
}
.uv-metric > i {
  grid-column: 1;
  grid-row: 1;
}
.uv-metric > span {
  grid-column: 2;
  grid-row: 1;
  margin-top: 0;
}
.uv-metric > #uv {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 12px;
  font-size: 2.6rem;
  line-height: 1;
}
.uv-metric > #uv-text {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 4px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
}
.uv-scale {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 4;
  height: 6px;
  margin-top: 13px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #65dc82 0 18%,
    #ffe16b 32%,
    #ff9f43 50%,
    #ff4d67 70%,
    #cc36e8 100%
  );
  box-shadow: 0 0 10px rgba(204, 54, 232, 0.2);
}
.uv-scale span {
  position: absolute;
  top: 50%;
  left: 0;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(25, 59, 82, 0.7);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.85);
  transform: translate(-50%, -50%);
  transition: left 0.35s ease;
}
.uv-metric > #uv-advice {
  grid-column: 1 / -1;
  grid-row: 5;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  line-height: 1.45;
}
@media (min-width: 900px) {
  .current-card .uv-metric {
    grid-template-columns: 38px minmax(0, 1fr);
  }
  .current-card .uv-metric > #uv {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 14px;
    font-size: 3rem;
  }
  .current-card .uv-metric > #uv + small {
    position: static;
    grid-column: 1 / -1;
    grid-row: 3;
    min-height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: #fff;
    font-size: 1.15rem;
    line-height: 1.2;
  }
  .current-card .uv-metric > .uv-scale {
    grid-column: 1 / -1;
    grid-row: 4;
  }
  .current-card .uv-metric > #uv-advice {
    grid-column: 1 / -1;
    grid-row: 5;
    font-size: 0.8rem;
  }
}
/* ===== 氣壓儀表卡片 ===== */
.pressure-metric {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
}
.pressure-metric > i {
  grid-column: 1;
  grid-row: 1;
}
.pressure-metric > span {
  grid-column: 2;
  grid-row: 1;
  margin-top: 0;
}
.pressure-gauge {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 2;
  width: min(100%, 210px);
  height: 178px;
  margin: 12px auto 0;
}
.pressure-dial {
  position: absolute;
  top: -16px;
  left: 50%;
  width: 174px;
  height: 174px;
  border-radius: 50%;
  transform: translateX(-50%);
}
.pressure-dial:before,
.pressure-dial:after {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  content: "";
  clip-path: polygon(0 0, 100% 0, 100% 75%, 0 75%);
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent 78%,
    #000 79% 84%,
    transparent 85%
  );
  mask: radial-gradient(
    farthest-side,
    transparent 78%,
    #000 79% 84%,
    transparent 85%
  );
}
.pressure-dial:before {
  background: conic-gradient(
    from 235deg,
    #68d8ff 0deg,
    #bcecff 105deg,
    #ffe07a 220deg,
    #ff9d6c 250deg,
    transparent 250deg
  );
  opacity: 0.58;
}
.pressure-dial:after {
  background: repeating-conic-gradient(
    from 235deg,
    rgba(255, 255, 255, 0.82) 0 1.5deg,
    transparent 1.5deg 8deg
  );
  opacity: 0.72;
}
.pressure-dial span {
  position: absolute;
  z-index: 3;
  top: 27px;
  left: calc(50% - 2px);
  width: 4px;
  height: 60px;
  border-radius: 999px;
  background: linear-gradient(#fff, #bcecff);
  box-shadow: 0 0 10px rgba(188, 236, 255, 0.8);
  transform: rotate(0deg);
  transform-origin: 50% 60px;
  transition: transform 0.45s ease;
}
.pressure-dial span:after {
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 12px;
  height: 12px;
  border: 3px solid rgba(18, 64, 91, 0.8);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 9px rgba(255, 255, 255, 0.75);
  content: "";
  transform: translateX(-50%);
}
.pressure-reading {
  position: absolute;
  z-index: 4;
  top: 88px;
  left: 50%;
  display: grid;
  justify-items: center;
  transform: translateX(-50%);
}
.pressure-reading b {
  color: #fff;
  font:
    650 2rem/1 Inter,
    sans-serif;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.pressure-reading small {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
}
.pressure-reading em {
  margin-top: 8px;
  padding: 4px 10px;
  border: 1px solid rgba(188, 236, 255, 0.18);
  border-radius: 999px;
  background: rgba(188, 236, 255, 0.09);
  color: #d9f4ff;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}
.pressure-range {
  position: absolute;
  right: 21px;
  bottom: 0;
  left: 21px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 600;
}
@media (min-width: 900px) {
  .current-card .pressure-metric {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
  }
  .current-card .pressure-metric > i {
    grid-column: 1;
    grid-row: 1;
  }
  .current-card .pressure-metric > span {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
  }
  .current-card .pressure-metric > .pressure-gauge {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
/* ===== 能見度資訊卡片 ===== */
.visibility-metric {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  align-items: center;
  column-gap: 10px;
}
.visibility-metric > i {
  grid-column: 1;
  grid-row: 1;
}
.visibility-metric > span {
  grid-column: 2;
  grid-row: 1;
  margin-top: 0;
}
.visibility-reading {
  display: flex;
  grid-column: 1 / -1;
  grid-row: 2;
  align-items: baseline;
  align-self: start;
  gap: 7px;
  margin-top: 24px;
}
.visibility-reading b {
  color: #fff;
  font:
    600 2.75rem/1 Inter,
    sans-serif;
  letter-spacing: -0.055em;
}
.visibility-reading small {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  font-weight: 600;
}
.visibility-metric > #visibility-text {
  grid-column: 1 / -1;
  grid-row: 3;
  align-self: end;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  line-height: 1.5;
}
@media (min-width: 900px) {
  .current-card .visibility-metric {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
  }
  .current-card .visibility-metric > i {
    grid-column: 1;
    grid-row: 1;
  }
  .current-card .visibility-metric > span {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
  }
  .current-card .visibility-metric > .visibility-reading {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .current-card .visibility-metric > #visibility-text {
    grid-column: 1 / -1;
    grid-row: 3;
  }
}
/* ===== 風向與指南針卡片 ===== */
.wind-metric {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 150px;
  grid-template-rows: auto 1fr;
  gap: 14px 24px;
  padding: 20px;
}
.wind-metric > header {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 10px;
}
.wind-metric > header i {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: rgba(68, 207, 235, 0.13);
  color: var(--accent);
}
.wind-metric > header span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 700;
}
.wind-details {
  display: grid;
  align-self: center;
}
.wind-details p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.wind-details p:last-child {
  border-bottom: 0;
}
.wind-details span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.76rem;
}
.wind-details b {
  color: #fff;
  font-size: 0.88rem;
  text-align: right;
}
.wind-compass {
  position: relative;
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
}
.wind-compass > span {
  position: absolute;
  z-index: 3;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.72rem;
  font-weight: 800;
}
.wind-compass .north {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}
.wind-compass .east {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}
.wind-compass .south {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}
.wind-compass .west {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}
.compass-ring {
  position: relative;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border: 1px solid rgba(188, 236, 255, 0.24);
  border-radius: 50%;
  background:
    repeating-conic-gradient(
      from 0deg,
      rgba(188, 236, 255, 0.32) 0 1deg,
      transparent 1deg 10deg
    ),
    radial-gradient(circle, rgba(8, 46, 69, 0.52) 0 62%, transparent 63%);
  box-shadow: inset 0 0 24px rgba(188, 236, 255, 0.06);
}
.compass-ring:after {
  position: absolute;
  inset: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}
.compass-ring > i {
  position: absolute;
  z-index: 2;
  inset: 10px;
  transition: transform 0.45s ease;
}
.compass-ring > i:before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 0;
  border-right: 6px solid transparent;
  border-bottom: 38px solid #bcecff;
  border-left: 6px solid transparent;
  content: "";
  filter: drop-shadow(0 0 5px rgba(188, 236, 255, 0.65));
  transform: translateX(-50%);
}
.compass-ring > i:after {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 32px solid rgba(255, 159, 101, 0.9);
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
  content: "";
  transform: translateX(-50%);
}
.compass-ring > b {
  position: relative;
  z-index: 4;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #214d69;
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 0 0 4px rgba(33, 77, 105, 0.78);
}
.compass-ring > b small {
  display: block;
  margin-top: -5px;
  color: var(--muted);
  font-size: 0.55rem;
}
@media (max-width: 480px) {
  .wind-metric {
    grid-template-columns: 1fr 126px;
    gap: 10px 14px;
    padding: 16px 13px;
  }
  .wind-compass {
    width: 126px;
    height: 126px;
  }
  .compass-ring {
    width: 94px;
    height: 94px;
  }
  .wind-details b {
    font-size: 0.78rem;
  }
}
/* ===== 桌機版觀測、風向與海況排列 ===== */
@media (min-width: 900px) {
  .current-card {
    grid-column: 1;
    grid-row: span 2;
  }
  .wind-card {
    grid-column: 2;
    min-width: 0;
  }
  .marine-card {
    grid-column: 2;
    min-width: 0;
  }
  .wind-card.wind-metric {
    grid-template-columns: minmax(0, 1fr) 156px;
    gap: 12px 20px;
    padding: 24px;
  }
  .wind-card .wind-compass {
    width: 150px;
    height: 150px;
  }
  .wind-card .wind-details b {
    white-space: nowrap;
  }
}
/* ===== 濕度、露點與體感動態指標 ===== */
.climate-metric {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto auto auto 1fr;
  align-items: center;
  column-gap: 10px;
}
.climate-metric > i {
  grid-column: 1;
  grid-row: 1;
}
.climate-metric > span {
  grid-column: 2;
  grid-row: 1;
  margin-top: 0;
}
.climate-metric > b {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 15px;
  color: #fff;
  font-size: 2.55rem;
  line-height: 1;
}
.climate-metric > small {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 5px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}
.indicator-scale {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 4;
  height: 6px;
  margin-top: 13px;
  border-radius: 999px;
}
.humidity-scale {
  background: linear-gradient(90deg, #ffc767, #6ed3ff 55%, #658cff);
}
.dew-scale {
  background: linear-gradient(
    90deg,
    #75d8ff,
    #74e4b4 45%,
    #ffd46b 72%,
    #ff8a68
  );
}
.feels-scale {
  background: linear-gradient(
    90deg,
    #76d8ff,
    #77e0b5 35%,
    #ffe06b 63%,
    #ff806c
  );
}
.indicator-scale span {
  position: absolute;
  top: 50%;
  left: 0;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(25, 59, 82, 0.7);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.85);
  transform: translate(-50%, -50%);
  transition: left 0.35s ease;
}
.climate-metric > p {
  grid-column: 1 / -1;
  grid-row: 5;
  align-self: end;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.75rem;
  line-height: 1.45;
}
@media (min-width: 900px) {
  .current-card .climate-metric {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto auto auto 1fr;
  }
  .current-card .climate-metric > i {
    grid-column: 1;
    grid-row: 1;
  }
  .current-card .climate-metric > span {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
  }
  .current-card .climate-metric > b {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 2.7rem;
  }
  .current-card .climate-metric > small {
    position: static;
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 5px;
    padding: 0;
    border: 0;
    background: none;
  }
  .current-card .climate-metric > .indicator-scale {
    grid-column: 1 / -1;
    grid-row: 4;
  }
  .current-card .climate-metric > p {
    grid-column: 1 / -1;
    grid-row: 5;
  }
}
/* ===== 海況動態效果 ===== */
.marine-card {
  position: relative;
  isolation: isolate;
}
.marine-card > * {
  position: relative;
  z-index: 2;
}
.marine-card:before,
.marine-card:after {
  position: absolute;
  z-index: 1;
  right: -18%;
  bottom: -58px;
  left: -18%;
  height: 92px;
  border-radius: 48% 52% 0 0 / 35% 42% 0 0;
  background: rgba(92, 204, 239, 0.075);
  content: "";
  pointer-events: none;
  transform-origin: 50% 100%;
  animation: marine-wave-drift 8s ease-in-out infinite alternate;
}
.marine-card:after {
  right: -25%;
  bottom: -70px;
  left: -25%;
  height: 108px;
  background: rgba(188, 236, 255, 0.045);
  animation-duration: 11s;
  animation-direction: alternate-reverse;
}
.marine-grid article {
  overflow: hidden;
}
.marine-grid article:after {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 25%,
    rgba(188, 236, 255, 0.075) 48%,
    transparent 70%
  );
  content: "";
  pointer-events: none;
  transform: translateX(-130%);
  animation: marine-card-sheen 7s ease-in-out infinite;
}
.marine-grid article:nth-child(2):after {
  animation-delay: 1.1s;
}
.marine-grid article:nth-child(3):after {
  animation-delay: 2.2s;
}
.marine-grid article:nth-child(4):after {
  animation-delay: 3.3s;
}
.marine-grid article:nth-child(1) > i {
  animation: marine-wave-icon 2.8s ease-in-out infinite;
}
.marine-grid article:nth-child(3) > i {
  transform-origin: 50% 70%;
  animation: marine-wind-icon 2.4s ease-in-out infinite alternate;
}
.marine-summary > i {
  animation: marine-ship-float 3s ease-in-out infinite;
}
@keyframes marine-wave-drift {
  0% {
    transform: translateX(-2%) skewX(-3deg) scaleY(0.86);
  }
  50% {
    transform: translateX(2%) skewX(2deg) scaleY(1.04);
  }
  100% {
    transform: translateX(-1%) skewX(-1deg) scaleY(0.92);
  }
}
@keyframes marine-card-sheen {
  0%,
  68% {
    transform: translateX(-130%);
  }
  88%,
  100% {
    transform: translateX(130%);
  }
}
@keyframes marine-wave-icon {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-3px) rotate(-4deg);
  }
}
@keyframes marine-wind-icon {
  from {
    transform: translateX(-1px) rotate(-3deg);
  }
  to {
    transform: translateX(2px) rotate(4deg);
  }
}
@keyframes marine-ship-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-3px) rotate(2deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .marine-card:before,
  .marine-card:after,
  .marine-grid article:after,
  .marine-grid article > i,
  .marine-summary > i {
    animation: none !important;
  }
}
/* ===== 動態刻度點精準對齊 ===== */
.current-card .metric .indicator-scale > span,
.current-card .metric .uv-scale > span {
  top: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
}
/* ===== 桌機版風向資訊對齊與指南針放大 ===== */
@media (min-width: 900px) {
  .wind-card.wind-metric {
    grid-template-columns: minmax(0, 1fr) 194px;
    grid-template-rows: auto 194px;
    gap: 10px 24px;
    align-items: center;
  }
  .wind-card .wind-details {
    display: grid;
    height: 156px;
    align-self: center;
    align-content: center;
  }
  .wind-card .wind-details p {
    min-height: 52px;
    padding: 12px 0;
  }
  .wind-card .wind-details span {
    margin: 0;
    font-size: 0.8rem;
  }
  .wind-card .wind-details b {
    margin: 0;
    font-size: 1rem;
    line-height: 1.25;
  }
  .wind-card .wind-compass {
    align-self: center;
    justify-self: center;
    width: 194px;
    height: 194px;
  }
  .wind-card .wind-compass > span {
    margin: 0;
    font-size: 0.82rem;
  }
  .wind-card .compass-ring {
    width: 148px;
    height: 148px;
  }
  .wind-card .compass-ring > i {
    inset: 12px;
  }
  .wind-card .compass-ring > i:before {
    border-right-width: 7px;
    border-bottom-width: 48px;
    border-left-width: 7px;
  }
  .wind-card .compass-ring > i:after {
    border-top-width: 40px;
    border-right-width: 6px;
    border-left-width: 6px;
  }
  .wind-card .compass-ring > b {
    width: 50px;
    height: 50px;
    font-size: 1.15rem;
  }
  .wind-card .compass-ring > b span {
    margin: 0;
    font-size: 1.15rem;
  }
  .wind-card .compass-ring > b small {
    margin: 1px 0 0;
    font-size: 0.6rem;
  }
}
/* ===== 桌機版風向內容上移 ===== */
@media (min-width: 900px) {
  .wind-card .wind-details,
  .wind-card .wind-compass {
    transform: translateY(-10px);
  }
}
