/* ============================================================
   digital.css — /digital 特舍數位 TS Digital 頁面樣式
   依賴 shared.css 的設計 tokens（顏色、字體、--header-height）。
   此頁使用自己的 nav / footer（TS Digital 子品牌），
   不載入 header.css / footer.css / fab.css。
   ============================================================ */

:root {
  /* 內容欄 1200px 置中，兩側至少留 48px */
  --pad-x: max(48px, calc((100% - 1200px) / 2));
  /* 字級旋鈕：跟隨 shared.css 的 --font-scale。
     乘 0.8 做正規化——預設 --font-scale: 1.25 時 --fs-scale = 1，
     維持本頁原設計尺寸；調整 --font-scale 時本頁字級等比跟進 */
  --fs-scale: calc(var(--font-scale) * 1);
}

html { scroll-behavior: smooth; }

body {
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

strong { color: var(--color-text-primary); }

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border-tertiary);
  padding: 0 var(--pad-x);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: calc(14px * var(--fs-scale));
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-primary);
  text-decoration: none;
}

.nav-logo span {
  color: var(--color-header-gold);
}

.nav-contact {
  font-size: calc(13px * var(--fs-scale));
  letter-spacing: 0.08em;
  color: var(--color-text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-text-primary);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

.nav-contact:hover {
  color: var(--color-header-gold);
  border-color: var(--color-header-gold);
}

/* HERO（覆蓋 shared.css 的 .hero 版型：此頁 hero 為整寬區塊） */
.hero {
  display: block;
  gap: 0;
  border-bottom: none;
  padding: calc(var(--header-height) + 100px) var(--pad-x) 120px;
}

.hero > * { max-width: 1400px; }

.hero-eyebrow {
  font-size: calc(13px * var(--fs-scale));
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #444;
  margin-bottom: 32px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(calc(40px * var(--fs-scale)), 6vw, calc(72px * var(--fs-scale)));
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
  color: var(--color-text-primary);
}

.hero-title em {
  font-style: italic;
  color: var(--color-header-gold);
}

#typewriter-cursor {
  color: var(--color-header-gold);
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* 覆蓋 shared.css 的 .hero-desc（字級、行寬不同） */
.hero-desc {
  font-size: calc(16px * var(--fs-scale));
  color: #444;
  max-width: 880px;
  line-height: 1.8;
  letter-spacing: normal;
  margin-bottom: 48px;
}

/* 對齊主站 .btn-dark（shared.css)：13px 28px、0.14em、hover 墨色 */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-text-primary);
  color: var(--color-background-primary);
  font-family: var(--font-sans);
  font-size: calc(13px * var(--fs-scale));
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 13px 28px;
  transition: background 0.2s, color 0.2s;
}

.hero-cta:hover { background: var(--color-ink-hover); }

/* SECTION */
section {
  padding: 100px var(--pad-x);
  border-top: 1px solid var(--color-border-tertiary);
}

section > *,
.contact-section > * {
  max-width: 1200px;
}

.section-alt {
  background: var(--color-background-secondary);
}

.section-label {
  font-size: calc(13px * var(--fs-scale));
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #444;
  margin-bottom: 48px;
}

/* 共用文字樣式 */
.lead-title {
  font-family: var(--font-serif);
  font-size: clamp(calc(20px * var(--fs-scale)), 2.5vw, calc(28px * var(--fs-scale)));
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-primary);
  margin-bottom: 24px;
}

.lead-title--space { margin-bottom: 64px; }

.body-text {
  font-size: calc(15px * var(--fs-scale));
  color: #222;
  line-height: 1.9;
}

.body-text--sm { font-size: calc(14px * var(--fs-scale)); }

.note-title {
  font-size: calc(13px * var(--fs-scale));
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 12px;
}

.section-intro {
  max-width: 640px;
  margin-bottom: 64px;
}

.narrow-block { max-width: 680px; }

.divider {
  border: none;
  border-top: 1px solid var(--color-border-tertiary);
  margin: 48px 0;
}

/* DIFFERENCE */
.diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: 100%;
}

