/* ==========================================================================
   催菜宝官网 v2 — 基础样式与全站公共组件
   依赖 tokens.css。组件：header / footer / btn / section / carousel /
   reveal / faq / 移动端菜单
   ========================================================================== */

/* ----- 现代化 Reset ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}

ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  color: inherit;
  font-weight: 700;
}

a {
  color: inherit;
  text-decoration: none;
}

section[id],
[id] {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background: var(--c-primary);
  color: #fff;
}

/* 无 JS 或用户偏好减少动效时，内容直接可见 / 动画关闭 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ----- 跳转链接（无障碍） ----- */
.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--c-ink);
  color: #fff;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  transform: translateY(-200%);
  transition: transform var(--t-fast);
}

.skip-link:focus {
  transform: none;
}

/* ----- 布局 ----- */
.container {
  width: 100%;
  max-width: var(--w-container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.section {
  padding-block: var(--s-7);
}

.section--soft {
  background: var(--c-bg-soft);
}

.section--dark {
  background: linear-gradient(180deg, var(--c-ink) 0%, var(--c-ink-deep) 100%);
  color: #fff;
}

.section--dark .section-head h2,
.section--dark h3 {
  color: #fff;
}

/* ----- 区块标题 ----- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.875rem;
  border-radius: var(--r-pill);
  background: var(--c-primary-soft);
  color: var(--c-primary-strong);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: var(--s-2);
}

.kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-primary);
}

.section--dark .kicker {
  background: rgb(255 255 255 / 0.1);
  color: var(--c-primary-bright);
}

.section--dark .kicker::before {
  background: var(--c-primary-bright);
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--s-5);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head h2 {
  font-size: var(--fs-h2);
  color: var(--c-ink);
}

.lede {
  margin-top: var(--s-1);
  color: var(--c-text-2);
}

.section--dark .lede {
  color: rgb(255 255 255 / 0.66);
}

/* ----- 按钮 ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9375rem;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast),
    color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

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

.btn--primary {
  background: var(--c-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--c-primary-strong);
  box-shadow: var(--shadow-2);
}

.btn--light {
  background: #fff;
  color: var(--c-ink);
}

.btn--light:hover {
  box-shadow: var(--shadow-2);
}

.btn--ghost {
  border-color: var(--c-line);
  color: var(--c-text);
}

.btn--ghost:hover {
  border-color: var(--c-primary);
  color: var(--c-primary-strong);
}

.btn--ghost-light {
  border-color: rgb(255 255 255 / 0.3);
  color: #fff;
}

.btn--ghost-light:hover {
  border-color: #fff;
  background: rgb(255 255 255 / 0.08);
}

.btn--lg {
  padding: 0.9rem 1.75rem;
  font-size: 1rem;
}

/* ----- 页头 ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgb(238 245 253 / 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-mid), box-shadow var(--t-mid);
}

.site-header.is-scrolled {
  border-color: var(--c-line);
  box-shadow: var(--shadow-1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--c-ink);
}

.brand img {
  height: 34px;
  width: auto;
}

.nav {
  display: none;
}

.nav a {
  display: block;
  padding: 0.5rem 0.875rem;
  border-radius: var(--r-sm);
  color: var(--c-text-2);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color var(--t-fast), background var(--t-fast);
}

.nav a:hover {
  color: var(--c-ink);
  background: var(--c-bg-soft);
}

.nav a[aria-current="page"] {
  color: var(--c-primary-strong);
  background: var(--c-primary-soft);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

.header-tel {
  display: none;
}

.nav-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
}

.nav-toggle:hover {
  background: var(--c-bg-soft);
}

.nav-toggle span {
  grid-area: 1 / 1;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-ink);
  transition: transform var(--t-mid), opacity var(--t-fast);
}

.nav-toggle span:nth-child(1) {
  transform: translateY(-5px);
}

.nav-toggle span:nth-child(3) {
  transform: translateY(5px);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg);
}

@media (min-width: 960px) {
  .nav {
    display: flex;
    gap: 0.25rem;
  }

  .nav-toggle {
    display: none;
  }

  .header-tel {
    display: inline-flex;
    margin-right: 0.5rem;
  }
}

/* ----- 移动端全屏菜单 ----- */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 90;
  padding: calc(var(--header-h) + var(--s-4)) clamp(1.25rem, 6vw, 3rem) var(--s-4);
  background: linear-gradient(180deg, var(--c-ink) 0%, var(--c-ink-deep) 100%);
  visibility: hidden;
  transform: translateX(100%);
  transition: transform var(--t-mid) var(--ease-out), visibility 0s var(--t-mid);
}

.mobile-nav.is-open {
  visibility: visible;
  transform: none;
  transition: transform var(--t-mid) var(--ease-out);
}

.mobile-nav a {
  display: block;
  padding: 1.125rem 0;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 500;
}

.mobile-nav a[aria-current="page"] {
  color: var(--c-primary-bright);
  font-weight: 700;
}

.mobile-nav .mobile-nav__cta {
  margin-top: var(--s-4);
}

body.nav-locked {
  overflow: hidden;
}

/* ----- 页脚 ----- */
.site-footer {
  background: var(--c-ink-deep);
  color: rgb(255 255 255 / 0.68);
  font-size: var(--fs-sm);
}

.footer-grid {
  display: grid;
  gap: var(--s-4);
  padding-block: var(--s-6) var(--s-4);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.125rem;
}

.footer-brand img {
  height: 30px;
  width: auto;
}

.footer-brand + p {
  margin-top: var(--s-2);
  max-width: 26em;
}

.site-footer h4 {
  margin-bottom: var(--s-2);
  color: #fff;
  font-size: var(--fs-body);
}

.footer-links a {
  display: block;
  padding-block: 0.3rem;
  transition: color var(--t-fast);
}

.footer-links a:hover,
.footer-contact a:hover {
  color: #fff;
}

.footer-contact li {
  display: flex;
  gap: 0.625rem;
  padding-block: 0.3rem;
}

.footer-contact svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 0.3rem;
  fill: none;
  stroke: var(--c-primary-bright);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-3);
  justify-content: space-between;
  padding-block: 1.25rem;
  border-top: 1px solid rgb(255 255 255 / 0.1);
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1.4fr;
  }
}

