/* ==========================================================================
   Directory Opus 繁體中文官網 - 公共樣式 common.css
   主題色：#323536 / #2185F5
   ========================================================================== */

/* ---------- 重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
    "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: #d7dadd;
  background: #17181a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
}

/* ---------- 變數 ---------- */
:root {
  --color-bg: #17181a;
  --color-bg-alt: #1e2023;
  --color-surface: #232629;
  --color-surface-2: #2b2e31;
  --color-border: #33373b;
  --color-primary: #2185F5;
  --color-primary-hover: #4098ff;
  --color-dark: #323536;
  --color-text: #e4e7ea;
  --color-text-dim: #9aa0a6;
  --color-text-mute: #6b7075;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-blue: 0 10px 30px rgba(33, 133, 245, 0.25);
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.35);
  --max-width: 1200px;
}

/* ---------- 通用容器 ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 通用按鈕 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-blue);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ==========================================================================
   導航欄 header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(23, 24, 26, 0.85);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.site-header__logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.site-header__title {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.site-header__title-main {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.3px;
}

.site-header__title-sub {
  font-size: 11px;
  color: var(--color-text-mute);
  margin-top: 3px;
  letter-spacing: 0.4px;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  margin-right: 16px;
}

.site-header__nav a {
  position: relative;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--color-text-dim);
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
}

.site-header__nav a:hover {
  color: #fff;
}

.site-header__nav a.is-active {
  color: #fff;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.site-header__burger {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  color: #fff;
  background: transparent;
  border: 1px solid var(--color-border);
}

.site-header__burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  position: relative;
  transition: all 0.25s ease;
}

.site-header__burger span::before,
.site-header__burger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.25s ease;
}

.site-header__burger span::before {
  top: -6px;
}

.site-header__burger span::after {
  top: 6px;
}

.site-header.is-open .site-header__burger span {
  background: transparent;
}

.site-header.is-open .site-header__burger span::before {
  top: 0;
  transform: rotate(45deg);
}

.site-header.is-open .site-header__burger span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ==========================================================================
   移動端選單：右側滑入面板
   ========================================================================== */
@media (max-width: 960px) {
  .site-header__inner {
    height: 64px;
  }

  /* 關鍵：移除 header 自身的 backdrop-filter，
     否則它會成為內部 position:fixed 元素的包含塊，
     導致滑入面板被限制在 header 高度內。 */
  .site-header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(23, 24, 26, 0.95);
  }

  /* 遮罩層（點選關閉） */
  .site-header::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 12, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    z-index: 90;
  }
  .site-header.is-open::before {
    opacity: 1;
    pointer-events: auto;
  }

  /* 滑入面板容器 */
  .site-header__nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(88vw, 380px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 84px 24px 28px;
    margin: 0;
    background:
      radial-gradient(120% 60% at 100% 0%, rgba(33, 133, 245, 0.18) 0%, transparent 55%),
      radial-gradient(80% 50% at 0% 100%, rgba(33, 133, 245, 0.08) 0%, transparent 60%),
      #15171a;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.55);
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    z-index: 95;
  }
  .site-header.is-open .site-header__nav {
    transform: translateX(0);
  }

  /* 頂部裝飾：豎向編號標籤 */
  .site-header__nav::before {
    content: "MENU";
    position: absolute;
    top: 28px;
    left: 24px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--color-primary);
    opacity: 0.9;
  }
  .site-header__nav::after {
    content: "";
    position: absolute;
    top: 50px;
    left: 24px;
    width: 28px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), transparent);
    border-radius: 2px;
  }

  /* 選單連結（卡片化設計） */
  .site-header__nav a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 16px 22px;
    margin: 0;
    border-radius: 14px;
    color: var(--color-text);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.2px;
    background: transparent;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, padding-left 0.3s ease;
    opacity: 0;
    transform: translateX(28px);
  }

  /* 左側指示條 */
  .site-header__nav a::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, var(--color-primary), #5fb0ff);
    border-radius: 3px;
    transition: height 0.3s ease;
  }

  /* 右側箭頭 */
  .site-header__nav a::after {
    content: "›";
    display: inline-block;
    margin-left: 12px;
    font-size: 22px;
    line-height: 1;
    color: var(--color-text-mute);
    transition: transform 0.25s ease, color 0.25s ease;
    /* 關閉原本 hairline underline */
    position: static;
    background: none;
    width: auto;
    height: auto;
  }

  .site-header__nav a:hover,
  .site-header__nav a:focus-visible {
    background: rgba(33, 133, 245, 0.10);
    color: #fff;
  }
  .site-header__nav a:hover::after {
    color: var(--color-primary);
    transform: translateX(4px);
  }

  .site-header__nav a.is-active {
    background: linear-gradient(90deg, rgba(33, 133, 245, 0.18), rgba(33, 133, 245, 0.04));
    color: var(--color-primary);
  }
  .site-header__nav a.is-active::before {
    height: 22px;
  }
  .site-header__nav a.is-active::after {
    color: var(--color-primary);
  }

  /* 展開時選單項錯峰入場 */
  .site-header.is-open .site-header__nav a {
    animation: menuItemIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  .site-header.is-open .site-header__nav a:nth-child(1) { animation-delay: 0.12s; }
  .site-header.is-open .site-header__nav a:nth-child(2) { animation-delay: 0.18s; }
  .site-header.is-open .site-header__nav a:nth-child(3) { animation-delay: 0.24s; }
  .site-header.is-open .site-header__nav a:nth-child(4) { animation-delay: 0.30s; }
  .site-header.is-open .site-header__nav a:nth-child(5) { animation-delay: 0.36s; }
  .site-header.is-open .site-header__nav a:nth-child(6) { animation-delay: 0.42s; }

  @keyframes menuItemIn {
    from { opacity: 0; transform: translateX(28px); }
    to   { opacity: 1; transform: translateX(0); }
  }

  /* 隱藏頂部 actions 中的 CTA 按鈕 */
  .site-header__actions .btn-ghost,
  .site-header__actions .btn-primary {
    display: none;
  }

  .site-header__burger {
    display: inline-flex;
    position: relative;
    z-index: 100;
  }

  /* 選單內 CTA：底部按鈕組 */
  .site-header__nav-cta {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding-top: 24px;
    position: relative;
    opacity: 0;
    transform: translateY(12px);
  }
  .site-header__nav-cta::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12px;
    right: 12px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  }
  .site-header.is-open .site-header__nav-cta {
    animation: menuItemIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
  }
  .site-header__nav-cta .btn {
    width: 100%;
    justify-content: center;
    padding: 14px;
    color: #ffffff;
    font-weight: 600;
  }

  .site-header__title-sub {
    display: none;
  }

}