.diff-item {
  padding: 40px 0;
  border-bottom: 1px solid var(--color-border-tertiary);
  transition: background 0.2s;
  cursor: default;
}

.diff-item:nth-child(odd) {
  padding-right: 64px;
  border-right: 1px solid var(--color-border-tertiary);
}

.diff-item:nth-child(even) {
  padding-left: 64px;
}

.diff-item:nth-last-child(-n+2) {
  border-bottom: none;
}

.diff-title {
  font-size: calc(16px * var(--fs-scale));
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  color: var(--color-text-primary);
  transition: color 0.2s;
}

.diff-item:hover .diff-title {
  color: var(--color-header-gold);
}

.diff-desc {
  font-size: calc(14px * var(--fs-scale));
  color: #222;
  line-height: 1.75;
}

.text-link-btn {
  margin-top: 12px;
  background: none;
  border: none;
  padding: 0;
  font-size: calc(12px * var(--fs-scale));
  color: var(--color-header-gold);
  cursor: pointer;
  letter-spacing: 0.06em;
}

/* OPTIONS（三欄比較） */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 16px;
  margin: 40px 0 64px;
  align-items: center;
  width: 100%;
}

.option-card {
  border: 1px solid var(--color-border-tertiary);
  padding: 36px 28px;
  background: var(--color-background-primary);
  cursor: default;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease;
}
.option-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-text-primary);
  transition: width 0.4s ease;
}
.option-card:hover::after {
  width: 100%;
}
.option-card.option-selected {
  border: none;
  position: relative;
  padding: 48px 36px;
}
.option-card.option-selected .border-draw {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.option-card.option-selected .border-draw rect {
  x: 1px;
  y: 1px;
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  fill: none;
  stroke: var(--color-text-primary);
  stroke-width: 2px;
  stroke-dasharray: 0 100;
  stroke-dashoffset: 0;
  transition: stroke-dasharray 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.option-card.option-selected.draw-border .border-draw rect {
  stroke-dasharray: 100 0;
  stroke-dashoffset: 50;
}
.option-card:not(.option-selected) {
  opacity: 0.5;
  filter: grayscale(0.3);
  transition: opacity 0.3s ease, filter 0.3s ease, border-color 0.3s ease;
}
.option-card:not(.option-selected):hover {
  opacity: 0.8;
}
.option-badge {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text-primary);
  color: var(--color-background-primary);
  font-size: calc(10px * var(--fs-scale));
  letter-spacing: 0.15em;
  padding: 4px 14px;
  white-space: nowrap;
}
.option-label {
  font-size: calc(11px * var(--fs-scale));
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}
.option-selected .option-label {
  color: var(--color-header-gold);
  margin-top: 16px;
}
.option-sub {
  font-size: calc(13px * var(--fs-scale));
  color: var(--color-header-gold);
  font-style: italic;
  margin-bottom: 20px;
}
.option-title {
  font-size: calc(18px * var(--fs-scale));
  font-weight: 500;
  margin-bottom: 20px;
  line-height: 1.4;
  color: var(--color-text-primary);
  transition: font-size 0.3s ease;
}
.option-card:hover .option-desc {
  color: var(--color-text-primary);
}
.option-divider {
  width: 32px;
  height: 1px;
  background: var(--color-border-tertiary);
  margin-bottom: 16px;
}
.option-desc {
  font-size: calc(13px * var(--fs-scale));
  color: #444;
  line-height: 1.8;
  transition: color 0.3s ease;
}

/* PLANS */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--color-border-tertiary);
  margin-top: 16px;
}

.plans-grid--two {
  grid-template-columns: repeat(2, 1fr);
}

.plan-card {
  background: var(--color-background-primary);
  padding: 48px 40px 56px;
  position: relative;
  overflow: hidden;
}

.plan-card.featured {
  background: var(--color-text-primary);
  color: var(--color-background-primary);
}

.plan-number {
  font-size: calc(11px * var(--fs-scale));
  letter-spacing: 0.15em;
  color: var(--color-header-gold);
  margin-bottom: 32px;
  display: block;
}

