/* ================================================================
   桐果云移动端 — 公共样式
   统一变量、导航、菜单、按钮、卡片、表单、动效等基础组件
   ================================================================ */

:root {
  --c-primary: #1677FF;
  --c-primary-dark: #0958d9;
  --c-primary-light: #4096FF;
  --c-accent: #FF7D00;
  --c-accent-light: #FF9A2E;
  --c-success: #10B981;
  --c-purple: #7C3AED;

  --c-text-1: #0F172A;
  --c-text-2: #334155;
  --c-text-3: #64748B;
  --c-text-4: #94A3B8;

  --c-border: #E2E8F0;
  --c-border-light: #F1F5F9;
  --c-bg-page: #FFFFFF;
  --c-bg-card: #FFFFFF;
  --c-bg-dark: #080c24;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;

  --fs-h1: 26px;
  --fs-h2: 22px;
  --fs-h3: 17px;
  --fs-body: 15px;
  --fs-caption: 13px;
  --fs-small: 12px;
  --fs-xs: 11px;

  --r-card: 12px;
  --r-btn: 8px;
  --r-sm: 6px;
  --r-xs: 4px;
  --r-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.10);

  --nav-h: 50px;
  --px: 20px;
  --page-max-w: 560px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --t-fast: .12s;
  --t-normal: .2s;
  --t-slow: .35s;
  --ease-out: cubic-bezier(.16,1,.3,1);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--font);
  color: var(--c-text-2);
  background: var(--c-bg-page);
  font-size: var(--fs-body);
  line-height: 1.55;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button { border: none; background: none; font: inherit; cursor: pointer; }
h1, h2, h3 { color: var(--c-text-1); font-weight: 700; line-height: 1.25; }

/* ====== 页容器 ====== */
.page-container {
  max-width: var(--page-max-w);
  margin: 0 auto;
  padding-top: var(--nav-h);
  padding-bottom: var(--s-7);
}

/* ====== 顶部导航 ====== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--px);
  max-width: var(--page-max-w);
  margin: 0 auto;
}
.navbar.scrolled { box-shadow: var(--shadow-sm); border-bottom-color: transparent; }
.nav-logo { height: 22px; width: auto; }
.nav-brand { display: flex; align-items: center; gap: 7px; }
.nav-brand span { font-weight: 700; font-size: 16px; line-height: 1; color: var(--c-text-1); }
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--c-text-1);
  min-width: 44px;
  min-height: 44px;
}
.nav-back svg { width: 20px; height: 20px; }
.nav-menu-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  transition: background var(--t-fast);
}
.nav-menu-btn:active { background: var(--c-border-light); }

/* ====== 侧边菜单 ====== */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-normal), visibility var(--t-normal);
}
.menu-overlay.open { opacity: 1; visibility: visible; }
.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 75%;
  max-width: 300px;
  height: 100dvh;
  background: #fff;
  z-index: 201;
  transform: translateX(100%);
  transition: transform var(--t-normal) var(--ease-out);
  display: flex;
  flex-direction: column;
}
.side-menu.open { transform: translateX(0); }
.side-menu-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--c-border-light);
}
.side-menu-header .menu-title { font-size: 17px; font-weight: 600; color: var(--c-text-1); }
.side-menu-header .menu-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  font-size: 18px;
  color: var(--c-text-3);
}
.side-menu-list {
  flex: 1;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.side-menu-list .menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px;
  border-radius: var(--r-card);
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--c-text-1);
  transition: background var(--t-fast);
  min-height: 48px;
}
.side-menu-list .menu-item:active { background: var(--c-border-light); }
.side-menu-list .menu-item .mi-icon { width: 20px; height: 20px; color: var(--c-text-3); flex-shrink: 0; }
.side-menu-list .menu-item.active { color: var(--c-primary); font-weight: 600; }
.side-menu-list .menu-item.active .mi-icon { color: var(--c-primary); }
.side-menu-list .menu-item.primary { color: var(--c-primary); }
.side-menu-list .menu-item.primary .mi-icon { color: var(--c-primary); }
.side-menu-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
  color: #fff;
}

