/* ============================================================
   悦邻生活服务 · 全局样式
   ⚠️ 替换品牌信息只需改下面 :root 里的变量即可全站生效
   ============================================================ */
:root {
  /* [替换] 品牌主色（示例 #165DFF） */
  --brand: #165DFF;
  --brand-dark: #0E42D2;
  --brand-light: #E8F0FF;
  /* [替换] 标准字体（示例：思源黑体 / Source Han Sans SC） */
  --font: "Source Han Sans SC", "思源黑体", "Noto Sans SC", -apple-system,
    BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;

  --ink: #1d2129;
  --ink-2: #4e5969;
  --ink-3: #86909c;
  --line: #e5e6eb;
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --radius: 14px;
  --maxw: 1120px;
  --shadow: 0 6px 24px rgba(20, 30, 60, 0.08);
}

* { box-sizing: border-box; }
/* 注意：不要给 html 设置 scroll-behavior: smooth。
   它会让每一次滚轮滚动都变成动画，在平滑滚轮的鼠标驱动下会互相打断，
   表现为「滚轮滑不动/滚一下卡住」。只在点击锚点跳转时用 JS 平滑滚动。 */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(22px, 3vw, 32px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
section { padding: 64px 0; }
.bg-soft { background: var(--bg-soft); }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--brand); }
.logo .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  display: grid; place-items: center; color: #fff; font-size: 15px;
}
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-2); font-weight: 500; padding: 6px 0; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--brand); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; border-radius: 2px; background: var(--brand);
}
.nav-toggle { display: none; background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--ink); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand); color: #fff; font-weight: 600;
  padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease; font-size: 15px;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.light { background: var(--brand-light); color: var(--brand-dark); }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, var(--brand-light), #fff 70%); position: relative; }
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero p.lead { color: var(--ink-2); font-size: 18px; max-width: 30em; }

