/* 字型：Noto Sans TC（Google Fonts）
   已移除原本的 @import：@import 會讓整份 CSS 等 Google 字型檔回來，連帶延後所有 JS 執行，
   造成換頁時 header／footer 晚約 1 秒才出現。字型改由 header.js 以 <link> 非同步載入。 */

/* ==========================================================================
   site.css｜全站共用（所有頁面都會載入）
   設計變數、基本設定、Header／導覽、公告倒數、Footer、浮動按鈕、諮詢表單、對話框
   首頁專屬區塊已移到 home.css；內頁版型請見 article.css
   ========================================================================== */

/* IELTS site styles. Original cascade order preserved. */

/* ===== styles ===== */
/* 01 / DESIGN SYSTEM, NAVIGATION & SHARED COMPONENTS
   Editorial IELTS · four authored modules, no legacy theme overrides. */
:root {
  --red: #c8102e;
  --bright: #d71920;
  --deep: #8e1024;
  --ink: #202020;
  --muted: #5e5e5e;
  --paper: #fff;
  --gray: #f4f4f4;
  --line: #292929;
  --soft-line: #20202030;
  --gutter: clamp(20px, 4.5vw, 80px);
  --section-space: clamp(64px, 7vw, 112px);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
  /* 換頁轉場時間（說明見檔案最後「換頁銜接」） */
  --pt-in: 0.3s;
  --pt-out: 0.2s;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  /* 固定預留捲軸位置：長頁、短頁切換時，版面不會因捲軸出現／消失而左右位移 */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  /* 換頁淡入；backwards：動畫結束後不再鎖住 opacity，離場淡出才能生效 */
  animation: pt-fade-in var(--pt-in) ease-out backwards;
}