.plan-card.featured .plan-number {
  color: var(--color-header-gold);
}

.plan-name {
  font-family: var(--font-serif);
  font-size: calc(24px * var(--fs-scale));
  font-weight: 400;
  margin-bottom: 8px;
  line-height: 1.2;
  display: inline-block;
  transition: transform 0.3s ease;
  transform-origin: left top;
}

.plan-card:hover .plan-name {
  transform: scale(1.08);
}

.plan-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-header-gold);
  transition: width 0.4s ease;
}

.plan-card:hover::after {
  width: 100%;
}

.plan-tagline {
  font-size: calc(15px * var(--fs-scale));
  color: var(--color-text-secondary);
  margin-bottom: 40px;
  line-height: 1.6;
}

.plan-card.featured .plan-tagline {
  color: #aaa;
}

.plan-price-block {
  margin-bottom: 32px;
}

.plan-price {
  font-size: calc(36px * var(--fs-scale));
  font-weight: 500;
  letter-spacing: -0.02em;
  display: block;
  margin-bottom: 4px;
}

.plan-price--sm { font-size: calc(24px * var(--fs-scale)); }

.plan-price-note {
  font-size: calc(12px * var(--fs-scale));
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.plan-card.featured .plan-price-note {
  color: #999;
}

.plan-divider {
  height: 1px;
  background: var(--color-border-tertiary);
  margin: 32px 0;
}

.plan-card.featured .plan-divider {
  background: #333;
}

.plan-includes {
  list-style: none;
  font-size: calc(13px * var(--fs-scale));
  color: #222;
  line-height: 2;
}

.plan-card.featured .plan-includes {
  color: #bbb;
}

.plan-includes li::before {
  content: '—  ';
  color: var(--color-header-gold);
}

.plans-grid .plan-card {
  display: flex;
  flex-direction: column;
}

.plans-grid .plan-card .plan-divider {
  margin-top: auto;
}

.cta-block { max-width: 700px; }

.cta-title {
  font-size: calc(17px * var(--fs-scale));
  color: var(--color-text-primary);
  line-height: 1.9;
  margin-bottom: 8px;
  font-weight: 500;
}

.cta-desc {
  font-size: calc(16px * var(--fs-scale));
  color: #222;
  line-height: 1.9;
  margin-bottom: 32px;
}

/* CASE */
.case-link {
  font-size: calc(12px * var(--fs-scale));
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-text-primary);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.case-link:hover {
  color: var(--color-header-gold);
  border-color: var(--color-header-gold);
}

.btn-black {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-text-primary);
  color: var(--color-background-primary);
  text-decoration: none;
  padding: 13px 28px;
  font-size: calc(13px * var(--fs-scale));
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s;
}
.btn-black:hover { background: var(--color-ink-hover); }

/* ABOUT（雙欄版型）— 填滿 1200px 內容欄，與其他區塊左右對齊 */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.about-para {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.about-para--lead {
  font-family: var(--font-serif);
  font-size: clamp(calc(18px * var(--fs-scale)), 2vw, calc(24px * var(--fs-scale)));
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text-primary);
  margin-bottom: 32px;
}

.about-para--body {
  font-size: calc(15px * var(--fs-scale));
  color: #222;
  line-height: 1.9;
  margin-bottom: 24px;
}

.about-sub {
  border-top: 1px solid var(--color-border-tertiary);
  padding-top: 40px;
  margin-top: 40px;
}

.address-note {
  font-size: calc(13px * var(--fs-scale));
  color: #444;
  line-height: 1.9;
  margin-bottom: 24px;
}

.about-photo {
  height: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  position: relative;
  background: var(--color-background-secondary);
  border: 1px solid var(--color-border-tertiary);
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.cloud {
  position: absolute;
  font-size: calc(48px * var(--fs-scale));
  pointer-events: none;
  transition: transform 0.1s ease-out;
}

#cloud1 { top: 8%; right: -15%; }
#cloud2 { top: 20%; right: -10%; font-size: calc(32px * var(--fs-scale)); opacity: 0.8; }

/* 網站架構圖 */
#tree-diagram {
  margin-top: 40px;
  font-family: var(--font-sans);
}

