/* =============================================================
   base.css — 共享基础样式（选择器与标签分离的核心层）
   作用域：reset / 主题变量 / 排版 / 容器 / 头部导航 / 页脚 / 按钮 / 工具类
   说明：所有页面共用，页面专属样式放各自 page.css，绝不写内联 style
   ============================================================= */

/* ---------- 主题变量：亮色（默认） ---------- */
:root {
  --c-primary: #14529b;
  --c-primary-strong: #0d3a72;
  --c-accent: #ff7a18;
  --c-accent-strong: #e86300;

  --c-bg: #f4f7fb;
  --c-surface: #ffffff;
  --c-surface-2: #eef3f9;
  --c-border: #e2e8f1;

  --c-text: #1f2a37;
  --c-text-soft: #5b6b7d;
  --c-text-mute: #8a99ab;

  --c-header-bg: rgba(255, 255, 255, 0.86);
  --c-header-border: rgba(20, 82, 155, 0.10);
  --c-shadow: 0 10px 30px -12px rgba(13, 58, 114, 0.22);
  --c-shadow-soft: 0 4px 16px -8px rgba(13, 58, 114, 0.20);

  --radius: 14px;
  --radius-sm: 10px;
  --container: 1200px;
  --header-h: 72px;

  --grad-hero: linear-gradient(120deg, #0d3a72 0%, #14529b 45%, #1f6fc4 100%);
  --grad-accent: linear-gradient(135deg, #ff7a18 0%, #ff9a3d 100%);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

/* ---------- 主题变量：暗色 ---------- */
[data-theme="dark"] {
  --c-primary: #4a9bff;
  --c-primary-strong: #2f7fe0;
  --c-accent: #ff8c3a;
  --c-accent-strong: #ff7714;

  --c-bg: #0c1320;
  --c-surface: #141d2e;
  --c-surface-2: #1b2738;
  --c-border: #283648;

  --c-text: #e8eef7;
  --c-text-soft: #aab8c9;
  --c-text-mute: #74859a;

  --c-header-bg: rgba(18, 26, 40, 0.82);
  --c-header-border: rgba(74, 155, 255, 0.14);
  --c-shadow: 0 10px 34px -10px rgba(0, 0, 0, 0.55);
  --c-shadow-soft: 0 4px 18px -8px rgba(0, 0, 0, 0.5);

  --grad-hero: linear-gradient(120deg, #0a1424 0%, #142844 55%, #1d3a63 100%);
  --grad-accent: linear-gradient(135deg, #ff8c3a 0%, #ffae5e 100%);
  color-scheme: dark;
}

/* ---------- reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/*noinspection CssOverwrittenProperties*/
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.7;
  font-size: 15px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color 0.25s var(--ease); }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---------- 布局容器 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }

/* ---------- 区块标题 ---------- */
.section-head { text-align: center; margin-bottom: 40px; }
.section-head .eyebrow {
  display: inline-block;
  color: var(--c-accent-strong);
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 13px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-head h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--c-text);
}
.section-head p { color: var(--c-text-soft); margin-top: 10px; }

/* 分隔短线 */
.divider {
  width: 56px; height: 4px; border-radius: 4px;
  background: var(--grad-accent);
  margin: 14px auto 0;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600; font-size: 15px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s var(--ease);
  will-change: transform;
}
.btn-primary {
  background: var(--grad-accent);
  color: #fff;
  box-shadow: 0 8px 22px -8px rgba(255, 122, 24, 0.7);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(255, 122, 24, 0.75); }
.btn-ghost {
  border: 2px solid var(--c-border);
  color: var(--c-text);
  background: var(--c-surface);
}
.btn-ghost:hover { border-color: var(--c-primary); color: var(--c-primary); transform: translateY(-2px); }

/* ---------- 头部 / 导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--c-header-bg);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--c-header-border);
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease);
}

/* 中间内容区：占据页头与页脚之间的剩余空间。
   整页在 window 上正常滚动（不再使用内部滚动容器，避免卡死）；
   flex:1 0 auto 让短页面时页脚贴底、长页面时随内容自然增高。 */
main {
  flex: 1 0 auto;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { height: 42px; width: auto; }
.brand img { height: 48px; width: auto; }
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand .brand-name { font-weight: 800; font-size: 24px; letter-spacing: 1px; }
.brand .brand-sub { font-size: 7px; color: var(--c-text-mute); letter-spacing: 1px; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 15px;
  color: var(--c-text-soft);
  border-radius: 8px;
  white-space: nowrap; /* 防止「产品展示」等四字导航被断行 */
}
.nav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 2px; background: var(--grad-accent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.nav a:hover { color: var(--c-primary); }
.nav a:hover::after,
.nav a.active::after { transform: scaleX(1); }
.nav a.active { color: var(--c-primary); }

.header-actions { display: flex; align-items: center; gap: 12px; }

/* 主题切换按钮 */
.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.theme-toggle:hover { transform: rotate(-18deg) scale(1.05); border-color: var(--c-primary); }
.theme-toggle svg { width: 20px; height: 20px; }

/* SVG 图标精灵容器：symbol 定义一次，页面内 <use> 到处引用，消除图标重复 */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.theme-toggle .i-moon { display: none; }
.theme-toggle[data-state="dark"] .i-sun { display: none; }
.theme-toggle[data-state="dark"] .i-moon { display: block; }

/* 移动端汉堡 */
.nav-toggle {
  display: none; width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid var(--c-border); background: var(--c-surface);
  flex-direction: column; gap: 5px; align-items: center; justify-content: center;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--c-text); border-radius: 2px; transition: 0.3s var(--ease); }

/* ---------- 页脚 ---------- */
.site-footer {
  flex-shrink: 0; /* 不收缩，始终完整显示；与 main 的 flex:1 配合实现短页面页脚贴底 */
  background: var(--c-surface-2);
  border-top: 1px solid var(--c-border);
  padding: 48px 0 22px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-col h4 { font-size: 15px; margin-bottom: 16px; color: var(--c-text); }
.footer-col a, .footer-col p { color: var(--c-text-soft); font-size: 14px; display: block; padding: 4px 0; }
.footer-col a:hover { color: var(--c-primary); }
.footer-brand p { margin-top: 12px; }
.footer-contact li { display: flex; gap: 4px; padding: 4px 0; color: var(--c-text-soft); font-size: 14px; }
.footer-bottom {
  margin-top: 36px; padding-top: 18px;
  border-top: 1px solid var(--c-border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  color: var(--c-text-mute); font-size: 13px;
}
.footer-bottom a { color: var(--c-text-mute); }
.footer-bottom a:hover { color: var(--c-primary); }

/* footer 内联样式外置（template.html 单一数据源，避免内联 style） */
.footer-brand-logo { display: flex; }
.footer-brand-name { font-size: 22px ; }
.footer-contact .fc-ico { width: 48px; height: auto; }
.footer-contact .fc-loc { width: auto; height: 48px; }

/* ---------- 面包屑 ---------- */
.breadcrumb { padding: 18px 0; font-size: 14px; color: var(--c-text-mute); }
.breadcrumb a:hover { color: var(--c-primary); }
.breadcrumb span { margin: 0 7px; }

/* ---------- 卡片通用 ---------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--c-shadow-soft);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--c-shadow); border-color: var(--c-primary); }

/* ---------- 工具类 ---------- */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mt-sm { margin-top: 14px; }
.mb-16 { margin-bottom: 16px; }
.muted { color: var(--c-text-mute); }
.soft { color: var(--c-text-soft); }

/* 语义化背景 / 对齐 / 间距（替代内联 style，保证选择器与标签分离） */
.bg-soft { background: var(--c-surface-2); }
.align-left { text-align: left; }
.align-left .divider { margin-left: 0; margin-right: auto; }
.section-head.tight { margin-bottom: 18px; }
.pad-22 { padding: 22px; }
.pad-26 { padding: 26px; }
.pad-36 { padding: 36px; }
.narrow { max-width: 880px; margin-left: auto; margin-right: auto; }
.title-sm { font-size: 22px; }
.qr-sm { width: 120px; height: auto; }
.qr-cap { margin-top: 8px; font-size: 13px; }

/* 回到顶部 */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--grad-accent); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 24px -8px rgba(255, 122, 24, 0.7);
  opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { transform: translateY(-3px); }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    padding: 10px 16px 18px;
    box-shadow: var(--c-shadow);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  }
  .nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav a { padding: 13px 12px; border-radius: 8px; }
  .nav a::after { display: none; }
  .nav a:hover, .nav a.active { background: var(--c-surface-2); }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
  .brand .brand-sub { display: none; }
}

/* 动态内容空状态（前端动态渲染时占位，无数据时优雅提示） */
.empty-state {
  padding: 56px 16px;
  text-align: center;
  color: var(--c-text-mute);
  font-size: 15px;
}
