/* ==========================================================================
   資訊軟體・東方美學廣告頁（新版 A / B）
   參考《東方美學》上、下兩幅構圖。尺寸以廣告頁寬度為基準 (cqw) 等比縮放。
   「資訊軟體」標題：華康徽宗宮體 (--font-brand-gong)；標語直書：華康龍門石碑 (--font-title-longmen)
   英文大字：Bodoni Moda（SIL Open Font License，檔案自帶於 assets/fonts）
   ========================================================================== */
@font-face {
  font-family: 'BodoniModaAd';
  src: url('assets/fonts/BodoniModa-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
.ad4 {
  container-type: inline-size;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid rgba(138, 158, 146, 0.42);
  box-shadow: 0 18px 46px rgba(24, 42, 54, 0.09);
  background:
    radial-gradient(circle at 18% 82%, rgba(212, 175, 112, 0.16) 0%, transparent 46%),
    linear-gradient(180deg, #b5d2c3 0%, #d3e2d6 36%, #ece5d5 78%, #f0e9da 100%);
  color: #14191c;
}
.ad4::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("assets/images/paper-texture.webp");
  background-size: 360px;
  opacity: 0.28;
  mix-blend-mode: multiply;
  pointer-events: none;
}
/* 宣紙金箔雜點：金色碎箔，下方較密、往上漸淡 */
.ad4::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("assets/images/ad-gold-flecks.webp");
  background-size: 100cqw auto;
  background-position: center bottom;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 38%, #000 76%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 38%, #000 76%);
  pointer-events: none;
  z-index: 1;
}
.ad4-a { aspect-ratio: 1192 / 520; }
.ad4-a::after {
  background-image: url("assets/images/ad-gold-flecks-a.webp");
  /* 中段的碎金箔也要看得到，漸淡幅度比第二張小 */
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.9) 40%, #000 70%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.9) 40%, #000 70%);
}
/* 第一張右側：淡粉暈染與一點金箔 */
.ad4-a-wash {
  position: absolute;
  right: -1.5cqw;
  top: 1.5cqw;
  height: 26cqw;
  width: auto;
  opacity: 0.9;
  z-index: 1;
  pointer-events: none;
}
.ad4-b { aspect-ratio: 1192 / 520; }

.ad4-meta {
  position: absolute;
  left: 4.6cqw;
  right: 4.6cqw;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: max(0.72cqw, 6px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(24, 35, 38, 0.7);
  z-index: 5;
}
.ad4-a .ad4-meta { top: 2.3cqw; color: #cf4a26; }
.ad4-b .ad4-meta { bottom: 1.7cqw; color: #cf4a26; }

.ad4-display {
  position: absolute;
  font-family: 'BodoniModaAd', 'Bodoni Moda', 'Didot', 'Noto Serif TC', serif;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.025em;
  font-variant-ligatures: none;
  white-space: nowrap;
  color: #14191c;
  user-select: none;
}

/* ---------------- 新版 A：海棠花窗（上幅構圖） ---------------- */
.ad4-a .ad4-display {
  left: 4.2cqw;
  top: 4.2cqw;
  font-size: 13.6cqw;
  z-index: 2;
}
.ad4-a-body {
  position: absolute;
  left: 4.6cqw;
  right: 11.3cqw; /* 右緣對齊英文大字 Software craft 的右緣 */
  top: 20.6cqw;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 27.6cqw;
  column-gap: 4.5cqw;
  align-items: stretch;
  z-index: 4;
}
.ad4-a-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.ad4-a-title-row {
  display: flex;
  align-items: flex-end;
  gap: 0.9cqw;
}
.ad4-a-title {
  margin: 0;
  font-family: var(--font-brand-gong);
  font-size: 5.2cqw;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.16em;
  color: #14191c;
}
.ad4-a-micro {
  margin: auto 0 0;
  padding-top: 2.6cqw;
  font-family: var(--font-mono);
  font-size: max(1.02cqw, 7px);
  line-height: 1.6;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #cf4a26;
}
.ad4-a-desc {
  margin: 1cqw 0 -0.45cqw;
  font-family: var(--font-sans);
  font-size: max(1.26cqw, 9px);
  line-height: 1.85;
  color: #2b373d;
}
.ad4-a-chips {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.05cqw;
  padding-top: 0.6cqw;
}
.ad4-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.9cqw;
  padding: 0.66cqw 1.4cqw;
  border: 1px solid rgba(24, 54, 93, 0.3);
  border-radius: 3px;
  background: rgba(255, 252, 246, 0.62);
  font-family: var(--font-sans);
  font-size: max(1.2cqw, 8px);
  letter-spacing: 0.08em;
  color: #18365d;
  white-space: nowrap;
}
.ad4-chip::before {
  content: "";
  width: 0.5cqw;
  height: 0.5cqw;
  background: #c94a29;
  transform: rotate(45deg);
  flex-shrink: 0;
}
/* ---------------- 新版 B：畫軸雙屏與直書（下幅構圖） ---------------- */
.ad4-b-panel {
  position: absolute;
  left: 0;
  width: 61cqw;
  height: 10.4cqw;
  box-sizing: border-box;
  padding: 0 2.4cqw 0 4.6cqw;
  display: grid;
  grid-template-columns: 4.6cqw 21cqw minmax(0, 1fr);
  column-gap: 1.6cqw;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(38, 30, 22, 0.12);
  color: #1d1512;
  z-index: 2;
}
.ad4-b-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("assets/images/paper-texture.webp");
  background-size: 300px;
  mix-blend-mode: multiply;
  opacity: 0.5;
}
.ad4-b-panel.p1 {
  top: 4cqw;
  background: linear-gradient(90deg, #d9502b 0%, #e07d55 42%, #dcb08a 100%);
}
.ad4-b-panel.p2 {
  left: 6.4cqw;
  top: 15.8cqw;
  background: linear-gradient(90deg, #dccdb0 0%, #d6c3a2 100%);
}
.ad4-b-panel-num {
  font-family: 'BodoniModaAd', 'Bodoni Moda', serif;
  font-size: 3.4cqw;
  line-height: 1;
}
.ad4-b-panel-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: max(0.7cqw, 6px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.ad4-b-panel-title {
  margin: 0.7cqw 0 0;
  font-family: var(--font-brand-gong);
  font-size: max(2.1cqw, 12px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.ad4-b-panel p {
  margin: 0;
  padding-left: 1.6cqw;
  border-left: 1px solid rgba(29, 21, 18, 0.38);
  font-family: var(--font-sans);
  font-size: max(1.16cqw, 9px);
  line-height: 1.85;
}
/* 標語：最底部一行、黑色 */
.ad4-b-slogan {
  position: absolute;
  left: 4.6cqw;
  right: 4.6cqw;
  bottom: 4.8cqw;
  margin: 0;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-title-longmen);
  font-weight: 400;
  font-size: 6.2cqw;
  line-height: 1.1;
  white-space: nowrap;
  color: #14191c;
  z-index: 5;
}
.ad4-b-slogan span { letter-spacing: 0.06em; }
/* 右上角：金葉荔枝 */
.ad4-b-lychee {
  position: absolute;
  right: -2cqw;
  top: -2.4cqw;
  height: 45cqw;
  width: auto;
  z-index: 1;
  pointer-events: none;
}
/* 資訊軟體頁：拿掉頁首標題區後，廣告頁直接接在導覽列下方 */
#softwareAdShowcase {
  padding-top: calc(var(--header-h) + 2rem);
}
/* 整張廣告頁可點（首頁輪播用） */
.ad4-link {
  position: absolute;
  inset: 0;
  z-index: 6;
}
