/*
 * 廣告測試站共用樣式。品牌色由 <html style="--sticker;--ink;--sticker-ink;--tint"> 帶入。
 * 主視覺是「維修貼紙」：師傅修完會貼在家電上、印著報修專線的那種貼紙。
 * 字型只用系統字（不載入任何外部字型）。
 */

:root {
  --paper: #fbfcfd;
  --text: #1d2733;
  --muted: #586373;
  --line: #d6dde5;
  --err: #b42318;
  --line-green: #037a3a;
  --radius: 12px;
  --font: "PingFang TC", "Heiti TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei",
    system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

/* .form、.done 等有自己的 display，沒有這條 hidden 屬性會失效 */
[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
p,
ol,
ul,
dl,
dd {
  margin: 0;
}

a {
  color: var(--ink);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap.narrow {
  max-width: 760px;
}

/* 中文標題不要在詞中間斷行（「有怪／聲」），只在標點斷；balance 讓兩行長度接近 */
h1,
h2 {
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

h2 {
  font-size: 26px;
  line-height: 1.35;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.section-lead {
  margin-top: 8px;
  color: var(--muted);
}

.muted {
  color: var(--muted);
  font-size: 15px;
}

/* ---------- 頁首 ---------- */

.top {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}

.wordmark-name {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}

.wordmark-sub {
  font-size: 15px;
  font-weight: 700;
}

.top-tel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.2;
}

.top-tel-label {
  font-size: 12px;
  color: var(--muted);
}

.top-tel-num {
  font-size: 19px;
  font-weight: 800;
}

/* ---------- 首屏 ---------- */

.hero {
  background: #fff;
  padding: 36px 0 32px;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  gap: 32px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(30px, 7.2vw, 46px);
  line-height: 1.25;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: 0.005em;
  max-width: 15em;
}

.hero-lead {
  margin-top: 14px;
  font-size: 18px;
  max-width: 30em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-sticker {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

/* 維修貼紙 */
.sticker {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 400px);
  padding: 26px 28px 24px;
  border-radius: 24px;
  background: var(--sticker);
  color: var(--sticker-ink);
  text-decoration: none;
  transform: rotate(-2.5deg);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 18px 30px -18px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease;
  /* backwards：播完回到元素本身的 transform，hover 才不會被動畫終點蓋掉 */
  animation: slap 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) backwards;
}

/* 模切線 */
.sticker::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 2px dashed currentColor;
  border-radius: 17px;
  opacity: 0.28;
  pointer-events: none;
}

/* 右下角翹起來的一角 */
.sticker::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 34px;
  height: 34px;
  border-radius: 0 0 24px 0;
  background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.55) 50%);
}

.sticker:hover {
  transform: rotate(-1deg) translateY(-2px);
}

.sticker-brand {
  font-size: 17px;
  font-weight: 800;
}

.sticker-label {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
}