/* ----- 滚动渐入（JS 未加载时内容直接可见） ----- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.js .reveal.d1 { transition-delay: 0.08s; }
.js .reveal.d2 { transition-delay: 0.16s; }
.js .reveal.d3 { transition-delay: 0.24s; }

/* ----- 原生滚动轮播（scroll-snap，零 JS 依赖即可滚动） ----- */
.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.carousel-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--c-line);
  background: #fff;
  box-shadow: var(--shadow-1);
  transition: border-color var(--t-fast), color var(--t-fast),
    opacity var(--t-fast);
}

.carousel-btn:hover {
  border-color: var(--c-primary);
  color: var(--c-primary-strong);
}

.carousel-btn[disabled] {
  opacity: 0.35;
  cursor: default;
}

/* ----- FAQ（details/summary 原生手风琴，零 JS） ----- */
.faq-list {
  max-width: 760px;
  margin-inline: auto;
}

.faq-list details {
  border-bottom: 1px solid var(--c-line);
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding-block: 1.25rem;
  font-weight: 600;
  color: var(--c-ink);
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--c-text-3);
  border-bottom: 2px solid var(--c-text-3);
  transform: rotate(45deg);
  transition: transform var(--t-mid);
}

.faq-list details[open] summary::after {
  transform: rotate(225deg);
}

.faq-list details[open] .faq-a {
  animation: faq-in 0.3s var(--ease-out);
}

.faq-a {
  padding-bottom: 1.25rem;
  color: var(--c-text-2);
}

@keyframes faq-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ----- 状态色小圆点（催菜流程语义色） ----- */
.status-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot, var(--c-text-3));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot, var(--c-text-3)) 18%, transparent);
}

/* ----- 按钮排（hero / CTA 共用） ----- */
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) 0.75rem;
  margin-top: var(--s-3);
}

/* ----- CTA 深色卡（各页页尾共用） ----- */
.cta-band {
  position: relative;
  overflow: hidden;
  padding: var(--s-6) var(--s-4);
  text-align: center;
  border-radius: var(--r-xl);
  color: #fff;
  background:
    radial-gradient(rgb(255 255 255 / 0.055) 1px, transparent 1.5px) 0 0 / 22px 22px,
    radial-gradient(40rem 20rem at 90% -20%, rgb(77 155 245 / 0.4), transparent 60%),
    linear-gradient(135deg, var(--c-ink) 0%, #0c2b55 100%);
}

.cta-band h2 {
  font-size: var(--fs-h2);
}

.cta-band p {
  margin-top: var(--s-1);
  color: rgb(255 255 255 / 0.68);
}

.cta-band .hero-cta {
  justify-content: center;
  margin-top: var(--s-3);
}

@media (min-width: 720px) {
  .cta-band {
    padding: var(--s-7) var(--s-6);
  }
}

/* ----- 软件下载卡（首页 / 联系页共用） ----- */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
}