/* ====== 按钮 ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--r-btn);
  font-size: var(--fs-body);
  font-weight: 600;
  transition: all var(--t-fast);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(22,119,255,.3);
}
.btn-primary:active { box-shadow: 0 2px 8px rgba(22,119,255,.2); }
.btn-outline {
  background: #fff;
  color: var(--c-primary);
  border: 1.5px solid var(--c-primary);
}
.btn-ghost { background: transparent; color: var(--c-primary); height: auto; padding: 0; }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 17px; padding: 0 28px; }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: var(--fs-caption); }

/* ====== 卡片 ====== */
.card {
  background: var(--c-bg-card);
  border-radius: var(--r-card);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.card:active { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: rgba(22,93,255,.2); }

/* ====== 通用区块 ====== */
.section { padding: var(--s-7) var(--px) 0; }
.section-header { text-align: center; margin-bottom: var(--s-5); }
.section-header h2 { font-size: var(--fs-h2); font-weight: 700; word-break: break-word; }
.section-header p { font-size: var(--fs-caption); color: var(--c-text-3); margin-top: var(--s-2); line-height: 1.5; }
.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--c-primary);
  background: rgba(22,119,255,.08);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: var(--s-3);
}

/* ====== Hero（深色科技风） ====== */
.hero, .case-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #080c24 0%, #0d1b3e 30%, #111d4a 60%, #080c24 100%);
  color: #fff;
  text-align: center;
}
.hero {
  padding: calc(var(--nav-h) + var(--s-6)) var(--px) var(--s-7);
}
.hero::before, .case-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, black 25%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, black 25%, transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 2; }
.hero h1 { font-size: var(--fs-h1); font-weight: 800; color: #fff; margin-bottom: var(--s-3); line-height: 1.2; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #60A5FA, #38BDF8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { font-size: var(--fs-caption); color: rgba(255,255,255,.6); line-height: 1.6; margin-bottom: var(--s-5); }
.hero-desc { font-size: var(--fs-caption); color: rgba(255,255,255,.7); line-height: 1.6; margin-bottom: var(--s-5); word-break: break-word; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  margin-bottom: var(--s-4);
}
.hero-tags {
  display: flex;
  gap: var(--s-2);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--s-5);
  max-width: 100%;
}
.hero-tags span {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: var(--fs-xs);
  font-weight: 500;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.1);
  white-space: nowrap;
}

