/* ==========================================================
   common.css — 全站公共样式（导航/页脚/基础组件）
   项目：谷多 GooDuo 制冰机官网
   规范：UI设计标准（7级字号体系）+ 项目级开发规范
   ========================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  /* 品牌色（方向A：明亮天蓝，用户 2026-08-21 选定，弃用原 1F497D） */
  --brand: #1E86E8;
  --brand-mid: #0A84FF;
  --brand-light: #E8F3FF;
  --accent: #36A3FF;

  /* 文本色（UI标准：正文#333 辅助#999） */
  --text-main: #333;
  --text-muted: #999;

  --border: #E5E8EC;
  --bg-gray: #F5F7FA;
  --white: #FFFFFF;

  --radius: 8px;
  --container: 1200px;

  /* 系统默认字体栈（按规范不引入外部字体，规避共享盘闪动） */
  --font-stack: system-ui, -apple-system, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ---------- 2. 基础重置 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-stack);
  font-size: 16px;               /* 正文 PC 16px（14-16 范围内） */
  line-height: 1.6;
  color: var(--text-main);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- 3. 布局容器（规范：内容1200px） ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;               /* <1200px（非手机）左右留白20px */
}
@media (min-width: 1200px) { .container { padding: 0; } }  /* >1200px 不留白 */
@media (max-width: 767px) { .container { padding: 0 16px; } }  /* 手机端留白16px */

/* 模块上下 padding：桌面80px / 手机44px */
.section { padding: 80px 0; }
@media (max-width: 767px) { .section { padding: 44px 0; } }
.section-bg { background: var(--bg-gray); }

/* ---------- 3.5 内页 Banner（全站内页共用骨架；背景图由各页面 css 指定） ---------- */
.page-banner {
  position: relative;
  height: min(31.25vw, 500px);   /* 常规1920x600横幅比例 */
  min-height: 320px;
  overflow: hidden;
  background: var(--brand);
}
.pb-bg { position: absolute; inset: 0; }
@media (max-width: 767px) {
  .page-banner { height: 240px; min-height: 240px; }
}

/* ---------- 4. 标题层级（UI标准 7 级体系，同单元内<=3种） ---------- */
.h1 { font-size: 32px; font-weight: 700; line-height: 1.3; color: var(--brand); }
.h2 { font-size: 24px; font-weight: 600; line-height: 1.4; color: var(--brand); }
.h3 { font-size: 19px; font-weight: 600; line-height: 1.4; color: var(--text-main); }
.h4 { font-size: 16px; font-weight: 500; line-height: 1.5; color: #444; }
@media (max-width: 767px) {
  .h1 { font-size: 26px; }
  .h2 { font-size: 21px; }
  .h3 { font-size: 18px; }
}
/* 正文 / 辅助说明 / 注释（移动端正文最小16px） */
.text-body { font-size: 16px; line-height: 1.7; color: var(--text-main); }
.text-sub { font-size: 14px; line-height: 1.6; color: var(--text-muted); }
.text-note { font-size: 12px; line-height: 1.5; color: var(--text-muted); }

/* 模块标题区（左标题+副标题，右侧行动链接；上下间距按3:1比例原则） */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 48px;
}
.section-head .sh-title { min-width: 0; }
.section-head .h2 { margin-bottom: 10px; }   /* 标题下方留白 */
.section-head .text-sub { max-width: 640px; }
.sh-more {
  flex: none;
  align-self: flex-end;
  font-size: 14px;
  color: var(--brand);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sh-more .arw { transition: transform .2s ease; }
.sh-more:hover { color: var(--brand-mid); }
.sh-more:hover .arw { transform: translateX(3px); }
@media (max-width: 767px) {
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 28px; }
  .sh-more { align-self: flex-start; }
}

/* ---------- 5. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 28px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; line-height: 1;
  transition: background .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--brand); color: var(--white); }
.btn-primary:hover { background: var(--brand-mid); }
.btn-outline { border: 1px solid var(--brand); color: var(--brand); background: transparent; }
.btn-outline:hover { background: var(--brand-light); }
.btn-light { background: var(--white); color: var(--brand); }
.btn-light:hover { background: #E8F0F8; }
.btn-ghost { border: 1px solid rgba(255,255,255,.7); color: var(--white); }
.btn-ghost:hover { background: rgba(255,255,255,.15); }

/* ---------- 6. 占位图（排版阶段使用，后续替换为AI生图） ---------- */
.ph {
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: #8FA8C8; font-size: 13px; line-height: 1.6;
  background: linear-gradient(135deg, #DCEBFF, #E8F3FF 55%, #F4F9FF);
  border: 1px dashed #B9CDE4;
}

/* ==========================================================
   7. 顶部导航（JS渲染注入，见 common.js）
   ========================================================== */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; height: 72px; gap: 32px; }