.dl-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: var(--s-4) var(--s-2);
  text-align: center;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  transition: transform var(--t-mid) var(--ease-out), box-shadow var(--t-mid),
    border-color var(--t-mid);
}

.dl-card:hover {
  transform: translateY(-4px);
  border-color: var(--c-primary);
  box-shadow: var(--shadow-2);
}

.dl-tile {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--r-md);
  margin-bottom: 0.625rem;
}

.dl-tile img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.dl-tile--b { background: var(--c-primary-soft); }
.dl-tile--g { background: #e8f8ee; }
.dl-tile--o { background: #fdf1e3; }
.dl-tile--p { background: #f3ecfe; }

.dl-card strong {
  font-size: 1.0625rem;
  color: var(--c-ink);
}

.dl-card > span:not(.dl-tile):not(.dl-btn) {
  font-size: var(--fs-sm);
  color: var(--c-text-3);
}

.dl-btn {
  margin-top: 0.5rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-primary-strong);
}

.dl-card--soon {
  opacity: 0.72;
}

.dl-card--soon .dl-btn {
  color: var(--c-text-3);
}

@media (min-width: 860px) {
  .dl-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ----- 客户评价卡（首页 / 案例页共用） ----- */
.quote-grid {
  display: grid;
  gap: var(--s-3);
}

.quote-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4);
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

.quote-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-primary) 0%, #8cc4ff 60%, transparent 100%);
}

.quote-card blockquote {
  flex: 1;
  color: var(--c-text-2);
  line-height: 1.85;
  font-size: var(--fs-sm);
}

.quote-card blockquote::before {
  content: "“";
  display: block;
  font-size: 2.5rem;
  line-height: 0.6;
  margin-bottom: 0.75rem;
  color: var(--c-primary);
  font-family: Georgia, serif;
}

.quote-who {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
}

.avatar--b { background: var(--c-primary-soft); color: var(--c-primary-strong); }
.avatar--g { background: #e8f8ee; color: #15803d; }
.avatar--p { background: #f3ecfe; color: #7e22ce; }

.quote-who strong {
  display: block;
  color: var(--c-ink);
  font-size: 0.9375rem;
}

.quote-who span {
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}

@media (min-width: 800px) {
  .quote-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ----- 返回顶部 ----- */
.back-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-2);
  color: var(--c-text-2);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--t-mid), transform var(--t-mid),
    color var(--t-fast), border-color var(--t-fast);
}

.back-top.is-show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.back-top:hover {
  color: var(--c-primary-strong);
  border-color: var(--c-primary);
}

/* ----- 页脚热门关键词 ----- */
.footer-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding-bottom: var(--s-3);
  font-size: var(--fs-xs);
}

.footer-keywords > span {
  color: rgb(255 255 255 / 0.45);
}

.footer-keywords a {
  color: rgb(255 255 255 / 0.55);
  transition: color var(--t-fast);
}

.footer-keywords a:hover {
  color: #fff;
}

/* ----- 微信内打开引导（app.js 检测微信 UA 后注入） ----- */
.wechat-guide {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgb(4 12 24 / 0.88);
  animation: guide-in 0.3s var(--ease-out);
}

.wechat-guide__card {
  position: relative;
  max-width: 340px;
  padding: 2rem 1.75rem 1.75rem;
  background: #fff;
  border-radius: 20px;
  text-align: center;
}

.wechat-guide__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--c-text-3);
  font-size: 1.25rem;
  line-height: 1;
}

.wechat-guide__close:hover {
  background: var(--c-bg-soft);
  color: var(--c-text);
}

.wechat-guide__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-ink);
}

.wechat-guide__text {
  margin-top: 0.75rem;
  color: var(--c-text-2);
  line-height: 1.8;
}

.wechat-guide__text b {
  color: var(--c-primary);
}

.wechat-guide__demo {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
}

.wechat-guide__dots {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--c-primary);
}

.wechat-guide__pill {
  padding: 0.35rem 1.25rem;
  border: 1.5px solid var(--c-primary);
  border-radius: var(--r-pill);
  color: var(--c-primary);
  font-size: 0.8125rem;
  font-weight: 600;
}

@keyframes guide-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
