/* 色彩 token 依 twmsolutiondesignsystem.md（twmsolution.com 深色企業服務站規格）*/
:root {
  --bg-base: #121212;
  --bg-header: #0b0c18;
  --brand-orange: #ff6700;
  --brand-orange-hover: #e65c00;
  --accent-amber: #ffb500;
  --accent-green: #00ac7a;
  --accent-purple: #624bee;
  --text-primary: #ffffff;
  --text-secondary: rgb(171, 173, 175);
  --text-muted: rgb(148, 163, 184);
  --surface-1: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-3: rgba(255, 255, 255, 0.2);
  --surface-4: rgba(255, 255, 255, 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
}

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

body {
  margin: 0;
  font-family: "Noto Sans TC", sans-serif;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(720px 720px at 8% 0%, rgba(255, 103, 0, 0.14), transparent 70%),
    radial-gradient(760px 760px at 96% 22%, rgba(98, 75, 238, 0.12), transparent 70%),
    radial-gradient(680px 680px at 50% 100%, rgba(47, 111, 237, 0.12), transparent 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-secondary);
}

/* 滾動到畫面內才觸發 fadeInUp，見 js/reveal.js */
.reveal {
  opacity: 0;
}

/* 自帶最小一套 animate.css 相容規則（僅涵蓋本站用到的 fadeInUp／delay），
   避免依賴外部 CDN — 若使用者網路無法連到 cdnjs，動畫會直接失效、
   元素永遠停在 opacity:0（比沒有動畫更糟）。 */
.animate__animated {
  animation-duration: 1s;
  animation-fill-mode: both;
}

.animate__fadeInUp {
  animation-name: fadeInUp;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 100%, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.animate__delay-1s {
  animation-delay: 1s;
}

.animate__delay-2s {
  animation-delay: 2s;
}

.banner {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: transparent;
}

.banner__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.banner__bg img {
  display: block;
}

/* 無限大（∞ AI）KV 圖 — 手機為版面內置中圖塊，桌機為滿版右側背景，見 index.html 兩個 .banner__infinity 節點 */
/* 淡入動畫改成等圖片真的載入完成（.is-loaded，見 js/infinity-src.js）才開始播放，
   避免在較慢的網路環境下，動畫時間一到但圖片還沒載完，導致圖片看起來「沒有淡入、整個消失」 */
.banner__infinity {
  opacity: 0;
}

.banner__infinity.is-loaded {
  animation: bannerInfinityIn 1.4s ease-out forwards;
}

.show-m{
  display:block
}



@keyframes bannerInfinityIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .banner__infinity {
    animation: none;
    opacity: 1;
  }
}

.banner__infinity--desktop {
  display: none;
}

.banner__infinity--mobile {
  display: block;
  width: 100vw;
  height: auto;
  margin: -60px calc(50% - 50vw) 0;
  pointer-events: none;
}



@media (min-width: 768px) {
  .banner__infinity--mobile {
    display: none;
  }

  .banner__infinity--desktop {
    display: block;
    position: absolute;
    top: -80px;
    right: -120px;
    height: 110%;
    z-index: 0;
    object-fit: cover;
    object-position: right top;
    pointer-events: none;
  }
}

.banner__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 28px);
}

.banner__logo {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 20px);
}

.banner__logo-img {
  display: block;
  height: 36px;
  width: auto;
  margin-bottom: 16px;
}

.banner__heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.banner__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  color: var(--text-primary);
  font-weight: 700;
  font-size: clamp(15px, 0.8vw, 18px);
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.banner__title-row {
  display: block;
}

/* 「台灣大哥大全資子公司」是台信電訊的形容詞，寬度要貼齊「台信電訊」四個字，
   高度（字級）用 JS 依寬度等比縮放（見 index.html syncSubtitleWidth），
   不吃全站適老字級下限——這裡的起始值只是縮放前的基準，最終大小由寬度換算決定 */
.banner__subtitle {
  margin: 0;
  color: white;
  font-weight: 700;
  font-size: clamp(13px, 1.6vw, 16px);
  letter-spacing: 0.05em;
  line-height: 1.2;
  white-space: nowrap;
  padding-left: 4px;
}