.smap-node { opacity: 0; }

.smap-caption {
  font-size: calc(10px * var(--fs-scale));
  color: #999;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.smap-header {
  transform: translateY(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.smap-header-bar {
  background: #e8f0f8;
  border: 1px solid #c5d5e8;
  padding: 10px 20px;
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: calc(12px * var(--fs-scale));
  color: #4a6fa5;
  flex-wrap: wrap;
}

.smap-logo { font-weight: 600; }

.smap-cta {
  border: 1px solid #4a6fa5;
  padding: 4px 12px;
  border-radius: 2px;
}

.smap-line {
  width: 1px;
  height: 20px;
  background: #ccc;
  margin-left: 60px;
  transition: opacity 0.3s ease 0.5s;
}

.smap-line--2 { transition-delay: 1.7s; }

.smap-home {
  transform: translateX(-8px);
  transition: opacity 0.4s ease 0.7s, transform 0.4s ease 0.7s;
}

.smap-home-box {
  border: 1px dashed #ccc;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.smap-row {
  background: #f0ede8;
  border: 1px solid #ddd;
  padding: 8px 16px;
  font-size: calc(12px * var(--fs-scale));
  color: #222;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateX(-12px);
}

.smap-row:nth-child(1) { transition: opacity 0.3s ease 0.9s, transform 0.3s ease 0.9s; }
.smap-row:nth-child(2) { transition: opacity 0.3s ease 1.1s, transform 0.3s ease 1.1s; }
.smap-row:nth-child(3) { transition: opacity 0.3s ease 1.3s, transform 0.3s ease 1.3s; }
.smap-row:nth-child(4) { transition: opacity 0.3s ease 1.5s, transform 0.3s ease 1.5s; }

.smap-num {
  color: #bbb;
  font-size: calc(10px * var(--fs-scale));
}

.smap-sub {
  transform: translateY(8px);
  transition: opacity 0.4s ease 1.9s, transform 0.4s ease 1.9s;
}

.smap-sub .smap-caption { text-align: center; }

.smap-pages {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.smap-page {
  background: #e8f5ef;
  border: 1px solid #a8d5b8;
  padding: 10px 20px;
  font-size: calc(12px * var(--fs-scale));
  font-weight: 500;
  color: #2d7a4f;
  flex: 1;
  text-align: center;
}

.smap-legend {
  display: flex;
  gap: 24px;
  margin-top: 12px;
  font-size: calc(10px * var(--fs-scale));
  color: #999;
  flex-wrap: wrap;
}

.smap-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.smap-swatch {
  width: 12px;
  height: 12px;
  display: inline-block;
}

.smap-swatch--home { background: #f0ede8; border: 1px solid #ddd; }
.smap-swatch--header { background: #e8f0f8; border: 1px solid #c5d5e8; }

/* DISCUSS */
.discuss-item {
  padding: 32px 0;
  border-bottom: 1px solid var(--color-border-tertiary);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  cursor: default;
}
.discuss-item:last-child {
  border-bottom: none;
}
.discuss-item.visible {
  opacity: 1;
  transform: translateY(0);
}
.discuss-title {
  font-size: calc(14px * var(--fs-scale));
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 8px;
  display: inline-block;
  transition: transform 0.3s ease;
  transform-origin: left center;
}
.discuss-item:hover .discuss-title {
  transform: scale(1.05);
}
.discuss-desc {
  font-size: calc(13px * var(--fs-scale));
  color: #333;
  line-height: 1.8;
  transition: color 0.3s ease;
}
.discuss-item:hover .discuss-desc {
  color: var(--color-text-primary);
}
.discuss-item .step-num {
  font-size: calc(13px * var(--fs-scale));
  letter-spacing: 0.15em;
  color: #222;
  margin-bottom: 8px;
  display: block;
  transition: color 0.3s ease;
  font-weight: 500;
}
.discuss-item:hover .step-num {
  color: var(--color-text-primary);
}

.diff-item .emoji {
  font-size: calc(28px * var(--fs-scale));
  margin-bottom: 16px;
  display: inline-block;
  transition: transform 0.6s ease;
}
.diff-item:hover .emoji {
  transform: scale(1.3) rotateY(360deg);
}
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* CONTACT */
.contact-section {
  padding: 100px var(--pad-x);
  border-top: 1px solid var(--color-border-tertiary);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.contact-title {
  font-family: var(--font-serif);
  font-size: clamp(calc(32px * var(--fs-scale)), 4vw, calc(52px * var(--fs-scale)));
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 24px;
}

.contact-desc {
  font-size: calc(14px * var(--fs-scale));
  color: #222;
  line-height: 1.8;
}

.contact-right {
  padding-top: 8px;
  /* 置中於右半欄，避免內容全部靠左、右側大片留白 */
  justify-self: center;
}

.contact-label {
  font-size: calc(11px * var(--fs-scale));
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-header-gold);
  margin-bottom: 16px;
}

.contact-line-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--color-line-green);
  color: var(--color-background-primary);
  text-decoration: none;
  padding: 16px 32px;
  font-size: calc(14px * var(--fs-scale));
  font-weight: 400;
  letter-spacing: 0.06em;
  transition: opacity 0.2s;
  margin-bottom: 24px;
}

.contact-line-btn:hover { opacity: 0.85; }

.contact-note {
  font-size: calc(12px * var(--fs-scale));
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* MODALS */
.contact-panel {
  display: none;
  position: fixed;
  top: var(--header-height);
  right: var(--pad-x);
  z-index: 998;
  background: #fff;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  width: 280px;
  max-width: calc(100vw - 48px);
  border-top: 2px solid var(--color-text-primary);
}

.contact-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 997;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: #fff;
  max-width: 480px;
  width: 90%;
  padding: 48px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: calc(18px * var(--fs-scale));
  cursor: pointer;
  color: #888;
}

.modal-box .modal-close {
  top: 20px;
  right: 24px;
  font-size: calc(20px * var(--fs-scale));
}

.modal-label {
  font-size: calc(11px * var(--fs-scale));
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-header-gold);
  margin-bottom: 16px;
}

.modal-box .modal-label {
  letter-spacing: 0.15em;
  margin-bottom: 20px;
}

.modal-text {
  font-size: calc(14px * var(--fs-scale));
  color: #555;
  line-height: 1.9;
}

.contact-qr {
  width: 120px;
  height: 120px;
  display: block;
  margin: 0 auto 16px;
  image-rendering: pixelated;
}

.contact-id {
  font-size: calc(12px * var(--fs-scale));
  color: #888;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.7;
}

.contact-line-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-line-green);
  color: #fff;
  text-decoration: none;
  padding: 12px;
  font-size: calc(13px * var(--fs-scale));
  letter-spacing: 0.06em;
}

