/* 地球與天氣 Earth and Weather：本系列多出來的樣式（class 前綴 ew-）。
   面板用 astro.css 的 .astro-lab／.al-*，卡片、數字、小工具外框用 chips.css 的 cp-*，三個檔一起載。 */

/* ---------- 第二課：台灣為什麼地震這麼多？ ---------- */
@media (min-width: 1021px) { .ew-qk-lab .al-space { min-height: 640px; } }
.ew-qk-k { margin: 0 0 .1rem; font-size: .74rem; font-weight: 700; letter-spacing: .04em; color: var(--al-mute); }
.ew-qk-bar i { background: linear-gradient(90deg, #4fd6a8, #ffd84a 55%, #ff8a2a 80%, #e0261a); transition: width .12s linear; }
.ew-qk-msg[hidden] { display: none; }
.ew-nums small { display: block; font-size: .7rem; font-weight: 600; color: var(--al-mute); line-height: 1.3; }
.al-lab.ew-lb-plate { font-weight: 800; }
.al-lab.ew-lb-push { color: #2a1d00; background: #ffb347; border-color: #ffb347; font-weight: 800; }
.al-lab.ew-lb-push small { color: #4a3400; }
.al-lab.ew-lb-fault { border-color: #ffd36e; font-weight: 800; }
.al-lab.ew-lb-fault.slip { color: #fff; background: #c8321e; border-color: #ff9a8a; }
.al-lab.ew-lb-fault.slip small { color: #ffe1dc; }
.al-lab.ew-lb-p { border-color: #ffe27a; } .al-lab.ew-lb-s { border-color: #ff5a46; }
.al-lg-ewfault i { border: 0; height: 3px; margin-top: .55rem; background: #ffd36e; }
.al-lg-ewstrain i { border: 0; height: 11px; margin-top: .3rem; border-radius: 2px; background: linear-gradient(90deg, #8a7358, #e0461a); }
.al-lg-ewwaves i { border: 2px solid #ffe27a; border-radius: 50%; width: 11px; height: 11px; margin: .25rem 4px 0; box-shadow: 16px 0 0 -2px #0b1226, 16px 0 0 0 #ff5a46; margin-right: 22px; background: transparent; }
/* 頁面小工具：警報響了以後，還有幾秒？ */
.ew-wn .al-age::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--brand) 0 var(--p, 31%), #e5dfd0 var(--p, 31%)); }
.ew-wn .al-age::-webkit-slider-thumb { border-color: var(--brand); }
.ew-wn .al-age::-moz-range-progress { background: var(--brand); }
.ew-wn-pre { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ew-wn-tl { position: relative; height: 12px; margin: 2.6rem .6rem 1.9rem; border-radius: 99px; background: #e5dfd0; }
.ew-wn-gap { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, #7cc7b0, #2f8f5b); }
.ew-wn-tl b { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ew-wn-tl b::before { content: attr(data-k); position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); font: 800 .8rem var(--sans); color: var(--ink); }
.ew-wn-tl b::after { content: attr(data-t); position: absolute; left: 50%; top: 20px; transform: translateX(-50%); font: 700 .72rem var(--sans); color: var(--ink-soft); white-space: nowrap; }
.ew-wn-p, .ew-wn-key i.p { background: #f2b90f; } .ew-wn-a, .ew-wn-key i.a { background: #2f6fd6; } .ew-wn-s, .ew-wn-key i.s { background: #e0261a; }
.ew-wn-key { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: 0 0 .6rem; font-size: .78rem; color: var(--ink-soft); }
.ew-wn-key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .35rem; }
@media (max-width: 560px) { .ew-wn-pre { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 第一課：地球裡面有什麼？ ---------- */
@media (min-width: 1021px) { .ew-in-lab .al-space { min-height: 680px; } }
.ew-in-lbox[hidden], .ew-in-wbox[hidden], .ew-in-msg[hidden] { display: none; }
.ew-in-stops { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ew-in-key { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .8rem; color: var(--al-text); }
.ew-in-key i { display: inline-block; width: 22px; height: 6px; border-radius: 3px; margin-right: .5rem; vertical-align: middle; }
.al-lab.ew-in-lb { font-weight: 800; }
.al-lab.ew-in-lb-here { color: #0b1226; background: #fff; border-color: #fff; font-weight: 800; font-variant-numeric: tabular-nums; }
.al-lab.ew-in-lb-here small { color: #33415f; }
.al-lab.ew-in-lb-ok { border-color: #7cf29a; } .al-lab.ew-in-lb-sh { border-color: #9aa4b8; }
.al-lg-ewin4 i { border: 0; height: 11px; margin-top: .3rem; border-radius: 2px; background: linear-gradient(90deg, #8a6a4a 0 12%, #d9572b 12% 55%, #ffa62b 55% 85%, #fff0a8 85%); }
.al-lg-ewinprobe i { border: 0; border-radius: 50%; width: 10px; height: 10px; margin: .35rem 6px 0; background: #fff; }
.al-lg-ewinrays i { border: 0; height: 3px; margin-top: .55rem; background: linear-gradient(90deg, #ffe27a 0 50%, #ff5a46 50%); }
/* 頁面小工具：一路往下，要走多久？ */
.ew-dg-rides { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; }
.ew-dg-rows { display: grid; gap: .5rem; margin: 1.1rem 0 .4rem; }
.ew-dg-row { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr) 7.2rem; gap: .7rem; align-items: center; font-size: .86rem; font-weight: 700; color: var(--ink); }
.ew-dg-row small { display: block; font-weight: 500; font-size: .76rem; color: var(--ink-soft); }
.ew-dg-bar { display: block; height: 12px; border-radius: 99px; background: #e5dfd0; overflow: hidden; }
.ew-dg-bar i { display: block; height: 100%; border-radius: 99px; transition: width .25s; }
.ew-dg-t { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .ew-dg-rides, .ew-in-stops { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ew-dg-row { grid-template-columns: 4.6rem minmax(0, 1fr) 5.6rem; } }

/* ---------- 第三課：規模和震度有什麼不同？ ---------- */
@media (min-width: 1021px) { .ew-sk-lab .al-space { min-height: 720px; } }
.ew-sk-epis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ew-sk-msg[hidden] { display: none; }
.ew-sk-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ew-sk-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .6rem; }
.ew-sk-list li { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .28rem .5rem; border-radius: 9px; border: 1px solid var(--al-line); font-size: .78rem; font-weight: 700; color: var(--al-text); }
.ew-sk-list small { margin-left: .35rem; font-family: var(--zh); font-weight: 500; color: var(--al-mute); }
.ew-sk-list b { min-width: 2.5rem; padding: .08rem .35rem; border-radius: 6px; text-align: center; color: #0b1226; font-family: var(--zh); font-size: .8rem; }
.al-lab.ew-sk-lb-city { font-size: .74rem; padding: .12rem .45rem; }
.al-lab.ew-sk-lb-epi { color: #0b1226; background: #fff; border-color: #fff; font-weight: 800; }
.al-lab.ew-sk-lb-epi small { color: #33415f; }
.al-lg-ewskcol i { border: 0; height: 11px; margin-top: .3rem; border-radius: 2px; background: linear-gradient(90deg, #cfe8ff, #7cf29a, #ffe27a, #ff8a2a, #d8251a, #a0126a); }
.al-lg-ewskring i { border: 2px solid #ffe27a; border-radius: 50%; width: 12px; height: 12px; margin: .25rem 6px 0; background: transparent; }
.al-lg-ewskhypo i { border: 0; border-radius: 50%; width: 10px; height: 10px; margin: .35rem 6px 0; background: #ff5a46; }
/* 頁面小工具：震度分級表 */
.ew-sc-lv { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .3rem; margin-bottom: 1rem; }
.ew-sc-lv button { padding: .5rem 0; border-radius: 10px; border: 2px solid transparent; background: var(--c); color: #0b1226; font: 800 .82rem var(--zh); cursor: pointer; }
.ew-sc-lv button:nth-child(n+9) { color: #fff; }
.ew-sc-lv button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; transform: translateY(-2px); }
.ew-sc-row { padding: .6rem 0; border-top: 1px solid var(--line); }
.ew-sc-k { margin: 0 0 .2rem; font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--brand); }
.ew-sc-t { margin: 0; font-size: .95rem; color: var(--ink); }
.ew-sc-t .zh { display: block; color: var(--ink-soft); font-size: .9rem; }
.ew-sc .cp-home-big b { font-size: clamp(2.6rem, 6vw, 3.6rem); }
.ew-sc-zh { display: block; margin-top: .3rem; font-family: var(--zh); }
@media (max-width: 560px) { .ew-sc-lv { grid-template-columns: repeat(5, minmax(0, 1fr)); } .ew-sk-list { grid-template-columns: 1fr 1fr; } }

/* ---------- 第四課：台灣的山是怎麼來的？ ---------- */
@media (min-width: 1021px) { .ew-mt-lab .al-space { min-height: 640px; } }
.ew-mt-push { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ew-mt-rain { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ew-mt-msg[hidden] { display: none; }
.al-lab.ew-mt-lb-peak { color: #0b1226; background: #fff; border-color: #fff; font-weight: 800; font-variant-numeric: tabular-nums; }
.al-lab.ew-mt-lb-peak small { color: #33415f; }
.al-lab.ew-mt-lb-plain { border-color: #d9c08a; }
.al-lg-ewmtyu i { border: 0; height: 3px; margin-top: .55rem; background: #ffd36e; }
.al-lg-ewmtrain i { border: 0; height: 11px; width: 3px; margin: .3rem 10px 0; background: #9fd0ff; box-shadow: 7px 3px 0 #9fd0ff, -7px 2px 0 #9fd0ff; }
.al-lg-ewmtsed i { border: 0; border-radius: 50%; width: 10px; height: 10px; margin: .35rem 6px 0; background: #c89a5a; }
/* 頁面小工具：如果沒有侵蝕 */
.ew-pk .al-age::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--brand) 0 var(--p, 16%), #e5dfd0 var(--p, 16%)); }
.ew-pk .al-age::-webkit-slider-thumb { border-color: var(--brand); }
.ew-pk .al-age::-moz-range-progress { background: var(--brand); }
.ew-pk-pre { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ew-pk-out { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 1.2rem; align-items: stretch; }
.ew-pk-col { position: relative; min-height: 220px; border-radius: 12px; background: rgba(255,255,255,.1); overflow: visible; }
.ew-pk-bar { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 12px; background: linear-gradient(0deg, #4f9a5a, #8c8478 60%, #f4f7fb); transition: height .2s; }
.ew-pk-mark { position: absolute; left: -4px; right: -4px; height: 2px; background: #ffd36e; }
.ew-pk-mark b { position: absolute; left: 0; bottom: 4px; font-size: .64rem; color: #ffd36e; white-space: nowrap; }

/* ---------- 第五課：火山怎麼噴發？ ---------- */
@media (min-width: 1021px) { .ew-vc-lab .al-space { min-height: 680px; } }
.ew-vc-msg[hidden] { display: none; }
.al-lab.ew-vc-lb-bub { border-color: #fff; }
.al-lg-ewvcmag i { border: 0; height: 11px; margin-top: .3rem; border-radius: 2px; background: linear-gradient(90deg, #ff7a1a, #ffd23c); }
.al-lg-ewvcbub i { border: 0; border-radius: 50%; width: 5px; height: 5px; margin: .45rem 3px 0; background: #fff; box-shadow: 9px -1px 0 1px #fff, 21px -2px 0 3px #fff; margin-right: 30px; }
.al-lg-ewvcash i { border: 0; border-radius: 50%; width: 10px; height: 10px; margin: .35rem 6px 0; background: #8b8f99; }
/* 頁面小工具：氣泡 */
.ew-bb .al-age::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--brand) 0 var(--p, 60%), #e5dfd0 var(--p, 60%)); }
.ew-bb .al-age::-webkit-slider-thumb { border-color: var(--brand); }
.ew-bb .al-age::-moz-range-progress { background: var(--brand); }
.ew-bb-pre { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ew-bb-out { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 1.2rem; align-items: stretch; }
.ew-bb-pic { position: relative; min-height: 240px; margin-top: 60px; border-radius: 0 0 12px 12px; background: linear-gradient(180deg, #7a4a2a, #d9572b); }
.ew-bb-top { position: absolute; left: 50%; top: -60px; width: 120px; height: 120px; margin-left: -60px; border-radius: 50%; background: rgba(255,255,255,.9); }
.ew-bb-marker { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed rgba(255,255,255,.6); }
.ew-bb-deep { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; }
@media (max-width: 560px) { .ew-bb-pre { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ew-bb-out { grid-template-columns: 1fr; } .ew-bb-pic { max-width: 130px; margin-left: auto; margin-right: auto; width: 100%; } }

/* ---------- 第六課：為什麼會下雨？ ---------- */
@media (min-width: 1021px) { .ew-rn-lab .al-space { min-height: 640px; } }
.ew-rn-msg[hidden] { display: none; }
.ew-rn-lab .al-age:disabled { opacity: .35; }
.al-lab.ew-rn-lb-base { color: #0b1226; background: #fff; border-color: #fff; font-weight: 800; }
.al-lab.ew-rn-lb-base small { color: #33415f; }
.al-lab.ew-rn-lb-t { font-weight: 800; font-variant-numeric: tabular-nums; padding: .1rem .5rem; }
.al-lab.ew-rn-lb-rain { border-color: #9fd0ff; }
.al-lg-ewrnair i { border: 0; border-radius: 50%; width: 9px; height: 9px; margin: .35rem 4px 0; background: #9fd8ff; box-shadow: 13px 0 0 #fff, 26px 0 0 #ffb36b; margin-right: 32px; }
.al-lg-ewrncloud i { border: 0; height: 11px; margin-top: .3rem; border-radius: 6px; background: #fff; }
.al-lg-ewrnrain i { border: 0; height: 11px; width: 3px; margin: .3rem 10px 0; background: #9fd0ff; box-shadow: 7px 3px 0 #9fd0ff, -7px 2px 0 #9fd0ff; }
/* 頁面小工具：這場雨有多少水？ */
.ew-gg .al-age::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--brand) 0 var(--p, 13%), #e5dfd0 var(--p, 13%)); }
.ew-gg .al-age::-webkit-slider-thumb { border-color: var(--brand); }
.ew-gg .al-age::-moz-range-progress { background: var(--brand); }
.ew-gg-pre { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ew-gg-areas { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: .4rem; }
.ew-gg-out { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 1.2rem; align-items: stretch; }
.ew-gg-tube { position: relative; min-height: 220px; border-radius: 8px 8px 14px 14px; border: 2px solid rgba(255,255,255,.5); border-top: 0; overflow: hidden; }
.ew-gg-fill { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, #2a6fc9, #7fc4ff); transition: height .2s; }
@media (max-width: 560px) { .ew-gg-pre { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ew-gg-areas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 第七課：風是怎麼來的？ ---------- */
@media (min-width: 1021px) { .ew-wd-lab .al-space { min-height: 600px; } }
.ew-wd-msg[hidden] { display: none; }
.al-lab.ew-wd-lb-t { font-weight: 800; font-variant-numeric: tabular-nums; padding: .1rem .5rem; }
.al-lg-ewwdair i { border: 0; border-radius: 50%; width: 9px; height: 9px; margin: .35rem 4px 0; background: #ffb38a; box-shadow: 13px 0 0 #b0dbff; margin-right: 19px; }
.al-lg-ewwdarrow i { border: 0; height: 5px; margin-top: .55rem; border-radius: 3px; background: #fff; }
.al-lg-ewwdground i { border: 0; height: 11px; margin-top: .3rem; border-radius: 3px; background: linear-gradient(90deg, #2a6fc9 50%, #4f8a55 50%); }
/* 頁面小工具：這是幾級風？ */
.ew-bf .al-age::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--brand) 0 var(--p, 25%), #e5dfd0 var(--p, 25%)); }
.ew-bf .al-age::-webkit-slider-thumb { border-color: var(--brand); }
.ew-bf .al-age::-moz-range-progress { background: var(--brand); }
.ew-bf-pic { position: relative; height: 96px; margin: .9rem 0 .2rem; }
.ew-bf-pole { position: absolute; left: 28px; top: 4px; bottom: 0; width: 5px; border-radius: 3px; background: #8a7a5c; }
.ew-bf-flag { position: absolute; left: 33px; top: 8px; width: 74px; height: 40px; background: var(--brand); border-radius: 0 6px 6px 0; transform-origin: 0 0; transform: rotate(calc(88deg - var(--a, 27deg))) skewY(0deg); animation: ew-bf-wave var(--d, 1s) ease-in-out infinite alternate; }
@keyframes ew-bf-wave { from { transform: rotate(calc(88deg - var(--a, 27deg))) skewY(-5deg); } to { transform: rotate(calc(88deg - var(--a, 27deg))) skewY(5deg); } }
@media (prefers-reduced-motion: reduce) { .ew-bf-flag { animation: none; } }
.ew-bf-out .cp-home-big b { display: inline-block; margin-right: .5rem; }

/* ---------- 第八課：颱風是怎麼形成的？ ---------- */
@media (min-width: 1021px) { .ew-ty-lab .al-space { min-height: 640px; } }
.ew-ty-msg[hidden] { display: none; }
.ew-ty-bar { width: 0; transition: width .2s linear; }
.ew-ty-cat small { display: block; font-family: var(--zh); font-weight: 600; font-size: .8rem; color: var(--al-mute); }
.al-lab.ew-ty-lb-g { font-weight: 800; }
.al-lg-ewtycloud i { border: 0; height: 11px; margin-top: .3rem; border-radius: 6px; background: #fff; }
.al-lg-ewtyin i { border: 0; border-radius: 50%; width: 9px; height: 9px; margin: .35rem 4px 0; background: #9fd8ff; box-shadow: 13px 0 0 #9fd8ff; margin-right: 19px; }
.al-lg-ewtysink i { border: 0; border-radius: 50%; width: 9px; height: 9px; margin: .35rem 10px 0; background: #ffb36b; }
/* 頁面小工具：颱風眼經過你家 */
.ew-ep-map { position: relative; height: 150px; border-radius: 14px; background: #1f5fae; overflow: hidden; }
.ew-ep-storm { position: absolute; left: 50%; top: 50%; width: 88%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, #1f5fae 0 6%, #fff 7% 13%, rgba(255,255,255,.75) 14% 26%, rgba(255,255,255,.35) 27% 44%, rgba(255,255,255,0) 50%); }
.ew-ep-town { position: absolute; top: 50%; left: 6%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #e0261a; border: 2px solid #fff; transition: left .5s ease; }
@media (prefers-reduced-motion: reduce) { .ew-ep-town { transition: none; } }
.ew-ep-cap { margin: .4rem 0 0; font-size: .8rem; color: var(--ink-soft); }
.ew-ep-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ew-ep-out .cp-home-big { font-size: 1.25rem; }
.ew-ep-meter { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .7rem; align-items: center; margin: .9rem 0 .2rem; font-weight: 800; font-size: .84rem; }
.ew-ep-track { height: 10px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; }
.ew-ep-wind { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #4fd6a8, #ffd84a 55%, #e0261a); transition: width .3s; }
.ew-ep-dir { font-size: 1.3rem; line-height: 1; color: #ffd36e; }
@media (max-width: 560px) { .ew-ep-steps button small { font-size: .66rem; } }

/* ---------- 第九課：閃電和打雷是怎麼回事？ ---------- */
@media (min-width: 1021px) { .ew-lt-lab .al-space { min-height: 640px; } }
.ew-lt-msg[hidden] { display: none; }
.ew-lt-bar { width: 0; background: linear-gradient(90deg, #58b4ff, #ffd84a) !important; }
.ew-lt-status small { display: block; font-family: var(--zh); font-weight: 600; font-size: .8rem; color: var(--al-mute); }
.ew-lt-strike { width: 100%; margin: .2rem 0 .3rem; padding: .6rem .8rem; border-radius: 12px; border: 1px solid #ffd84a; background: rgba(255,216,74,.12); color: #ffe9a0; font-family: var(--sans); font-weight: 800; font-size: .9rem; cursor: pointer; }
.ew-lt-strike:hover { background: rgba(255,216,74,.22); }
.al-lab.ew-lt-lb-p { border-color: #ff6b5e; }
.al-lab.ew-lt-lb-n { border-color: #58b4ff; }
.al-lg-ewltpos i { border: 0; border-radius: 50%; width: 10px; height: 10px; margin: .35rem 10px 0; background: #ff6b5e; }
.al-lg-ewltneg i { border: 0; border-radius: 50%; width: 10px; height: 10px; margin: .35rem 10px 0; background: #58b4ff; }
.al-lg-ewltbolt i { border: 0; height: 4px; margin-top: .6rem; border-radius: 2px; background: #fff7c2; box-shadow: 0 0 6px #ffd84a; }
.al-lg-ewltring i { height: 11px; margin-top: .3rem; border: 2px solid #ffd36e; border-radius: 50%; background: transparent; }
/* 頁面小工具：這道閃電離我多遠？ */
.ew-th .al-age::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--brand) 0 var(--p, 10%), #e5dfd0 var(--p, 10%)); }
.ew-th .al-age::-webkit-slider-thumb { border-color: var(--brand); }
.ew-th .al-age::-moz-range-progress { background: var(--brand); }
.ew-th-sky { display: grid; place-items: center; min-height: 92px; margin: .9rem 0 .6rem; padding: .6rem; border-radius: 14px; background: #1a2338; color: #dfe6f5; text-align: center; transition: background .5s; }
.ew-th-sky[data-state="flash"] { background: #f4f1c8; color: #1a2338; transition: none; }
.ew-th-sky[data-state="boom"] { background: #3a2a55; color: #ffd36e; }
.ew-th-say { margin: 0; font-weight: 800; }
.ew-th-go { width: 100%; padding: .6rem .8rem; border-radius: 12px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font-family: var(--sans); font-weight: 800; font-size: .9rem; cursor: pointer; }
.ew-th-ans { margin: .6rem 0 0; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .ew-th-sky[data-state="flash"] { background: #1a2338; color: #ffd36e; } }

/* ---------- 第十課：天氣預報是怎麼做出來的？ ---------- */
@media (min-width: 1021px) { .ew-fc-lab .al-space { min-height: 640px; } }
.ew-fc-msg[hidden] { display: none; }
.ew-fc-k2 { margin-top: .9rem; }
.ew-fc-table { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin: .5rem 0 .7rem; }
.ew-fc-cell { position: relative; overflow: hidden; padding: .4rem .1rem .45rem; border-radius: 9px; border: 1px solid var(--al-line); background: rgba(255,255,255,.04); color: var(--al-text); font-family: var(--sans); cursor: pointer; text-align: center; }
.ew-fc-cell::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--f, 0%); background: rgba(88,180,255,.38); transition: height .2s; }
.ew-fc-cell span { position: relative; display: block; font-size: .6rem; font-weight: 700; color: var(--al-mute); white-space: nowrap; }
.ew-fc-cell b { position: relative; display: block; margin-top: .15rem; font-size: .86rem; font-variant-numeric: tabular-nums; }
.ew-fc-cell.is-now { border-color: var(--al-sun); box-shadow: 0 0 0 1px var(--al-sun) inset; }
.al-lg-ewfcmain i { border: 0; height: 11px; margin-top: .3rem; border-radius: 6px; background: #fff; }
.al-lg-ewfcghost i { border: 0; height: 11px; margin-top: .3rem; border-radius: 6px; background: #b9c6da; }
.al-lg-ewfcrain i { border: 0; height: 11px; width: 3px; margin: .3rem 10px 0; background: #cfe6ff; box-shadow: 7px 3px 0 #cfe6ff, -7px 2px 0 #cfe6ff; }
/* 頁面小工具：晴、多雲還是陰？ */
.ew-sw .al-age::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--brand) 0 var(--p, 60%), #e5dfd0 var(--p, 60%)); }
.ew-sw .al-age::-webkit-slider-thumb { border-color: var(--brand); }
.ew-sw .al-age::-moz-range-progress { background: var(--brand); }
.ew-sw-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; margin: .9rem 0 .3rem; padding: 6px; border-radius: 12px; background: #6fa8e6; }
.ew-sw-grid i { aspect-ratio: 1; border-radius: 6px; background: rgba(255,255,255,.12); transition: background .2s; }
.ew-sw-grid i.on { background: #f4f7fb; }
.ew-sw-out .cp-home-big b { display: inline-block; margin-right: .5rem; font-size: clamp(2rem, 5vw, 2.8rem); }

/* ---------- 第十一課：河流怎麼改變大地？ ---------- */
@media (min-width: 1021px) { .ew-rv-lab .al-space { min-height: 620px; } }
.ew-rv-msg[hidden] { display: none; }
.ew-rv-water { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.ew-rv-bar { width: 0; background: linear-gradient(90deg, #4fd6a8, #e2c275) !important; }
.ew-rv-status small { display: block; font-family: var(--zh); font-weight: 600; font-size: .8rem; color: var(--al-mute); }
.ew-rv-reset { border-color: var(--al-line); background: rgba(255,255,255,.05); color: var(--al-text); }
.al-lg-ewrvgravel i { border: 0; border-radius: 50%; width: 12px; height: 12px; margin: .3rem 9px 0; background: #8d8778; }
.al-lg-ewrvsand i { border: 0; border-radius: 50%; width: 9px; height: 9px; margin: .38rem 10px 0; background: #e2c275; }
.al-lg-ewrvmud i { border: 0; border-radius: 50%; width: 6px; height: 6px; margin: .45rem 12px 0; background: #6a4a2f; box-shadow: 0 0 0 1px rgba(255,255,255,.4); }
.al-lg-ewrvwater i { border: 0; height: 9px; margin-top: .35rem; border-radius: 4px; background: linear-gradient(90deg, #3f8fe0, #9a7448); }
/* 頁面小工具：這樣的水帶得動什麼？ */
.ew-cy .al-age::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--brand) 0 var(--p, 50%), #e5dfd0 var(--p, 50%)); }
.ew-cy .al-age::-webkit-slider-thumb { border-color: var(--brand); }
.ew-cy .al-age::-moz-range-progress { background: var(--brand); }
.ew-cy-items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: 1rem 0 .4rem; }
.ew-cy-item { display: grid; justify-items: center; gap: .15rem; padding: .7rem .2rem .6rem; border-radius: 12px; border: 1px solid var(--line); background: var(--cream); font-size: .8rem; text-align: center; opacity: .55; transition: opacity .2s, border-color .2s, background .2s; }
.ew-cy-item i { display: block; border-radius: 50%; background: #8d8778; margin-bottom: .2rem; }
.ew-cy-mud i { width: 6px; height: 6px; background: #6a4a2f; margin-top: 20px; } .ew-cy-sand i { width: 11px; height: 11px; background: #e2c275; margin-top: 15px; }
.ew-cy-pebble i { width: 18px; height: 18px; margin-top: 8px; } .ew-cy-boulder i { width: 26px; height: 26px; background: #6f6a5e; }
.ew-cy-item.moving { opacity: 1; border-color: #3f8fe0; background: #e8f2fd; }
.ew-cy-item.moving i { animation: ew-cy-roll .7s linear infinite alternate; }
@keyframes ew-cy-roll { from { transform: translateX(-7px); } to { transform: translateX(7px); } }
@media (prefers-reduced-motion: reduce) { .ew-cy-item.moving i { animation: none; } }
.ew-cy-out .cp-home-big { font-size: 1.3rem; }

/* ---------- 第十二課：海嘯和一般的海浪有什麼不同？ ---------- */
@media (min-width: 1021px) { .ew-ts-lab .al-space { min-height: 600px; } }
.ew-ts-msg[hidden] { display: none; }
.ew-ts-go:disabled { opacity: .4; cursor: default; }
.al-lg-ewtsmove i { border: 0; border-radius: 50%; width: 10px; height: 10px; margin: .35rem 10px 0; background: #ffd84a; }
.al-lg-ewtsstill i { border: 0; border-radius: 50%; width: 10px; height: 10px; margin: .35rem 10px 0; background: #dfeaf7; }
.al-lg-ewtssea i { border: 0; height: 11px; margin-top: .3rem; border-radius: 3px; background: #2f7fd6; }
/* 頁面小工具：海嘯跑多快？ */
.ew-tw .al-age::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--brand) 0 var(--p, 67%), #e5dfd0 var(--p, 67%)); }
.ew-tw .al-age::-webkit-slider-thumb { border-color: var(--brand); }
.ew-tw .al-age::-moz-range-progress { background: var(--brand); }
.ew-tw-pre { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 560px) { .ew-tw-pre { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 第十三課：海水為什麼是鹹的？ ---------- */
@media (min-width: 1021px) { .ew-sa-lab .al-space { min-height: 640px; } }
.ew-sa-msg[hidden] { display: none; }
.ew-sa-bar { width: 0; background: linear-gradient(90deg, #2f7fd6, #fff) !important; transition: width .2s linear; }
.ew-sa-status small { display: block; font-family: var(--zh); font-weight: 600; font-size: .8rem; color: var(--al-mute); }
.al-lg-ewsawater i { border: 0; border-radius: 50%; width: 9px; height: 9px; margin: .35rem 10px 0; background: #9fd8ff; }
.al-lg-ewsasalt i { border: 0; width: 9px; height: 9px; margin: .35rem 10px 0; background: #fff; }
.al-lg-ewsavapor i { border: 0; border-radius: 50%; width: 7px; height: 7px; margin: .42rem 12px 0; background: #7fa9d8; }
/* 頁面小工具：曬乾之後剩多少鹽？ */
.ew-sp .al-age::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--brand) 0 var(--p, 5%), #e5dfd0 var(--p, 5%)); }
.ew-sp .al-age::-webkit-slider-thumb { border-color: var(--brand); }
.ew-sp .al-age::-moz-range-progress { background: var(--brand); }
.ew-sp-w { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: .9rem; }
.ew-sp-out { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 1.2rem; align-items: end; }
.ew-sp-pan { position: relative; height: 150px; border-bottom: 6px solid #cdb98a; border-radius: 0 0 10px 10px; }
.ew-sp-pile { position: absolute; left: 6%; right: 6%; bottom: 0; height: var(--h, 7%); min-height: 3px; background: #fff; clip-path: polygon(0 100%, 50% 0, 100% 100%); transition: height .25s; }
@media (max-width: 560px) { .ew-sp-out { grid-template-columns: 64px minmax(0, 1fr); } }

/* ---------- 第十四課：化石是怎麼形成的？ ---------- */
@media (min-width: 1021px) { .ew-fo-lab .al-space { min-height: 620px; } }
.ew-fo-msg[hidden] { display: none; }
.ew-fo-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-bottom: .7rem; }
.ew-fo-steps button { padding: .38rem .1rem; border-radius: 10px; border: 1px solid var(--al-line); background: rgba(255,255,255,.04); color: var(--al-text); font-family: var(--sans); font-weight: 800; font-size: .86rem; cursor: pointer; }
.ew-fo-steps button small { display: block; font-family: var(--zh); font-weight: 600; font-size: .66rem; color: var(--al-mute); }
.ew-fo-steps button[aria-pressed="true"] { border-color: var(--al-sun); background: #22345f; }
.ew-fo-steps button[aria-pressed="true"] small { color: var(--al-sun); }
.al-lg-ewfobone i { border: 0; height: 5px; margin-top: .55rem; border-radius: 3px; background: #f2ecdc; }
.al-lg-ewfostone i { border: 0; height: 5px; margin-top: .55rem; border-radius: 3px; background: #6b4a32; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.al-lg-ewfolayer i { border: 0; height: 12px; margin-top: .25rem; border-radius: 2px; background: linear-gradient(180deg, #c9b48a 0 34%, #8f7d62 34% 67%, #b9a37a 67%); }
/* 頁面小工具：哪一層比較老？ */
.ew-ly-cliff { display: grid; gap: 3px; margin: .6rem 0 .5rem; }
.ew-ly-row { display: grid; grid-template-columns: 2.2rem auto minmax(0, 1fr); gap: .5rem; align-items: center; padding: .55rem .7rem; border: 2px solid transparent; border-radius: 8px; color: #2a2118; font-family: var(--sans); font-size: .86rem; text-align: left; cursor: pointer; }
.ew-ly-row i { font-style: normal; font-size: 1.2rem; text-align: center; }
.ew-ly-row .zh { font-size: .8rem; color: #4a3d2e; }
.ew-ly-0 { background: #d9c8a2; } .ew-ly-1 { background: #c2ad85; } .ew-ly-2 { background: #cfb98f; } .ew-ly-3 { background: #a9946f; } .ew-ly-4 { background: #b8a27b; }
.ew-ly-row[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 2px #fff inset; }
.ew-ly-out .cp-home-big { font-size: 1.3rem; }
.ew-ly-out .cp-home-sub .zh { display: block; }

/* ---------- 第十五課：我們怎麼知道地球幾歲？ ---------- */
@media (min-width: 1021px) { .ew-ag-lab .al-space { min-height: 640px; } }
.ew-ag-msg[hidden] { display: none; }
.ew-ag-bar { width: 100%; background: #57e08a !important; transition: width .15s linear; }
.ew-ag-status small { display: block; font-family: var(--zh); font-weight: 600; font-size: .8rem; color: var(--al-mute); }
.al-lab.ew-ag-lb-p { border-color: #57e08a; } .al-lab.ew-ag-lb-c { border-color: #8b93a6; }
.al-lg-ewagparent i { border: 0; border-radius: 50%; width: 11px; height: 11px; margin: .3rem 9px 0; background: #57e08a; }
.al-lg-ewagchild i { border: 0; border-radius: 50%; width: 11px; height: 11px; margin: .3rem 9px 0; background: #8b93a6; }
/* 頁面小工具：把地球的歷史縮成一天 */
.ew-dy-list { display: grid; gap: 4px; margin: .5rem 0; }
.ew-dy-row { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: .6rem; align-items: center; padding: .5rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: var(--cream); color: var(--ink); font-family: var(--sans); font-size: .86rem; text-align: left; cursor: pointer; }
.ew-dy-row b { font-variant-numeric: tabular-nums; color: var(--brand); }
.ew-dy-row .zh { display: block; font-size: .8rem; color: var(--ink-soft); }
.ew-dy-row[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.ew-dy-row[aria-pressed="true"] b, .ew-dy-row[aria-pressed="true"] .zh { color: #fff; }
.ew-dy-out { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.ew-dy-face { position: relative; width: 110px; aspect-ratio: 1; border-radius: 50%; border: 3px solid rgba(255,255,255,.55); background: radial-gradient(circle, rgba(255,255,255,.08), rgba(255,255,255,0) 70%); }
.ew-dy-face::after { content: "24 h"; position: absolute; left: 0; right: 0; bottom: 18%; text-align: center; font-size: .7rem; font-weight: 800; color: rgba(255,255,255,.5); }
.ew-dy-hand { position: absolute; left: calc(50% - 2px); bottom: 50%; width: 4px; height: 42%; border-radius: 2px; background: #ffd36e; transform-origin: 50% 100%; transform: rotate(var(--a, 0deg)); transition: transform .5s; }
@media (prefers-reduced-motion: reduce) { .ew-dy-hand { transition: none; } }
.ew-dy-out .cp-home-big b { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.ew-dy-out .cp-home-sub .zh { display: block; }
@media (max-width: 560px) { .ew-dy-out { grid-template-columns: 76px minmax(0, 1fr); } .ew-dy-face { width: 76px; } }

/* ---------- 第十六課：溫室效應是什麼？ ---------- */
@media (min-width: 1021px) { .ew-gh-lab .al-space { min-height: 620px; } }
.ew-gh-msg[hidden] { display: none; }
.ew-gh-bar { width: 0; background: linear-gradient(90deg, #ffb36b, #ff5a4a) !important; transition: width .3s; }
.ew-gh-status small { display: block; font-family: var(--zh); font-weight: 600; font-size: .8rem; color: var(--al-mute); }
.al-lab.ew-gh-lb-s { border-color: #ffe27a; } .al-lab.ew-gh-lb-h { border-color: #ff5a4a; }
.al-lg-ewghsun i { border: 0; border-radius: 50%; width: 9px; height: 9px; margin: .35rem 10px 0; background: #ffe27a; }
.al-lg-ewghheat i { border: 0; border-radius: 50%; width: 9px; height: 9px; margin: .35rem 10px 0; background: #ff5a4a; }
.al-lg-ewghgas i { border: 0; border-radius: 50%; width: 12px; height: 12px; margin: .28rem 8px 0; background: #b9c6da; }
/* 頁面小工具：三個世界的溫度 */
.ew-bk-w { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ew-bk-out { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 1.2rem; align-items: stretch; }
.ew-bk-tube { position: relative; min-height: 200px; border-radius: 20px; border: 2px solid rgba(255,255,255,.5); overflow: hidden; }
.ew-bk-fill { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h, 10%); background: #ffb36b; transition: height .4s, background .4s; }
.ew-bk-fill[data-k="cold"] { background: #7fc4ff; } .ew-bk-fill[data-k="hot"] { background: #e0261a; }
.ew-bk-out .cp-home-sub .zh { display: block; }
@media (max-width: 560px) { .ew-bk-w { grid-template-columns: 1fr; } }

/* ---------- 全系列共用 ---------- */
.cp-link.ew-link-soon { border-style: dashed; opacity: .78; cursor: default; }
.ew-safety-src { margin: 1rem 0 0; font-size: .86rem; color: var(--ink-soft); }
.ew-safety-src .zh { display: block; }