.banner__divider {
  width: 100%;
  max-width: 420px;
  height: 1px;
  margin-top: 6px;
  background: var(--surface-4);
}

.banner__text {
  margin: 0;
  color: white;
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0.05em;
  line-height: 1.4;
}

.banner__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.banner__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 1.2vw, 13px) clamp(18px, 2.2vw, 24px);
  border-radius: var(--radius-sm);
  background: var(--brand-orange);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.05em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.banner__btn:hover,
.banner__btn:focus-visible {
  background: var(--brand-orange-hover);
  transform: translateY(-3px);
}

.banner__btn:active {
  transform: translateY(-1px);
}

/* ---------- Mobile (default, < 768px) ---------- */
.banner {
  padding: 48px 24px 56px;
}

.banner__bg img {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
}

.banner__content {
  max-width: 360px;
  margin: 0 auto;
  align-items: center;
  text-align: center;
}

.banner__logo {
  justify-content: center;
}

.banner__title {
  font-size: clamp(32px, 8vw, 44px);
}

.banner__divider {
  margin-left: auto;
  margin-right: auto;
}

.banner__text {
  max-width: 300px;
}

.banner__buttons {
  justify-content: center;
}

@media (max-width: 767px) {
  .banner__logo {
    width: 100%;
  }

  .banner__logo-img {
    width: 100%;
    max-width: 360px;
    height: auto;
  }
}

/* ---------- Tablet / Desktop (>= 768px) ---------- */
@media (min-width: 768px) {

  .show-m{
  display:none;
   }


  .banner {
    padding-top: clamp(32px, 8vw, 108px);
    padding-right: 4vw;
    padding-bottom: clamp(32px, 8vw, 108px);
    padding-left: clamp(60px, calc(20.4vw - 96.7px), 295px);
    min-height: 320px;
    display: flex;
    align-items: center;
  }

  .banner__bg {
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
  }

  .banner__bg img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
  }

  .banner__content {
    max-width: 800px;
    margin: 0;
    align-items: flex-start;
    text-align: left;
  }

  .banner__logo {
    justify-content: flex-start;
  }

  .banner__logo-img {
    height: clamp(24px, 2.1vw, 40px);
  }

  .banner__title {
    max-width: none;
    white-space: nowrap;
    font-size: clamp(38px, 2.3vw, 48px);
  }

  .banner__heading {
    align-items: flex-start;
  }

  .banner__divider {
    margin-left: 0;
  }

  .banner__text {
    font-size: clamp(14px, 1.05vw, 20px);
    max-width: none;
  }

  .banner__buttons {
    justify-content: flex-start;
  }
}


/* ==================== 區塊二：收購資訊 ==================== */
.deal {
   background: transparent;
  padding: 12px 24px 40px;
}

.deal__container {
  max-width: 1120px;
  margin: 0 auto;
}

.deal__title {
  margin: 0 0 0px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: clamp(32px, 3vw, 36px);
  letter-spacing: 0.04em;
  text-align: center;
}

.deal__title-line {
  display: block;
  width: 260px;
  max-width: 60%;
  height: auto;
  margin: 0 auto 18px;
}

.deal__countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 8px 24px;
  width: 100%;
  background: transparent;
  border-radius: var(--radius-md);
}

.deal__countdown-line {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
}

.deal__countdown-label {
  color: var(--text-primary);
  font-weight: 800;
  font-size: clamp(22px, 3.6vw, 36px);
  letter-spacing: 0.02em;
  margin-right: 0.35em;
}

.deal__countdown-clock {
  display: inline-flex;
  align-items: baseline;
}

.deal__countdown-block {
  display: inline-flex;
  align-items: baseline;
}