/* FOOTER */
footer {
  background: var(--color-surface-dark);
  color: var(--color-text-secondary);
  position: relative;
}

/* 金色髮絲線，呼應主站 header 的 .gold-line */
footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-header-gold) 30%, var(--color-header-gold) 70%, transparent);
  opacity: 0.5;
}

.footer-inner {
  padding: 80px var(--pad-x) 32px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 64px;
  margin-bottom: 72px;
}

#footer-logo {
  font-family: var(--font-sans);
  font-size: clamp(calc(20px * var(--fs-scale)), 1vw, calc(40px * var(--fs-scale)));
  font-weight: 300;
  letter-spacing: 0.2em;
  color: #e0e0e0;
  line-height: 1;
  margin-bottom: 12px;
  opacity: 0;
}

.footer-tagline {
  font-size: calc(10px * var(--fs-scale));
  letter-spacing: 0.12em;
  color: #777;
  margin-bottom: 24px;
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: calc(10px * var(--fs-scale));
  letter-spacing: 0.08em;
  color: #999;
  border: 1px solid #2a2a2a;
  padding: 9px 16px;
}

/* 呼吸綠點，呼應主站 .rfq-trigger-btn-dot */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 6px rgba(46, 204, 113, 0.45), 0 0 12px rgba(46, 204, 113, 0.25);
  animation: dotBreath 2.8s ease-in-out infinite;
}

