/* =====================================================================
   安禧保 · 官网样式
   设计系统 + 移动优先响应式
   ===================================================================== */

/* ---------- 设计令牌 ---------- */
:root {
  --c-primary: #0e5fb0;
  --c-primary-dark: #0a4a8c;
  --c-primary-light: #e8f1fb;
  --c-accent: #16b8a6;
  --c-accent-soft: #e6f7f4;
  --c-ink: #1a2230;
  --c-ink-soft: #5a6678;
  --c-bg: #ffffff;
  --c-bg-alt: #f5f8fc;
  --c-line: #e3e9f2;
  --c-warn: #d9534f;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(14, 95, 176, 0.08);
  --shadow: 0 12px 32px rgba(14, 95, 176, 0.12);
  --shadow-lg: 0 24px 60px rgba(14, 95, 176, 0.18);

  --container: 1180px;
  --space: clamp(3rem, 7vw, 6rem);
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--c-ink);
  background: var(--c-bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; }
p { margin: 0; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }

/* 焦点可达性 */
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; border-radius: 4px; }

/* 跳链（无障碍） */
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 200;
  background: var(--c-primary); color: #fff; padding: .6rem 1rem;
  border-radius: var(--radius-sm); transition: top .2s;
}
.skip-link:focus { top: 1rem; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 600; font-size: 1rem; cursor: pointer;
  padding: .7rem 1.4rem; border-radius: 999px; border: 2px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--c-primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--c-primary-dark); box-shadow: var(--shadow); transform: translateY(-2px); }
