/* ============================================================
   common.css — 多模态OCR 全站统一设计系统
   所有页面共用此样式
   ============================================================ */

/* ============ Design Tokens ============ */
:root {
  /* 颜色 */
  --bg: #ffffff;
  --surface: #f6f9fc;
  --ink: #061b31;
  --ink-soft: #273951;
  --body-c: #64748d;
  --border: #e5edf5;
  --accent: #533afd;
  --accent-dark: #4434d4;
  --accent-soft: rgba(83, 58, 253, 0.06);
  --ok: #108c3d;
  --ok-bg: rgba(21, 190, 83, 0.14);
  --err: #df1b41;
  --err-bg: rgba(223, 27, 65, 0.1);
  --warn-bg: rgba(255, 179, 32, 0.14);
  --warn: #9b6829;

  /* 阴影 */
  --shadow-blue: 0 30px 45px -30px rgba(50, 50, 93, 0.25), 0 18px 36px -18px rgba(0, 0, 0, 0.1);
  --shadow-ambient: 0 15px 35px rgba(23, 23, 23, 0.08);
  --shadow-sm: 0 2px 6px rgba(23, 23, 23, 0.05);

  /* 字体 */
  --font-sans: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "Source Code Pro", ui-monospace, SFMono-Regular, Consolas, monospace;

  /* 布局 */
  --max-w: 1120px;
  --radius: 10px;
  --radius-sm: 6px;
}

/* ============ 全局重置 ============ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ============ 容器 ============ */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

b {
  color: var(--ink);
}

/* ============ 顶部导航（全站统一） ============ */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

header .wrap {
  padding: 0 24px;
}

nav {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

/* Logo */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  /* background: var(--accent); */
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}