@keyframes dotBreath {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.15); opacity: 1; }
}

.footer-cols {
  display: flex;
  gap: 72px;
  flex-shrink: 0;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col-title {
  font-size: calc(12px * var(--fs-scale));
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-header-gold);
  margin-bottom: 8px;
}

.footer-col a {
  font-size: calc(10px * var(--fs-scale));
  color: #999;
  text-decoration: none;
  width: fit-content;
  transition: color 0.2s;
}

.footer-col a:hover { color: #fff; }

.footer-top-btn {
  background: none;
  border: 1px solid #333;
  color: #fff;
  width: 44px;
  height: 44px;
  cursor: pointer;
  font-size: calc(16px * var(--fs-scale));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.3s, color 0.3s;
}

.footer-top-btn:hover {
  border-color: var(--color-header-gold);
  color: var(--color-header-gold);
}

/* 底欄照主站 footer.css 的 .footer-base 規格 */
.footer-base {
  border-top: 0.5px solid #222;
  padding: 16px 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-base-left {
  font-size: calc(10px * var(--fs-scale));
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #888;
  line-height: 1.8;
}

.footer-base-left a {
  color: inherit;
  letter-spacing: 0.04em;
}

.footer-base-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-copyright {
  font-size: calc(10px * var(--fs-scale));
  color: #666;
}

.footer-social {
  display: flex;
  gap: 12px;
  align-items: center;
}

.footer-social a {
  color: #555;
  text-decoration: none;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

.footer-social a:hover { color: var(--color-accent); }

@keyframes digitalFlicker {
  0%   { text-shadow: 0 0 8px rgba(255,255,255,0.3); }
  10%  { opacity: 0.85; }
  15%  { opacity: 1; }
  20%  { opacity: 0.9; text-shadow: 0 0 16px rgba(255,255,255,0.5); }
  25%  { opacity: 1; }
  70%  { text-shadow: 0 0 8px rgba(255,255,255,0.2); }
  72%  { opacity: 0.7; }
  74%  { opacity: 1; }
  100% { text-shadow: 0 0 8px rgba(255,255,255,0.3); }
}

@keyframes fadeInThenFlicker {
  0%   { opacity: 0; }
  30%  { opacity: 1; text-shadow: none; }
  40%  { opacity: 0.85; }
  45%  { opacity: 1; }
  55%  { opacity: 0.9; text-shadow: 0 0 16px rgba(255,255,255,0.5); }
  60%  { opacity: 1; }
  100% { opacity: 1; text-shadow: 0 0 8px rgba(255,255,255,0.3); }
}

#footer-logo.visible-logo {
  animation: fadeInThenFlicker 1.5s ease forwards, digitalFlicker 4s infinite ease-in-out 1.5s;
  color: #e0e0e0;
}

@keyframes bounceIn {
  0% { opacity: 0; transform: translateY(60px); }
  60% { opacity: 1; transform: translateY(-10px); }
  80% { transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.bounce-title {
  opacity: 0;
}

.bounce-title.visible {
  animation: bounceIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* PAGE LOAD ANIMATION */
#ts-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-background-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: loaderOut 0.6s ease 3.5s forwards;
}

.loader-stage {
  display: flex;
  align-items: center;
  opacity: 0;
  animation: loaderIn 0.5s ease 0.2s forwards;
}

/* 單一間距單位 26px：四邊留白 = 字母間距（垂直與水平皆同）
   26 + 30 + 26 + 30 + 26 + 邊框 2 = 140 正方形 */
.loader-box {
  width: 140px;
  height: 140px;
  border: 1px solid transparent; /* 佔位維持尺寸計算，實際框線畫在 ::before */
  padding: 26px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 26px;
  overflow: hidden;
  flex-shrink: 0;
  animation:
    loaderSwallow 0.5s cubic-bezier(0.4, 0, 0.2, 1) 1.0s forwards,
    loaderSquare 0.5s cubic-bezier(0.4, 0, 0.2, 1) 1.7s forwards;
}

/* 框線獨立一層，淡出用 opacity，四邊整體同步消失 */
.loader-box::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid #9f3433;
  pointer-events: none;
  animation:
    loaderInkBorder 0.4s ease 2.3s forwards,
    loaderBorderFade 0.4s ease 3.1s forwards;
}

.loader-row {
  display: flex;
  gap: 26px;
  flex-shrink: 0;
  font-size: 30px; /* loader 為固定幾何（140px 方框），不隨字級縮放 */
  font-weight: 500;
}

/* 每個字母固定 30×30 置中格，讓間距計算完全一致 */
.loader-row span {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.loader-cs { color: var(--color-header-gold); }

.loader-ts {
  color: #9f3433;
  animation:
    loaderGapShrink 0.5s cubic-bezier(0.4, 0, 0.2, 1) 1.7s forwards,
    loaderInkText 0.4s ease 2.3s forwards;
}

/* 30px 字母格與間距同步收縮，T S 才會真正靠攏 */
.loader-ts span {
  animation: loaderCellShrink 0.5s cubic-bezier(0.4, 0, 0.2, 1) 1.7s forwards;
}

.loader-digital {
  width: fit-content;
  max-width: 0;
  overflow: hidden;
  flex-shrink: 0;
  animation: loaderDigitalGrow 0.6s cubic-bezier(0.4, 0, 0.2, 1) 2.4s forwards;
}

.loader-digital span {
  display: inline-block;
  white-space: nowrap;
  padding-left: 20px;
  margin-right: -0.15em; /* 抵銷最後一個字母後的 letter-spacing 空隙 */
  font-size: 30px; /* loader 為固定幾何，不隨字級縮放 */
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--color-header-gold);
  transform: translateX(-110%);
  animation: loaderDigitalSlide 0.6s cubic-bezier(0.4, 0, 0.2, 1) 2.4s forwards;
}

@keyframes loaderIn { to { opacity: 1; } }
/* 84 = 邊框2 + 下留白26 + TS列30 + 上方26（原列間距，CS 恰好被裁切） */
@keyframes loaderSwallow { to { height: 84px; } }
@keyframes loaderSquare { to { width: 84px; padding-left: 8px; padding-right: 8px; } }
@keyframes loaderGapShrink { to { gap: 6px; } }
@keyframes loaderCellShrink { to { width: 22px; } }
@keyframes loaderInkBorder { to { border-color: var(--color-text-primary); } }
@keyframes loaderInkText { to { color: var(--color-text-primary); } }
@keyframes loaderBorderFade { to { opacity: 0; } }
@keyframes loaderDigitalGrow { to { max-width: 300px; } }
@keyframes loaderDigitalSlide { to { transform: translateX(0); } }
@keyframes loaderOut { to { opacity: 0; visibility: hidden; } }

/* 間距工具（取代原本零散的 inline margin） */
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }

/* TABLET */
@media (max-width: 1024px) {
  .options-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .two-col {
    gap: 48px;
  }
}

/* MOBILE（--header-height 75px 由 shared.css 提供） */
@media (max-width: 768px) {
  /* 手機字級跟隨 shared.css 的 --m-font-scale（預設 1 = 原設計尺寸） */
  :root { --pad-x: 24px; --fs-scale: var(--m-font-scale); }
  .hero { padding-top: calc(var(--header-height) + 60px); padding-bottom: 80px; background: var(--color-background-primary); }
  section { padding-top: 72px; padding-bottom: 72px; }

  /* 四個優點 */
  .diff-grid { grid-template-columns: 1fr; width: 100%; }
  .diff-item:nth-child(odd) { padding-right: 0; border-right: none; }
  .diff-item:nth-child(even) { padding-left: 0; }
  .diff-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--color-border-tertiary); }
  .diff-item:last-child { border-bottom: none; }

  /* 服務方案 */
  .plans-grid,
  .plans-grid--two { grid-template-columns: 1fr; }
  .plan-card { padding: 40px 28px 48px; }

  /* 三個選項卡片 */
  .option-card { padding: 32px 24px; }
  .option-card.option-selected { padding: 40px 24px; }

  /* 雙欄變單欄 */
  .two-col { grid-template-columns: 1fr; gap: 48px; }

  /* 照片改方形、雲朵位置調整 */
  .about-photo { aspect-ratio: 1/1; }
  .about-photo img { object-position: center 10%; }
  #cloud1 { top: 0%; right: -60%; }
  #cloud2 { top: 20%; right: -80%; font-size: calc(32px * var(--fs-scale)); opacity: 0.8; }

  /* 子頁面圖示直排 */
  .smap-pages { flex-direction: column; }
  .smap-line { margin-left: 40px; }

  /* 聯絡區塊 */
  .contact-section { grid-template-columns: 1fr; gap: 48px; padding-top: 72px; padding-bottom: 72px; }
  .contact-right { justify-self: stretch; }

  /* 頁尾縮小 */
  #footer-logo { font-size: clamp(calc(18px * var(--fs-scale)), 1vw, calc(32px * var(--fs-scale))); }
  .footer-status { font-size: calc(10px * var(--fs-scale)); }
  .status-dot {
    width: 4px;
    height: 4px;
    box-shadow: 0 0 3px rgba(46, 204, 113, 0.45), 0 0 12px rgba(46, 204, 113, 0.25);
  }
  .footer-inner { padding-top: 56px; padding-bottom: 24px; }
  .footer-top { flex-direction: column; gap: 48px; margin-bottom: 56px; }
  .footer-cols { flex-wrap: wrap; gap: 40px 56px; }
  .footer-top-btn { position: absolute; top: 56px; right: 24px; }
  .footer-base { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 0 32px; }
  .footer-base-left { font-size: calc(10px * var(--fs-scale)); }
  .footer-copyright { font-size: calc(10px * var(--fs-scale)); }
  .footer-base-right { width: 100%; justify-content: space-between; }

  /* 按鈕全寬 */
  .btn-black { width: 100%; justify-content: center; margin-bottom: 40px;}
  .contact-line-btn { width: 100%; justify-content: center; }

  /* hero title 字體縮小 */
  .hero-title { font-size: clamp(calc(28px * var(--fs-scale)), 7vw, calc(48px * var(--fs-scale))); }
}