/* 開啟移動選單時鎖定 body 滾動 */
body.is-menu-open {
  overflow: hidden;
}

@media (max-width: 420px) {
  .site-header__title-main {
    font-size: 14px;
  }

  .btn {
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* ==========================================================================
   頁尾 footer
   ========================================================================== */
.site-footer {
  position: relative;
  margin-top: 80px;
  padding: 56px 0 28px;
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(33, 133, 245, 0.12) 0%, transparent 60%),
    #111214;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--color-text-dim);
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.site-footer__top {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-footer__brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.site-footer__brand-text strong {
  display: block;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.site-footer__brand-text span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--color-text-mute);
}

.site-footer__contact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.site-footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.site-footer__contact-item:hover {
  border-color: rgba(33, 133, 245, 0.4);
  background: rgba(33, 133, 245, 0.06);
}

.site-footer__contact-item svg {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.site-footer__contact-item .label {
  display: block;
  font-size: 12px;
  color: var(--color-text-mute);
  margin-bottom: 2px;
}

.site-footer__contact-item .value {
  display: block;
  font-size: 14px;
  color: #fff;
  word-break: break-all;
}

.site-footer__notice {
  margin-top: 32px;
  padding: 16px 0 16px 20px;
  border-left: 2px solid rgba(33, 133, 245, 0.5);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--color-text-mute);
}

.site-footer__notice strong {
  color: #d7dadd;
  font-weight: 600;
  margin-right: 4px;
}

.site-footer__notice .en {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.35);
}

/* 導航內嵌 CTA（僅移動端選單展開時顯示） */
.site-header__nav-cta {
  display: none;
}

/* ==========================================================================
   語言切換器
   ========================================================================== */
.site-header__lang {
  position: relative;
  display: inline-flex;
}

.site-header__lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.site-header__lang-trigger:hover {
  background: rgba(33, 133, 245, 0.10);
  border-color: rgba(33, 133, 245, 0.45);
  color: #fff;
}

.site-header__lang-globe {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}

.site-header__lang-caret {
  width: 12px;
  height: 12px;
  opacity: 0.65;
  transition: transform 0.25s ease;
}

.site-header__lang.is-open .site-header__lang-trigger {
  background: rgba(33, 133, 245, 0.12);
  border-color: rgba(33, 133, 245, 0.55);
  color: #fff;
}

.site-header__lang.is-open .site-header__lang-caret {
  transform: rotate(180deg);
}

.site-header__lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  padding: 8px;
  background: rgba(23, 24, 26, 0.98);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 50;
}

.site-header__lang.is-open .site-header__lang-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.site-header__lang-title {
  padding: 8px 12px 6px;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--color-text-mute);
}

.site-header__lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 14px;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.site-header__lang-item:hover {
  background: rgba(33, 133, 245, 0.12);
  color: #fff;
}

.site-header__lang-item.is-active {
  color: var(--color-primary);
  background: rgba(33, 133, 245, 0.08);
}

.site-header__lang-check {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
  flex-shrink: 0;
}

/* 窄屏：僅保留地球圖示 + caret，隱藏當前語言文字 */
@media (max-width: 480px) {
  .site-header__lang-current {
    display: none;
  }
  .site-header__lang-trigger {
    padding: 9px 8px;
  }
}

.site-footer__bottom {
  margin-top: 28px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-mute);
  letter-spacing: 0.2px;
}

.site-footer__bottom strong {
  color: #e4e7ea;
  font-weight: 500;
}

@media (max-width: 860px) {
  .site-footer__top {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 480px) {
  .site-footer__contact {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   通用工具類
   ========================================================================== */
.section-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--color-primary);
  background: rgba(33, 133, 245, 0.1);
  border: 1px solid rgba(33, 133, 245, 0.25);
  border-radius: 999px;
  text-transform: uppercase;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  letter-spacing: 0.3px;
  margin: 18px 0 16px;
}

.section-desc {
  font-size: 15px;
  color: var(--color-text-dim);
  max-width: 720px;
  line-height: 1.8;
}

@media (max-width: 720px) {
  .section-title {
    font-size: 26px;
  }
}
