/* ============================================================
   宁波市人工智能公共服务平台 — 设计系统
   ============================================================ */

/* ——— 阿里巴巴普惠体 3.0（自托管 woff2，子集 CJK 基本区）——— */
@font-face {
  font-family: "Alibaba PuHuiTi 3.0";
  src: url("fonts/puhuiti-regular.woff2") format("woff2");
  font-weight: 100 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alibaba PuHuiTi 3.0";
  src: url("fonts/puhuiti-medium.woff2") format("woff2");
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ——— Light/Default Theme: 政务蓝 + 科技青 ——— */
  --bg: #f4f6fb;
  --bg-elevated: #ffffff;
  --bg-deep: #0a1b3d;             /* 用于反白区段 */
  --bg-deep-2: #112651;
  --bg-section: #ffffff;
  --bg-soft: #eef2f9;

  --line: #dde3ee;
  --line-strong: #c4cde0;
  --line-dark: rgba(255,255,255,0.12);

  --ink: #0a1b3d;
  --ink-2: #2b3a5c;
  --ink-3: #5b6783;
  --ink-mute: #8a93ad;
  --ink-inv: #ffffff;
  --ink-inv-2: #b8c6e6;
  --ink-inv-3: #7e8db3;

  --brand: #1554f0;               /* 主色：宁波蓝 */
  --brand-2: #0a3bcc;
  --brand-soft: #e6edff;

  --accent: #00b8d4;              /* 科技青 */
  --accent-2: #008fa8;

  --warm: #ff7a45;                /* 港口暖橙 */
  --warm-2: #e85d2a;

  --good: #16a34a;
  --warn: #f59e0b;

  /* 类型 */
  --font-cjk: "Alibaba PuHuiTi 3.0",-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei","Noto Sans SC","Hiragino Sans GB",Arial,sans-serif;
  --font-num: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;

  /* 几何 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* 阴影 */
  --shadow-1: 0 1px 2px rgba(15,30,60,0.04), 0 1px 1px rgba(15,30,60,0.02);
  --shadow-2: 0 4px 16px rgba(15,30,60,0.06), 0 1px 2px rgba(15,30,60,0.04);
  --shadow-3: 0 16px 48px rgba(15,30,60,0.10), 0 2px 6px rgba(15,30,60,0.05);

  /* 容器 */
  --container: 1320px;
  --gutter: 32px;
}

/* —— Theme: 深空科技（dark hero/sections） —— */
[data-theme="deep"] {
  --bg: #06112c;
  --bg-elevated: #0d1d44;
  --bg-section: #06112c;
  --bg-soft: #0d1d44;
  --line: #1a2c5a;
  --line-strong: #243a72;
  --ink: #ffffff;
  --ink-2: #c8d3ec;
  --ink-3: #8a99c2;
  --ink-mute: #5d6c94;
  --brand: #4c8bff;
  --brand-soft: rgba(76,139,255,0.14);
  --accent: #00e5ff;
  --warm: #ff9359;
}