.deal__countdown-num {
  color: var(--brand-orange);
  font-weight: 800;
  font-size: clamp(22px, 3.6vw, 36px);
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.deal__countdown-unit {
  color: var(--text-primary);
  font-weight: 800;
  font-size: clamp(22px, 3.6vw, 36px);
  margin-left: 4px;
}

.deal__countdown.is-ended .deal__countdown-label {
  color: var(--text-muted);
  font-size: clamp(18px, 2.6vw, 24px);
  margin-right: 0;
}

.deal__countdown-period {
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(15px, 1.6vw, 18px);
  font-weight: 700;
}

/* ---- 收購對價／約當收購價／溢價：圖片滑動＋文字疊圖 ---- */
.deal__carousel {
  position: relative;
  margin-bottom: 24px;
}

.carousel-img-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  min-height: 380px; /* 「高溢價」那張文案較長，方形版面裝不下，改高一點給文字空間，避免疊在圖上 */
  border-radius: var(--radius-md);
  overflow: hidden;
}

.carousel-img-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.carousel-slide__img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  background-color: var(--surface-1);
  background-repeat: no-repeat;
}

.carousel-slide__img--1 { background-image: url('../images/benefits1-carousel-m.webp'); flex: 0 0 100%;
    width: 100%;height: auto; aspect-ratio: 16 / 9;  background-size: 100% auto; background-position: top center; background-repeat: no-repeat; background-color: var(--surface-1);}
.carousel-slide__img--2 { background-image: url('../images/benefits2-carousel-m.webp'); flex: 0 0 100%;
    width: 100%;height: auto; aspect-ratio: 16 / 9;  background-size: 100% auto; background-position: top center; background-repeat: no-repeat; background-color: var(--surface-1);}
.carousel-slide__img--3 { background-image: url('../images/benefits3-carousel-m.webp');flex: 0 0 100%;
    width: 100%;height: auto; aspect-ratio: 16 / 9;  background-size: 100% auto; background-position: top center; background-repeat: no-repeat; background-color: var(--surface-1); }

@media (min-width: 768px) {
  .carousel-slide__img--1 { background-image: url('../images/benefits1-carousel.webp'); }
  .carousel-slide__img--2 { background-image: url('../images/benefits2-carousel.webp'); }
  .carousel-slide__img--3 { background-image: url('../images/benefits3-carousel.webp'); }
}

/* 底部到左側漸暗，確保疊在圖上的文字可讀（同 .outlook-card::after 手法） */
.carousel-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(to top, rgba(51, 53, 66, 0.92) 0%, rgba(0, 0, 0, 0.6) 35%, rgba(0, 0, 0, 0.15) 65%, rgba(0, 0, 0, 0) 85%);
  pointer-events: none;
}

.carousel-body {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
  padding: clamp(16px, 4vw, 32px);
}

.carousel-text-stack {
  position: relative;
}

.carousel-text-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
}

.carousel-text-slide.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
}

.carousel-slide__title {
  margin: 0 0 8px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 26px);
}

.carousel-slide__desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(18px, 1.2vw, 22px);
  line-height: 1.65;
}

.carousel-slide__desc strong {
  color: var(--brand-orange);
  font-size: 1.2em;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
}

.carousel-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  cursor: pointer;
  transition: width 0.3s ease;
}

.carousel-dot.is-active {
  width: 60px;
}

.carousel-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--brand-orange);
  border-radius: inherit;
}

.carousel-dot.is-active::after {
  animation: carouselProgress 5s linear forwards;
}

.deal__carousel:hover .carousel-dot.is-active::after {
  animation-play-state: paused;
}

@keyframes carouselProgress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.carousel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--brand-orange);
  background: transparent;
  color: var(--brand-orange);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.carousel-btn:hover,
.carousel-btn:focus-visible {
  background: var(--brand-orange);
  color: #fff;
}

.carousel-btn svg {
  width: 20px;
  height: 20px;
}

@media (min-width: 768px) {
  .carousel-img-viewport {
    /* 桌機圖檔原生比例 2.5:1（benefits1-3-carousel.webp 1000×400），手機版之後會換上另外提供的直式圖，屆時另外調整比例 */
    aspect-ratio: 12 / 3;
    /* 768px 附近版面較窄，12/3 算出來的高度裝不下「高溢價」那張的長文案，加個底線高度墊著 */
    min-height: 300px;
  }
}

.hl--orange {
  color: var(--brand-orange);
  font-weight: 700;
}

