@charset "UTF-8";
/* ============================================================
   過敏性鼻炎自我檢測表 - main.css
   ============================================================ */
:root {
  --teal-dark: #2e6f7d;      /* 深青綠（標題、內文） */
  --teal: #2a8090;           /* header 背景 */
  --teal-bright: #2fa3a0;    /* 強調字（可能 / 多嚴重） */
  --teal-light: #93cfc7;     /* 進度條填色 */
  --teal-score: #2fa19b;     /* 分數（低）/ 結果框（低） */
  --coral: #e2837a;          /* 橘紅（高分、警示） */
  --coral-deep: #dd7466;     /* 橘紅漸層深色 */
  --track-gray: #ccd6da;     /* 滑桿未填色 */
  --font-serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --font-sans: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--teal-dark);
  background: #fff;
  min-height: 100vh;
}

#app {
  max-width: 768px;
  margin: 0 auto;
  min-height: 100vh;
  background: url("/assets/web/images/bg2.png") no-repeat center top / contain,
  url("/assets/web/images/bg.png") no-repeat center bottom / contain;
  box-shadow: 0 0 24px rgba(46, 111, 125, .12);
  overflow: hidden;
}

/* ---------- 共用 ---------- */
.screen { display: none; min-height: 100vh; flex-direction: column; }
.screen.active { display: flex; }

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 6vh 6% 5vh;
}

.topbar {
  background: var(--teal);
  color: #fff;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(20px, 5.5vw, 30px);
  text-align: center;
  letter-spacing: .12em;
  padding: .55em 0 .65em;
}

.topbar + .content { padding-top: 4.5vh; }

.divider {
  width: min(40%, 220px);
  height: 5px;
  border-radius: 3px;
  margin: 22px auto;
}
.divider--coral { background: #e79c8e; }
.divider--teal { background: #9fc9c5; }

.page-title {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(28px, 8vw, 46px);
  letter-spacing: .06em;
  text-align: center;
  color: var(--teal-dark);
}
.page-title .hl { color: var(--teal-bright); }

.page-sub {
  text-align: center;
  font-size: clamp(16px, 4.4vw, 24px);
  letter-spacing: .08em;
  margin-top: 1.1em;
  color: #4a7d8a;
}

/* ---------- 首頁 ---------- */
.intro-content { align-items: center; justify-content: center; text-align: center; }

.intro-title {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(40px, 11vw, 64px);
  line-height: 1.35;
  letter-spacing: .1em;
  color: #37858e;
}

.intro-pic {
  width: min(78%, 480px);
  margin: 3vh 0 5vh;
}

.intro-btn {
  position: relative;
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(22px, 5.5vw, 32px);
  letter-spacing: .18em;
  color: #fff;
  background: url("/assets/web/images/intro-btn.svg") no-repeat center / 100% 100%;
  width: min(70%, 280px);
  aspect-ratio: 534.35 / 143.08;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  transition: transform .15s ease, filter .15s ease;
}
.intro-btn:hover { filter: brightness(1.07); transform: translateY(-2px); }
.intro-btn:active { transform: translateY(1px); }
.intro-arrow { width: .62em; }

/* ---------- 進度條 ---------- */
.progress {
  position: relative;
  height: 22px;
  border: 1px solid #8fc0bd;
  border-radius: 11px;
  background: #fff;
  margin: 3.2vh 2% 0;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--teal-light);
  border-radius: 11px;
  transition: width .35s ease;
}
.progress-seps {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(12.5% - 1px),
    rgba(255, 255, 255, .75) calc(12.5% - 1px),
    rgba(255, 255, 255, .75) 12.5%
  );
  pointer-events: none;
}

/* ---------- 題目 ---------- */
.question {
  display: flex;
  align-items: center;
  gap: 6%;
  margin-top: 5.5vh;
}

.q-pic {
  flex: 0 0 26%;
  display: flex;
  justify-content: center;
}
.q-pic img {
  width: 100%;
  max-height: 230px;
  object-fit: contain;
}