/* —— Theme: 暖科技（neutral warm） —— */
[data-theme="warm"] {
  --bg: #faf8f4;
  --bg-elevated: #ffffff;
  --bg-section: #ffffff;
  --bg-soft: #f0ece3;
  --line: #e3ddcc;
  --line-strong: #c9c0a8;
  --ink: #1f1d2c;
  --ink-2: #383548;
  --ink-3: #6b6680;
  --brand: #2a3d8f;
  --brand-soft: #e6e9f7;
  --accent: #d97757;
  --warm: #d97757;
  --bg-deep: #1c1e2e;
  --bg-deep-2: #292c41;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html, body { overflow-x: clip; max-width: 100%; }
body {
  font-family: var(--font-cjk);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, h5, p { margin: 0; }

.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mono { font-family: var(--font-num); letter-spacing: 0.02em; }

/* ============================================================
   Container
   ============================================================ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ============================================================
   Top Bar (utility nav)
   ============================================================ */
.topbar {
  background: #061333;
  color: #b8c6e6;
  font-size: 12.5px;
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 36px;
}
.topbar-left { display: flex; gap: 18px; align-items: center; }
.topbar-left .gov-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 3px;
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.topbar-left .gov-badge::before {
  content: ""; width: 12px; height: 12px;
  background: linear-gradient(135deg,#e63946,#ffb800);
  border-radius: 2px;
}
.topbar-right { display: flex; gap: 18px; }
.topbar-right a { opacity: 0.85; }
.topbar-right a:hover { opacity: 1; color: #fff; }
.topbar-right .divider { color: rgba(255,255,255,0.2); }

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.94);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
  flex-shrink: 0;
}
.brand-mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 55%, #00b8d4 100%);
  border-radius: 10px;
  position: relative;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(21,84,240,0.28);
}
.brand-mark svg { width: 24px; height: 24px; color: #fff; }
.brand-text { line-height: 1.15; min-width: 0; }
.brand-cn { font-weight: 700; font-size: 15.5px; letter-spacing: 0.01em; color: var(--ink); white-space: nowrap; }
.brand-en { font-family: var(--font-num); font-size: 10px; color: var(--ink-3); margin-top: 2px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }

.nav-menu {
  display: flex;
  gap: 2px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}
.nav-menu a {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 500;
  position: relative;
  display: inline-flex; align-items: center; gap: 3px;
  white-space: nowrap;
}
.nav-menu a:hover { color: var(--brand); background: var(--brand-soft); }
.nav-menu a.active {
  color: var(--brand);
  background: var(--brand-soft);
}
.nav-menu a .chev {
  font-size: 9px; opacity: 0.7;
}

.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn .arrow { transition: transform 0.2s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 6px 16px rgba(21,84,240,0.28);
}
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-dark {
  background: var(--ink); color: #fff;
}
.btn-dark:hover { background: var(--ink-2); }
.btn-on-dark {
  background: #fff; color: var(--bg-deep);
}
.btn-on-dark:hover { background: #f0f4ff; }
.btn-ghost-on-dark {
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}
.btn-ghost-on-dark:hover { border-color: #fff; background: rgba(255,255,255,0.08); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 15.5px; }

/* ============================================================
   Section helpers
   ============================================================ */
section { position: relative; }
.section { padding: 88px 0; }
.section-tight { padding: 56px 0; }
.section-dark {
  background: var(--bg-deep);
  color: #fff;
}
.section-dark .eyebrow { color: var(--accent); }
.section-dark .section-title { color: #fff; }
.section-dark .section-sub { color: var(--ink-inv-2); }

.section-head { margin-bottom: 48px; }
.section-head.center { text-align: center; max-width: 760px; margin-left: auto; margin-right: auto; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: ""; width: 24px; height: 1.5px; background: currentColor;
}
.eyebrow.no-bar::before { display: none; }

.section-title {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 14px;
}
.section-title .accent { color: var(--brand); }
.section-sub {
  font-size: 16px;
  color: var(--ink-3);
  max-width: 720px;
  line-height: 1.7;
}
.section-head.center .section-sub { margin-left: auto; margin-right: auto; }

.section-tag {
  display: inline-flex; gap: 6px;
  font-size: 12px; color: var(--ink-mute);
  font-family: var(--font-num);
  margin-bottom: 8px;
  letter-spacing: 0.08em;
}

/* ============================================================
   Cards (generic)
   ============================================================ */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: #050d24;
  color: #b8c6e6;
  padding: 64px 0 32px;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-col h5 {
  color: #fff;
  font-size: 14px;
  margin-bottom: 18px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: #8c9bc1; transition: color 0.15s; }
.footer-col a:hover { color: #fff; }

.footer-brand .brand-cn { color: #fff; font-size: 18px; }
.footer-brand .brand-en { color: #7e8db3; }
.footer-brand-desc { color: #8c9bc1; line-height: 1.7; margin-top: 14px; font-size: 13.5px; max-width: 340px; }
.footer-meta {
  margin-top: 24px; display: flex; flex-direction: column; gap: 8px;
  font-size: 12.5px; color: #7e8db3; font-family: var(--font-num);
}

.footer-bottom {
  padding-top: 28px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: #7e8db3;
}
.footer-bottom .icp { letter-spacing: 0.04em; }
.footer-bottom .gov-stamps { display: flex; gap: 16px; align-items: center; }
.footer-bottom .stamp {
  width: 28px; height: 28px; background: rgba(255,255,255,0.06); border-radius: 4px;
  display: grid; place-items: center;
  font-size: 10px; color: #8c9bc1;
}

/* ============================================================
   Animation utilities
   ============================================================ */
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.6; }
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(21,84,240,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(21,84,240,0); }
}
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #16a34a;
  position: relative;
}
.live-dot::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  background: rgba(22,163,74,0.4); animation: pulse-dot 2s ease-out infinite;
}

/* dotted bg */
.bg-dots {
  background-image: radial-gradient(rgba(21,84,240,0.10) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* ============================================================
   Responsive
   ============================================================ */
/* 汉堡按钮 / 开关 —— 桌面隐藏 */
.nav-toggle { display: none; }
.nav-burger { display: none; }

@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ======= 移动端 ≤960：主菜单收进汉堡下拉 ======= */
@media (max-width: 960px) {
  .nav { height: 60px; justify-content: flex-start; }
  .brand { margin-right: auto; }
  .nav-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 8px;
    color: var(--ink); order: 3;
  }
  .nav-burger:hover { background: var(--bg-soft); }
  .nav-actions { order: 2; gap: 6px; }
  .nav-actions .btn-ghost { display: none; }   /* 移动端隐藏“登录”，给汉堡腾空间 */

  /* 下拉面板 */
  .site-header .nav { position: relative; }
  .nav-menu {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    justify-content: flex-start;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-2);
    padding: 8px 16px 16px; gap: 2px;
  }
  .nav-toggle:checked ~ .nav-menu { display: flex; }
  .nav-menu a { padding: 12px 12px; font-size: 15px; border-radius: 8px; }
}

/* ======= 手机 ≤720 ======= */
@media (max-width: 720px) {
  :root { --gutter: 18px; }
  .section { padding: 48px 0; }
  .section-tight { padding: 36px 0; }
  .section-head { margin-bottom: 32px; }
  .section-title { font-size: 26px; }
  .section-sub { font-size: 15px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 14px; align-items: flex-start; }
  .footer-bottom .gov-stamps { gap: 12px; }
}

/* ======= 小屏手机 ≤480 ======= */
@media (max-width: 480px) {
  :root { --gutter: 14px; }
  .topbar { display: none; }
  .brand-cn { font-size: 13.5px; }
  .brand-en { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-mark svg { width: 20px; height: 20px; }
  .section-title { font-size: 22px; }
  .btn { padding: 10px 15px; font-size: 13.5px; }
  .btn-lg { padding: 12px 18px; font-size: 14.5px; }
  .nav-actions .btn { padding: 8px 12px; font-size: 13px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
}