main {
  overflow-x: clip;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

a:hover {
  color: var(--red);
}

button,
a,
input,
select,
textarea,
summary {
  outline-offset: 5px;
}

:focus-visible {
  outline: 2px solid currentColor;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  text-wrap: balance;
}

h2 {
  font-size: clamp(32px, 3.45vw, 52px);
  line-height: 1.4;
  letter-spacing: -0.045em;
}

h3 {
  font-size: 25px;
  line-height: 1.5;
  letter-spacing: -0.025em;
}

p {
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

.container {
  width: min(1220px, calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

section {
  scroll-margin-top: 90px;
}

.eyebrow,
.topic-label {
  display: block;
  color: var(--red);
  font:
    700 14px/1.6 var(--sans);
  letter-spacing: 0.12em;
  margin-bottom: 22px;
}

.button,
.consult-submit {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 52px;
  padding: 12px 24px;
  border: 1px solid var(--line);
  font-size: 15px;
  font-weight: 700;
  transition:
    background 0.18s,
    color 0.18s;
}

.button-navy {
  background: var(--ink);
  color: #fff !important;
}

.button:hover,
.consult-submit:hover {
  background: var(--deep);
  border-color: var(--deep);
  color: #fff;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--red);
  z-index: 100;
  pointer-events: none;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  background: #fff;
  padding: 12px;
  z-index: 101;
}

.skip-link:focus {
  top: 8px;
}

.announcement {
  background: #f1f1f1;
  color: #c8102e;
  display: flex;
  justify-content: center;
  gap: 22px;
  padding: 8px 20px;
  font-size: 16px;
  letter-spacing: 2px;
}

.announcement a:hover {
  color: #fff;
  text-decoration: underline;
}

.pill-light {
  font-weight: 700;
}

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
  border-bottom: 1px solid var(--line);
  /* 主選單顏色（說明見「主選單（2026-11 改版）」） */
  --menu-bg: #474747;
  --menu-hover: #5f5f5f;
  --menu-text: #fff;
  --line-green: #07883f;
  --line-green-hover: #066f33;
}

.nav-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

.brand-text {
  border-left: 1px solid var(--line);
  padding-left: 15px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.nav-wrap nav {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-left: auto;
  font-size: 16px;
  font-weight: 500;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.search-button {
  padding: 6px;
  display: grid;
  place-items: center;
}

.menu-button {
  display: none;
}

/* ---------- 右下浮動按鈕（桌機；900px 以下改用 .mobile-contact-bar） ---------- */
.floating-actions {
  position: fixed;
  right: 22px;
  bottom: 30px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.floating-actions a,
.floating-actions button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 50px;
  min-height: 50px;
  padding: 5px;
  border: 1px solid #e5e3e0;
  background: #fff;
  color: #292929;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 5px 18px #00000012;
  transition: transform 0.2s, box-shadow 0.2s;
}

.floating-actions a:first-child {
  border-top: 2px solid #a70e28;
}

.floating-actions a:first-child .contact-icon {
  color: #a70e28;
}

.floating-actions a.floating-line {
  background: #fff;
  color: #252525;
  border-top: 2px solid #06c755;
}

.floating-actions a.floating-line .contact-icon {
  color: #06c755;
}

.floating-actions button {
  flex-direction: row;
  min-height: 46px;
  border-color: #262626;
  background: #262626;
  color: #fff;
}

.floating-actions button .contact-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

.floating-actions a:hover,
.floating-actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 22px #00000022;
}

/* ---------- Footer ---------- */
footer {
  padding: 70px 0 25px;
  border-top: 1px solid var(--line);
  background: #101010;
  color: #fff;
}

/* 版面：左欄 LOGO＋標語＋社群，右側四欄連結 */
.footer-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.7fr) repeat(4, minmax(0, 1fr));
  gap: 40px 28px;
}

.footer-grid h2 {
  display: block; /* 蓋過手機版 h2 的 display: contents，保留標題下方間距 */
  font-size: 17px;
  margin-bottom: 20px;
}

/* 連結欄 */
.footer-grid>div:not(.footer-about)>a {
  display: block;
  width: fit-content;
  margin-bottom: 8px;
  font-size: 15px;
  transition: opacity 0.18s;
}

.footer-grid>div:not(.footer-about)>a[href]:hover {
  opacity: 0.7;
}

/* 社群：LOGO 下方，細線分隔；左 LINE QR、右側文字與社群圖示（與 QR 齊上） */
.footer-community {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid #ffffff26;
}

footer .footer-line-qr {
  display: block;
  flex: 0 0 96px;
}

.footer-line-qr img {
  display: block;
  box-sizing: border-box;
  width: 96px;
  height: 96px;
  padding: 5px;
  background: #fff;
}

.footer-social {
  min-width: 0;
}

/* 右側文字：「加入官方 LINE」在上、「與菁英保持聯繫」在下，再接社群圖示 */
footer .footer-line-text {
  display: block;
  width: fit-content;
  margin-top: -3px; /* 抵銷行高上方空白，文字頂端對齊 QR 圖片 */
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  transition: opacity 0.18s;
}

footer .footer-line-text:hover {
  opacity: 0.7;
}

footer .footer-social-label {
  margin: 2px 0 12px;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.footer-social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

footer .social-icon-link {
  display: inline-flex;
  text-decoration: none;
}

.footer-bottom {
  margin-top: 55px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 1600px) {
  :root {
    --gutter: 80px;
  }
}

@media (max-width: 1150px) {
  .nav-wrap {
    gap: 16px;
  }

  .nav-wrap nav {
    gap: 13px;
    font-size: 14px;
  }

  .brand-text {
    font-size: 14px;
  }
}

@media (max-width: 900px) {
  .nav-wrap nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 71px;
    background: #fff;
    padding: 20px var(--gutter);
    max-height: calc(100svh - 72px);
    overflow: auto;
    border-bottom: 1px solid var(--line);
  }

  .nav-wrap nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .menu-button {
    display: grid;
    gap: 6px;
    margin-left: auto;
    padding: 10px;
  }

  .menu-button span {
    width: 23px;
    height: 1px;
    background: var(--ink);
  }

  .nav-actions {
    gap: 8px;
  }

}

@media (max-width: 650px) {
  .announcement {
    font-size: 14px;
    gap: 10px;
  }

  .announcement>span:nth-child(2) {
    display: none;
  }

  .brand-text {
    padding-left: 10px;
  }

  .brand {
    gap: 10px;
  }

  h2 {
    font-size: 32px;
    display: contents;
  }

  h3 {
    font-size: 23px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    margin-top: 35px;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* 諮詢表單：紅白底色維持滿版，文字內容對齊 .container 的左右邊
   --side ＝ .container 外側到螢幕邊的距離（1220px 需與 .container 的最大寬度一致）
   100cqw ＝ 諮詢區本身的寬度（不含捲軸，比 100vw 準確） */
.consultation-section {
  background: var(--red);
  color: #fff;
  border-top: 1px solid var(--line);
  container-type: inline-size;
}

.consultation-layout {
  --side: max(var(--gutter), calc((100cqw - 1220px) / 2));
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  width: 100%;
  max-width: none;
  gap: 0;
}

/* 桌機：左欄文字靠齊左邊、右欄表單靠齊右邊，中間間距不變 */
.consultation-intro {
  padding: 75px 55px 75px var(--side);
  align-self: start;
  position: sticky;
  top: 72px;
}

.consultation-intro .eyebrow,
.consultation-intro>p {
  color: #fff;
}

.consultation-intro h2 {
  font-size: clamp(32px, 3.45vw, 52px);
  line-height: 1.4;
  margin: 25px 0;
}

.consultation-intro>p:not(.eyebrow) {
  font-size: 16px;
  line-height: 1.9;
}

.consultation-points {
  margin: 35px 0;
  border-top: 1px solid #ffffff80;
}

.consultation-points>div {
  display: flex;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid #ffffff80;
  padding: 17px 0;
}

.consultation-points span {
  font-size: 14px;
}

.consultation-points p {
  font-size: 15px;
  color: #fff;
}

.consultation-intro>.existing-student-note {
  font-size: 14px;
}

.consultation-form-card {
  background: #fff;
  color: var(--ink);
  padding: 70px var(--side) 70px 55px;
  border-left: 1px solid var(--line);
  min-width: 0;
}

.form-card-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 25px;
  margin-bottom: 30px;
}

.form-card-head>span {
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--red);
}

.form-card-head h3 {
  font-size: 34px;
  margin: 15px 0;
}

.form-card-head p {
  font-size: 14px;
}

.required-mark {
  color: var(--red);
  margin-left: 4px;
}

.form-group {
  border: 0;
  padding: 0;
  margin: 0 0 28px;
  min-width: 0;
}

.form-group legend {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  padding: 0;
}

.form-group legend small {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.form-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-chips label {
  position: relative;
  cursor: pointer;
}

.form-chips input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.form-chips span {
  display: block;
  padding: 10px 13px;
  border: 1px solid var(--soft-line);
  font-size: 14px;
}

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

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

.source-options {
  display: flex;
  gap: 12px 20px;
  flex-wrap: wrap;
}

.source-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  cursor: pointer;
}

.source-options input,
.consent-label input {
  width: 17px;
  height: 17px;
  accent-color: var(--red);
  flex-shrink: 0;
}

.consultation-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 20px;
}

.form-field {
  min-width: 0;
}

.form-field label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}

