*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1.75;
}
/* 14px、16px、18px 三種字級，對應App的「小、中、大」設定；預設 16px，調整後會在 body 上加 class（fontSize-14/16/18）*/
body.fontSize-14 p {
  font-size: 14px;
}
body.fontSize-14 h1 {
  font-size: 18px;
}
body.fontSize-14 h2 {
  font-size: 15px;
}
body.fontSize-14 .article-cat {
  font-size: 14px;
}
body.fontSize-14 .article-img-caption {
  font-size: 14px;
}
body.fontSize-14 .author-name {
  font-size: 12px;
}
body.fontSize-14 .meta-info {
  font-size: 12px;
}
body.fontSize-16 p {
  font-size: 16px;
}
body.fontSize-16 h1 {
  font-size: 20px;
}
body.fontSize-16 h2 {
  font-size: 17px;
}
body.fontSize-16 .article-cat {
  font-size: 16px;
}
body.fontSize-16 .article-img-caption {
  font-size: 15px;
}
body.fontSize-16 .author-name {
  font-size: 14px;
}
body.fontSize-16 .meta-info {
  font-size: 14px;
}
body.fontSize-18 p {
  font-size: 18px;
}
body.fontSize-18 h1 {
  font-size: 22px;
}
body.fontSize-18 h2 {
  font-size: 19px;
}
body.fontSize-18 .article-cat {
  font-size: 18px;
}
body.fontSize-18 .article-img-caption {
  font-size: 17px;
}
body.fontSize-18 .author-name {
  font-size: 16px;
}
body.fontSize-18 .meta-info {
  font-size: 16px;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
img {
  max-width: 100%;
}

:root {
  --navy: #972018;
  --red: #c4501e;
  --bg: #faf7f5;
  --bg2: #f2ebe4;
  --muted: #7a5a50;
  --border: #e4d4cc;
  --max: 1200px;
  --text: #251510;
  --c-cover: #972018;
  --c-finance: #972018;
  --c-globe: #972018;
  --c-backpack: #972018;
  --c-bilingual: #972018;
  --c-expert: #972018;
  --c-trend: #972018;
  --c-project: #c0987e;
  --cat: var(--c-cover);
  --footer-bg: #1c0c06;
  --section-gap: 40px;
  --section-gap-sm: 28px;
  --cat-hd-bg: #972018;
  --ft-h5-color: #d4906a;
  --earth-yellow-dark: #c4501e;
  --earth-yellow-light: #e8a078;
  /* nav 內容自然寬度（含 padding 0 32px）—— 改動 nav 項目時請重抓 */
  --nav-content-width: 1100px;
  /* bottom-nav 實際高度（含 safe-area）；common.js 會用 offsetHeight 精確覆寫此值 */
  --bnav-h: calc(64px + env(safe-area-inset-bottom, 0px));
}

#sticky-top {
  position: sticky;
  top: 0;
  z-index: 200;
}

/* ─── HEADER ─── */
.site-header {
  position: relative;
  z-index: auto;
  background: #c82010;
}
.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 32px;
  position: relative;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-right a {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.header-right a:hover {
  color: #fff;
}
.hamburger {
  display: none;
}
/* hamburger → X when open */
.hamburger.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}
.hamburger span {
  transition:
    transform 0.25s,
    opacity 0.2s;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-zh {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
}
.logo-sep {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.25);
}
.logo-en {
  font-size: 14px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.08em;
  line-height: 1;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
}
.logo-en span {
  display: block;
  line-height: 1.15;
}
.logo-nw-mark {
  display: block;
  height: 28px;
  width: auto;
  flex-shrink: 0;
  align-self: center;
}
.mobile-logo .logo-nw-mark {
  height: 22px;
}

/* Logo wordmark：HTML 裡的文字 span 用 clip 視覺隱藏（仍在 DOM，搜尋讀得到），
   實際畫面用 ::after 帶入 logo.svg，跨 in-app browser 完全不會跑版 */