.hl--green {
  color: #64ffad;
  font-weight: 700;
}

.deal__support {
  margin: 0 0 32px;
  padding-top: 20px;
  text-align: center;
  color: var(--text-primary);
  font-weight: 700;
  font-size: clamp(14px, 1.6vw, 17px);
}

/* ---- benefits panel ---- */
.deal__benefits {
  margin-top: 8px;
}

.deal__benefits-title {
  margin: 0 0 16px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: clamp(24px, 2.2vw, 32px);
  text-align: center;
}

.benefit-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.benefit-card {
  position: relative;
  overflow: hidden;
  background: var(--surface-1);
  border-radius: var(--radius-md);
  padding: 24px;
  min-height: 200px;
  box-shadow: none;
}

.benefit-card__img {
  position: absolute;
  right: -8%;
  bottom: -10%;
  width: 52%;
  aspect-ratio: 1 / 1;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  transition: transform 0.4s ease;
}

.benefit-card:hover .benefit-card__img {
  transform: scale(1.06);
}

.benefit-card__body {
  position: relative;
  z-index: 1;
  max-width: 62%;
}

.benefit-card__title {
  display: block;
  margin: 0 0 8px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: clamp(20px, 1.6vw, 24px);
}

.benefit-card__desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(18px, 1vw, 20px);
  line-height: 1.65;
}

.benefit-cards__note {
  margin: 16px 0 0;
  text-align: center;
  color: white;
  font-size: clamp(20px, 1.6vw, 24px);
}

/* ---- 換股利益：台灣大哥大電信每股獲利王 ---- */
.eps {
  position: relative;
  overflow: hidden;
  padding: 48px 24px 56px;
  background: linear-gradient(180deg, rgba(255, 103, 0, 0.16) 0%, transparent 60%);
}

.eps__mesh {
  position: absolute;
  inset: -6%;
  z-index: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  mix-blend-mode: multiply;
  opacity: 0.55;
  animation: meshDrift 16s ease-in-out infinite;
}

@keyframes meshDrift {
  0%, 100% {
    transform: translate(0, 0) scale(0.85);
  }
  50% {
    transform: translate(-14px, 10px) scale(0.85);
  }
}

@media (prefers-reduced-motion: reduce) {
  .eps__mesh {
    animation: none;
  }
}

.eps__container {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
}

