/* ========================================
   鸿博档案官网 - 公共样式
   配色：白底 + 深蓝 #002B5B + 红色 #E60012
   ======================================== */

:root {
  --color-navy: #002B5B;
  --color-navy-light: #003d7a;
  --color-red: #D01F27;
  --color-red-dark: #c4000f;
  --color-blue-light: #4a90d9;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-text-muted: #999999;
  --color-bg: #ffffff;
  --color-bg-gray: #f5f5f5;
  --color-border: #e0e0e0;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --design-width: 1920px;
  --design-height: 1080px;
  --hero-height: 720px;
  --page-scale: 1;
  --header-height: 80px;
  --transition: 0.3s ease;
  --shadow: 0 2px 12px rgba(0, 43, 91, 0.1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

html.is-loading { scroll-behavior: auto; }

html.is-loading #scale-outer,
html.is-loading #header {
  visibility: hidden;
}

html.is-loading #header,
html.is-loading .header {
  transition: none !important;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { text-decoration: none; color: inherit; transition: color var(--transition); }
ul { list-style: none; }
img { max-width: 100%; display: block; height: auto; }
button, input, select, textarea { font-family: inherit; font-size: inherit; border: none; outline: none; }

/* 等比缩放容器 */
#scale-outer {
  width: 100%;
}

#scale-inner {
  width: var(--design-width);
  zoom: var(--page-scale);
}

section {
  scroll-margin-top: var(--header-offset, var(--header-height));
}

.page-banner {
  padding-top: 120px;
  padding-bottom: 40px;
  background: var(--color-bg-gray);
}

.page-banner .section-title {
  margin-bottom: 16px;
}

.page-lead {
  text-align: center;
  font-size: 18px;
  color: var(--color-text-light);
  max-width: 720px;
  margin: 0 auto;
}

.page-content {
  color: var(--color-text-light);
  font-size: 16px;
  line-height: 1.8;
}

.page-content p {
  margin-bottom: 16px;
}

.container {
  width: calc(var(--design-width) - 80px);
  max-width: none;
  margin: 0 auto;
  padding: 0;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 36px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition);
  border-radius: 4px;
}

.btn-red {
  background: var(--color-red);
  color: #fff;
}

.btn-red:hover {
  background: var(--color-red-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(230, 0, 18, 0.3);
}

/* 区块标题 */
.section { padding: 80px 0; }

.section-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 48px;
}

.section-title-red {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-red);
  margin-bottom: 20px;
}

/* ========================================
   导航栏
   ======================================== */
.header,
#header {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--design-width);
  z-index: 1000;
  height: var(--header-height);
  overflow: visible;
  background-color: transparent;
  zoom: var(--page-scale);
  transition: background-color var(--transition), box-shadow var(--transition);
}

#header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: transparent;
  z-index: -1;
  transition: background-color var(--transition), box-shadow var(--transition);
  box-shadow: none;
}

#header.scrolled,
.header.scrolled {
  background-color: #ffffff;
  box-shadow: var(--shadow);
}

#header.scrolled::before,
.header.scrolled::before {
  background-color: #ffffff;
  box-shadow: var(--shadow);
}

#header .header-inner {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0 40px;
  overflow: visible;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 48px;
  height: 100%;
}

#nav,
.nav-list,
.nav-item {
  overflow: visible;
}

#nav {
  margin-left: 0;
}

.header-cta {
  position: absolute;
  right: 40px;
  top: 50%;
  z-index: 2;
  padding: 6px 16px;
  font-size: 12px;
  line-height: 1.4;
  background-color: #2E428A;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(calc(-50% - 6px));
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.header-cta:hover {
  background-color: #243670;
  color: #fff;
  box-shadow: 0 4px 12px rgba(46, 66, 138, 0.3);
}

#header.scrolled .header-cta,
.header.scrolled .header-cta {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%);
}