.q-body { flex: 1; }

.q-text {
  font-size: clamp(19px, 5vw, 30px);
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: .05em;
  color: #3c7382;
  min-height: 3.1em;
}

.answers {
  display: flex;
  justify-content: center;
  gap: 9%;
  margin-top: 4.5vh;
}

.ans-btn {
  border: 0;
  cursor: pointer;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(24px, 6vw, 38px);
  color: var(--teal-dark);
  background: url("/assets/web/images/btn.svg") no-repeat center / 100% 100%;
  width: clamp(120px, 34%, 175px);
  aspect-ratio: 261.95 / 125.04;
  padding-bottom: .12em;
  transition: color .12s ease;
}
.ans-btn.selected {
  background-image: url("../images/btn_hover.svg");
  color: #fff;
}
/* 僅在支援滑鼠 hover 的裝置套用，避免觸控裝置點擊後 hover 樣式殘留 */
@media (hover: hover) {
  .ans-btn:hover {
    background-image: url("/assets/web/images/btn_hover.svg");
    color: #fff;
  }
}

/* ---------- 下一題 / 看結果 ---------- */
.next-wrap {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  padding-top: 5vh;
}

.next-btn {
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(18px, 4.6vw, 27px);
  letter-spacing: .1em;
  color: #fff;
  background: url("/assets/web/images/next-btn.svg") no-repeat center / 100% 100%;
  width: clamp(140px, 38%, 185px);
  aspect-ratio: 260.28 / 88.27;
  padding-right: .8em;
  transition: filter .15s ease, opacity .15s ease;
}
.next-btn:hover:not(:disabled) { background-image: url("/assets/web/images/next-btn_hover.svg"); }
.next-btn:disabled { opacity: .45; cursor: default; }

/* ---------- VAS 滑桿 ---------- */
.vas-desc {
  font-size: clamp(17px, 4.6vw, 27px);
  line-height: 1.7;
  letter-spacing: .04em;
  color: #3c7382;
  margin-top: 2vh;
}

.vas-area { margin-top: 6vh; padding: 0 15%; }

.vas-scale {
  position: relative;
  height: clamp(58px, 12vw, 86px);
  font-family: var(--font-serif);
  font-weight: 700;
}
.vas-end {
  position: absolute;
  bottom: 0;
  font-size: clamp(42px, 10vw, 64px);
  color: #b9cdd2;
  line-height: 1;
}
.vas-end#vas-min { left: 0;transform: translateX(-50%);
  -webkit-transform: translateX(-50%);width: 0; }
.vas-end#vas-max { right: 0;transform: translateX(50%);
  -webkit-transform: translateX(50%); }
.vas-cur {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  font-size: clamp(42px, 10vw, 64px);
  line-height: 1;
  color: var(--teal-score);
}
.vas-cur.is-high { color: var(--coral); }
.vas-end.is-hidden { visibility: hidden; }

.vas-track-wrap {
  position: relative;
  margin-top: 14px;
  height: 30px;
}

/* 底軌 + 填色：以容器寬度計算，右緣正好對齊滑鈕中心 */
.vas-rail {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  height: 12px;
  border-radius: 6px;
  background: var(--track-gray);
  overflow: hidden;
}
.vas-fill {
  height: 100%;
  width: 0;
  border-radius: 6px;
  background: var(--teal-score);
}
.vas-fill.is-high { background: var(--coral); }

/* 原生滑桿：透明軌道只顯示滑鈕；左右外擴 15px，讓滑鈕在 0 / 10 時置中於端點 */
input[type="range"] {
  position: absolute;
  top: 0;
  left: -15px;
  width: calc(100% + 30px);
  height: 30px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  height: 30px;
}
input[type="range"]::-moz-range-track {
  background: transparent;
  border: 0;
  height: 30px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: var(--teal-score);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  transition: background .15s ease;
}
input[type="range"]::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: var(--teal-score);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
input[type="range"].is-high::-webkit-slider-thumb { background: var(--coral); }
input[type="range"].is-high::-moz-range-thumb { background: var(--coral); }