.eps-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.eps-cards--outlook {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.eps-cards--outlook .eps-card {
  width: 100%;
  max-width: 360px;
  padding: 28px 20px;
}

.eps-cards--outlook .eps-card__label {
  font-size: clamp(17px, 1.6vw, 19px);
}

.eps-card__value--revise {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.eps-card__value--revise strong {
  font-size: clamp(30px, 3.2vw, 38px);
}

.eps-card__value-old {
  color: var(--text-muted);
  font-size: 17px;
  text-decoration: line-through;
}

.eps-card__value-arrow {
  color: var(--text-muted);
  font-size: 15px;
}

.eps-card__value--revise strong {
  color: var(--brand-orange);
}

.eps-cards + .deal__benefits-title {
  margin-top: 40px;
}

/* ---- 發展前景：EPS 年年成長趨勢圖，見 index.html #epsTrend / js/eps-animate.js ---- */
.eps-trend {
  position: relative;
  z-index: 1;
  margin: 4px 0 20px;
  max-width: 800px;
  width: 100%;
  margin:4px auto 20px;
  padding: 22px 0px 18px;
  border-radius: var(--radius-md);
}

.eps-trend__head {
  position: absolute;
  left: 1%;
  bottom: 112%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  opacity: 0;
  transition: opacity 1.4s ease 0.4s;
}


.eps-trend.is-visible .eps-trend__head {
  opacity: 1;
}

.eps-trend__title {
  color: var(--text-primary);
  font-weight: 700;
  font-size: clamp(16px, 1.2vw, 18px);
  color:#e5630d;
}

.eps-trend__unit {
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .eps-trend__head {
        left: 77%;
        bottom: 27%;
        text-align: right;
  }
}

.eps-trend__chart {
  padding-top: 40px;
}

.eps-trend__plot {
  position: relative;
}

.eps-trend__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.eps-trend__fill {
  opacity: 0;
  transition: opacity 1.2s ease 0.5s;
}

.eps-trend.is-visible .eps-trend__fill {
  opacity: 1;
}

.eps-trend__line {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  filter: drop-shadow(0 0 3px rgba(255, 103, 0, 0.9)) drop-shadow(0 0 10px rgba(255, 103, 0, 0.55));
  transition: stroke-dashoffset 1.8s cubic-bezier(0.16, 0.84, 0.44, 1);
}

.eps-trend.is-visible .eps-trend__line {
  stroke-dashoffset: 0;
}

.eps-trend__dot {
  fill: #ffffff;
  stroke: var(--brand-orange);
  stroke-width: 3;
  opacity: 0;
  filter: drop-shadow(0 0 4px rgba(255, 103, 0, 0.95)) drop-shadow(0 0 9px rgba(255, 103, 0, 0.6));
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.3);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.eps-trend.is-visible .eps-trend__dot {
  opacity: 1;
  transform: scale(1);
}

.eps-trend.is-visible .eps-trend__dot--1 { transition-delay: 0s; }
.eps-trend.is-visible .eps-trend__dot--2 { transition-delay: 0.35s; }
.eps-trend.is-visible .eps-trend__dot--3 { transition-delay: 0.7s; }
.eps-trend.is-visible .eps-trend__dot--4 { transition-delay: 1.05s; }
.eps-trend.is-visible .eps-trend__dot--5 { transition-delay: 1.4s; }

.eps-trend__points {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.eps-trend__point {
  position: absolute;
  transform: translate(-50%, -160%);
}

.eps-trend__point:first-child {
  transform: translate(0, -160%);
}

.eps-trend__point:last-child {
  transform: translate(-100%, -160%);
}

.eps-trend__value {
  display: inline-block;
  color: var(--text-primary);
  font-weight: 700;
  font-size: clamp(18px, 1.4vw, 20px);
  white-space: nowrap;
}

.eps-trend__years {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}

.eps-trend__year {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 600;
}

.eps-card {
  position: relative;
  overflow: hidden;
  background: var(--surface-1);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: none;
  color: var(--brand-orange);
  text-align: center;
}

.eps-card--blue {
  color: var(--brand-orange);
}

.eps-card--gold {
  color: var(--accent-amber);
}

.eps-card__head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.eps-card__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.eps-card__icon svg {
  width: 100%;
  height: 100%;
}

.eps-card__label {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 15px;
}

.eps-card__value {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text-primary);
  font-size: 16px;
}

.eps-card__value strong {
  font-size: clamp(26px, 2.6vw, 32px);
}

.eps-card__foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.eps-card__growth {
  color: var(--brand-orange);
  font-weight: 700;
  font-size: clamp(15px, 0.6vw, 16px);
}

.eps-card--blue .eps-card__growth {
  color: var(--brand-orange);
}

.eps-card--gold .eps-card__growth {
  color: var(--brand-orange);
}

.eps-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--brand-orange);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}

.eps-card__spark {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 55%;
  height: 40px;
  opacity: 0.85;
}

.eps-card__spark polyline {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 1.6s cubic-bezier(0.16, 0.84, 0.44, 1);
}

.eps-card.is-visible .eps-card__spark polyline {
  stroke-dashoffset: 0;
}

.eps-card__spark-fill {
  opacity: 0;
  transition: opacity 1.2s ease 0.3s;
}

.eps-card.is-visible .eps-card__spark-fill {
  opacity: 1;
}

/* ---- 發展前景：三大策略卡 ---- */
.outlook-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.outlook-card {
  position: relative;
  background: var(--surface-1);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: none;
  aspect-ratio: 4 / 3;
}

@media (max-width: 767px) {
  /* 手機版寬度較窄，「跨售/AI/區域化」文案較長，4/3 卡片太扁，文字會貼到底、擋住圖片；
     howto-path-cards（擇一途徑辦理應賣交存）文案短，不受影響，故排除 */
  .outlook-cards:not(.howto-path-cards) .outlook-card {
    aspect-ratio: 1 / 1;
  }
}

