/* ============================================================
   TDSI 官网 · 布局层
   导航栏 / 页脚 / 页面骨架 / 入场动画
   ============================================================ */

/* ---------- 导航栏 ---------- */
.nav {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: calc(100% - 32px);
  max-width: 1080px;
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--r-xl);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.07), var(--shadow-inset);
  transition: box-shadow var(--dur-slow) var(--ease-out),
              background var(--dur) ease,
              padding var(--dur) ease,
              border-color var(--dur) ease;
}

html.dark-mode .nav {
  background: rgba(10, 16, 32, 0.74);
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.5);
}

.nav--scrolled {
  padding: 7px 18px;
  box-shadow: 0 14px 48px rgba(15, 23, 42, 0.13);
}
html.dark-mode .nav--scrolled { box-shadow: 0 14px 48px rgba(0, 0, 0, 0.62); }

/* 品牌 */
.nav__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: var(--text-1);
  flex-shrink: 0;
  transition: opacity var(--dur) ease;
}
.nav__brand:hover { opacity: 0.82; }
.nav__brand img {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.16);
}

/* 链接列表 */
.nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: color var(--dur) ease, background var(--dur) ease;
}
.nav__link:hover { color: var(--c-brand); background: rgba(14, 165, 233, 0.09); }
.nav__link[aria-current="page"] {
  color: var(--c-brand);
  background: rgba(14, 165, 233, 0.12);
  font-weight: 700;
}
.nav__link--sponsor {
  color: #b45309;
  background: rgba(245, 158, 11, 0.13);
}
.nav__link--sponsor:hover { background: rgba(245, 158, 11, 0.22); color: #92400e; }
html.dark-mode .nav__link--sponsor { color: #fbbf24; }

/* 右侧操作区 */
.nav__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* 移动端菜单按钮 */
.nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-pill);
  color: var(--text-2);
  border: 1px solid var(--line);
  transition: all var(--dur) ease;
}
.nav__toggle:hover { color: var(--c-brand); border-color: rgba(14, 165, 233, 0.4); }
.nav__toggle svg { width: 20px; height: 20px; }

/* ---------- 页脚 ---------- */
.footer {
  position: relative;
  z-index: 2;
  margin-top: var(--sp-8);
  padding: var(--sp-7) var(--sp-5) var(--sp-5);
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  box-shadow: var(--shadow-inset), 0 -8px 40px rgba(15, 23, 42, 0.05);
}

html.dark-mode .footer { box-shadow: var(--shadow-inset), 0 -8px 40px rgba(0, 0, 0, 0.3); }

.footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: var(--sp-6);
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 900;
  margin-bottom: var(--sp-3);
}
.footer__brand img { width: 30px; height: 30px; border-radius: var(--r-xs); }

.footer__tagline {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-3);
  max-width: 34ch;
}

.footer__col h4 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--sp-3);
}

.footer__col ul { display: flex; flex-direction: column; gap: 9px; }

.footer__col a {
  font-size: 13.5px;
  color: var(--text-2);
  transition: color var(--dur) ease, padding-left var(--dur) ease;
  display: inline-block;
}
.footer__col a:hover { color: var(--c-brand); padding-left: 3px; }

.footer__bottom {
  max-width: var(--container);
  margin: var(--sp-6) auto 0;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: 12px;
  color: var(--text-3);
}

.footer__copy { line-height: 1.7; }

.footer__disclaimer {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-3);
  opacity: 0.85;
  max-width: 62ch;
}

/* ---------- 页面头部（内页） ---------- */
.page-head {
  padding: var(--sp-6) 0 var(--sp-5);
  text-align: center;
}

.page-head h1 {
  font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.015em;
  margin-bottom: var(--sp-2);
}

.page-head p {
  font-size: 14px;
  color: var(--text-3);
  max-width: 62ch;
  margin: 0 auto;
  line-height: 1.7;
}

/* ---------- 面包屑 ---------- */
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}
.crumbs a { transition: color var(--dur) ease; }
.crumbs a:hover { color: var(--c-brand); }
.crumbs svg { width: 13px; height: 13px; opacity: 0.6; }

/* ---------- 入场动画 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* 首屏立即入场（不等滚动） */
.page-entered [data-reveal="immediate"] {
  animation: enter-up 0.75s var(--ease-out) both;
}
@keyframes enter-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .page-entered [data-reveal="immediate"] { animation: none !important; }
}

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 900;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--bg-surface-solid);
  border: 1px solid var(--line);
  color: var(--text-2);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--dur) var(--ease-out);
}
.to-top--show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover {
  color: #fff;
  background: var(--c-grad);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.35);
}
.to-top svg { width: 20px; height: 20px; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .nav__links {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    display: none;
  }
  html.dark-mode .nav__links { background: rgba(15, 23, 42, 0.97); }

  .nav__links--open { display: flex; }

  .nav__link { padding: 11px 14px; font-size: 14px; }

  .nav__toggle { display: inline-flex; }

  .nav__brand span { font-size: 15px; }
}

@media (max-width: 860px) {
  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  :root { --nav-h: 56px; }
  body { padding-top: calc(var(--nav-h) + 16px); font-size: 14.5px; }
  .container { padding: 0 var(--sp-4); }
  .section { padding: var(--sp-6) 0; }
  .card { padding: var(--sp-4); }
  .announce { padding: var(--sp-4); gap: var(--sp-3); }
  .announce__icon { width: 38px; height: 38px; }
  .page { padding-bottom: var(--sp-7); }
  .footer { padding: var(--sp-6) var(--sp-4) var(--sp-4); }
  .to-top { right: 14px; bottom: 16px; width: 42px; height: 42px; }
  .btn--lg { padding: 13px 26px; font-size: 14px; }
}