/* 向下滚动提示 */
.scroll-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255,255,255,.5);
  font-size: var(--fs-xs);
  animation: bounce 2s infinite;
}
.scroll-hint svg { width: 20px; height: 20px; }
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ====== CTA & Footer ====== */
.cta-block {
  text-align: center;
  padding: 48px var(--px);
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  margin: 0 calc(var(--px) * -1);
}
.cta-title { font-size: var(--fs-h2); font-weight: 700; color: #fff; margin-bottom: 8px; }
.cta-sub { font-size: var(--fs-caption); color: rgba(255,255,255,.55); margin-bottom: 28px; }
.cta-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cta-btns .btn { background: var(--c-primary); color: #fff; border: none; min-height: 48px; padding: 0 28px; font-size: 15px; }
.cta-btns .btn-outline-cta { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.page-footer {
  text-align: center;
  padding: 32px var(--px) 24px;
  font-size: var(--fs-small);
  color: rgba(255,255,255,.35);
  line-height: 1.8;
  background: #0f172a;
  margin: 0 calc(var(--px) * -1);
}
.page-footer .footer-brand { font-weight: 600; color: rgba(255,255,255,.5); margin-bottom: 4px; }

/* ====== 案例详情页通用组件 ====== */
.case-hero { position: relative; overflow: hidden; padding: calc(var(--nav-h) + var(--s-7)) var(--px) var(--s-7); text-align: center; }
.case-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 50% 40% at 50% 30%, #000 20%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse 50% 40% at 50% 30%, #000 20%, transparent 65%);
  pointer-events: none;
}
.case-hero > * { position: relative; z-index: 2; }
.case-hero .back-link { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-caption); color: rgba(255,255,255,.6); margin-bottom: var(--s-4); }
.case-hero h1 { font-size: var(--fs-h1); font-weight: 800; color: #fff; margin-bottom: var(--s-3); }
.case-hero .hero-desc { font-size: var(--fs-caption); color: rgba(255,255,255,.55); line-height: 1.6; margin-bottom: var(--s-4); }
.case-hero .hero-tags { display: flex; gap: var(--s-2); justify-content: center; flex-wrap: wrap; margin-bottom: var(--s-5); max-width: 100%; }
.case-hero img { max-width: 260px; margin: 0 auto; border-radius: var(--r-card); border: 1px solid rgba(255,255,255,.08); }

.stats-bar { background: var(--c-bg-card); border-bottom: 1px solid var(--c-border); padding: var(--s-4) var(--px); display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: var(--s-2); text-align: center; }
.stats-bar .sb-num { font-size: 18px; font-weight: 800; color: var(--c-primary); }
.stats-bar .sb-lbl { font-size: var(--fs-xs); color: var(--c-text-3); margin-top: 2px; }

.pain-grid { display: flex; flex-direction: column; gap: var(--s-2); }
.pain-card { padding: var(--s-4); display: flex; gap: var(--s-3); align-items: flex-start; background: var(--c-bg-card); border-radius: var(--r-card); border: 1px solid var(--c-border); box-shadow: var(--shadow-xs); }
.pain-card .pc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.pain-card:nth-child(1) .pc-dot { background: #EF4444; }
.pain-card:nth-child(2) .pc-dot { background: #F59E0B; }
.pain-card:nth-child(3) .pc-dot { background: var(--c-primary); }
.pain-card h4 { font-size: var(--fs-caption); font-weight: 600; color: var(--c-text-1); margin-bottom: 2px; }
.pain-card p { font-size: var(--fs-small); color: var(--c-text-3); line-height: 1.4; }

.arch-img { border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--c-border); }
.arch-img img { width: 100%; }
.screenshot { border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--c-border); margin-bottom: var(--s-3); }
.screenshot img { width: 100%; }
.detail-card { padding: var(--s-5); margin-bottom: var(--s-3); background: var(--c-bg-card); border-radius: var(--r-card); border: 1px solid var(--c-border); box-shadow: var(--shadow-xs); }
.detail-card h4 { font-size: var(--fs-body); font-weight: 600; color: var(--c-text-1); margin-bottom: var(--s-2); }
.detail-card p { font-size: var(--fs-caption); color: var(--c-text-2); line-height: 1.6; }
.value-list { display: flex; flex-direction: column; gap: var(--s-2); }
.value-card { padding: var(--s-5); text-align: center; background: var(--c-bg-card); border-radius: var(--r-card); border: 1px solid var(--c-border); box-shadow: var(--shadow-xs); }
.value-card h4 { font-size: var(--fs-body); font-weight: 600; color: var(--c-text-1); margin-bottom: var(--s-1); }
.value-card p { font-size: var(--fs-caption); color: var(--c-text-3); line-height: 1.5; }

@media (max-width: 359px) {
  .stats-bar .sb-num { font-size: 16px; }
  .stats-bar .sb-lbl { font-size: 10px; }
}

/* ====== 表单基础 ====== */
input, select, textarea {
  font-family: inherit;
  font-size: var(--fs-body);
  color: var(--c-text-1);
  outline: none;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-btn);
  background: var(--c-bg-card);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(22,119,255,.1);
}
input::placeholder, textarea::placeholder { color: var(--c-text-4); }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: var(--fs-caption); font-weight: 600; color: var(--c-text-1); margin-bottom: var(--s-1); }
label .req { color: #EF4444; }
.form-group { margin-bottom: var(--s-4); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }

/* ====== 浮动立即咨询 ====== */
.float-contact {
  position: fixed;
  right: 12px;
  bottom: 24px;
  z-index: 150;
  padding: 10px 14px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
  box-shadow: 0 4px 16px rgba(22,93,255,.35);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform var(--t-fast);
  -webkit-transform: translate3d(0,0,0);
  transform: translate3d(0,0,0);
}
.float-contact svg { width: 18px; height: 18px; }
.float-contact:active { transform: scale(.92) translate3d(0,0,0); }

/* ====== 入场动效 ====== */
.reveal { opacity: 0; transform: translateY(16px); transition: all var(--t-slow) var(--ease-out); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }

/* ====== 可访问性：减少动效 ====== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ====== 响应式微调 ====== */
@media (min-width: 420px) {
  :root { --fs-h1: 28px; --fs-h2: 24px; }
}
@media (min-width: 560px) {
  .hero { border-radius: 0 0 var(--r-card) var(--r-card); }
}