/* ---------- 首页轮播图 ---------- */
.hero-carousel { overflow: hidden; }
.hero-carousel, .hero-carousel.has-img, .hero.has-img { background: #0f172a; }
.hero-carousel { min-height: 420px; display: flex; align-items: center; }
.hero-carousel h1, .hero-carousel p.lead { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.hero-carousel .tag { background: rgba(255,255,255,.18); color: #fff; }
.hc-slides { position: absolute; inset: 0; z-index: 0; }
.hc-slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity .9s ease;
}
.hc-slide.is-active { opacity: 1; }
.hero-carousel .container { position: relative; z-index: 2; }
.hc-dots { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; gap: 10px; z-index: 3; margin: 0; padding: 0; }
.hc-dot {
  width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.45); box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: all .25s;
}
.hc-dot.is-active { background: #fff; width: 26px; border-radius: 6px; }
.hc-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(15,23,42,.35); color: #fff; font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background .2s;
}
.hc-arrow:hover { background: rgba(15,23,42,.6); }
.hc-prev { left: 16px; } .hc-next { right: 16px; }
@media (max-width: 640px) { .hc-arrow { display: none; } }

/* ---------- 页脚二维码弹窗（抖音/公众号） ---------- */
a.qr-trigger { color: inherit; text-decoration: none; cursor: pointer; border-bottom: 1px dashed rgba(148,163,184,.6); }
a.qr-trigger:hover { color: var(--brand, #165DFF); border-bottom-color: var(--brand, #165DFF); }
#qrModal {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.6);
  z-index: 9999; align-items: center; justify-content: center; padding: 20px;
}
#qrModal.is-open { display: flex; }
.qr-card {
  position: relative; background: #fff; border-radius: 14px; padding: 26px 26px 20px;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); max-width: 90vw;
}
.qr-card img { width: 230px; height: 230px; object-fit: contain; display: block; background: #fff; border-radius: 8px; }
.qr-card p { margin: 14px 0 0; color: #475569; font-size: 14px; }
.qr-close {
  position: absolute; top: 6px; right: 10px; border: 0; background: none;
  font-size: 24px; color: #94a3b8; cursor: pointer; line-height: 1; padding: 4px;
}
.qr-close:hover { color: #0f172a; }
.tag { display: inline-block; background: var(--brand-light); color: var(--brand-dark); font-weight: 600; padding: 4px 12px; border-radius: 999px; font-size: 13px; margin-bottom: 16px; }
.hero-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.hero-card .row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.hero-card .row:last-child { border-bottom: 0; }
.hero-card .k { color: var(--ink-3); }
.hero-card .v { font-weight: 600; }

/* ---------- 通用网格 ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .ico { width: 42px; height: 42px; border-radius: 10px; background: var(--brand-light); color: var(--brand); display: grid; place-items: center; font-size: 20px; margin-bottom: 12px; }
.card h3 { font-size: 18px; }
.card p { color: var(--ink-2); margin: 0; font-size: 15px; }

/* ---------- 区块标题 ---------- */
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-head p { color: var(--ink-2); }

/* ---------- 步骤 ---------- */
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step { position: relative; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.step::before { counter-increment: s; content: counter(s); position: absolute; top: 14px; right: 16px; font-size: 30px; font-weight: 800; color: var(--brand-light); }
.step h3 { font-size: 16px; }

/* ---------- 数据条 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; text-align: center; }
.stat .num { font-size: 34px; font-weight: 800; color: var(--brand); }
.stat .label { color: var(--ink-2); font-size: 14px; }

/* ---------- FAQ ---------- */
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; margin-bottom: 12px; background: #fff; overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--brand); font-size: 22px; }
.faq-item[open] summary::after { content: "−"; }
.faq-item .ans { padding: 0 20px 18px; color: var(--ink-2); }

/* ---------- 面包屑 ---------- */
.breadcrumb { font-size: 13px; color: var(--ink-3); padding: 14px 0; }
.breadcrumb a:hover { color: var(--brand); }

/* ---------- 联系 ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.info-list .ic { color: var(--brand); font-weight: 700; }
.map-box { background: var(--brand-light); border-radius: var(--radius); min-height: 280px; display: grid; place-items: center; color: var(--brand-dark); text-align: center; padding: 24px; }

/* ---------- 页脚 ---------- */
.site-footer { background: #0f172a; color: #c8d0e0; padding: 48px 0 28px; }
.site-footer a { color: #c8d0e0; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer-grid h4 { color: #fff; font-size: 15px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { padding: 6px 0; font-size: 14px; }
.footer-bottom { border-top: 1px solid #1f2a44; margin-top: 28px; padding-top: 18px; font-size: 13px; color: #8a96ad; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .cards, .grid-3, .stats, .steps { grid-template-columns: repeat(2, 1fr); }
  .contact-grid, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 12px 20px; border-bottom: 1px solid var(--line); gap: 4px; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .cards, .grid-3, .stats, .steps, .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- 可访问性 ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- 首屏横幅淡入（消除背景图加载后的突兀弹入） ----------
   main.js 在页面加载初期给 <html> 加 hd-boot 类，900ms 后移除；
   仅在启动窗口内让横幅整体淡入，把背景图「突然画出」变成平滑过渡。 */
html.hd-boot .page-banner.has-img,
html.hd-boot .hero.has-img,
html.hd-boot .hero-carousel .hc-slide.is-active { animation: hd-bg-in .55s ease both; }
@keyframes hd-bg-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html.hd-boot .page-banner.has-img,
  html.hd-boot .hero.has-img,
  html.hd-boot .hero-carousel .hc-slide.is-active { animation: none; }
}

/* ---------- 表单 ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea, .field select {
  font-family: inherit; font-size: 15px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.form-note { font-size: 13px; color: var(--ink-3); margin-top: 10px; }
.form-ok { display: none; background: var(--brand-light); color: var(--brand-dark); padding: 12px 14px; border-radius: 10px; margin-top: 14px; font-weight: 600; }

/* ---------- 客户案例 ---------- */
.case-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.case-card .metrics { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.case-card .metric .n { font-size: 24px; font-weight: 800; color: var(--brand); }
.case-card .metric .t { font-size: 13px; color: var(--ink-3); }
.case-card blockquote { margin: 8px 0 0; padding: 10px 14px; border-left: 3px solid var(--brand); background: var(--bg-soft); border-radius: 0 8px 8px 0; color: var(--ink-2); font-size: 14px; }

/* ---------- 页面横幅（各页开头，后台可上传背景图） ---------- */
.page-banner {
  padding: 56px 0;
  background: linear-gradient(180deg, var(--brand-light), #fff 70%);
  margin-bottom: 8px;
}
.page-banner .section-head { margin-bottom: 0; }
.page-banner.has-img {
  min-height: 300px;
  display: flex;
  align-items: center;
}
.page-banner.has-img .section-head,
.page-banner.has-img h1,
.page-banner.has-img p { color: #fff; text-align: left; margin-left: 0; }

/* 首页 hero 使用横幅图时的覆盖样式 */
.hero.has-img { background-size: cover; background-position: center; min-height: 420px; display: flex; align-items: center; }
.hero.has-img h1, .hero.has-img p.lead { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.4); }

/* ---------- 新闻动态 ---------- */
.news-item { display: flex; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: center; }
.news-item .date { color: var(--brand); font-weight: 700; font-size: 16px; min-width: 86px; }
.news-item .news-body { flex: 1; min-width: 0; }
.news-item h3 { font-size: 18px; margin: 0 0 6px; }
.news-item h3 a:hover { color: var(--brand); }
.news-item p { color: var(--ink-2); margin: 0; font-size: 15px; }
.news-item .more a { color: var(--brand); font-size: 14px; font-weight: 600; }
.news-item .news-cover { width: 190px; height: 118px; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.news-item .news-cover img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 文章两栏布局：主栏 + 精品文章推荐侧栏 ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.article-side { position: sticky; top: 80px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px 8px; }
.side-head { font-size: 18px; margin: 0 0 4px; padding-left: 10px; border-left: 4px solid var(--brand); line-height: 1.3; }
.side-card { display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; border-bottom: 1px dashed var(--line); text-decoration: none; }
.side-card:last-child { border-bottom: 0; }
.side-card img { width: 96px; height: 68px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; flex-shrink: 0; padding: 3px; }
.side-card .side-card-body { min-width: 0; }
.side-card .side-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.5; color: var(--ink); font-weight: 600; margin-bottom: 5px; }
.side-card .side-date { display: block; font-size: 12px; color: #94a3b8; }
.side-card:hover .side-title { color: var(--brand); }
@media (max-width: 960px) {
  .article-layout { grid-template-columns: 1fr; gap: 24px; }
  .article-side { position: static; order: 2; }
  .news-main { order: 1; }
}

/* ---------- 文章详情页 ---------- */
.article-detail { max-width: 820px; margin: 0 auto; }
.article-detail .article-meta { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 14px; margin-bottom: 12px; }
.article-detail .article-meta .date { color: var(--brand); font-weight: 700; }
.article-detail h1 { font-size: clamp(24px, 3vw, 34px); }
.article-detail .art-cover { border-radius: var(--radius); margin: 8px 0 20px; }
.article-detail .article-content { color: var(--ink-2); font-size: 16px; }
.article-detail .article-content img { border-radius: var(--radius); margin: 14px 0; }
.article-detail .article-content h2 { color: var(--ink); font-size: 20px; font-weight: 700; margin: 26px 0 12px; }
.article-detail .article-content h3 { color: var(--ink); font-size: 17px; font-weight: 700; margin: 22px 0 10px; }
.article-detail .article-content h4 { color: var(--ink); font-size: 16px; font-weight: 700; margin: 20px 0 8px; }
/* 富文本（后台编辑器 / Word 导入）产物的基础排版 */
.article-content p { margin: 0 0 1em; }
.article-content ul, .article-content ol { padding-left: 1.6em; margin: 0 0 1em; }
.article-content blockquote { border-left: 3px solid var(--brand); background: var(--soft, #f5f8ff); padding: 10px 16px; margin: 0 0 1em; border-radius: 0 8px 8px 0; }
.article-content table { border-collapse: collapse; width: 100%; margin: 0 0 1em; font-size: 14px; }
.article-content th, .article-content td { border: 1px solid var(--line, #e2e8f0); padding: 8px 10px; text-align: left; }
.article-content th { background: #f8fafc; }
.article-content pre { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 13px; }
.article-content code { background: rgba(15,23,42,.06); padding: 2px 5px; border-radius: 4px; }
.article-content pre code { background: none; padding: 0; }
.article-content hr { border: 0; border-top: 1px solid var(--line, #e2e8f0); margin: 1.6em 0; }
.article-content a { color: var(--brand); }
.article-foot { display: flex; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- 地图嵌入 ---------- */
.map-embed { display: block; }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .news-item { flex-wrap: wrap; }
  .news-item .news-cover { width: 100%; height: 170px; order: -1; }
  .article-foot { flex-wrap: wrap; }
}

/* Logo 图片版式（后台/头部引用 assets/img/logo.svg） */
.logo img.mark { width: 36px; height: 32px; background: none; border-radius: 0; object-fit: contain; }
