/* ============================================================
   CRF 公共页眉 / 页脚（供全站所有页面共用，含遗留页面）
   由 assets/js/layout.js 注入 .site-header / .site-footer / .to-top
   变量作用域限定在组件内部，避免覆盖各页面自有主题变量
   ============================================================ */
.site-header, .site-footer, .to-top {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-light: #eff6ff;
  --brand-soft: #f0f9ff;
  --sky: #0ea5e9;
  --ink: #0f172a;
  --ink-2: #334155;
  --gray: #64748b;
  --gray-light: #94a3b8;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --radius: 14px;
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, .12);
  --shadow-hover: 0 18px 40px -14px rgba(37, 99, 235, .25);
  --header-h: 68px;
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Inter, system-ui, sans-serif;
}

body { padding-top: 68px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  height: var(--header-h);
  font-family: var(--font);
  box-sizing: border-box;
}
.site-header *, .site-footer * { box-sizing: border-box; }
.site-header .inner {
  max-width: 1280px; margin: 0 auto; padding: 0 20px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--sky));
  color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center; letter-spacing: .5px;
}
.brand .name { font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.brand .name small { display: block; font-size: 11px; font-weight: 500; color: var(--gray); letter-spacing: .12em; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav > .nav-item { position: relative; }
.main-nav a.nav-link {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 14px; border-radius: 8px;
  color: var(--ink-2); font-size: 15px; font-weight: 500;
  text-decoration: none; transition: all .2s; white-space: nowrap;
}
.main-nav a.nav-link:hover, .main-nav > .nav-item.active > a.nav-link {
  color: var(--brand); background: var(--brand-light);
}
.main-nav a.nav-link .caret { font-size: 10px; color: var(--gray-light); font-style: normal; }
.dropdown {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  min-width: 200px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 8px;
  opacity: 0; visibility: hidden; transition: all .18s ease;
}
.main-nav > .nav-item:hover .dropdown,
.main-nav > .nav-item:focus-within .dropdown { opacity: 1; visibility: visible; }
.dropdown a { display: block; padding: 9px 14px; border-radius: 8px; color: var(--ink-2); font-size: 14px; text-decoration: none; }
.dropdown a:hover { background: var(--brand-light); color: var(--brand); }
.dropdown a span { display: block; font-size: 12px; color: var(--gray-light); }
.nav-cta { margin-left: 8px; padding: 9px 18px !important; background: var(--brand); color: #fff !important; border-radius: 10px !important; font-weight: 600 !important; }
.nav-cta:hover { background: var(--brand-dark) !important; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; transition: .2s; }

@media (max-width: 1080px) {
  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: #fff; flex-direction: column; align-items: stretch;
    padding: 16px 20px 40px; gap: 2px; overflow-y: auto;
    transform: translateX(100%); transition: transform .25s ease;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav > .nav-item > a.nav-link { padding: 14px 10px; font-size: 16px; border-bottom: 1px solid var(--bg-soft); border-radius: 0; }
  .dropdown { position: static; transform: none; opacity: 1; visibility: visible; box-shadow: none; border: none; padding: 0 0 6px 16px; display: none; min-width: 0; }
  .main-nav > .nav-item.dropdown-open .dropdown { display: block; }
  .main-nav > .nav-item:hover .dropdown { display: none; }
  .main-nav > .nav-item.dropdown-open:hover .dropdown { display: block; }
  .nav-toggle { display: block; }
}

/* ---------- 页脚 ---------- */
.site-footer { background: var(--ink); color: #cbd5e1; font-family: var(--font); }
.site-footer .top {
  max-width: 1180px; margin: 0 auto; padding: 56px 20px 40px;
  display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px;
}
.site-footer h4 { color: #fff; font-size: 15px; margin: 0 0 16px; }
.site-footer a { display: block; color: #94a3b8; font-size: 13.5px; line-height: 1.75; padding: 0; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer .intro p { font-size: 13.5px; color: #94a3b8; line-height: 1.75; margin: 0; max-width: 320px; }
.site-footer .intro p:first-of-type { margin-top: 14px; }
.site-footer .intro p a { display: inline; padding: 0; color: #93c5fd; }
.site-footer .intro p a:hover { color: #fff; }
.site-footer .bottom { border-top: 1px solid rgba(255, 255, 255, .1); }
.site-footer .bottom .inner {
  max-width: 1180px; margin: 0 auto; padding: 18px 20px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: 12.5px; color: #64748b;
}
@media (max-width: 900px) { .site-footer .top { grid-template-columns: repeat(2, 1fr); } .site-footer .intro { grid-column: 1 / -1; } }

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed; right: 22px; bottom: 26px; z-index: 90;
  width: 42px; height: 42px; border-radius: 12px; border: none; cursor: pointer;
  background: var(--brand); color: #fff; font-size: 18px;
  opacity: 0; visibility: hidden; transition: .2s; box-shadow: var(--shadow-hover);
}
.to-top.show { opacity: 1; visibility: visible; }