.outlook-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.6) 35%, rgba(0, 0, 0, 0.15) 65%, rgba(0, 0, 0, 0) 85%);
  pointer-events: none;
}

.outlook-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: var(--surface-2);
  background-size: cover;
  background-position: center;
  transition: transform 0.4s ease;
}

.outlook-card:hover .outlook-card__img {
  transform: scale(1.06);
}

.outlook-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  padding: 20px;
}

.outlook-card__title {
  margin: 0 0 8px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: clamp(20px, 1.6vw, 24px);
}

.outlook-card__desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(18px, 1vw, 20px);
  line-height: 1.65;
}

.outlook-card__note {
  display: inline-block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.7em;
}

/* ---- 如何應賣：證券商按鈕＋步驟教學彈窗 ---- */
.howto-rule-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.howto-path-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.howto-path-cards .outlook-card {
  width: 100%;
}

.howto-path-cards .outlook-card__bottom {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.howto-rule-card {
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface-1);
  border: 1px solid var(--card-accent, var(--surface-3));
  border-radius: var(--radius-md);
  box-shadow: 0 0 24px -8px var(--card-accent, transparent);
}

.howto-rule-card--orange {
  --card-accent: rgba(255, 103, 0, 0.5);
}

.howto-rule-card--blue {
  --card-accent: rgba(47, 111, 237, 0.5);
}

.howto-rule-card--purple {
  --card-accent: rgba(98, 75, 238, 0.5);
}

.howto-rule-card__icon {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.howto-rule-card__text {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(18px, 1vw, 20px);
  font-weight: 700;
  line-height: 1.6;
  text-align:center;
}

.howto-rule-cards--methods {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.howto-rule-card--text-block {
  display: block;
  text-align: left;
}

.howto-rule-card__title {
  margin: 0 0 10px;
  color: var(--brand-orange);
  font-weight: 700;
  font-size: clamp(18px, 1.2vw, 20px);
}

.howto-rule-card__body {
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(15px, 0.9vw, 16px);
  line-height: 1.7;
}
.howto-rules__subtitle {
  margin: 20px 0 8px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: 0.04em;
  text-align: center;
}

.howto__hint {
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: clamp(15px, 0.8vw, 17px);
  text-align: center;
}

.howto-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.howto-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  min-width: 140px;
  border: 1px solid var(--surface-4);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.howto-btn:hover,
.howto-btn:focus-visible {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
  transform: translateY(-3px);
}

.howto-btn:active {
  transform: translateY(-1px);
}

.swap-card__heading {
  margin-top: 28px;
}

.swap-card {
  position: relative;
  overflow: hidden;
  margin-top: 0;
  background: var(--surface-1);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: none;
}

/* 文字／表單內容獨立一層並蓋上 padding，圖片（.swap-card__photo）則直接貼齊 .swap-card 四邊，不吃這層 padding */
.swap-card__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px;
}

.swap-card__desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(15px, 0.8vw, 17px);
  line-height: 1.8;
}

/* 手機版不放圖；桌機版讓圖直接貼齊卡片四個邊、壓在文字與試算表單背後，見下方 @media (min-width:768px) */
.swap-card__photo {
  display: none;
}

.swap-card__form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  column-gap: 12px;
  row-gap: 28px;
  margin: 0 0 28px;
}

.swap-card__submit {
  display: inline-flex;
  flex: 1 1 100%;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 22px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--brand-orange);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.swap-card__submit:hover,
.swap-card__submit:focus-visible {
  background: var(--brand-orange-hover);
  transform: translateY(-2px);
}

.swap-card__submit:active {
  transform: translateY(0);
}

@media (min-width: 480px) {
  .swap-card__submit {
    flex: 0 0 auto;
  }
}

/* 按下「開始試算」時短暫脈動一下結果卡片，當作提示 */
.swap-card__grid.is-highlighted .swap-tile {
  animation: swapResultPulse 0.9s ease;
}