@media (max-width: 600px) {
  .loader-stage { transform: scale(0.8); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #ts-loader { display: none; }
  .reveal, .discuss-item, .bounce-title {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }
}

/* ── ABOUT：照片底緣對齊第二條分隔線（門市地址區塊的 border-top）──
   兩列 grid：第一列 = 文字 + 品牌網站區塊 / 照片（拉伸填滿列高），
   第二列 = 門市地址區塊。列底就是分隔線位置。
   放在檔尾，蓋過上方 media query 的 .two-col gap 設定。 */
.about-grid { row-gap: 0; }

.about-grid > .about-col {
  grid-column: 1;
  grid-row: 1;
  /* 原本第二個 .about-sub 的 margin-top: 40px 改由此提供，
     讓列底恰好是分隔線 */
  padding-bottom: 40px;
}

.about-grid > .about-photo {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  aspect-ratio: auto;
  min-height: 0;
}

/* 圖片改為絕對定位填滿容器，
   不讓圖片的原始高度撐高第一列（否則列高會被圖片拉開） */
.about-grid > .about-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-grid > .about-sub {
  grid-column: 1;
  grid-row: 2;
  margin-top: 0;
}

@media (max-width: 768px) {
  .about-grid { row-gap: 0; }
  .about-grid > .about-col { grid-column: auto; grid-row: auto; }
  .about-grid > .about-sub { grid-column: auto; grid-row: auto; }
  /* 手機恢復方形照片、排在最後 */
  .about-grid > .about-photo {
    grid-column: auto;
    grid-row: auto;
    align-self: auto;
    aspect-ratio: 1/1;
    order: 3;
  }
}