/* logo 高度固定40px，不显示公司名称 */
.logo { flex: none; height: 40px; display: flex; align-items: center; }
.logo img { height: 40px; width: auto; border-radius: 4px; }
.nav { margin-left: auto; display: flex; gap: 28px; }
.nav a { font-size: 16px; color: var(--text-main); padding: 6px 0; position: relative; }
.nav a:hover { color: var(--brand); }
.nav a.active { color: var(--brand); font-weight: 600; }
.nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--brand);
}
.header-lang { display: flex; align-items: center; gap: 4px; flex: none; margin-left: 12px; }
.lang-btn {
  font-size: 13px; color: #666; border: 1px solid var(--border);
  border-radius: 4px; padding: 4px 10px; line-height: 1.4;
}
.lang-btn:hover { color: var(--brand); border-color: var(--brand); }
.lang-btn.active { background: var(--brand-light); color: var(--brand); border-color: var(--brand); font-weight: 500; }

/* 汉堡按钮 */
.hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 32px; height: 40px; }
.hamburger span { display: block; height: 2px; background: var(--text-main); border-radius: 2px; transition: transform .2s, opacity .2s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端导航（<1024px 全屏菜单：覆盖 header 下方整个视口，链接垂直居中） */
@media (max-width: 1023px) {
  .nav {
    position: fixed; top: 72px; left: 0; right: 0;
    height: calc(100vh - 72px); height: calc(100dvh - 72px);
    background: var(--white);
    flex-direction: column; justify-content: center; gap: 0;
    padding: 0 24px;
    max-height: 0; overflow: hidden;
    transition: max-height .35s ease;
  }
  .nav.open { max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); }
  .nav a {
    padding: 17px 0; font-size: 17px; text-align: center;
    border-bottom: 1px solid #F0F2F5;
  }
  .nav a.active::after { display: none; }
  .header-lang { margin-left: auto; }
  .hamburger { display: flex; }
  .header-inner { gap: 12px; }
}

/* 滚动入场动画：滑入上移 + 错峰；关于我们大图缩放 reveal
   用独立 translate/scale 属性，避免与卡片 :hover 的 transform 冲突 */
.section .reveal {
  opacity: 0;
  translate: 0 24px;
  transition: opacity .6s ease, translate .6s ease;
  will-change: opacity, translate;
}
.section .reveal.in { opacity: 1; translate: 0 0; }
.section .reveal-zoom {
  opacity: 0;
  scale: 1.06;
  transition: opacity .7s ease, scale .7s ease;
  will-change: opacity, scale;
}
.section .reveal-zoom.in { opacity: 1; scale: 1; }
@media (prefers-reduced-motion: reduce) {
  .section .reveal,
  .section .reveal-zoom {
    opacity: 1 !important;
    translate: 0 0 !important;
    scale: 1 !important;
    transition: none;
  }
}

/* ==========================================================
   8. 页脚（JS渲染注入；手机端手风琴）
   ========================================================== */
.footer { background: #1B2A44; color: #C9D4E4; }
.footer-main { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1.4fr; gap: 40px; padding: 56px 0 40px; }
.footer-col h4 { font-size: 16px; font-weight: 500; color: var(--white); margin-bottom: 16px; }
.footer-col a { font-size: 14px; color: #A9B8CC; display: block; padding: 4px 0; }
.footer-col a:hover { color: var(--white); }
.footer-contact li { font-size: 14px; color: #A9B8CC; padding: 4px 0; line-height: 1.7; }
.footer-contact li strong { color: var(--white); font-weight: 500; }
.footer-contact .fc-more { padding-top: 10px; }
.footer-contact .fc-more a {
  color: var(--brand);
  display: inline-flex; align-items: center; gap: 4px;
  transition: color .2s ease;
}
.footer-contact .fc-more a:hover { color: var(--accent); }
.footer-contact .fc-more .arw { transition: transform .2s ease; }
.footer-contact .fc-more a:hover .arw { transform: translateX(3px); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 16px 0; text-align: center;
  font-size: 12px; color: #8FA0B8;
}

/* 手机端页脚手风琴 */
@media (max-width: 767px) {
  .footer-main { grid-template-columns: 1fr; gap: 0; padding: 16px 0 0; }   /* 底部 padding 归 0，避免末组下方多出空隙 */
  .footer-col { border-bottom: 1px solid rgba(255,255,255,.1); }
  .footer-col:last-child { border-bottom: none; }   /* 末组（联系我们）与版权行上边框避免双线 */
  .footer-col h4 {
    margin: 0; padding: 14px 0; cursor: pointer; position: relative;
    display: flex; align-items: center; justify-content: space-between;
  }
  .footer-col h4::after { content: "+"; font-size: 18px; color: #8FA0B8; font-weight: 400; }
  .footer-col.open h4::after { content: "-"; }
  .fc-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
  .footer-col.open .fc-body { max-height: 500px; padding-bottom: 12px; }
}

/* ---------- 回到顶部按钮（全站） ---------- */
.back-top {
  position: fixed; right: 24px; bottom: 32px; z-index: 999;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(30,134,232,.35);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
}
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { background: var(--brand-mid); }
.back-top svg { width: 20px; height: 20px; }
@media (max-width: 767px) {
  .back-top { width: 40px; height: 40px; right: 14px; bottom: 18px; }
  .back-top svg { width: 18px; height: 18px; }
}