.form-field label small {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 10px;
  background: var(--gray);
  border: 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #686868;
}

.form-field>small {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}

.message-field {
  grid-column: 1/-1;
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  margin-top: 20px;
  cursor: pointer;
}

.consent-label input {
  margin-top: 4px;
}

.consent-label a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.form-error {
  font-size: 14px;
  color: var(--red);
  margin-top: 8px;
}

.form-status {
  border: 1px solid var(--line);
  background: var(--gray);
  padding: 20px;
  margin: 22px 0;
}

.form-status p,
.form-status a {
  font-size: 14px;
  margin-top: 10px;
}

.form-status a {
  display: inline-block;
  text-decoration: underline;
  color: var(--red);
}

.consult-submit {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  width: 100%;
  font-size: 16px;
  min-height: 55px;
  margin-top: 30px;
}

@media (max-width: 1100px) {

  .consultation-intro {
    padding-right: 35px;
  }

  .consultation-form-card {
    padding-left: 35px;
  }

  .consultation-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {

  .consultation-layout {
    grid-template-columns: 1fr;
  }

  /* 900px 以下上下排列：左右都對齊 .container */
  .consultation-intro {
    position: static;
    padding: 60px var(--side);
  }

  .consultation-form-card {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 55px var(--side);
  }

  .consultation-fields {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 650px) {

  .consultation-intro {
    padding: 50px var(--side);
  }

  .consultation-intro h2 {
    font-size: 38px;
  }

  .consultation-form-card {
    padding: 40px var(--side);
  }

  .consultation-fields {
    grid-template-columns: 1fr;
  }

  .form-card-head h3 {
    font-size: 30px;
  }

  .form-chips span {
    font-size: 14px;
  }

  .form-field input,
  .form-field select,
  .form-field textarea {
    font-size: 16px;
  }
}

/* ===== updates ===== */
.brand-logo {
  display: block;
  width: 170px;
  object-fit: contain;
  flex-shrink: 0;
}

footer .brand-text,
footer h2,
footer p,
footer a,
footer .footer-bottom {
  color: #fff !important;
}

footer .footer-bottom {
  border-color: #ffffff40;
}

@media (max-width: 900px) {
  .brand-logo {
    width: 120px;
  }

  .header .nav-wrap nav {
    top: 100%;
    border-bottom: 0;
    box-shadow: 0 14px 24px -12px rgba(0, 0, 0, 0.22);
  }

  .header .nav-wrap nav.open {
    border-top: 1px solid #dedede;
  }
}

/* Compact consultation message, desktop tools, footer community and mobile dock. */
#consultation .consultation-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#consultation .message-field {
  grid-column: auto;
}

#consult-email,
#consult-message {
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  line-height: 22px;
}