@keyframes swapResultPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 103, 0, 0.55);
  }
  60% {
    box-shadow: 0 0 0 8px rgba(255, 103, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 103, 0, 0);
  }
}

.swap-card__field {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  gap: 8px;
  font-size: clamp(18px, 1vw, 20px);
  color: var(--text-secondary);
  font-weight: 700;
}


.swap-card__field input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--surface-3);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-primary);
  font: inherit;
  text-align: right;
  padding: 0 14px;
}

@media (min-width: 480px) {
  .swap-card__field {
    flex: 0 0 auto;
  }

  .swap-card__field input {
    width: 160px;
  }
}

/* 手機版：應賣張數／原買進均價／開始試算 由上而下單欄堆疊、各自滿版寬度；僅作用於 Mobile Breakpoint（767px 以下，與現有 PC 版 min-width:768px 斷點互不重疊），不影響 PC 版雙欄佈局 */
@media (max-width: 767px) {
  .swap-card__form {
    flex-direction: column;
    align-items: stretch;
    row-gap: 32px;
  }

  .swap-card__field {
    flex: 0 0 auto;
    width: 100%;
  }

  .swap-card__field input {
    width: 100%;
  }

  .swap-card__submit {
    flex: 0 0 auto;
    width: 100%;
    height: 48px;
  }
}

.swap-card__field-error {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 6px;
  color: #ff5c5c;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: right;
}

.swap-card__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .swap-card__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.swap-card__footnote {
  margin-top: 16px;
}

/* 桌機版把「股票市值依...」說明移到左側說明文字下方，見 index.html .swap-card__footnote--intro / --mobile */
.swap-card__footnote--intro {
  display: none;
}

.swap-card__basis {
  margin: 0;
  color: var(--brand-orange);
  font-size: clamp(15px, 0.8vw, 17px);
}

.swap-card__disclaimer {
  display: block;
  width: 100%;
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}