.vas-labels {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: clamp(15px, 4vw, 24px);
  font-weight: 500;
  color: #3c7382;
}
.vas-labels span:nth-child(1){
  position: absolute;
  left: 0%;
  transform: translateX(-50%);
  -webkit-transform: translateX(-50%);
  text-align: center;
  width: 25vw;
}
.vas-labels span:nth-child(2){
  position: absolute;
  left: 100%;
  transform: translateX(-50%);
  -webkit-transform: translateX(-50%);
  text-align: center;
  width: 25vw;
}
/* ---------- 結果頁 ---------- */
.result-content { padding-top: 8vh; }

.result-title {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(34px, 9.5vw, 56px);
  letter-spacing: .12em;
  text-align: center;
  color: var(--teal-dark);
}

.scores { margin: 4.5vh auto 0; }

.score-row {
  font-size: clamp(19px, 5vw, 30px);
  letter-spacing: .06em;
  color: #3c7382;
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin-bottom: 1em;
}

.score-num {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(46px, 11vw, 70px);
  line-height: 1;
  color: var(--teal-score);
  margin: 0 .3em 0 .4em;
}
.score-num.is-high { color: var(--coral); }

/* 結果框 */
.result-box {
  display: flex;
  align-items: center;
  border: 2px solid var(--teal-score);
  border-radius: 20px;
  background: rgba(255, 255, 255, .6);
  padding: clamp(16px, 4vw, 26px) clamp(14px, 4vw, 26px);
  margin-top: 3vh;
}
.result-box.is-high { border-color: var(--coral); }

.box-label {
  flex: 0 0 34%;
  font-weight: 700;
  font-size: clamp(19px, 5vw, 30px);
  letter-spacing: .02em;
  color: var(--teal-score);
  text-align: center;
}
.result-box.is-high .box-label { color: var(--coral); }

.box-text {
  flex: 1;
  border-left: 3px solid var(--teal-score);
  padding-left: clamp(12px, 3.5vw, 24px);
  font-size: clamp(16px, 4.4vw, 26px);
  line-height: 1.6;
  letter-spacing: .03em;
  color: #3c7382;
}
.result-box.is-high .box-text { border-left-color: var(--coral); }

/* 兩者皆偏高警示 */
.warn-wrap {
  display: flex;
  align-items: flex-end;
  gap: 2%;
  margin-top: 4vh;
  padding-bottom: 10vw;
}
.warn-wrap[hidden] { display: none; }

.warn-pic { flex: 0 0 24%; min-width: 0; }

.warn-box {
  flex: 1;
  position: relative;
  background: var(--coral);
  border-radius: 18px;
  padding: clamp(18px, 4.5vw, 30px) clamp(16px, 4vw, 28px);
  color: #fff;
  margin-bottom: 1vh;
}

.warn-icon {
  position: absolute;
  left:0;
  top: 0%;
  transform: translateY(-50%);
  width: clamp(64px, 15vw, 96px);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .15));
  transform: translate(-50%, -25%);
}

/* .warn-body { padding-left: clamp(40px, 10vw, 70px); } */

.warn-title {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(24px, 6.5vw, 38px);
  letter-spacing: .1em;
  text-align: center;
}

.warn-divider {
  width: 42%;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  margin: .5em auto .7em;
}

.warn-text {
  font-size: clamp(15px, 4.2vw, 24px);
  line-height: 1.65;
  letter-spacing: .02em;
}
.warn-text b { font-weight: 900; }

/* 重新作答 */
.restart-wrap {
  display: flex;
  justify-content: center;
  margin-top: 5vh;
  padding-bottom: 6vh;
}

/* ---------- RWD ---------- */
@media (max-width: 480px) {
  .question { flex-direction: row; }
  .q-pic { flex-basis: 30%; }
  .box-label { flex-basis: 38%; }
}

.grecaptcha-badge {
  visibility: hidden;
}