#consult-message {
  resize: none;
  overflow: auto;
}

.contact-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: block;
}

.mobile-contact-bar {
  display: none;
}

footer .social-icon-link .contact-icon {
  flex: none;
  box-sizing: content-box;
  width: 23px;
  height: 23px;
  padding: 10px;
  border-radius: 10px;
  color: #fff;
  box-shadow: 0 4px 14px #00000020;
}

footer .social-icon-link[data-social="facebook"] .contact-icon {
  background: #1877f2;
}

footer .social-icon-link[data-social="youtube"] .contact-icon {
  background: #f50919;
}

footer .social-icon-link[data-social="instagram"] .contact-icon {
  background: linear-gradient(140deg, #6846c7 0%, #c62d89 45%, #ef6543 75%, #f4b85c 100%);
}

footer .social-icon-link[data-social="tiktok"] .contact-icon {
  background: #17191c;
  border: 1px solid #3b3b3b;
  filter: drop-shadow(-1px 0 #25f4ee) drop-shadow(1px 1px #fe2c55);
}

.social-icon-link[aria-disabled="true"] {
  opacity: 0.55;
  cursor: default;
}

.social-icon-link[href]:hover {
  opacity: 0.7;
}

/* Footer 中尺寸：LOGO 區獨占一列（社群移到右側），下方四欄連結 */
@media (max-width: 1100px) {
  .footer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .footer-about {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 40px;
    align-items: center;
    padding-bottom: 36px;
    border-bottom: 1px solid #ffffff26;
  }

  .footer-about>.footer-community {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 900px) {
  .floating-actions {
    display: none !important;
  }

  /* 手機底部聯絡列 */
  .mobile-contact-bar {
    position: fixed;
    inset: auto 12px calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 6px;
    padding: 6px;
    border: 1px solid #e4e0dc;
    border-radius: 12px;
    background: #faf9f6;
    box-shadow: 0 6px 28px #19191926;
  }

  .mobile-contact-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 50px;
    padding: 11px 8px;
    border-radius: 7px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none;
  }

  .mobile-contact-bar .mobile-line {
    background: transparent;
    color: #262626;
  }

  .mobile-contact-bar .mobile-line .contact-icon {
    color: #06b950;
  }

  .mobile-contact-bar .mobile-booking {
    background: var(--red);
    color: #fff;
    box-shadow: 0 2px 6px #7e102320;
  }

  body {
    padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  }

  html {
    scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 600px) {
  #consultation .consultation-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Footer 手機：LOGO 區上下排列，連結兩欄 */
  /* 兩欄連結依內容寬度排列、整組置中，與上方置中的 LOGO 對齊中軸；
     左右兩側留彈性空白欄，LOGO 與社群區仍橫跨全寬（分隔線與版權線同寬） */
  .footer-grid {
    grid-template-columns: 1fr max-content 56px max-content 1fr;
    gap: 32px 0;
  }

  .footer-grid>div:not(.footer-about):nth-child(even) {
    grid-column: 2;
  }

  .footer-grid>div:not(.footer-about):nth-child(odd) {
    grid-column: 4;
  }

  /* 手機版暫時隱藏四欄連結（認識雅思／報名與成績／課程與備考／認識菁英）
     要恢復顯示：刪除下面這一段即可，上面的兩欄排版設定仍保留 */
  .footer-grid>div:not(.footer-about) {
    display: none;
  }

  .footer-grid h2 {
    margin-bottom: 14px;
  }

  /* LOGO 區拆開（display: contents）：LOGO 留在最上方，
     LINE QR＋社群圖示改排到四欄連結的下方（用 order 調整順序，HTML 不用改） */
  .footer-about {
    display: contents;
  }

  .footer-about>.footer-brand {
    grid-column: 1 / -1;
    order: -1;
    justify-content: center;
    padding-bottom: 28px;
    border-bottom: 1px solid #ffffff26;
  }

  /* 手機版 LOGO 放大（原本 900px 以下為 120px） */
  .footer-brand .brand-logo {
    width: 160px;
  }

  .footer-brand .brand-text {
    font-size: 16px;
  }

  .footer-about>.footer-community {
    grid-column: 1 / -1;
    grid-row: auto; /* 取消 1100px 以下設定的 grid-row: 1 */
    order: 1;
    justify-content: center; /* QR＋社群整組置中 */
    margin-top: 0;
    padding-top: 28px;
    border-top: 1px solid #ffffff26;
  }

  /* 連結隱藏期間：LOGO 下方已有分隔線，社群區不再重複一條（恢復連結時一併刪除這段） */
  .footer-about>.footer-community {
    padding-top: 0;
    border-top: 0;
  }

  /* 版權文字縮小（全站唯一小於 14px 的例外） */
  footer .footer-bottom {
    font-size: 12px;
    line-height: 1.7;
  }
}

/* 超窄手機（375px 以下，例如 iPhone SE）：QR 與社群圖示微縮，四個圖示維持一排 */
@media (max-width: 374px) {
  .footer-community {
    gap: 14px;
  }

  footer .footer-line-qr {
    flex-basis: 80px;
  }

  .footer-line-qr img {
    width: 80px;
    height: 80px;
  }

  .footer-social-icons {
    gap: 6px;
  }

  footer .social-icon-link .contact-icon {
    padding: 9px;
  }
}

.announcement [data-ielts-monthly-countdown] {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  line-height: 1.4;
}

.countdown-label,
.countdown-unit {
  white-space: nowrap;
}

.countdown-digits {
  display: inline-flex;
  gap: 4px;
  letter-spacing: 0;
}

.countdown-digit {
  position: relative;
  display: inline-block;
  width: 29px;
  height: 38px;
  perspective: 200px;
  font:
    700 29px/38px var(--sans);
  color: #fff;
  border-radius: 3px;
  box-shadow: 0 2px 3px #0002;
}

.countdown-digit::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid #65051f88;
  z-index: 5;
  pointer-events: none;
}

.countdown-digit .flip-half {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  backface-visibility: hidden;
  background: #bf0d2b;
}

.countdown-digit .flip-half>span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 38px;
  text-align: center;
}

.countdown-digit .flip-top {
  top: 0;
  border-radius: 3px 3px 0 0;
  transform-origin: bottom;
  background: #ad0b27;
}

.countdown-digit .flip-top>span {
  top: 0;
}

.countdown-digit .flip-bottom {
  bottom: 0;
  border-radius: 0 0 3px 3px;
  transform-origin: top;
}

.countdown-digit .flip-bottom>span {
  bottom: 0;
}

.countdown-digit .flip-old {
  z-index: 3;
  animation: countdown-fold 0.36s ease-in both;
}

.countdown-digit .flip-new {
  z-index: 4;
  animation: countdown-unfold 0.4s 0.36s ease-out both;
}

.countdown-accessible {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes countdown-fold {
  from {
    transform: rotateX(0);
  }

  to {
    transform: rotateX(-90deg);
  }
}

@keyframes countdown-unfold {
  from {
    transform: rotateX(90deg);
  }

  to {
    transform: rotateX(0);
  }
}

@media (max-width: 650px) {
  .announcement [data-ielts-monthly-countdown] {
    font-size: 15px;
    gap: 7px;
    letter-spacing: 1px;
  }

  .countdown-digit {
    width: 24px;
    height: 32px;
    font-size: 24px;
    line-height: 32px;
  }

  .countdown-digit .flip-half>span {
    height: 32px;
  }
}

.announcement .countdown-course-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.announcement .countdown-course-link:hover {
  color: #8e1024;
}

@media (max-width: 760px) {
  .announcement {
    padding: 12px 16px;
  }

  .announcement [data-ielts-monthly-countdown] {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 6px;
    font-size: 15px;
    letter-spacing: 0.5px;
    text-align: center;
  }

  .announcement .countdown-course-link {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 14px;
  }
}

/* ==========================================================================
   主選單（2026-11 改版）：多層下拉、深灰底，第三層往右展開
   顏色集中在 .header 的變數（--menu-bg 等，寫在檔案前段的 .header），日後改色只改那裡
   ========================================================================== */

.nav-list,
.nav-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list {
  display: flex;
  gap: 34px;
}

.nav-list .nav-link,
.nav-list .nav-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--ink);
}