.btn-ghost { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.7); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255,255,255,.28); transform: translateY(-2px); }
.btn-lg { padding: .95rem 1.9rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  background: rgba(255,255,255,.0);
  transition: background .3s, box-shadow .3s, padding .3s;
  padding: .55rem 0;
}
.site-header.scrolled {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(14,95,176,.08);
  padding: .35rem 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.25rem; color: #fff; transition: color .3s; }
.site-header.scrolled .brand { color: var(--c-primary); }
.brand-mark { display: inline-flex; color: var(--c-accent); }
.brand-text { letter-spacing: .04em; }

.primary-nav { display: flex; align-items: center; gap: 1.6rem; }
.primary-nav ul { display: flex; gap: 1.6rem; }
.primary-nav a:not(.btn) { color: rgba(255,255,255,.92); font-weight: 500; position: relative; padding: .3rem 0; transition: color .3s; }
.site-header.scrolled .primary-nav a:not(.btn) { color: var(--c-ink); }
.primary-nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--c-accent); transition: width .25s;
}
.primary-nav a:not(.btn):hover::after, .primary-nav a.active::after { width: 100%; }
.nav-cta { padding: .55rem 1.2rem; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px;
  align-items: center; justify-content: center; background: transparent;
  border: 0; cursor: pointer;
}
.nav-toggle .bar { width: 24px; height: 2.5px; background: #fff; border-radius: 2px; transition: .3s; }
.site-header.scrolled .nav-toggle .bar { background: var(--c-primary); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  overflow: hidden; color: #fff;
  background: linear-gradient(135deg, #0a4a8c 0%, #0e5fb0 55%, #16b8a6 130%);
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(105deg, rgba(10,74,140,.88) 0%, rgba(14,95,176,.6) 45%, rgba(22,184,166,.25) 100%);
}
.hero-content { position: relative; z-index: 2; padding-top: 5rem; padding-bottom: 3rem; max-width: 720px; }
.hero-eyebrow {
  display: inline-block; letter-spacing: .25em; font-size: .85rem; font-weight: 600;
  padding: .35rem .9rem; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; margin-bottom: 1.2rem;
}
.hero-title { font-size: clamp(2.2rem, 6vw, 3.8rem); margin-bottom: 1.1rem; text-shadow: 0 2px 18px rgba(0,0,0,.2); }
.hero-sub { font-size: clamp(1rem, 2.5vw, 1.2rem); color: rgba(255,255,255,.92); margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 2rem; margin-top: 3rem;
  padding-top: 1.6rem; border-top: 1px solid rgba(255,255,255,.25);
}
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.8rem; font-weight: 800; color: #fff; }
.hero-stats span { font-size: .85rem; color: rgba(255,255,255,.82); }

.scroll-hint { position: absolute; bottom: 1.4rem; left: 50%; transform: translateX(-50%); z-index: 2; }
.scroll-hint .mouse {
  display: block; width: 24px; height: 38px; border: 2px solid rgba(255,255,255,.7); border-radius: 14px; position: relative;
}
.scroll-hint .mouse::after {
  content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 7px; background: #fff; border-radius: 2px; animation: scrollDot 1.6s infinite;
}
@keyframes scrollDot { 0%{opacity:0;top:7px} 40%{opacity:1} 80%{opacity:0;top:18px} 100%{opacity:0} }

/* ---------- 通用区块 ---------- */
.section { padding-block: var(--space); }
.philosophy { background: var(--c-bg); }
.products { background: var(--c-bg-alt); }
.services { background: var(--c-bg); }
.contact { background: linear-gradient(160deg, var(--c-bg-alt), var(--c-primary-light)); }

.section-head { max-width: 680px; margin: 0 auto 3rem; text-align: center; }
.section-eyebrow { color: var(--c-accent); font-weight: 700; letter-spacing: .12em; font-size: .85rem; margin-bottom: .6rem; }
.section-title { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: .9rem; }
.section-desc { color: var(--c-ink-soft); font-size: 1.05rem; }

/* ---------- 卡片网格 ---------- */
.card-grid { display: grid; gap: 1.5rem; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* 品牌理念卡片 */
.feature-card {
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 2rem 1.6rem; text-align: center; box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--c-primary-light); }
.feature-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 18px; margin-bottom: 1.1rem;
  background: var(--c-primary-light); color: var(--c-primary);
}
.feature-card h3 { font-size: 1.3rem; margin-bottom: .6rem; }
.feature-card p { color: var(--c-ink-soft); }

/* 产品卡片 */
.product-card {
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s;
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.product-media { aspect-ratio: 4/3; overflow: hidden; background: var(--c-primary-light); }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product-card:hover .product-media img { transform: scale(1.06); }
.media-gradient {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0e5fb0, #16b8a6);
}
.media-emoji { font-size: 3rem; }
.product-body { padding: 1.4rem 1.4rem 1.6rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.product-body h3 { font-size: 1.2rem; }
.product-body p { color: var(--c-ink-soft); font-size: .95rem; flex: 1; }
.link-more { color: var(--c-primary); font-weight: 600; font-size: .95rem; transition: gap .2s; }
.link-more span { display: inline-block; transition: transform .2s; }
.link-more:hover span { transform: translateX(4px); }

/* 服务项 */
.services-grid { gap: 1.2rem; }
.service-item {
  display: flex; gap: 1.1rem; align-items: flex-start;
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s;
}
.service-item:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.service-icon {
  flex: none; width: 52px; height: 52px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-accent-soft); color: var(--c-accent);
}
.service-item h3 { font-size: 1.15rem; margin-bottom: .3rem; }
.service-item p { color: var(--c-ink-soft); font-size: .95rem; }

/* ---------- 客服中心 ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.contact-intro .section-eyebrow,
.contact-intro .section-title,
.contact-intro .section-desc { text-align: left; }
.contact-intro .section-head { text-align: left; }
.contact-info { margin: 1.8rem 0; display: grid; gap: 1.1rem; }
.contact-info li { display: flex; gap: .9rem; align-items: center; }
.ci-icon { font-size: 1.4rem; flex: none; }
.contact-info strong { display: block; font-size: 1rem; }
.contact-info span { color: var(--c-ink-soft); font-size: .92rem; }

.contact-form {
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-lg);
  padding: 2rem; box-shadow: var(--shadow); display: grid; gap: 1.1rem;
}
.field { display: grid; gap: .4rem; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 1rem; padding: .8rem 1rem;
  border: 1.5px solid var(--c-line); border-radius: var(--radius-sm); background: #fff; color: var(--c-ink);
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-light); outline: none;
}
.field textarea { resize: vertical; }
.error-msg { color: var(--c-warn); font-size: .82rem; min-height: 1em; }
.field.invalid input, .field.invalid select { border-color: var(--c-warn); }
.form-feedback { font-size: .95rem; color: var(--c-accent); font-weight: 600; min-height: 1.2em; }

/* ---------- 页脚 ---------- */
.site-footer { background: #0c1b2e; color: #c7d2e0; }
.footer-inner {
  display: grid; gap: 2rem; padding-block: 3rem;
  grid-template-columns: 1.5fr 1fr; align-items: start;
}
.footer-brand .brand-text { color: #fff; font-size: 1.4rem; font-weight: 800; }
.footer-brand p { color: #9fb0c4; margin-top: .3rem; }
.footer-domain { color: var(--c-accent) !important; letter-spacing: .05em; }
.footer-links { display: flex; flex-direction: column; gap: .7rem; }
.footer-links a { color: #c7d2e0; transition: color .2s; }
.footer-links a:hover { color: #fff; }
.footer-note { grid-column: 1 / -1; font-size: .82rem; color: #8294a8; border-top: 1px solid rgba(255,255,255,.08); padding-top: 1.4rem; }
.footer-bottom { background: #081320; padding-block: 1rem; font-size: .82rem; color: #8294a8; }
.footer-bottom .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- 滚动揭示动画 ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint .mouse::after { animation: none; }
}

/* ---------- 在线客服浮窗 ---------- */
.chat-widget {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 150;
  width: min(340px, calc(100vw - 2rem)); background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
  transform: translateY(20px) scale(.96); opacity: 0; pointer-events: none;
  transition: transform .25s, opacity .25s;
}
.chat-widget.open { transform: none; opacity: 1; pointer-events: auto; }
.chat-header {
  background: var(--c-primary); color: #fff; padding: .9rem 1rem;
  display: flex; align-items: center; justify-content: space-between; font-weight: 600;
}
.chat-close { background: transparent; border: 0; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.chat-body { padding: 1rem; display: grid; gap: .6rem; max-height: 260px; overflow-y: auto; background: var(--c-bg-alt); }
.chat-bubble { padding: .6rem .85rem; border-radius: 14px; font-size: .9rem; max-width: 85%; line-height: 1.5; }
.chat-bubble.bot { background: #fff; border: 1px solid var(--c-line); align-self: start; border-bottom-left-radius: 4px; }
.chat-bubble.user { background: var(--c-primary); color: #fff; align-self: end; border-bottom-right-radius: 4px; }
.chat-input { display: flex; gap: .5rem; padding: .8rem; border-top: 1px solid var(--c-line); }
.chat-input input { flex: 1; border: 1.5px solid var(--c-line); border-radius: 999px; padding: .55rem .9rem; font-family: inherit; }
.chat-input input:focus { outline: none; border-color: var(--c-primary); }
.chat-input button { background: var(--c-primary); color: #fff; border: 0; border-radius: 999px; padding: .55rem 1.1rem; font-weight: 600; cursor: pointer; }

/* ---------- 返回顶部 ---------- */
.back-to-top {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 140;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--c-primary); color: #fff; font-size: 1.3rem; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s, background .2s;
}
.back-to-top.show { opacity: 1; transform: none; }
.back-to-top:hover { background: var(--c-primary-dark); }

/* =====================================================================
   响应式断点
   ===================================================================== */

/* 平板及以下 */
@media (max-width: 960px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-inner { grid-template-columns: 1fr; }
}

/* 移动端导航 */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px);
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; padding: 5rem 1.5rem 2rem; box-shadow: var(--shadow-lg);
    transform: translateX(100%); transition: transform .3s ease; z-index: 110;
  }
  .primary-nav.open { transform: translateX(0); }
  .primary-nav ul { flex-direction: column; gap: 0; }
  .primary-nav a:not(.btn) { color: var(--c-ink) !important; padding: 1rem 0; border-bottom: 1px solid var(--c-line); display: block; }
  .primary-nav a:not(.btn)::after { display: none; }
  .nav-cta { margin-top: 1.2rem; }
  /* 移动端头部始终白底，保证汉堡可见 */
  .site-header:not(.scrolled) { background: rgba(14,95,176,.96); }
  .hero-stats { gap: 1.4rem; }
  .hero-stats strong { font-size: 1.4rem; }
}

/* 小屏 */
@media (max-width: 520px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1; }
  .contact-form { padding: 1.4rem; }
  .br-desktop { display: none; }
}

/* 桌面细节增强 */
@media (min-width: 769px) {
  .site-header { padding: .65rem 0; }
}