.site-logo .logo-zh,
.site-logo .logo-sep,
.site-logo .logo-en,
.mobile-logo .logo-zh,
.mobile-logo .logo-sep,
.mobile-logo .logo-en {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.site-logo::after,
.mobile-logo::after {
  content: "";
  display: block;
  flex-shrink: 0;
  background: url("https://imgcdn.cna.com.tw/www/newsworld/assets/img/logo.svg") no-repeat center / contain;
}
.site-logo::after {
  width: 215px;
  height: 36px;
}
.mobile-logo::after {
  width: 167px;
  height: 28px;
}
/* Desktop nav */
.site-nav {
  background: #972018;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.nav-list {
  display: flex;
  list-style: none;
  padding: 0 32px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-list::-webkit-scrollbar {
  display: none;
}
.nav-list li a {
  display: block;
  padding: 8px 16px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-bottom: 3px solid transparent;
  color: rgba(255, 255, 255, 0.9);
  transition:
    color 0.2s,
    border-color 0.2s;
}
.nav-list li a:hover {
  color: #e8a078;
  border-bottom-color: rgba(255, 255, 255, 0.4);
}
.nav-list li a.active {
  color: #fff;
  border-bottom-color: #e8a078;
}
.nav-list li:has(.nav-subscribe) {
  display: flex;
  align-items: center;
}
.nav-list .nav-subscribe {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 6px 12px;
  margin-left: 8px;
  line-height: 1;
  font-size: 16px;
}
.nav-list .nav-subscribe:hover {
  background: rgba(255, 255, 255, 0.42);
  color: #fff;
  border-color: var(--red);
  border-bottom-color: transparent;
}
/* Search panel – desktop default */
.mob-search-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9500;
  background: var(--bg, #faf7f5);
  border-bottom: 2px solid var(--red, #c4501e);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  transform: translateY(-110%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.mob-search-panel.open {
  transform: translateY(0);
  pointer-events: auto;
}

.search-icon {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7) !important;
}
.search-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}
/* ─── MOBILE DRAWER ─────────────────────────────── */
.mob-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 8000;
  pointer-events: none;
  visibility: hidden;
}
.mob-drawer.open {
  pointer-events: auto;
  visibility: visible;
}
.mob-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s;
}
.mob-drawer.open .mob-drawer-overlay {
  background: rgba(0, 0, 0, 0.55);
}
.mob-drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 288px;
  background: var(--bg, #faf7f5);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.mob-drawer.open .mob-drawer-panel {
  transform: translateX(0);
}
.mob-drawer-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e4d4cc);
  background: var(--bg);
  flex-shrink: 0;
}
.mob-drawer-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy, #972018);
  letter-spacing: 0.05em;
}
.mob-drawer-close {
  background: none;
  border: none;
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #251510);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s;
}
.mob-drawer-close:hover {
  color: var(--red, #c4501e);
}
.mob-drawer-nav {
  list-style: none;
  padding: 8px 0;
  margin: 0;
  flex-shrink: 0;
}
.mob-drawer-nav li a {
  display: block;
  padding: 13px 20px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text, #251510);
  letter-spacing: 0.04em;
  border-left: 3px solid transparent;
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}
.mob-drawer-nav li a:hover {
  color: var(--red, #c4501e);
  border-left-color: var(--red, #c4501e);
  background: var(--bg2, #f2ebe4);
}
.mob-drawer-divider {
  height: 1px;
  background: var(--border, #e4d4cc);
  margin: 4px 20px;
  flex-shrink: 0;
}
.mob-drawer-sub {
  list-style: none;
  padding: 4px 0;
  margin: 0;
  flex-shrink: 0;
}
.mob-drawer-sub li a {
  display: block;
  padding: 12px 20px;
  font-size: 16px;
  color: var(--muted, #7a5a50);
  transition: color 0.15s;
}
.mob-drawer-sub li a:hover {
  color: var(--text);
}
.mob-drawer-sub .drawer-subscribe {
  color: var(--red, #c4501e) !important;
  font-weight: 700;
}
.mobile-icon-btn {
  display: none;
  color: rgba(255, 255, 255, 0.8);
  align-items: center;
}
.mobile-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.mob-sp-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 24px;
  height: 60px;
}
.mob-sp-inner svg {
  width: 20px;
  height: 20px;
  stroke: var(--muted, #7a5a50);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}
.mob-sp-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 18px;
  color: var(--text, #251510);
  outline: none;
}
.mob-sp-input::placeholder {
  color: var(--muted, #7a5a50);
}
.mob-sp-cancel {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--muted, #7a5a50);
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.mob-sp-cancel:hover {
  color: var(--text);
}
.mobile-search-btn {
  display: none;
}
.mobile-logo {
  display: none;
}
/* Mobile-only: cat-tabs */
.cat-tabs {
  display: none;
}
/* ─── EXPERT ─── */
.expert-sec {
  padding: var(--section-gap) 0;
  background: #fff;
}
.expert-sec .sec-more {
  color: #4a4a4a !important;
}
.expert-sec .sec-more:hover {
  color: var(--c-expert) !important;
  text-decoration: none;
}
.expert-list {
  list-style: none;
  margin-top: 16px;
}
.exp-item {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 16px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.exp-item:first-child {
  padding-top: 0;
}
.exp-item:last-child {
  border-bottom: none;
}
.exp-item:hover .exp-title {
  color: var(--red);
}
.exp-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}
.exp-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.exp-date {
  font-size: 14px;
  color: var(--muted);
  text-align: right;
}
/* ─── MAIN BODY ─── */
.body-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

/* ─── FOOTER ─── */
.site-footer {
  background: linear-gradient(180deg, #1c0c06 0%, #120604 100%);
  color: rgba(255, 255, 255, 0.9);
  margin-top: 32px;
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 200px 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 36px;
  font-size: 16px;
}
.ft-brand .logo-zh {
  color: var(--ft-h5-color, #e5d5c5);
  font-size: 16px;
  font-weight: 700;
}
.ft-brand .logo-en {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.1em;
  margin-top: 3px;
  margin-bottom: 14px;
}
.ft-brand p {
  font-size: 16px;
  line-height: 1.75;
}
.ft-col h5 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ft-h5-color, #e5d5c5);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.ft-col ul {
  list-style: none;
}
.ft-col ul li {
  margin-bottom: 9px;
}
.ft-col ul li a {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.2s;
}
.ft-col ul li a:hover {
  color: #fff;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.footer-bottom a {
  color: rgba(255, 255, 255, 0.45);
  margin-left: 16px;
}
.footer-bottom a:hover {
  color: #fff;
}
/* Mobile footer (hidden on desktop) */
.ft-logo {
  display: none;
}
.ft-desc {
  display: none;
}
.ft-links-mob {
  display: none;
}
.ft-bottom-mob {
  display: none;
}
/* ─── BOTTOM NAV (hidden on desktop) ─── */
.bottom-nav {
  display: none;
}
.sidebar-ad-pc {
  width: 300px;
  height: 600px;
}
@media screen and (max-width: 1024px) {
  .sidebar-ad-pc {
    display: none;
  }
}
@media (min-width: 769px) and (max-width: 1200px) {
  .header-main {
    padding: 0 24px;
  }
  .nav-list {
    padding: 0 12px;
    width: auto;
    max-width: none;
    margin: 0;
    justify-content: flex-start;
  }
  .instant-wrapper > .wrapper {
    padding-left: 22px;
    padding-right: 12px;
  }
  .nav-list li a {
    font-size: 16px;
    padding: 8px 10px;
    white-space: nowrap;
  }
  .exp-item {
    grid-template-columns: 1fr;
  }
  .exp-img {
    display: none;
  }
  /* Body */
  .body-grid {
    grid-template-columns: 1fr !important;
  }
  .body-grid--list-feat .list-feat-row .sb-block--feat-pair {
    display: none;
  }
  .body-grid--list-feat > main {
    grid-row: auto;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 28px !important;
  }
  .ft-brand {
    display: none;
  }
}
@media (max-width: 768px) {
  .site-nav {
    display: none;
  }
  body {
    font-size: 16px;
    padding-bottom: 64px;
  }
  .header-main {
    height: 52px;
    padding: 0 16px;
  }
  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
    cursor: pointer;
    background: none;
    border: none;
  }
  .hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 1px;
  }
  .site-logo {
    display: none;
  }

  /* Header */
  .header-right {
    display: none;
  }

  .mob-drawer {
    display: block;
  }

  .mob-sp-inner {
    padding: 10px 16px;
    height: 52px;
    gap: 8px;
  }
  .mob-sp-inner svg {
    width: 18px;
    height: 18px;
  }
  .mob-sp-input {
    font-size: 16px;
  }
  .mob-sp-cancel {
    font-size: 15px;
  }
  /* fix button default bg for search trigger */
  button.mobile-search-btn {
    background: none;
    border: none;
    cursor: pointer;
  }
  /* Mobile: tighter search panel */
  .mobile-search-btn,
  .mobile-icon-btn {
    display: flex;
    align-items: center;
    /* 漢堡移除後，.mobile-search-btn 變成 .header-main 唯一的 flex 子元素，
       space-between 會把它推到 flex-start（左邊）；用 margin-left: auto 拉回右邊 */
    margin-left: auto;
  }
  .mobile-search-btn svg,
  .mobile-icon-btn svg {
    width: 20px;
    height: 20px;
    stroke: rgba(255, 255, 255, 0.8);
    fill: none;
    stroke-width: 2;
  }

  .mobile-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
  .mobile-logo .logo-zh {
    font-size: 17px;
    min-width: 72px;
  }
  .mobile-logo .logo-sep {
    height: 20px;
  }
  .mobile-logo .logo-en {
    font-size: 12px;
  }
  /* Mobile-only: cat-tabs */
  .cat-tabs {
    display: flex;
    align-items: center;
    overflow-x: auto;
    background: #972018;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px 8px 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .cat-tabs::-webkit-scrollbar {
    display: none;
  }
  .cat-tab {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.04em;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
  }
  .cat-tab.active {
    color: #fff;
    border-bottom-color: #e8a078;
  }
  .cat-tab.cat-tab-subscribe {
    color: rgba(255, 255, 255, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 5px 14px;
    margin-left: 4px;
    flex-shrink: 0;
    align-self: center;
    line-height: 1;
    display: inline-flex;
    align-items: center;
  }
  .cat-tab.cat-tab-subscribe:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.75);
    color: #fff;
  }
  /* Expert */
  .expert-sec {
    padding: var(--section-gap-sm) 0;
  }
  .expert-sec .sec-hd {
    padding: 16px 16px 10px;
  }
  .expert-list {
    padding: 0 16px;
    margin-top: 12px;
  }
  .exp-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 0;
  }
  .exp-name {
    font-size: 14px;
    margin-bottom: 5px;
  }
  /* 與側欄／手機區 .pop-title 同為 16px */
  .exp-title {
    font-size: 16px;
  }
  .exp-date {
    display: none;
  }
  /* Sec-hd: add horizontal padding on mobile */
  .body-grid {
    display: block;
  }
  .body-grid--list-feat > main {
    grid-row: 1;
  }
  body.cat-cover .wrap:has(.body-grid--list-feat) {
    padding-top: 40px;
  }
  /* Footer */
  .site-footer {
    padding: 20px 16px 16px;
  }
  .footer-grid {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
    margin-bottom: 24px;
  }
  .ft-brand {
    grid-column: 1 / -1;
  }
  .ft-logo {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
  }
  .ft-desc {
    display: none;
  }
  .ft-links-mob {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px 8px;
    margin-bottom: 14px;
  }
  .ft-mob-sec {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .ft-mob-h {
    font-size: 11px;
    font-weight: 700;
    color: var(--ft-h5-color, #e5d5c5);
    margin-bottom: 3px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .ft-links-mob a {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
  }
  .ft-links-mob a:hover {
    color: #fff;
  }
  .ft-bottom-mob {
    display: block;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 10px;
    font-size: 12px;
    text-align: center;
  }
  .footer-bottom {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  /* Bottom nav */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    z-index: 300;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    /* iOS gesture bar / Android 系統手勢區：把 nav 背景往下延伸蓋住，
       否則在 iPhone 上 nav 下方會留一條 ~34px 空白 */
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  /* 內容預留 nav 高度的 padding，避免被 nav 蓋住，
     也讓 body 在 mobile Chrome URL bar 收合 reflow 時不會塌陷 */
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0));
  }
  .bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 0 10px;
    font-size: 16px;
    color: var(--muted);
    letter-spacing: 0.03em;
  }
  .bnav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
  }
  .bnav-item.active {
    color: var(--red);
  }
  .bnav-item.active svg {
    stroke: var(--red);
  }
}

@media (max-width: 400px) {
  .logo-nw-mark {
    display: none;
  }
}

/* ─── GDPR BANNER ────────────────────────────────── */
.gdpr-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a1a;
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 7999;
  border-top: 3px solid var(--red, #c4501e);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}
.gdpr-text {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.7;
  margin: 0;
  flex: 1;
}
.gdpr-text a {
  color: var(--red, #c4501e);
  text-decoration: underline;
  font-weight: 600;
}
.gdpr-text a:hover {
  opacity: 0.8;
}
.gdpr-close {
  flex-shrink: 0;
  background: none;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.gdpr-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}
@media (max-width: 767px) {
  .gdpr-banner {
    bottom: 64px;
    padding: 12px 16px;
    gap: 12px;
  }
  .gdpr-text {
    font-size: 14px;
  }
}

/* ─── 行動裝置 APP 下載提示（手機才顯示） ─── */
.app-banner {
  display: none;
  background: var(--bg2);
  color: var(--text);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
}
.app-banner-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.app-banner-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: block;
}
.app-banner-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-banner-btn {
  flex-shrink: 0;
  padding: 4px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 2px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
}
.app-banner-btn:hover,
.app-banner-btn:active {
  background: var(--red);
  color: #fff;
}
@media (max-width: 768px) {
  .app-banner {
    display: flex;
  }
}

/* ─── 快訊 INSTANT NEWS（全站共用） ─── */
/* 底色 #f2decb 暖米色，文字色 #972018 深栗紅（與 nav 同色） */
.instant {
  display: none;
  background-color: #f2decb;
  color: #972018;
  overflow: hidden;
}
.instant.instantOpen {
  display: block;
}
.instant a,
.instant a:link,
.instant a:visited,
.instant a:hover,
.instant a:active {
  color: #972018;
  text-decoration: none;
}
/* .nav-list 用 width: max-content; margin: 0 auto 置中，第一項 left =
   (viewport - nav-content-width)/2 + 32(.nav-list padding-left) + 16(a padding-left)。
   >1200 用 calc 對齊；769-1200、≤768 各自在媒體查詢覆蓋。
   nav 項目改動時請更新 :root 的 --nav-content-width。 */
.instant-wrapper {
  position: relative;
  height: 56px;
}
.instant-wrapper > .wrapper {
  position: absolute;
  inset: 0;
  padding-left: max(48px, calc((100vw - var(--nav-content-width)) / 2 + 48px));
  padding-right: 32px; /* 對齊 .nav-list 的右側 padding */
  display: flex;
  align-items: center;
}
.instant-wrapper > .wrapper > a {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  font-size: 24px;
  font-weight: 600;
}
.instant-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 桌機 hover 暫停動畫 */
@media (min-width: 1025px) {
  .instant-wrapper.marguee:hover [class*="slide"] {
    animation-play-state: paused;
  }
}
/* 手機：.site-nav 在 ≤768 直接 display: none，沒有對齊參照
   → 退回 .wrap 的 16px 內邊；參考 CNA_2018 — 字級變小、最多 2 行、不顯示 ellipsis */
@media (max-width: 768px) {
  .instant-wrapper {
    height: 80px;
  }
  .instant-wrapper > .wrapper {
    padding-left: 16px;
    padding-right: 16px;
  }
  .instant-wrapper > .wrapper > a {
    font-size: 18px;
    line-height: 1.4;
  }
  .instant-text {
    white-space: normal;
    overflow: hidden;
    text-overflow: clip;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: calc(1.4em * 2);
  }
}

/* === 輪播動畫：每則停留 4.8s，N 則總長 N × 4.8s === */
/* 2 則 */
.slide2-1 { animation: instant-slide2-1 9.6s linear infinite; }
.slide2-2 { animation: instant-slide2-2 9.6s linear infinite; }
@keyframes instant-slide2-1 {
  0%, 41.67% { opacity: 1; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-100%); }
  50.1% { opacity: 0; transform: translateY(-100%); }
  50.2% { opacity: 0; transform: translateY(100%); }
  91.67% { opacity: 1; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes instant-slide2-2 {
  0%, 41.67% { opacity: 1; transform: translateY(100%); }
  50%, 91.67% { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(-100%); }
}
/* 3 則 */
.slide3-1 { animation: instant-slide3-1 14.4s linear infinite; }
.slide3-2 { animation: instant-slide3-2 14.4s linear infinite; }
.slide3-3 { animation: instant-slide3-3 14.4s linear infinite; }
@keyframes instant-slide3-1 {
  0%, 27.78% { opacity: 1; transform: translateY(0); }
  33.34% { opacity: 1; transform: translateY(-100%); }
  33.35% { opacity: 0; transform: translateY(-100%); }
  33.36% { opacity: 0; transform: translateY(100%); }
  94.44% { opacity: 1; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes instant-slide3-2 {
  0%, 27.78% { opacity: 1; transform: translateY(100%); }
  33.34%, 61.12% { opacity: 1; transform: translateY(0); }
  66.68% { opacity: 1; transform: translateY(-100%); }
  66.69% { opacity: 0; transform: translateY(-100%); }
  66.7% { opacity: 0; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(100%); }
}
@keyframes instant-slide3-3 {
  0%, 61.12% { opacity: 1; transform: translateY(100%); }
  66.68%, 94.44% { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(-100%); }
}
/* 4 則 */
.slide4-1 { animation: instant-slide4-1 19.2s linear infinite; }
.slide4-2 { animation: instant-slide4-2 19.2s linear infinite; }
.slide4-3 { animation: instant-slide4-3 19.2s linear infinite; }
.slide4-4 { animation: instant-slide4-4 19.2s linear infinite; }
@keyframes instant-slide4-1 {
  0%, 20.83% { opacity: 1; transform: translateY(0); }
  25% { opacity: 1; transform: translateY(-100%); }
  25.1% { opacity: 0; transform: translateY(-100%); }
  25.2% { opacity: 0; transform: translateY(100%); }
  95.83% { opacity: 1; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes instant-slide4-2 {
  0%, 20.83% { opacity: 1; transform: translateY(100%); }
  25%, 45.83% { opacity: 1; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-100%); }
  50.1% { opacity: 0; transform: translateY(-100%); }
  50.2% { opacity: 0; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(100%); }
}
@keyframes instant-slide4-3 {
  0%, 45.83% { opacity: 1; transform: translateY(100%); }
  50%, 70.83% { opacity: 1; transform: translateY(0); }
  75% { opacity: 1; transform: translateY(-100%); }
  75.1% { opacity: 0; transform: translateY(-100%); }
  75.2% { opacity: 0; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(100%); }
}
@keyframes instant-slide4-4 {
  0%, 70.83% { opacity: 1; transform: translateY(100%); }
  75%, 95.83% { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(-100%); }
}
/* 5 則 */
.slide5-1 { animation: instant-slide5-1 24s linear infinite; }
.slide5-2 { animation: instant-slide5-2 24s linear infinite; }
.slide5-3 { animation: instant-slide5-3 24s linear infinite; }
.slide5-4 { animation: instant-slide5-4 24s linear infinite; }
.slide5-5 { animation: instant-slide5-5 24s linear infinite; }
@keyframes instant-slide5-1 {
  0%, 16.67% { opacity: 1; transform: translateY(0); }
  20% { opacity: 1; transform: translateY(-100%); }
  20.1% { opacity: 0; transform: translateY(-100%); }
  20.2% { opacity: 0; transform: translateY(100%); }
  96.67% { opacity: 1; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes instant-slide5-2 {
  0%, 16.67% { opacity: 1; transform: translateY(100%); }
  20%, 36.67% { opacity: 1; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-100%); }
  40.1% { opacity: 0; transform: translateY(-100%); }
  40.2% { opacity: 0; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(100%); }
}
@keyframes instant-slide5-3 {
  0%, 36.67% { opacity: 1; transform: translateY(100%); }
  40%, 56.67% { opacity: 1; transform: translateY(0); }
  60% { opacity: 1; transform: translateY(-100%); }
  60.1% { opacity: 0; transform: translateY(-100%); }
  60.2% { opacity: 0; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(100%); }
}
@keyframes instant-slide5-4 {
  0%, 56.67% { opacity: 1; transform: translateY(100%); }
  60%, 76.67% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(-100%); }
  80.1% { opacity: 0; transform: translateY(-100%); }
  80.2% { opacity: 0; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(100%); }
}
@keyframes instant-slide5-5 {
  0%, 76.67% { opacity: 1; transform: translateY(100%); }
  80%, 96.67% { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(-100%); }
}
/* 6 則 */
.slide6-1 { animation: instant-slide6-1 28.8s linear infinite; }
.slide6-2 { animation: instant-slide6-2 28.8s linear infinite; }
.slide6-3 { animation: instant-slide6-3 28.8s linear infinite; }
.slide6-4 { animation: instant-slide6-4 28.8s linear infinite; }
.slide6-5 { animation: instant-slide6-5 28.8s linear infinite; }
.slide6-6 { animation: instant-slide6-6 28.8s linear infinite; }
@keyframes instant-slide6-1 {
  0%, 13.89% { opacity: 1; transform: translateY(0); }
  16.67% { opacity: 1; transform: translateY(-100%); }
  16.77% { opacity: 0; transform: translateY(-100%); }
  16.87% { opacity: 0; transform: translateY(100%); }
  97.22% { opacity: 1; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes instant-slide6-2 {
  0%, 13.89% { opacity: 1; transform: translateY(100%); }
  16.67%, 30.55% { opacity: 1; transform: translateY(0); }
  33.33% { opacity: 1; transform: translateY(-100%); }
  33.43% { opacity: 0; transform: translateY(-100%); }
  33.53% { opacity: 0; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(100%); }
}
@keyframes instant-slide6-3 {
  0%, 30.55% { opacity: 1; transform: translateY(100%); }
  33.33%, 47.22% { opacity: 1; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-100%); }
  50.1% { opacity: 0; transform: translateY(-100%); }
  50.2% { opacity: 0; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(100%); }
}
@keyframes instant-slide6-4 {
  0%, 47.22% { opacity: 1; transform: translateY(100%); }
  50%, 63.89% { opacity: 1; transform: translateY(0); }
  66.67% { opacity: 1; transform: translateY(-100%); }
  66.77% { opacity: 0; transform: translateY(-100%); }
  66.87% { opacity: 0; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(100%); }
}
@keyframes instant-slide6-5 {
  0%, 63.89% { opacity: 1; transform: translateY(100%); }
  66.67%, 80.55% { opacity: 1; transform: translateY(0); }
  83.33% { opacity: 1; transform: translateY(-100%); }
  83.43% { opacity: 0; transform: translateY(-100%); }
  83.53% { opacity: 0; transform: translateY(100%); }
  100% { opacity: 1; transform: translateY(100%); }
}
@keyframes instant-slide6-6 {
  0%, 80.55% { opacity: 1; transform: translateY(100%); }
  83.33%, 97.22% { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(-100%); }
}