.nav-list .nav-link:hover,
.nav-list .nav-trigger:hover,
.nav-list .nav-item.is-open>.nav-trigger {
  color: var(--red);
}

.nav-caret {
  display: block;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin: 0 2px 4px;
}

/* 子選單預設隱藏，.is-open（點擊）時顯示 */
.nav-list .sub-menu {
  display: none;
}

.nav-list .has-sub.is-open>.sub-menu,
.nav-list .has-sub:has(> .sub-menu :focus-visible)>.sub-menu {
  display: block;
}

.sub-row {
  position: relative;
  display: flex;
  align-items: stretch;
}

.sub-row>a {
  flex: 1;
  min-width: 0;
}

.sub-toggle {
  display: grid;
  place-items: center;
  padding: 0;
}

/* LINE 線上諮詢按鈕 */
.nav-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 18px;
  background: var(--line-green);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.18s;
}

.nav-line:hover {
  background: var(--line-green-hover);
  color: #fff;
}

.nav-line-icon {
  display: block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ---------- 桌機 ---------- */
@media (min-width: 901px) {

  /* 讓選單項目撐滿 header 高度，下拉面板剛好接在 header 底部 */
  .nav-wrap nav {
    align-self: stretch;
  }

  .nav-list {
    height: 100%;
  }

  .nav-list>.nav-item {
    position: relative;
    display: flex;
    align-items: center;
  }

  .nav-list .sub-menu {
    position: absolute;
    z-index: 40;
    min-width: 200px;
    padding: 6px 0;
    background: var(--menu-bg);
    box-shadow: 0 10px 24px #0000002e;
  }

  .nav-list>.nav-item>.sub-menu {
    top: 100%;
    left: -20px;
  }

  .nav-list .sub-menu li {
    position: relative;
  }

  /* 第三層：貼齊第二層右側 */
  .nav-list .sub-menu .sub-menu {
    top: -6px;
    left: 100%;
  }

  .nav-list .sub-menu a {
    display: block;
    padding: 11px 22px;
    color: var(--menu-text);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }

  .nav-list .sub-menu a:hover,
  .nav-list .sub-menu a:focus-visible,
  .nav-list .has-sub.is-open>.sub-row>a {
    background: var(--menu-hover);
    color: var(--menu-text);
  }

  .nav-list .has-sub.is-open>.sub-row>a {
    font-weight: 700;
  }

  .nav-list .sub-menu :focus-visible {
    outline-offset: -3px;
  }

  .nav-list .sub-row>a {
    padding-right: 48px;
  }

  /* ▸ 右三角：有第三層的項目 */
  .sub-toggle {
    position: absolute;
    top: 0;
    right: 8px;
    bottom: 0;
    width: 32px;
    color: var(--menu-text);
  }

  .sub-toggle::before {
    content: "";
    border-left: 5px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
  }
}

/* 滑鼠裝置：滑過即展開（觸控平板改用點擊，避免卡住） */
@media (hover: hover) and (min-width: 901px) {
  .nav-list .has-sub:hover>.sub-menu {
    display: block;
  }

  .nav-list .nav-item.has-sub:hover>.nav-trigger {
    color: var(--red);
  }

  .nav-list .has-sub:hover>.sub-row>a {
    background: var(--menu-hover);
    font-weight: 700;
  }
}

@media (max-width: 1150px) and (min-width: 901px) {
  .nav-list {
    gap: 22px;
  }

  .nav-list .nav-link,
  .nav-list .nav-trigger {
    font-size: 15px;
  }
}

/* 1150px 以下隱藏 LINE 按鈕（中尺寸空間不足；手機版有底部聯絡列） */
@media (max-width: 1150px) {
  .nav-line {
    display: none;
  }
}

/* ---------- 手機（漢堡選單內）：點擊展開的手風琴 ---------- */
@media (max-width: 900px) {
  .nav-list {
    display: block;
  }

  .nav-list>.nav-item {
    border-bottom: 1px solid var(--soft-line);
  }

  .nav-list .nav-link,
  .nav-list .nav-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 14px 0;
    font-size: 16px;
    text-align: left;
  }

  .nav-list>.nav-item>.sub-menu {
    margin-bottom: 14px;
    background: var(--gray);
  }

  .nav-list .sub-menu a {
    display: block;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
  }

  /* 第三層：縮排、白底、左側紅線 */
  .nav-list .sub-menu .sub-menu {
    padding: 4px 0 8px;
    background: #fff;
    border-left: 2px solid var(--red);
    margin: 0 16px 10px;
  }

  .nav-list .sub-menu .sub-menu a {
    padding: 10px 14px;
  }

  .nav-list .has-sub.is-open>.sub-row>a {
    color: var(--red);
    font-weight: 700;
  }

  .sub-toggle {
    flex: 0 0 48px;
    color: var(--ink);
  }

  .sub-toggle::before {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s;
  }

  .has-sub.is-open>.sub-row>.sub-toggle::before {
    transform: rotate(225deg);
  }
}
/* ==========================================================================
   換頁銜接（2026-11）：減少點選單跳頁時的畫面跳動
   ========================================================================== */