.swap-tile {
  background: var(--surface-1);
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.swap-tile__label {
  color: var(--text-secondary);
  font-size: clamp(15px, 0.8vw, 17px);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.swap-tile__value {
  margin-top: 8px;
  color: var(--text-primary);
  font-weight: 800;
  font-size: clamp(26px, 2.4vw, 32px);
  letter-spacing: -0.03em;
}

.swap-tile__sub {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: clamp(15px, 0.7vw, 16px);
  line-height: 1.5;
}

.swap-tile .tnum {
  font-variant-numeric: tabular-nums;
}

.swap-tile__unit {
  margin-left: 4px;
  font-size: clamp(15px, 0.8vw, 17px);
  font-weight: 700;
  letter-spacing: 0;
}

.swap-tile.is-positive .swap-tile__value,
.swap-tile.is-positive .swap-tile__sub {
  color: #64ffad;
}

.swap-tile.is-negative .swap-tile__value,
.swap-tile.is-negative .swap-tile__sub {
  color: #ff5c5c;
}


.howto-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.howto-modal.is-open {
  visibility: visible;
  opacity: 1;
}

.howto-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.howto-modal__panel {
  position: relative;
  z-index: 1;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-header);
  border-radius: var(--radius-md);
  padding: 28px 24px 24px;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
}

.howto-modal.is-open .howto-modal__panel {
  transform: translateY(0) scale(1);
}

.howto-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.howto-modal__close:hover {
  background: var(--surface-3);
}

.howto-modal__title {
  margin: 0 0 16px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 20px;
  text-align: center;
}

.howto-modal__img {
  display: block;
  width: 100%;
  border-radius: var(--radius-md);
  background: var(--surface-1);
}

@media (min-width: 768px) {
  .deal {
    padding: 24px 5vw 40px;
  }

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

  .swap-card__content {
    flex-direction: row;
    align-items: stretch;
    gap: 40px;
    padding: 36px;
  }

  .swap-card__intro {
    flex: 0 0 300px;
    padding-right: 32px;
    border-right: 1px solid var(--surface-2);
  }

  .swap-card__calc {
    flex: 1 1 auto;
    min-width: 0;
  }

  .swap-card__footnote--intro {
    display: block;
  }

  .swap-card__footnote--mobile {
    display: none;
  }

  .eps {
    padding: 24px 5vw 40px;
  }

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

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

  .howto-rule-cards {
    grid-template-columns: repeat(3, 1fr);
    max-width: calc(((100% - 32px) / 3) * 2 + 16px);
    margin: 0 auto;
  }

  .howto-rule-cards--methods {
    grid-template-columns: repeat(2, 1fr);
    max-width: none;
  }

  .howto-path-cards {
    display: grid;
    grid-template-columns: repeat(3, calc((100% - 32px) / 3));
    justify-content: center;
  }

  .eps-cards--outlook {
    display: grid;
    grid-template-columns: repeat(2, calc((100% - 32px) / 3));
    justify-content: center;
  }

  .eps-cards--outlook .eps-card {
    width: auto;
    max-width: none;
  }

}

@media (min-width: 1440px) {
  .deal__container {
    max-width: 1200px;
  }

  .eps__container {
    max-width: 1200px;
  }
}

/* ---- 頁尾：法律聲明（佔位，待法務核定正式文案）---- */
.site-footer {
  border-top: 1px solid var(--surface-2);
  padding: 32px 24px 40px;
}

.site-footer__container {
  max-width: 1120px;
  margin: 0 auto;
}

.site-footer__disclaimer {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
}

.site-footer__copyright {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

@media (min-width: 768px) {
  .site-footer {
    padding: 28px 5vw 28px;
  }
}

/* ==================== 區塊：常見問答 ==================== */
.faq__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 860px;
  margin: 8px auto 0;
}

.faq-item {
  background: var(--surface-1);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-item__question {
  margin: 0;
}

.faq-item__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 22px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(18px, 1.2vw, 20px);
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease;
}

.faq-item.is-open .faq-item__trigger {
  color: var(--brand-orange);
}

.faq-item__icon {
  flex: none;
  color: var(--text-secondary);
  transition: transform 0.25s ease, color 0.25s ease;
}

.faq-item.is-open .faq-item__icon {
  color: var(--brand-orange);
  transform: rotate(180deg);
}

.faq-item__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.faq-item__answer-inner {
  padding: 0 22px 20px;
  color: var(--text-secondary);
  font-size: clamp(16px, 1vw, 18px);
  line-height: 1.7;
}

.faq-item__answer-inner p {
  margin: 0 0 12px;
}

.faq-item__answer-inner p:last-child {
  margin-bottom: 0;
}

.faq-formula {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  text-align: center;
}

.faq-formula__frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.5;
}

.faq-formula__num {
  padding: 0 2px 2px;
  border-bottom: 1px solid currentColor;
}

.faq-formula__den {
  padding: 2px 2px 0;
}

/* ==================== 區塊：貼心提醒 ==================== */
.reminder__panel {
  position: relative;
  margin: 8px auto 0;
  max-width: 860px;
  background: var(--surface-1);
  border-radius: var(--radius-md);
  padding: 24px 24px 20px;
}

.reminder__content {
  max-height: 140px;
  overflow: hidden;
  transition: max-height 0.35s ease;
  -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 65%, transparent 100%);
}

.reminder__panel.is-expanded .reminder__content {
  -webkit-mask-image: none;
  mask-image: none;
}

.reminder__content p {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.9;
}

.reminder__content p:last-child {
  margin-bottom: 0;
}

.howto-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 32px auto 0;
  padding: 10px 26px;
  border: 1px solid var(--surface-3);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.howto-more-btn:hover,
.howto-more-btn:focus-visible {
  background: var(--surface-2);
  color: var(--text-primary);
}

.howto-more-btn__icon {
  flex: none;
  color: currentColor;
}

.reminder__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 16px auto 0;
  padding: 8px 22px;
  border: 1px solid var(--surface-3);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.reminder__toggle:hover,
.reminder__toggle:focus-visible {
  background: var(--surface-2);
  color: var(--text-primary);
}

.reminder__toggle-icon {
  flex: none;
  color: currentColor;
  transition: transform 0.25s ease;
}

.reminder__panel.is-expanded .reminder__toggle-icon {
  transform: rotate(180deg);
}
