/* =========================================================
   Section 3：AI狂潮（新版，3 個 tab）
   新增檔案；section 改用 .section-3n，不套用原本 .section-3 樣式
   tab 切換與左右箭頭共用 js/section-6.js 與 .s6-arrow / .s6-panel
   ========================================================= */

.section-3n {
  --s3-navy: #2d3192;
  --s3-blue: #0165e9;
  --s3-ink: #231814;
  --s3-gold: linear-gradient(90deg, #f0d26f 0%, #c1892f 13.9%, #f8eaaf 33.2%, #fff9c7 43.3%, #f7e9ad 57.2%, #d9b04e 79.8%, #f7dd78 100%);

  position: relative;
  overflow: hidden;
  padding: 285px 20px 22px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1920 283'%3E%3Cpath fill='%23007EFF' d='M368.3 146.5C188.7 146.5 58.8 237.5 1.24 282L.3 275.5C66.3 221 242.2 112 417.8 112c219.5 0 615.5 128 867 128 208.5 0 402.5-138.5 475-181 58-34 122.4-59 159.9-59l-.4 4.5c-144 17-349.5 267-634.5 267S592.8 146.5 368.3 146.5Z'/%3E%3C/svg%3E") no-repeat 50% 0 / 100% auto,
    linear-gradient(180deg, #fff 25.5%, #e7f2fe 62%, #add2fc 90.4%, #d2e6ff 100%);
  font-family: 'Noto Sans TC', sans-serif;
  color: var(--s3-ink);
  scroll-margin-top: 0;
}
.section-3n *,
.section-3n *::before,
.section-3n *::after { box-sizing: border-box; }
.section-3n h2,
.section-3n h3,
.section-3n h4,
.section-3n p,
.section-3n ul,
.section-3n figure { margin: 0; padding: 0; }

.s3-container {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}

.s3-title {
  text-align: center;
  color: var(--s3-blue);
  font-size: 50px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 1px;
}

.s3-title .s3-title-style1 {
  padding-right: 15px;
  margin-right: 15px;
  border-right: 1px solid #30aaad;
  height: 70px;
}

.s3-title .s3-title-style2 {
    color: var(--main-blue-2);
    font-weight: 900;
}

/* ---------- Tabs ---------- */
.s3-tabs {
  position: relative;
  margin-top: 58px;
}
.s3-tab-menu {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 41px;
}
.s3-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  width: 320px;
  height: 80px;
  margin: 0;
  padding: 0 8px 0 3px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--s3-navy);
  font-family: inherit;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: .5px;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  /* 覆蓋既有 button { top/left:50% } */
  top: auto;
  left: auto;
}
.s3-tab img {
  flex: none;
  width: 100px;
  height: 100px;
  margin-top: -18px;
  position: relative;
  z-index: 1;
  transition: transform .25s;
}
.s3-tab span { position: relative; z-index: 1; }
.s3-tab:hover img { transform: translateY(-4px); }
.s3-tab + .s3-tab { margin-left: 32px; }
.s3-tab + .s3-tab::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 25px;
  height: 39px;
  border-left: 1px solid #9a9a9a;
}
.s3-tab.is-active + .s3-tab::before,
.s3-tab + .s3-tab.is-active::before { opacity: 0; }
.s3-tab.is-active {
  background: var(--s3-gold);
  color: var(--s3-ink);
}
.s3-tab.is-active img { margin-top: -54px; }
/* 下方指示三角 */
.s3-tab.is-active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 36px;
  height: 19px;
  margin-left: -18px;
  background: linear-gradient(90deg, #f8eaaf, #fff9c7 50%, #f7e9ad);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
/* 底部陰影 */
.s3-tab-menu .s3-tab.is-active { box-shadow: 0 22px 18px -14px rgba(33, 29, 23, .45); }
.s3-tab:focus-visible { outline: 3px solid #ffc700; outline-offset: 3px; }

/* ---------- 內容卡片 ---------- */
.s3-card {
  position: relative;
  min-height: 580px;
  padding: 29px 66px 40px 55px;
  border: 1px solid #e0effd;
  border-radius: 20px;
  background: linear-gradient(180deg, #f5fbff 0%, #e2f3fe 100%);
  box-shadow: 0 4px 6px rgba(0, 0, 0, .2);
}
.s3-card-title {
  text-align: center;
  color: var(--s3-navy);
  font-size: 36px;
  line-height: 1.3;
  font-weight: 700;
}
.section-3n .s3-card-text {
  margin-top: 25px;
  text-align: center;
  color: var(--s3-ink);
  font-size: 18px;
  line-height: 28px;
}
.section-3n .s3-coming {
  padding: 140px 0;
  text-align: center;
  color: var(--s3-navy);
  font-size: 20px;
  font-weight: 700;
}

.s3-body {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-top: 30px;
}

/* ---------- AI 應用扇形圖 ---------- */
.s3-fan {
  position: relative;
  flex: 1 1 530px;
  max-width: 530px;
  aspect-ratio: 530 / 365;
  margin-bottom: -13px;
  container-type: inline-size;
}
.s3-fan-art {
  position: absolute;
  left: calc(120 / 530 * 100%);
  top: calc(67 / 365 * 100%);
  width: calc(317 / 530 * 100%);
  container-type: inline-size;
}
.s3-fan-art img { display: block; width: 100%; height: auto; }
.s3-fan-tag,
.s3-fan-core {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.s3-fan-tag {
  color: #42210b;
  font-size: calc(18 / 317 * 100cqw);
  line-height: 1.2;
}
.s3-fan-core {
  left: 50.63%;
  top: 52.55%;
  color: #fff;
  font-size: calc(19 / 317 * 100cqw);
  line-height: 1.25;
  text-shadow: 0 0 4px rgba(0, 0, 0, .5);
}

.s3-fan-lists { position: static; }
.s3-fan-list {
  position: absolute;
  left: calc(var(--l) / 530 * 100%);
  top: calc(var(--t) / 365 * 100%);
}
.section-3n .s3-fan-list-title {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.s3-fan-list ul { list-style: none; }
.s3-fan-list li {
  position: relative;
  padding-left: calc(16 / 530 * 100cqw);
  color: var(--s3-ink);
  font-size: clamp(11px, calc(14 / 530 * 100cqw), 16px);
  line-height: calc(20 / 530 * 100cqw);
  white-space: nowrap;
}
.s3-fan-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: calc(10 / 530 * 100cqw);
  height: calc(8 / 530 * 100cqw);
  min-width: 8px;
  min-height: 6px;
  margin-top: -1px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 8'%3E%3Cpath d='M1.2 4.2 3.8 6.6 8.8 1.2' fill='none' stroke='%23FB9404' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat 50% 50% / contain;
}

/* ---------- 圖表 ---------- */
.s3-chart {
  flex: 0 0 436px;
  min-height: 354px;
  margin-top: -2px !important;
  padding: 16px 11px 10px !important;
  border-radius: 12px;
  background: #fff;
  text-align: center;
}
.section-3n .s3-chart-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 330px;
  height: 40px;
  padding: 0 20px;
  border-radius: 20px;
  background: var(--s3-blue);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .5px;
}
.s3-chart-pill-icon { width: 21px; height: 22px; flex: none; }
.s3-chart-title {
  margin-top: 14px !important;
  color: #000;
  font-size: 16px;
  line-height: 22px;
  font-weight: 700;
}
.s3-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 4px;
  overflow: visible;
}
.s3-chart-text text {
  fill: var(--s3-ink);
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 14px;
}
.s3-chart-text text.u { fill: #606060; }
.s3-chart-callout {
  fill: #42210b;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 14px;
  font-weight: 700;
}

/* ---------- 附註 ---------- */
.section-3n .s3-note {
  margin-top: 14px;
  color: var(--s3-ink);
  font-size: 16px;
  line-height: 22px;
}
.s3-note strong { color: var(--s3-blue); font-weight: 700; }

/* ---------- 左右箭頭（沿用 .s6-arrow） ----------
   --s6-menu-h：箭頭群組頂端到卡片頂端的距離（tab 列 80 + 間距 41） */
.s3-arrow { --s6-menu-h: 121px; }

/* =========================================================
   RWD
   ========================================================= */
@media screen and (max-width: 1199px) {
  .section-3n { padding-top: 230px; }
  .s3-tab { width: auto; flex: 0 1 300px; font-size: 22px; }
  .s3-tab img { width: 86px; height: 86px; }
  .s3-card { padding-left: 40px; padding-right: 40px; }
  .s3-chart { flex-basis: 400px; }
  .section-3n .s3-chart-pill { min-width: 0; padding: 0 16px; font-size: 17px; }
  .s3-br { display: none; }
}

@media screen and (max-width: 991px) {
  .section-3n { padding-top: 150px; }
  .s3-container .s3-title { font-size: 40px; display: flex; flex-direction: column; gap: 0px; margin-bottom: 50px;}
  .s3-title .s3-title-style1 {
    padding-right: 0px;
    margin-right: 0px;
    border-right: none;
    height: 60px;
  }
  .s3-title .s3-title-style2 {
    font-size: 40px;
  }
  .s3-tabs { margin-top: 48px; }
  .s3-tab-menu { margin-bottom: 34px; }
  .s3-tab { height: 64px; flex-basis: 230px; font-size: 18px; padding-right: 6px; }
  .s3-tab img { width: 64px; height: 64px; margin-top: -10px; }
  .s3-tab.is-active img { margin-top: -36px; }
  .s3-tab + .s3-tab { margin-left: 20px; }
  .s3-tab + .s3-tab::before { left: -10px; top: 18px; height: 28px; }
  .s3-arrow { --s6-menu-h: 98px; }

  .s3-card { min-height: 0; padding: 26px 30px 30px; }
  .s3-card-title { font-size: 30px; }
  .section-3n .s3-card-text { font-size: 17px; line-height: 28px; margin-top: 16px; }
  .s3-br { display: none; }

  .s3-body { flex-direction: column; align-items: center; gap: 24px; margin-top: 24px; }
  .s3-fan { flex: none; width: 100%; max-width: 580px; margin-bottom: 0; }
  .s3-chart { flex: none; width: 100%; max-width: 520px; margin-top: 0 !important; }
  .section-3n .s3-coming { padding: 80px 0; }
}

@media screen and (max-width: 767px) {
  .section-3n { padding: 76px 16px 24px; }
  .s3-title { font-size: 40px; }
  .s3-tabs { margin-top: 36px; }

  /* tabs：三欄、圖示在上 */
  .s3-tab-menu { align-items: stretch; margin-bottom: 26px; }
  .s3-tab,
  .s3-tab.is-active {
    flex: 1 1 0;
    flex-direction: column;
    justify-content: flex-start;
    gap: 2px;
    height: auto;
    min-height: 84px;
    padding: 0 4px 8px;
    border-radius: 10px;
    font-size: 16px;
    line-height: 1.3;
    letter-spacing: 0;
    text-align: center;
  }
  .s3-tab img,
  .s3-tab.is-active img { width: 52px; height: 52px; margin-top: -20px; }
  .s3-tab span { word-break: keep-all; }
  .s3-tab + .s3-tab { margin-left: 10px; }
  .s3-tab + .s3-tab::before { left: -6px; top: 20px; height: 40px; }
  .s3-tab.is-active::after { bottom: -12px; width: 24px; height: 13px; margin-left: -12px; }
  .s3-arrow { --s6-menu-h: 110px; }

  .s3-card { padding: 22px 22px 22px; border-radius: 14px; }
  .s3-card-title { font-size: 22px; }
  .section-3n .s3-card-text { font-size: 16px; line-height: 26px; text-align: justify; }

  /* 扇形圖：圖在上，各產業清單改兩欄卡片 */
  .s3-fan { aspect-ratio: auto; max-width: none; }
  .s3-fan-art { position: relative; left: auto; top: auto; width: 88%; margin: 0 auto; }
  .s3-fan-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
  }
  .s3-fan-list {
    position: static;
    padding: 8px 8px 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .75);
    border: 1px solid #f5dfa6;
  }
  .section-3n .s3-fan-list-title {
    position: static !important;
    width: auto; height: auto;
    overflow: visible; clip: auto;
    margin-bottom: 2px;
    color: #42210b;
    font-size: 16px;
    line-height: 20px;
    font-weight: 700;
  }
  .s3-fan-list li {
    padding-left: 16px;
    font-size: 14px;
    line-height: 21px;
    white-space: normal;
  }
  .s3-fan-list li::before { width: 10px; height: 8px; }

  .s3-chart { padding: 14px 8px 8px !important; min-height: 0; }
  .section-3n .s3-chart-pill { height: 36px; padding: 0 14px; font-size: 15px; gap: 6px; letter-spacing: 0; }
  .s3-chart-pill-icon { width: 17px; height: 18px; }
  .s3-chart .s3-chart-title { font-size: 14px; margin-top: 8px; margin-bottom: 4px; }

  .section-3n .s3-note { font-size: 15px; line-height: 24px; }
}

/* =========================================================
   Section 3 圖表動態
   由 js/section-3.js 於圖表進入畫面時加上 .is-play
   （.s3c-ready 才套用初始隱藏狀態，JS 未載入時圖表照常完整顯示）
   ========================================================= */
.s3c-ready .s3c-grid path {
  transform-box: fill-box;
  transform-origin: 0 50%;
  transform: scaleX(0);
  opacity: 0;
}
.s3c-ready .s3-chart-text,
.s3c-ready .s3c-legend { opacity: 0; }
.s3c-ready .s3c-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.s3c-ready .s3c-callout {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  opacity: 0;
  transform: translateY(8px) scale(.5);
}

/* 播放 */
.is-play .s3c-grid path { animation: s3c-grid .6s cubic-bezier(.3, .7, .3, 1) forwards; }
.is-play .s3c-grid path:nth-child(1) { animation-delay: .00s; }
.is-play .s3c-grid path:nth-child(2) { animation-delay: .06s; }
.is-play .s3c-grid path:nth-child(3) { animation-delay: .12s; }
.is-play .s3c-grid path:nth-child(4) { animation-delay: .18s; }
.is-play .s3c-grid path:nth-child(5) { animation-delay: .24s; }
.is-play .s3-chart-text { animation: s3c-fade .5s .2s ease forwards; }
.is-play .s3c-legend { animation: s3c-fade .5s .3s ease forwards; }
.is-play .s3c-line--a { animation: s3c-draw 1.8s .45s cubic-bezier(.45, .05, .25, 1) forwards; }
.is-play .s3c-line--b { animation: s3c-draw 1.8s .75s cubic-bezier(.45, .05, .25, 1) forwards; }
.is-play .s3c-callout { animation: s3c-callout .55s 2.5s cubic-bezier(.3, 1.5, .5, 1) forwards; }

@keyframes s3c-grid { to { transform: scaleX(1); opacity: 1; } }
@keyframes s3c-fade { to { opacity: 1; } }
@keyframes s3c-draw { to { stroke-dashoffset: 0; } }
@keyframes s3c-callout {
  0% { opacity: 0; transform: translateY(8px) scale(.5); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 使用者偏好減少動態：直接顯示完整圖表 */
@media (prefers-reduced-motion: reduce) {
  .s3c-ready .s3c-grid path,
  .s3c-ready .s3-chart-text,
  .s3c-ready .s3c-legend,
  .s3c-ready .s3c-callout {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .s3c-ready .s3c-line { stroke-dashoffset: 0 !important; animation: none !important; }
}

/* =========================================================
   Section 3：Tab 2（兆元大餅 一檔掌握）、Tab 3（長線投資 價值浮現）
   ========================================================= */
.section-3n .s3-note[hidden] { display: none; }
.s3-panel--t2 .s3-card-title,
.s3-panel--t3 .s3-card-title { margin-top: 6px; }
.section-3n .s3-panel--t2 .s3-card-text,
.section-3n .s3-panel--t3 .s3-card-text { margin-top: 18px; }

/* 圖表內文字（共用） */
.s3x-svg { display: block; width: 100%; height: auto; overflow: visible; }
.s3x-text text {
  fill: var(--s3-ink);
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 12px;
}
.s3x-text .u { fill: #606060; font-size: 13.5px; }
.s3x-text .v { font-size: 16.5px; font-weight: 700; }
.s3x-text .v--hl { fill: #fff; font-size: 19.5px; }
.s3x-text .c { fill: #42210b; font-size: 13.5px; font-weight: 700; }
.s3x-text .sd { font-size: 12.5px; font-weight: 700; }
.s3x-bar .s3x-text text:not(.u):not(.v) { font-size: 13.5px; }

/* ---------- Tab 2 ---------- */
.section-3n .s3-big-pill {
  display: table;
  margin: 22px auto 0;
  padding: 0 24px;
  border-radius: 23px;
  background: var(--s3-blue);
  color: #fff;
  font-size: 20px;
  line-height: 45px;
  font-weight: 700;
  letter-spacing: .3px;
  text-align: center;
}
.s3-big-pill strong {
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(180deg, #f3bf66 10%, #fffcf0 31%, #f3bf66 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 1px rgba(0, 30, 120, .45));
}

.s3-t2-body {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  margin: 23px 0 0 38px;
}
.section-3n .s3-bar-card {
  flex: 0 1 420px;
  margin-top: 5px;
  padding: 12px 10px 14px;
  border-radius: 12px;
  background: #fff;
}
.s3-legend {
  display: grid;
  grid-template-columns: 92px 134px auto;
  margin: 3px 0 0 8px !important;
  list-style: none;
}
.s3-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--s3-ink);
  font-size: 14px;
  line-height: 24px;
  white-space: nowrap;
}
.s3-legend i { flex: none; width: 12px; height: 12px; border-radius: 2px; }

.s3-t2-arrow {
  flex: none;
  width: 28px;
  height: 57px;
  margin: 124px 21px 0 16px;
}

/* AI 三大領域：圖片 + 三個說明框（寬 448 x 高 293 的座標） */
.s3-orb {
  position: relative;
  flex: 0 1 448px;
  aspect-ratio: 448 / 293;
  container-type: inline-size;
}
.s3-orb-art {
  position: absolute;
  left: calc(53 / 448 * 100%);
  top: calc(5 / 293 * 100%);
  width: calc(318 / 448 * 100%);
  container-type: inline-size;
}
.s3-orb-art img { display: block; width: 100%; height: auto; }
.s3-orb-core {
  position: absolute;
  left: 51.1%;
  top: 44.5%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: calc(21 / 318 * 100cqw);
  line-height: 1.2;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 0 4px rgba(0, 0, 0, .55);
}
.s3-orb-box {
  position: absolute;
  padding: calc(8 / 448 * 100cqw);
  border-radius: 8px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 2px 6px rgba(0, 40, 120, .2);
  text-align: left;
}
.s3-orb-box--infra { left: calc(250 / 448 * 100%); top: calc(3 / 293 * 100%); width: calc(148 / 448 * 100%); --c: #b64926; }
.s3-orb-box--soft  { left: 0;                       top: calc(179 / 293 * 100%); width: calc(112 / 448 * 100%); --c: #0070c0; }
.s3-orb-box--svc   { left: calc(324 / 448 * 100%); top: calc(175 / 293 * 100%); width: calc(124 / 448 * 100%); --c: #ff8427; }
.section-3n .s3-orb-box h4 {
  color: var(--c);
  font-size: clamp(14px, calc(20 / 448 * 100cqw), 22px);
  line-height: 1.3;
  font-weight: 700;
}
.section-3n .s3-orb-box p {
  margin-top: 4px;
  color: var(--s3-ink);
  font-size: clamp(11px, calc(13.5 / 448 * 100cqw), 15px);
  line-height: 1.55;
}
.section-3n .s3-orb-box .s3-orb-co {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 30%, transparent)) 1;
  font-weight: 700;
  line-height: 1.45;
}

/* ---------- Tab 3 ---------- */
.s3-t3-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 36px 4px 0 15px;
}
.section-3n .s3-line-card {
  padding: 16px 18px 17px;
  border-radius: 12px;
  background: #fff;
  text-align: center;
}
.section-3n .s3-line-pill {
  display: inline-block;
  min-width: 288px;
  padding: 0 20px;
  border-radius: 23px;
  background: var(--s3-blue);
  color: #fff;
  font-size: 20px;
  line-height: 45px;
  font-weight: 700;
  letter-spacing: .3px;
}
.section-3n .s3-line-title {
  margin-top: 16px;
  color: #000;
  font-size: 16px;
  line-height: 22px;
  font-weight: 700;
}
.s3-line-card .s3x-svg { margin-top: 6px; }

/* ---------- Tab 2/3 RWD ---------- */
@media screen and (max-width: 1199px) {
  .s3-t2-body { margin: 23px 0 0; justify-content: center; }
  .s3-t2-arrow { margin: 124px 12px 0; }
  .s3-t3-body { margin: 30px 0 0; }
  .section-3n .s3-line-pill { min-width: 0; font-size: 18px; }
}

@media screen and (max-width: 991px) {
  .section-3n .s3-big-pill { font-size: 17px; line-height: 40px; padding: 0 18px; }
  .s3-big-pill strong { font-size: 20px; }
  .s3-t2-body { flex-direction: column; align-items: center; }
  .section-3n .s3-bar-card { flex: none; width: 100%; max-width: 480px; }
  .s3-t2-arrow { width: 20px; height: 40px; margin: 14px 0; transform: rotate(90deg); }
  .s3-orb { flex: none; width: 100%; max-width: 520px; }
  .s3-t3-body { grid-template-columns: 1fr; max-width: 520px; margin-left: auto; margin-right: auto; }
}

@media screen and (max-width: 767px) {
  .section-3n .s3-big-pill { display: block; margin-top: 16px; padding: 6px 12px; font-size: 16px; line-height: 24px; border-radius: 18px; }
  .s3-big-pill strong { display: inline-block; font-size: 19px; }
  .section-3n .s3-bar-card { padding: 10px 6px 12px; }
  .s3-legend { grid-template-columns: auto auto; justify-content: space-between; column-gap: 8px; margin: 4px 6px 0 !important; }
  .s3-legend li { font-size: 12px; line-height: 22px; gap: 5px; }
  .s3-legend i { width: 10px; height: 10px; }
  .s3x-text .v { font-size: 17px; }
  .s3x-text .v--hl { font-size: 19px; }

  /* 三大領域：圖在上、說明框改直排 */
  .s3-orb { aspect-ratio: auto; }
  .s3-orb-art { position: relative; left: auto; top: auto; width: 82%; margin: 0 auto; }
  .s3-orb-boxes { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
  .s3-orb-box { position: static; width: auto !important; padding: 10px 12px; }
  .section-3n .s3-orb-box h4 { font-size: 18px; }
  .section-3n .s3-orb-box p { font-size: 15px; }
  .section-3n .s3-orb-box p br { display: none; }
  .section-3n .s3-orb-box .s3-orb-co br { display: inline; }

  .s3-t3-body { gap: 14px; margin-top: 20px; }
  .section-3n .s3-line-card { padding: 12px 6px 10px; }
  .section-3n .s3-line-pill { font-size: 15px; line-height: 36px; padding: 0 14px; }
  .section-3n .s3-line-title { font-size: 14px; margin-top: 10px; }
  .s3x-text text { font-size: 15px; }
  .s3x-text .u { font-size: 15px; }
  .s3x-text .sd { font-size: 14.5px; }
  .s3x-text .c { font-size: 15px; }
}

/* 手機版標題於空白處斷行（例：AI兆元大餅／一檔掌握前三大領域），避免最後一行只剩一個字 */
@media screen and (max-width: 767px) {
  .section-3n .s3-card-title { word-break: keep-all; overflow-wrap: anywhere; }
  .s3-t2-arrow {display: none;}
}

/* =========================================================
   Section 3：Tab 2、Tab 3 圖表動態
   由 js/section-3.js 加上 .s3a-ready（初始隱藏）與 .is-play（播放）
   進入畫面或切回該 tab 時重播
   ========================================================= */
/* Tab 2：左圖淡入 → 箭頭 → 右圖淡入 */
.s3a-ready .s3-bar-card,
.s3a-ready .s3-t2-arrow,
.s3a-ready .s3-orb { opacity: 0; }
.s3a-ready .s3-bar-card,
.s3a-ready .s3-orb { transform: translateY(14px); }
.s3a-ready.is-play .s3-bar-card { animation: s3a-fade-up .7s .1s ease-out forwards; }
.s3a-ready.is-play .s3-t2-arrow { animation: s3a-fade .4s .75s ease-out forwards; }
.s3a-ready.is-play .s3-orb { animation: s3a-fade-up .8s 1s ease-out forwards; margin-top: 12px; }

/* Tab 3：線圖由左往右刷出，左圖刷完後淡入「預估逐季回升」 */
.s3a-ready .s3a-wipe { clip-path: inset(0 100% 0 0); }
.s3a-ready .s3a-callout { opacity: 0; }
.s3a-ready.is-play .s3a-wipe { animation: s3a-wipe 1.8s .2s cubic-bezier(.45, .05, .3, 1) forwards; }
.s3a-ready.is-play .s3a-callout { animation: s3a-fade .5s 2.05s ease-out forwards; }

@keyframes s3a-fade { to { opacity: 1; } }
@keyframes s3a-fade-up { to { opacity: 1; transform: translateY(0); } }
@keyframes s3a-wipe { to { clip-path: inset(0 0 0 0); } }

@media (prefers-reduced-motion: reduce) {
  .s3a-ready .s3-bar-card,
  .s3a-ready .s3-t2-arrow,
  .s3a-ready .s3-orb,
  .s3a-ready .s3a-callout { opacity: 1 !important; transform: none !important; animation: none !important; }
  .s3a-ready .s3a-wipe { clip-path: none !important; animation: none !important; }
}

/* 圖表紫線終點金點：線畫完時淡入（與「約 7,200 美元」同步） */
.s3c-ready .s3c-golddot { opacity: 0; }
.s3c-ready.is-play .s3c-golddot { animation: s3c-fade .4s 2.5s ease-out forwards; }
@media (prefers-reduced-motion: reduce) { .s3c-ready .s3c-golddot { opacity: 1 !important; animation: none !important; } }