/* 1. 換頁轉場（仿 language-center.com.tw 的淡出→換頁→淡入，純 CSS＋原生 JS）
      ‧進場：每頁載入時整頁淡入（純 CSS，第一次繪製就生效，不必等 JS）
      ‧離場：點站內連結時 header.js 幫 <html> 加上 .pt-leaving，整頁淡出後才換頁
      ‧時間集中在 :root 的 --pt-in／--pt-out；body 的淡入動畫寫在檔案開頭的 body；
        有開「減少動態效果」的使用者不套用 */
html.pt-leaving body {
  opacity: 0;
  transition: opacity var(--pt-out) ease-in;
  pointer-events: none;
}

/* 讀取中：畫面中央三顆灰點，大→中→小輪流跑（等待新頁時才出現）
   單一個 ::after 用三組 box-shadow 畫三顆點，不需要額外 HTML；
   放在 <html> 上，不會跟著 body 一起淡出 */
html::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 9999;
  /* 需要 2px 實體大小＋圓角，box-shadow 擴展出來的點才會是圓的 */
  width: 2px;
  height: 2px;
  margin: -1px 0 0 -1px;
  border-radius: 999px;
  background: currentColor;
  color: #d0d0d0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

html.pt-leaving::after {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.15s var(--pt-out);
  animation: pt-dots 0.9s linear infinite;
}