#header.scrolled .header-cta:hover,
.header.scrolled .header-cta:hover {
  transform: translateY(calc(-50% - 1px));
}

.nav-list {
  display: flex;
  justify-content: flex-start;
  gap: 4px;
}

.nav-item {
  position: relative;
}

.nav-item-dropdown > .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  transition: transform var(--transition);
}

.nav-arrow svg {
  width: 10px;
  height: 10px;
}

.nav-item-dropdown:hover .nav-arrow {
  transform: rotate(180deg);
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  padding: 8px 0;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(46, 66, 138, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  z-index: 2000;
}

.nav-dropdown::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  width: 100%;
  height: 10px;
}

.nav-item-dropdown:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown li a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 400;
  color: #2E428A;
  white-space: nowrap;
  transition: background-color var(--transition), color var(--transition);
}

.nav-dropdown li a:hover {
  background-color: #f5f7fa;
  color: #2E428A;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.logo-img { height: 36px; width: auto; object-fit: contain; }

.logo-fallback { display: flex; align-items: center; gap: 8px; }

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-red);
  color: #fff;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 700;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  transition: color var(--transition);
}

.header.scrolled .logo-text { color: var(--color-navy); }

.nav-link {
  display: block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 400;
  color: #2E428A;
  transition: color var(--transition), font-weight var(--transition);
}

.header.scrolled .nav-link { color: #2E428A; }

.nav-link:hover { color: #2E428A; }

.nav-link.active {
  color: #2E428A;
  font-weight: 700;
}

.nav-toggle {
  display: none;
  gap: 5px;
  background: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  transition: all var(--transition);
}

.header.scrolled .nav-toggle span { background: var(--color-navy); }

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ========================================
   页脚
   ======================================== */
.footer {
  background: #0B1633;
  color: #707686;
  padding: 36px 0 0;
}

.footer > .container {
  width: 65%;
}

.footer-grid {
  display: grid;
  grid-template-columns: 3fr repeat(5, 1fr);
  gap: 20px;
  padding-bottom: 24px;
}

.footer-logo {
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
}

.footer-logo .logo-text { color: #fff; }

.footer-logo-img {
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}

.footer-logo-img[hidden] {
  display: none;
}

.footer-contact-info p {
  font-size: 13px;
  margin-bottom: 4px;
  line-height: 1.5;
}

.footer-contact-info .footer-company {
  color: #707686;
  font-weight: 500;
  margin-bottom: 8px;
}

.footer-qrcode {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.qrcode-placeholder {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-navy);
  overflow: hidden;
  padding: 0;
}

.qrcode-placeholder svg,
.qrcode-placeholder img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.footer-links h4 {
  color: #ffffff;
  font-size: 14px;
  margin-bottom: 10px;
}

.footer-links h4 a {
  color: #ffffff;
  font-size: inherit;
}

.footer-links h4 a:hover {
  color: #fff;
}

.footer-links ul li {
  line-height: 1.4;
  margin-bottom: 8px;
}

.footer-links ul li:last-child {
  margin-bottom: 0;
}

.footer-links a {
  font-size: 13px;
  color: #D8D8D8;
}

.footer-links ul li a {
  color: #D8D8D8;
}

.footer-links ul li a:hover { color: #fff; }

.footer-bottom {
  text-align: center;
  padding: 14px 0;
  font-size: 12px;
  color: #707686;
}

.footer-bottom a { color: #707686; }
.footer-bottom a:hover { color: #fff; }

/* ========================================
   返回顶部
   ======================================== */
.back-to-top {
  position: fixed;
  width: 44px;
  height: 44px;
  background: var(--color-red);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition), background var(--transition);
  box-shadow: 0 4px 12px rgba(230, 0, 18, 0.3);
  z-index: 999;
  border: none;
}

.back-to-top-scaled {
  bottom: 32px;
  right: 32px;
  zoom: var(--page-scale);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover { background: var(--color-red-dark); }
.back-to-top svg { width: 18px; height: 18px; }