.logo-text {
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  line-height: 1;
  user-select: none;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.brand.has-logo-img .logo-text {
  display: none;
}
.brand.has-logo-img .logo-img {
  display: block;
}

.brand-name {
  color: var(--ink);
}

/* 导航链接 */
.nav-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 14px;
  color: var(--ink-soft);
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 120ms ease;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* 右侧按钮 */
.nav-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

/* ============ 按钮（全站统一） ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  border: 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  letter-spacing: 0.02em;
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  text-decoration: none;
}

.btn-pri {
  background: var(--accent);
  color: #fff;
}

.btn-pri:hover {
  background: var(--accent-dark);
}

.btn-pri:active {
  transform: translateY(1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: #fff;
  border-color: #c9d6e6;
  box-shadow: var(--shadow-sm);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-invert {
  background: #fff;
  color: var(--accent);
}

.btn-invert:hover {
  opacity: 0.92;
}

.btn-danger {
  background: #fff;
  border: 1px solid rgba(223, 27, 65, 0.4);
  color: var(--err);
}

.btn-danger:hover {
  border-color: var(--err);
  background: var(--err-bg);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ============ 文字层级 ============ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 14px;
}

.sec-head {
  max-width: 720px;
  margin: 0 auto 52px;
  text-align: center;
}

.sec-head h2 {
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
}

.sec-head p {
  color: var(--body-c);
  font-size: 16px;
  max-width: 52ch;
  margin: 0 auto;
}

/* ============ 区块 ============ */
section {
  padding: 84px 0;
}

section.soft {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ============ 页脚（全站统一，固定贴底） ============ */
footer {
  margin-top: auto;
  padding: 34px 0 28px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.foot-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px 24px;
  flex-wrap: wrap;
}

/* 左侧：版权 + 备案（同一行） */
.foot-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.foot-brand {
  color: var(--body-c);
  font-size: 13px;
}

footer .links {
  display: flex;
  gap: 24px;
}

footer .links a {
  color: var(--body-c);
  font-size: 13px;
  text-decoration: none;
  transition: color 120ms ease;
}

footer .links a:hover {
  color: var(--ink);
}

/* 备案信息 */
footer .foot-beian {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 18px;
}

footer .foot-beian a,
footer .foot-beian span {
  color: var(--body-c);
  font-size: 12px;
  text-decoration: none;
  transition: color 120ms ease;
}

footer .foot-beian a:hover {
  color: var(--accent);
}

/* ============ Hero ============ */
.hero {
  padding: 96px 0 84px;
  text-align: center;
}

.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 26px;
}

.hero .badge b {
  color: var(--accent);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
}

.hero h1 {
  font-size: clamp(34px, 5.6vw, 60px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--ink);
  margin: 0 auto 22px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero .sub {
  max-width: 640px;
  margin: 0 auto;
  color: var(--body-c);
  font-size: 18px;
  line-height: 1.6;
}

.hero-cta {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero .mini {
  margin-top: 16px;
  font-size: 13px;
  color: var(--body-c);
}

/* ============ 代码块 ============ */
pre {
  background: #0d253d;
  border-radius: var(--radius);
  padding: 20px 22px;
  overflow: auto;
  font-size: 13px;
  color: #dbe7f5;
  line-height: 1.7;
  font-family: var(--font-mono);
  margin: 16px 0 20px;
  box-shadow: var(--shadow-ambient);
}

pre .k {
  color: #8fd0ff;
}
pre .s {
  color: #9be8c2;
}
pre .c {
  color: #7d93ac;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

/* ============ 消息条 ============ */
.msg {
  font-size: 13px;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0;
  display: none;
}

.msg.show {
  display: block;
}

.msg.err {
  background: var(--err-bg);
  border: 1px solid rgba(223, 27, 65, 0.35);
  color: var(--err);
}

.msg.ok {
  background: var(--ok-bg);
  border: 1px solid rgba(21, 190, 83, 0.4);
  color: var(--ok);
}

/* ============ Toast ============ */
#toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 120;
  box-shadow: var(--shadow-blue);
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
  .wrap {
    padding: 0 16px;
  }

  header .wrap {
    padding: 0 16px;
  }

  nav {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 12px 0;
    gap: 12px;
  }

  .brand {
    justify-content: center;
  }

  .nav-links {
    margin-left: 0;
    justify-content: center;
    gap: 16px;
    font-size: 14px;
    flex-wrap: wrap;
  }

  .nav-right {
    justify-content: center;
  }

  .hero {
    padding: 56px 0 48px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero .sub {
    font-size: 16px;
  }

  section {
    padding: 48px 0;
  }

  .sec-head {
    margin-bottom: 32px;
  }

  .foot-inner {
    flex-direction: column;
    text-align: center;
  }

  .foot-meta {
    justify-content: center;
  }

  footer .links {
    justify-content: center;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding: 0 12px;
  }

  .logo-placeholder {
    width: 30px;
    height: 30px;
  }

  .logo-text {
    font-size: 14px;
  }

  .brand-name {
    font-size: 14px;
  }

  .nav-links {
    gap: 12px;
    font-size: 13px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .hero .sub {
    font-size: 14px;
  }

  .hero {
    padding: 40px 0 32px;
  }

  section {
    padding: 32px 0;
  }

  .sec-head h2 {
    font-size: 20px;
  }

  .btn {
    padding: 6px 14px;
    font-size: 13px;
  }

  .btn-sm {
    padding: 4px 12px;
    font-size: 12px;
  }

  .btn-lg {
    padding: 10px 20px;
    font-size: 14px;
  }

  pre {
    font-size: 11px;
    padding: 12px 14px;
  }

  footer .links {
    gap: 12px;
  }

  footer .links a {
    font-size: 12px;
  }

  .foot-brand {
    font-size: 12px;
  }
}
/* 跨页面平滑过渡（Chrome/Edge 支持；其它浏览器自动回退普通跳转） */
@view-transition { navigation: auto; }


/* 跨页加载遮罩（掩盖整页加载抖动） */
.page-mask {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.86);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.2s ease;
}
.page-mask.show {
  opacity: 1;
  pointer-events: auto;
}
.mask-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(90, 120, 255, 0.25);
  border-top-color: #5a78ff;
  animation: maskSpin 0.7s linear infinite;
}
.mask-text {
  font-size: 13px;
  color: #6b7280;
}
@keyframes maskSpin {
  to { transform: rotate(360deg); }
}


/* 联系我们弹窗 */
.contact-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  font-size: 14px;
  color: #1f2937;
  border-bottom: 1px solid #eef1f5;
}
.contact-row:last-of-type { border-bottom: 0; }
.contact-row span {
  flex: none;
  width: 46px;
  color: #9ca3af;
}
.contact-row em {
  font-style: normal;
}