@keyframes pt-dots {
  0%,
  100% {
    box-shadow: -22px 0 0 8px, 0 0 0 5px, 22px 0 0 3px;
  }

  33% {
    box-shadow: -22px 0 0 3px, 0 0 0 8px, 22px 0 0 5px;
  }

  66% {
    box-shadow: -22px 0 0 5px, 0 0 0 3px, 22px 0 0 8px;
  }
}

@keyframes pt-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

  html.pt-leaving body {
    opacity: 1;
    transition: none;
  }

  html.pt-leaving::after {
    animation: none;
    box-shadow: -22px 0 0 5px, 0 0 0 5px, 22px 0 0 5px;
  }
}

/* 2. 頂部公告＋header 由 header.js 插入，載入前先預留高度，
      避免內容先出現、header 再把整頁往下推（上下抖動的主因） */
[data-component="header"]:empty {
  --ph-bar: 54px; /* 公告列高度 */
  display: block;
  min-height: 127px;
  /* 骨架：上方灰色公告列＋白色 header＋底線，插入前看起來就像選單已在位置上 */
  background:
    linear-gradient(#f1f1f1 var(--ph-bar), #fff var(--ph-bar) calc(100% - 1px), var(--line) calc(100% - 1px));
}

@media (max-width: 760px) {
  [data-component="header"]:empty {
    --ph-bar: 62px;
    min-height: 135px;
  }
}

@media (max-width: 650px) {
  [data-component="header"]:empty {
    --ph-bar: 56px;
    min-height: 129px;
  }
}

@media (max-width: 350px) {
  [data-component="header"]:empty {
    --ph-bar: 82px;
    min-height: 155px;
  }
}

/* 3. 固定預留捲軸位置（scrollbar-gutter）已併入檔案開頭的 html 設定 */

/* ==========================================================================
   對話框共用外框（首頁教學摘要 POP、全站站內搜尋）
   ========================================================================== */
dialog {
  width: min(760px, calc(100% - 32px));
  max-height: 85svh;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

dialog::backdrop {
  background: #0009;
}

.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
}

.dialog-top .topic-label {
  margin: 0;
}

.close-dialog {
  font-size: 28px;
}

/* ==========================================================================
   站內搜尋（js/search.js 產生；資料在 js/search-data.js）
   ========================================================================== */
.site-search {
  width: min(860px, calc(100% - 32px));
}

.search-body {
  padding: 32px;
}

.search-body h2 {
  margin-bottom: 24px;
  font-size: 32px;
  line-height: 1.4;
  letter-spacing: -0.03em;
}

.search-label {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
}

.search-field {
  display: flex;
  border: 1px solid var(--line);
  background: #fff;
}

.search-field:focus-within {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

#search-input {
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
  border: 0;
  background: transparent;
  font-size: 16px;
  outline: 0;
}

#search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.search-field button {
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  border-left: 1px solid var(--line);
  background: var(--ink);
  color: #fff;
  transition: background 0.18s;
}