.sticker-tel {
  font-size: clamp(36px, 10vw, 52px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.sticker-hours {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
}

@keyframes slap {
  from {
    opacity: 0;
    transform: rotate(-7deg) scale(1.08);
  }
  to {
    opacity: 1;
    transform: rotate(-2.5deg) scale(1);
  }
}

.promises {
  list-style: none;
  padding: 0;
  margin-top: 32px;
  display: grid;
  gap: 14px;
}

.promises li {
  padding-left: 14px;
  border-left: 4px solid var(--sticker);
  font-size: 15px;
  color: var(--muted);
}

.promises strong {
  display: block;
  font-size: 18px;
  color: var(--ink);
}

/* ---------- 按鈕 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.btn-ink {
  background: var(--ink);
  color: #fff;
}

.btn-ink:hover {
  filter: brightness(1.15);
}

.btn-line {
  background: #fff;
  color: var(--line-green);
  border-color: var(--line-green);
}

.btn-line:hover {
  background: #effaf3;
}

/* ---------- 區塊 ---------- */

.band {
  padding: 48px 0;
}

.band-tint {
  background: var(--tint);
}

/* 症狀 */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.chip {
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--ink);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.chip[aria-pressed="true"]::before {
  content: "✓ ";
}

.chips-go {
  margin-top: 20px;
}

.onsite {
  margin-top: 24px;
  max-width: 36em;
  color: var(--muted);
}

/* 首頁：選家電 */
.picks {
  list-style: none;
  padding: 0;
  margin-top: 20px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.picks li + li {
  border-top: 1px solid var(--line);
}

.pick {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text);
}

.pick:hover {
  background: #f6f8fa;
}

.pick .icon {
  flex: none;
  width: 52px;
  height: 52px;
  padding: 11px;
  border-radius: 14px;
  background: var(--sticker);
  color: var(--sticker-ink);
}

.pick-text {
  display: flex;
  flex-direction: column;
}

.pick-label {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.pick-blurb {
  font-size: 15px;
  color: var(--muted);
}

/* 收費、服務地區 */
.fee,
.area {
  margin-top: 20px;
}

.fee > div,
.area > div {
  display: grid;
  gap: 2px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.fee > div:last-child,
.area > div:last-child {
  border-bottom: 1px solid var(--line);
}

.fee dt,
.area dt {
  font-weight: 800;
  color: var(--ink);
}

.area + .muted {
  margin-top: 14px;
}

/* 流程：真的有先後順序，所以用編號 */
.steps {
  list-style: none;
  padding: 0;
  margin-top: 24px;
  display: grid;
  gap: 22px;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 56px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sticker);
  color: var(--sticker-ink);
  font-weight: 900;
  font-size: 18px;
}

.step-title {
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
}

.steps li p:not(.step-title) {
  color: var(--muted);
}

/* 常見問題 */
.faq {
  margin-top: 16px;
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  font-weight: 800;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  padding: 0 0 18px;
  color: var(--muted);
}

/* ---------- 報修表單 ---------- */

.booking {
  background: #fff;
  border-top: 6px solid var(--sticker);
}

.form {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}

.field-label,
.field legend {
  font-weight: 800;
  padding: 0;
}

.opt {
  margin-left: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.form input:not([type="checkbox"]):not([type="radio"]),
.form select,
.form textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 17px;
}

.form textarea {
  resize: vertical;
  line-height: 1.6;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: 3px solid var(--sticker);
  outline-offset: 0;
  border-color: var(--ink);
}

.form select:disabled {
  background: #f3f5f7;
  color: var(--muted);
}

.form [aria-invalid="true"] {
  border-color: var(--err);
}

.pair {
  display: grid;
  gap: 18px;
}

.segs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.seg {
  position: relative;
}

.seg input {
  position: absolute;
  opacity: 0;
}

.seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.seg input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.seg input:focus-visible + span {
  outline: 3px solid var(--sticker);
  outline-offset: 2px;
}

.hint {
  font-size: 14px;
  color: var(--muted);
}

.err {
  font-size: 15px;
  color: var(--err);
  font-weight: 600;
}

.err:empty {
  display: none;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.consent input {
  width: 22px;
  height: 22px;
  margin-top: 4px;
  flex: none;
  accent-color: var(--ink);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn-submit {
  width: 100%;
  min-height: 58px;
  font-size: 19px;
}

.btn-submit[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.form-status {
  font-weight: 700;
  color: var(--err);
}

.form-status:empty {
  display: none;
}

.done {
  margin-top: 24px;
  padding: 24px;
  border: 3px solid var(--sticker);
  border-radius: 16px;
  display: grid;
  gap: 10px;
}

.done-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
}

/* ---------- 條款頁 ---------- */

.prose h1 {
  font-size: 30px;
  line-height: 1.3;
  color: var(--ink);
}

.prose .muted {
  margin-top: 8px;
}

.terms {
  margin-top: 24px;
  padding-left: 1.4em;
  display: grid;
  gap: 14px;
}

.controller {
  margin: 28px 0;
  padding: 18px 20px;
  background: var(--tint);
  border-radius: 12px;
}

/* ---------- 頁尾 ---------- */

.foot {
  background: var(--ink);
  color: #fff;
  padding: 40px 0 24px;
  font-size: 15px;
}

.foot a {
  color: #fff;
}

.foot :focus-visible {
  outline-color: var(--sticker);
}

.foot-grid {
  display: grid;
  gap: 18px;
}

.foot-name {
  font-size: 18px;
  font-weight: 800;
}

.foot-copy {
  margin-top: 28px;
  font-size: 13px;
  opacity: 0.75;
}

/* ---------- 手機底部撥號列 ---------- */

.callbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  box-shadow: 0 -6px 18px -10px rgba(0, 0, 0, 0.4);
}

.callbar a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding-bottom: env(safe-area-inset-bottom);
  font-weight: 800;
  font-size: 17px;
  text-decoration: none;
}

.callbar-tel {
  background: var(--sticker);
  color: var(--sticker-ink);
}

.callbar-book {
  background: var(--ink);
  color: #fff;
}

body {
  padding-bottom: 60px;
}

/* ---------- 寬螢幕 ---------- */

@media (min-width: 600px) {
  .pair {
    grid-template-columns: 1fr 1fr;
  }

  .promises {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 860px) {
  .hero {
    padding: 56px 0 44px;
  }

  .hero-grid {
    grid-template-columns: 1.25fr 1fr;
    gap: 48px;
  }

  .band {
    padding: 64px 0;
  }

  h2 {
    font-size: 30px;
  }

  .steps {
    grid-template-columns: repeat(4, 1fr);
  }

  .steps li {
    padding-left: 0;
    padding-top: 56px;
  }

  .fee > div,
  .area > div {
    grid-template-columns: 9em 1fr;
    gap: 16px;
  }

  .foot-grid {
    grid-template-columns: 1.3fr 1fr 1fr;
  }

  .callbar {
    display: none;
  }

  body {
    padding-bottom: 0;
  }
}

@media (max-width: 380px) {
  .top-tel-label {
    display: none;
  }

  .wordmark-sub {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .sticker {
    animation: none;
    transition: none;
  }
}
