/* =========================================================
   SynoVita 皮肤 — 全站共享「页头 / 页脚」样式（仅作用于自身）
   · 作用域限定在 .site-header / .site-footer 之内，避免影响
     内页正文（详情/列表等仍用旧的 style.css + 浏览器默认）。
   · 首页整页视觉由 syno-home.css 提供（全量，仅首页加载）。
   ========================================================= */

/* ---- 字体 ---- */
@font-face {
  font-family: "AlibabaHealthFont20CN";
  src: url("assets/AlibabaHealthFont20CN-85B.TTF") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "FanThinkGroteskSemibold";
  src: url("assets/Semibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #03479c;
  --navy-2: #123a8f;
  --gold: #c9a15a;
  --gold-dark: #a97f38;
  --ink: #17203a;
  --muted: #6b7280;
  --line: #e8eaf2;
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --shadow: 0 18px 45px rgba(11, 31, 91, .10);
}

.site-header,
.site-footer {
  font-family: "AlibabaHealthFont20CN", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
}

.site-header,
.site-header *,
.site-footer,
.site-footer * {
  box-sizing: border-box;
}

/* ---- 容器（仅页头/页脚内部使用） ---- */
.site-header .container,
.site-footer .container {
  width: min(1400px, calc(100% - 32px));
  margin-inline: auto;
}

/* Bootstrap 全局 clearfix 会给 .container/.row 等生成 display:table 的 ::before/::after。
   页头/页脚里 .container 是 grid/flex 容器，这些空伪元素会被当作多余子项，
   把 grid 挤到换行/错位（如页脚「關於我們」被顶到下一行）。这里统一禁用。 */
.site-header .container::before,
.site-header .container::after,
.site-footer .container::before,
.site-footer .container::after {
  display: none;
  content: none;
}

/* ================= 页头 ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 2px 20px rgba(11, 31, 91, .06);
  transition: box-shadow .25s ease, background-color .25s ease;
}
.site-header.scrolled {
  background: #ffffff;
  box-shadow: 0 2px 20px rgba(11, 31, 91, .06), 0 0 5px 5px rgba(0, 0, 0, 0.03);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 82px;
}
.brand { display: inline-flex; }
.brand img { height: 70px; width: auto; object-fit: contain; }

.main-nav { display: flex; gap: clamp(18px, 4vw, 72px); }
.main-nav a {
  position: relative;
  font-size: 18px;
  font-weight: 500;
  padding: 28px 0;
  color: #333333;
  text-decoration: none;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width .25s, left .25s;
}
.main-nav a:hover { color: var(--navy); }
.main-nav a:hover::after { left: 0; width: 100%; }
.main-nav a.active { color: var(--navy); }
.main-nav a.active::after { left: 0; width: 100%; }

.header-tools { display: flex; align-items: center; gap: 16px; }
.header-tools .icon-btn { margin-top: 9px; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 28px 6px 14px;
  font-size: 12px;
  color: var(--muted);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2303479c' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.lang-select:hover { border-color: var(--gold); }

/* 汉堡菜单按钮（仅手机端显示） */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--navy);
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 960px) {
  .header-inner { height: auto; padding: 14px 0; flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; }
  /* 导航收起为顶部下拉面板 */
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, .98);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 30px rgba(11, 31, 91, .10);
    padding: 8px 0 12px;
  }
  .main-nav.open { display: flex; animation: navDrop .28s ease; }
  .main-nav a { display: block; padding: 14px 24px; font-size: 16px; }
  .main-nav a::after { display: none; }
  .main-nav a.active { background: var(--bg-soft); }
  @keyframes navDrop {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
  }
}

@media (max-width: 560px) {
  .brand img { height: 40px; }
  .header-tools { margin-left: auto; }
}

/* 抵消旧 responsive.css（≤768px）为「fixed 旧页头」预留的间距与 img 强制规则
   —— 新页头为 sticky（自身占位），无需 padding-top 补偿 */
@media (max-width: 768px) {
  #layout-main { padding-top: 0 !important; }
  .brand img { height: 40px !important; width: auto !important; }
}

/* ================= 页脚 ================= */
.site-footer {
  color: #fff;
  background: linear-gradient(30deg, #081742, #2367bc, #081742);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr repeat(5, auto);
  gap: 70px;
  padding: 68px 0 52px;
}
.footer-brand img { width: 200px; object-fit: contain; }
.footer-brand p { margin: 20px 0 24px; color: #aab4d2; }
.footer-brand strong { color: #fff; font-size: 18px; }
.site-footer h4 { font-size: 17px; margin-bottom: 20px; font-weight: 500; }
.site-footer nav a {
  display: block;
  margin-bottom: 20px;
  color: #aab4d2;
  text-decoration: none;
}
.site-footer nav h4 a { display: inline; margin: 0; color: #fff; }
.site-footer nav a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 22px 0;
  font-size: 13px;
  color: #909cb8;
}

.footer-contact {
  margin-top: 10px;
  display: flex;
  align-items: center;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-weight: 300;
}
.footer-contact img { height: 20px; width: 20px; margin-right: 10px; }

/* 页脚可收起栏目（手风琴）开关按钮：桌面端隐藏，仅移动端显示 */
.footer-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: 14px;
  border-radius: 50%;
  color: #fff;
}
.footer-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.footer-toggle .footer-toggle-v {
  transition: transform .25s ease, opacity .2s ease;
}
.footer-toggle:hover { color: var(--gold); }
.footer-toggle[aria-expanded="true"] .footer-toggle-v {
  transform: scaleY(0);
  opacity: 0;
}

/* 页脚网格断点 */
@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* 页脚手风琴（仅手机端生效，桌面/平板端保持现状） */
@media (max-width: 560px) {
  .footer-grid { gap: 40px; padding: 48px 0 40px; }
  .site-footer .footer-col { border-bottom: 1px solid rgba(255, 255, 255, .14); }
  .site-footer .footer-col-collapse { padding: 4px 0 0; }
  .site-footer .footer-col-collapse h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    padding: 10px 0;
    cursor: pointer;
  }
  .site-footer .footer-col-collapse .footer-toggle { display: inline-flex; }
  .site-footer .footer-col-collapse .footer-sub { padding-bottom: 6px; }
  .footer-col-collapse:not(.open) .footer-sub { display: none; }
}