.search-field button:hover {
  background: var(--red);
}

.search-status {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--muted);
}

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

/* 結果 */
.search-hit {
  padding: 20px 0;
  border-bottom: 1px solid var(--soft-line);
}

.search-hit:first-child {
  margin-top: 6px;
}

.search-hit-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 20px;
  color: var(--ink);
}

.search-hit-title small {
  grid-column: 1;
  font-size: 14px;
  color: var(--red);
  letter-spacing: 0.04em;
}

.search-hit-title span {
  grid-column: 1;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

.search-hit-title i {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-style: normal;
  color: var(--red);
  transition: transform 0.18s;
}

.search-hit-title:hover span {
  color: var(--red);
}

.search-hit-title:hover i {
  transform: translate(2px, -2px);
}

.search-snippet {
  display: block;
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

.search-sections {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.search-sections li + li {
  margin-top: 8px;
}

.search-sections a {
  display: block;
  padding: 10px 14px;
  background: #f7f6f3;
  border-left: 2px solid var(--red);
  color: var(--ink);
  transition: background 0.15s;
}

.search-sections a:hover {
  background: #f8edef;
  color: var(--ink);
}

.search-sections strong {
  display: block;
  font-size: 15px;
  line-height: 1.6;
}

.search-sections .search-snippet {
  margin-top: 2px;
}

.site-search mark {
  padding: 0 1px;
  background: linear-gradient(transparent 55%, #f6d4da 55%);
  color: inherit;
  font-weight: 700;
}

/* 預設版面：熱門搜尋＋快速瀏覽 */
.search-default {
  margin-top: 30px;
}

.search-heading {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--red);
}

.search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-chip {
  padding: 8px 14px;
  border: 1px solid var(--soft-line);
  background: #fff;
  font-size: 14px;
  line-height: 1.5;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.search-chip:hover,
.search-chip:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.search-browse {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.search-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 20px;
}

.search-group h4 {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--soft-line);
  font-size: 15px;
}

.search-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-group li + li {
  margin-top: 6px;
}

.search-group a {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.search-group a:hover {
  color: var(--red);
}

@media (max-width: 760px) {
  .search-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .search-body {
    padding: 24px 20px;
  }

  .site-search .dialog-top {
    padding: 12px 20px;
  }

  .search-body h2 {
    display: block; /* 蓋過手機版 h2 的 display: contents，保留下方間距 */
    font-size: 26px;
    margin-bottom: 18px;
  }

  .search-hit-title span {
    font-size: 17px;
  }
}
