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

:root {
  --bg: #f5f5f5;
  --text: #111;
  --text-secondary: #6b6b6b;
  --border: #d8d8d8;
  --card-bg: #fff;
  --radius: 16px;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

section[id] { scroll-margin-top: 88px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

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

/* ===== Background Patterns ===== */
.line-bg { position: relative; }
.line-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg, transparent, transparent 14px,
    rgba(0,0,0,0.03) 14px, rgba(0,0,0,0.03) 15px
  );
  pointer-events: none;
  z-index: 0;
}

.dot-bg { position: relative; }
.dot-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(0, 0, 0, 0.18) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
  z-index: 0;
}

.dot-bg-vignette::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  mask-image: radial-gradient(ellipse at center, transparent 22%, black 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 22%, black 80%);
  pointer-events: none;
  z-index: 0;
}

/* ===== Navigation ===== */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  isolation: isolate;
  padding: 16px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(16px);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.site-nav.scrolled {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.nav-logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.nav-logo:hover { opacity: 0.85; }

.nav-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
}

.nav-center {
  display: flex;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-pill {
  position: relative;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 100px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
}

.nav-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  width: 0;
  border-radius: 100px;
  background: var(--text);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.nav-pill a {
  position: relative;
  z-index: 1;
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.25s ease;
  color: var(--text-secondary);
  white-space: nowrap;
}

.nav-pill a:hover { color: var(--text); }

.nav-pill a.active { color: #fff; }

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  justify-content: space-around;
  gap: 4px;
}

.mobile-nav a {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}

.mobile-nav a.active {
  background: var(--text);
  color: #fff;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Language switcher */
.lang-switcher {
  position: relative;
}

.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.lang-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lang-chevron {
  transition: transform 0.25s ease;
}

.lang-switcher.open .lang-chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 148px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 200;
}

.lang-switcher.open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}

.lang-option:hover {
  background: var(--bg);
}

.lang-option.active {
  background: var(--bg);
  font-weight: 700;
}

/* ====================================================
   HERO - Flat circle follows mouse, reveals Chinese
   ==================================================== */
.hero-section,
#hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: clip;
  overflow-y: visible;
  background: var(--bg);
}

.hero-section { padding-top: 80px; }

.hero-tag {
  position: absolute;
  font-size: 13px;
  letter-spacing: 3px;
  color: rgba(0,0,0,0.1);
  font-weight: 500;
  z-index: 2;
  pointer-events: none;
}

.hero-stage {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform-style: preserve-3d;
  will-change: transform;
  overflow: visible;
}

.hero-headline {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: min(98vw, 1120px);
  padding-inline: clamp(16px, 4vw, 40px);
  text-align: center;
  transform-style: preserve-3d;
  overflow: visible;
}

.hero-title-stack {
  position: relative;
  /* 上下各留半个球，球贴边时不溢出、不压副标题 */
  padding-block: calc(var(--orb-size, 165px) / 2);
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: visible;
  max-width: 100%;
}

.hero-title-stack > .hero-text-base,
.hero-title-stack > .hero-text-reveal,
.hero-title-stack > .hero-circle {
  grid-area: 1 / 1;
}

.hero-title-line {
  margin: 0;
  font-size: clamp(34px, 5.9vw, 78px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.08;
  white-space: nowrap;
  overflow: visible;
  padding-inline-end: 0.28em;
  box-sizing: content-box;
}

.hero-text-base .hero-title-line {
  color: var(--text);
}

.hero-text-reveal .hero-title-line {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  /* 中文与英文同字号：球窗内显示的正是标题该位置的字符 */
  font-size: clamp(34px, 5.9vw, 78px);
}

.hero-text-base .hero-title-line em {
  font: inherit;
  font-style: normal;
  letter-spacing: inherit;
}

.hero-below {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 24px;
  text-align: center;
  pointer-events: none;
}

.hero-below .hero-subtitle {
  margin: 0;
  text-align: center;
}

.hero-below .hero-cta {
  margin-top: 28px;
}

.hero-text-base {
  position: relative;
  z-index: 1;
  width: max-content;
  max-width: 100%;
  overflow: visible;
  padding-inline: 0.12em 0.35em;
  pointer-events: none;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.hero-text-reveal {
  position: relative;
  z-index: 3;
  width: max-content;
  max-width: 100%;
  overflow: visible;
  padding-inline: 0.12em 0.35em;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.hero-text-reveal.is-revealing {
  visibility: visible;
  opacity: 1;
}

.hero-badge {
  position: absolute;
  top: 100px;
  left: 50%;
  /* 用独立的 translate 属性居中：.reveal 会改 transform，不能共用 */
  translate: -50% 0;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  max-width: calc(100% - 40px);
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
  flex-shrink: 0;
}

.hero-below .hero-cta {
  pointer-events: auto;
}

.hero-below .hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

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

.btn-secondary:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}


/* 实心黑球夹在英文底层与中文揭示层之间，与标题 mask 同坐标系 */
.hero-circle {
  position: absolute;
  /* 球尺寸跟随标题字号（一行高约 1.08em），略大一点让中文完整显示 */
  --orb-size: clamp(112px, 13vw, 190px);
  width: var(--orb-size);
  height: var(--orb-size);
  margin: 0;
  border-radius: 50%;
  background: #111;
  z-index: 2;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  left: 50%;
  top: 50%;
  opacity: 0;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  will-change: transform, left, top, opacity;
}

.hero-circle-glow {
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.1), transparent 70%);
  pointer-events: none;
}

.hero-section.sleeping .hero-badge-dot {
  background: #b0b0b0;
  animation: hero-dot-pulse 2.2s ease-in-out infinite;
}

.hero-section.awake .hero-badge-dot.is-live {
  background: #10b981;
  animation: none;
}

@keyframes hero-dot-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.82); }
  50% { opacity: 1; transform: scale(1); }
}

.hero-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--text-secondary);
  z-index: 8;
  pointer-events: none;
}

/* ===== Shared Section Header ===== */
.section-header { margin-bottom: 60px; }

.section-header h2 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 900;
}

.section-header-line {
  width: 60px;
  height: 4px;
  background: var(--text);
  border-radius: 2px;
  margin-top: 16px;
  margin-bottom: 16px;
}

.section-header p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 500px;
}

.section-hint {
  font-size: 13px;
  color: #767676;
  margin-top: 10px;
}

.section-eyebrow {
  display: block;
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #aaa;
  margin-bottom: 12px;
}

.section-eyebrow-light { color: rgba(255, 255, 255, 0.45); }

/* ===== PRODUCTS Section ===== */
#products { padding: 100px 0; }

.products-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 48px;
  position: relative;
  z-index: 1;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Border beam (reference site) */
@keyframes beam-spin {
  to { offset-distance: 100%; }
}

.border-beam-card {
  position: relative;
  --beam-size: 120px;
  --beam-duration: 6s;
  --beam-delay: 0s;
}

.border-beam {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 12;
  border-radius: inherit;
  border: 1px solid transparent;
  -webkit-mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0) border-box;
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0) border-box;
  mask-composite: exclude;
}

.border-beam::after {
  content: '';
  position: absolute;
  width: var(--beam-size);
  aspect-ratio: 1;
  background: linear-gradient(to left, #111, transparent 50%);
  opacity: 0.55;
  animation: beam-spin var(--beam-duration) linear infinite;
  animation-delay: var(--beam-delay);
  offset-path: rect(0 auto auto 0 round var(--beam-size));
  offset-anchor: 90% 50%;
  offset-distance: 0%;
}

/* Flip cards — uniform size, hover to reveal intro */
.flip-card {
  height: 230px;
  perspective: 1000px;
  border-radius: var(--radius);
}

/* reveal 的 translateY 会破坏 preserve-3d，导致背面镜像 */
.flip-card.reveal {
  opacity: 0;
  transform: none;
  transition: opacity 0.6s ease;
}

.flip-card.reveal.visible {
  opacity: 1;
  transform: none;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

/* 悬停翻面（不限制媒体查询，兼容老浏览器与部分内嵌 WebView） */
.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.flip-card-front {
  background: var(--card-bg);
  transform: rotateY(0deg);
  z-index: 2;
}

.flip-card:hover .flip-card-front {
  border-color: transparent;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

.flip-card-back {
  background: #111;
  border-color: rgba(255, 255, 255, 0.08);
  transform: rotateY(180deg);
  justify-content: space-between;
  z-index: 1;
}

.flip-card:hover .flip-card-back {
  border-color: transparent;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.25);
}

.flip-card-back p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

.flip-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  transition: gap 0.2s, opacity 0.2s;
}

.flip-card-link:hover {
  gap: 10px;
  opacity: 0.85;
}

.product-card-number {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 52px;
  font-weight: 900;
  color: rgba(0, 0, 0, 0.05);
  line-height: 1;
  pointer-events: none;
}

.product-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.product-tags span {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  background: var(--text);
  color: #fff;
  border-radius: 100px;
}

.product-tag-accent {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--text);
}

.product-card-icon {
  width: 44px;
  height: 44px;
  background: #222;
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.flip-card-front h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.3;
}

.flip-card-front .product-domain {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: "SF Mono", "Fira Code", monospace;
}

/* ===== PROJECTS Section ===== */
.projects-header-bar {
  background: #111;
  color: #fff;
  padding: 80px 48px 60px;
  text-align: center;
}

.projects-header-bar h2 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 900;
}

.projects-header-line {
  width: 60px;
  height: 4px;
  background: #fff;
  border-radius: 2px;
  margin: 16px auto 0;
}

.projects-header-desc {
  margin: 16px auto 0;
  max-width: 520px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.7;
}

#projects { padding: 0 0 100px; }

.projects-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 48px 0;
  position: relative;
  z-index: 1;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  margin-bottom: 20px;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
  transform-style: preserve-3d;
  will-change: transform;
  cursor: default;
}

.project-card.border-beam-card {
  overflow: hidden;
  --beam-size: 140px;
  --beam-duration: 7s;
}

.flip-card.border-beam-card:nth-child(3n+1) { --beam-delay: 0s; }
.flip-card.border-beam-card:nth-child(3n+2) { --beam-delay: 1.2s; }
.flip-card.border-beam-card:nth-child(3n) { --beam-delay: 2.4s; }

.contact-item:nth-child(1) { --beam-delay: 0s; }
.contact-item:nth-child(2) { --beam-delay: 1.5s; }

.hero-section.sleeping {
  cursor: pointer;
}

.project-card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.project-index {
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.project-year {
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
  font-size: 13px;
  color: #767676;
}

.project-card-divider {
  display: none;
}

.project-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card h3 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
}

.project-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 0;
}

.project-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.project-tags span {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  background: #f5f5f5;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 100px;
}

@media (min-width: 768px) {
  .project-card {
    flex-direction: row;
    align-items: stretch;
    gap: 32px;
    padding: 40px 36px;
  }

  .project-card-meta {
    flex-direction: column;
    justify-content: flex-start;
    width: 88px;
    flex-shrink: 0;
  }

  .project-card-divider {
    display: block;
    width: 1px;
    align-self: stretch;
    background: var(--border);
    flex-shrink: 0;
  }
}

/* ===== CONTACT Section (reference layout) ===== */
.contact-section {
  position: relative;
  overflow: hidden;
  padding: 96px 0 72px;
  background: #fff;
}

.contact-bg-dot {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(0, 0, 0, 0.18) 1px, transparent 1px);
  background-size: 18px 18px;
}

.contact-bg-mask {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: #fff;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, transparent 0%, #000 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, transparent 0%, #000 70%);
}

.contact-bg-glow {
  pointer-events: none;
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(640px, 90vw);
  height: min(640px, 90vw);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.07), transparent 70%);
  filter: blur(24px);
}

.contact-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.contact-headline {
  margin-top: 16px;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.contact-lead {
  margin: 20px auto 0;
  max-width: 36rem;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.65;
  color: var(--text-secondary);
}

.contact-cta-wrap {
  margin-top: 40px;
}

.contact-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 48px -8px rgba(0, 0, 0, 0.5);
}

.contact-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  text-align: left;
}

.contact-item {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  --beam-size: 100px;
  --beam-duration: 5s;
}

.contact-item-body {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.contact-item-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f5f5f5;
  color: #444;
}

.contact-item-text {
  min-width: 0;
  flex: 1;
}

.contact-item-label {
  display: block;
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 4px;
}

.contact-item-value {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.contact-item-value:hover {
  text-decoration: underline;
}

.contact-item-copy {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #888;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.contact-item-copy:hover {
  background: #f0f0f0;
  color: var(--text);
}

.toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 12px 20px;
  background: var(--text);
  color: #fff;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 300;
  pointer-events: none;
}

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

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border);
  background: #fff;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 48px;
  text-align: center;
}

.footer-slogan {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.footer-links a {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

footer p:last-child {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
    overscroll-behavior-x: none;
  }

  body {
    padding-bottom: 72px;
    touch-action: pan-y;
    position: relative;
  }

  section,
  .hero-section,
  #hero,
  .dot-bg {
    max-width: 100%;
    overflow-x: hidden;
  }

  .site-nav {
    padding: 14px 16px;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .nav-center { display: none; }
  .nav-logo span { display: none; }
  .mobile-nav { display: flex; }
  .lang-trigger { padding: 8px 14px; }
  .lang-menu { min-width: 0; max-width: calc(100vw - 32px); }
  .lang-current { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .hero-section,
  #hero {
    overflow: hidden;
  }

  .hero-stage {
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    padding-inline: 0;
  }

  .hero-headline {
    width: 100%;
    max-width: 100%;
    padding-inline: 16px;
    box-sizing: border-box;
    overflow: hidden;
  }

  .hero-title-stack,
  .hero-text-base,
  .hero-text-reveal {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding-inline: 0;
    box-sizing: border-box;
  }

  .hero-title-line {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: clamp(24px, 7vw, 40px);
    line-height: 1.12;
    padding-inline-end: 0;
    letter-spacing: -0.03em;
  }

  .hero-badge {
    top: 88px;
    font-size: 11px;
    padding: 6px 12px;
    max-width: calc(100vw - 24px);
    white-space: normal;
    line-height: 1.45;
    text-align: center;
  }

  .hero-tag {
    font-size: 11px;
    letter-spacing: 2px;
  }

  .hero-below {
    width: 100%;
    max-width: 100%;
    padding-inline: 16px;
    box-sizing: border-box;
  }

  .hero-subtitle {
    font-size: 14px;
    line-height: 1.5;
  }

  .hero-cta {
    margin-top: 24px;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    gap: 10px;
  }

  .btn {
    padding: 12px 20px;
    font-size: 13px;
    max-width: 100%;
  }

  .products-container,
  .projects-body {
    padding: 0 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .contact-inner {
    padding: 0 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { padding: 32px 16px; }
  .projects-header-bar { padding: 60px 16px 40px; }
  .products-grid { grid-template-columns: 1fr; }
  .flip-card { height: 210px; }
  .toast { bottom: 80px; }

  .project-card:hover {
    transform: none;
    box-shadow: none;
  }
}

/* ===== 联系区：标题旁的 AI 机器人（bloub，MIT © Jérémy Perret） ===== */
.contact-head-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 16px;
}
.contact-head-row .contact-headline { margin-top: 0; }
.contact-bot {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.contact-bot svg { display: block; width: 100%; height: 100%; }
.contact-bot:focus-visible { box-shadow: 0 0 0 2px var(--text); border-radius: 24px; }

@media (max-width: 767px) {
  .contact-head-row { flex-direction: column; gap: 4px; margin-top: 12px; }
  .contact-head-row .contact-headline { text-align: center; }
  .contact-bot { width: 84px; height: 84px; }
}

/* ================= bloub 机器人扩展 ================= */

/* AI 产品卡图标位 */
/* 产品卡图标位：由 .bot-sprite 提供背景图，这里只管尺寸 */
.product-card-icon.product-card-icon-bot {
  width: 49.5px;
  height: 49.5px;
  display: block;
  overflow: visible;
  background-color: transparent;
  border-radius: 0;
}

/* 右下角悬浮助手 */
.bot-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: 76px;              /* 只按球体占位，气泡用绝对定位不占宽度 */
  height: 76px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
}
.bot-float.is-in { opacity: 1; visibility: visible; transform: none; }

.bot-float-inner {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .28), 0 0 0 1px rgba(0, 0, 0, .05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s;
}
.bot-float-inner:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 16px 36px -14px rgba(0, 0, 0, .34), 0 0 0 1px rgba(0, 0, 0, .07);
}
.bot-float-inner svg { display: block; }

.bot-float-bubble {
  position: absolute;
  right: calc(100% + 10px);
  bottom: 18px;
  padding: 8px 14px;
  border-radius: 14px 14px 4px 14px;
  background: #111;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .4);
  opacity: 0;
  transform: translateX(6px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.bot-float.is-in .bot-float-bubble { opacity: 1; transform: none; }
.bot-float.is-hidden-bubble .bot-float-bubble { opacity: 0; transform: translateX(6px); }

.bot-float-close {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.bot-float:hover .bot-float-close { display: flex; }
.bot-float-close:hover { background: var(--bg); color: var(--text); }

@media (max-width: 767px) {
  /* 移动端：贴右下、避开底部导航，默认只显示球，气泡短暂出现后收起 */
  .bot-float { right: 12px; bottom: 78px; width: 54px; height: 54px; }
  .bot-float-inner { width: 54px; height: 54px; }
  .bot-float-inner svg { width: 42px; height: 42px; }
  .bot-float-bubble {
    right: calc(100% + 8px);
    bottom: 10px;
    font-size: 12px;
    padding: 6px 11px;
    white-space: nowrap;
  }
  .bot-float-close { display: flex; width: 20px; height: 20px; font-size: 13px; }
}

/* ================= 可访问性 ================= */

/* 键盘焦点：全站统一可见轮廓（用 box-shadow 更贴合圆角，不破坏布局） */
:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
  border-radius: 8px;
}
/* 鼠标点击不显示轮廓 */
:focus:not(:focus-visible) { outline: none; }

/* 链接/按钮在深色底上换浅色轮廓 */
.btn-primary:focus-visible,
.contact-cta-primary:focus-visible,
.lang-trigger:focus-visible,
.nav-cta:focus-visible {
  outline-color: #111;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, .18);
}
.flip-card-back a:focus-visible,
.contact-cta-primary:focus-visible {
  outline-color: #fff;
}

/* 跳转链接（键盘用户） */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* ================= 动效降级 ================= */
@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;
  }
  /* 首屏黑球与卡片流光：保持静态可见，不无限循环 */
  .border-beam::after { animation: none !important; opacity: 0; }
  .hero-title-line .hero-underline { animation: none !important; }
  .bot-float { transition: none !important; }
}

/* ================= bloub 精灵图动画（纯 CSS，零 JS） ================= */
/* 精灵图 24 帧横排，每帧 112px（96 内容 + 两侧各 8 留白） */
.bot-sprite {
  background-repeat: no-repeat;
  animation: bot-play 2.4s steps(24) infinite;
  will-change: background-position;
}
@keyframes bot-play {
  from { background-position: 0 0; }
  to   { background-position: -2592px 0; }
}
.bot-hexagon  { background-image: url("assets/bloub/hexagon.png?v=20261110f"); }
.bot-egg      { background-image: url("assets/bloub/egg.png?v=20261110f"); }
.bot-idle     { background-image: url("assets/bloub/idle.png?v=20261110f"); }
.bot-wide     { background-image: url("assets/bloub/wide.png?v=20261110f"); }
.bot-notify   { background-image: url("assets/bloub/notify.png?v=20261110f"); }
.bot-play     { background-image: url("assets/bloub/play.png?v=20261110f"); }
.bot-orbit    { background-image: url("assets/bloub/orbit.png?v=20261110f"); }
.bot-thinking { background-image: url("assets/bloub/thinking.png?v=20261110f"); }

/* 产品卡图标：44px 显示 112px 的一帧 */
.product-card-icon-bot.bot-sprite {
  width: 49.5px;
  height: 49.5px;
  background-color: transparent !important;
  background-size: 1188px 49.5px;     /* 2592 * (49.5/108)，图标显示 49.5px 更饱满 */
  animation-name: bot-play-sm;
  transition: filter .3s ease;
}
@keyframes bot-play-sm {
  from { background-position: 0 0; }
  to   { background-position: -1188px 0; }
}
.flip-card:hover .product-card-icon-bot.bot-sprite { filter: contrast(1.15); }

/* 首屏徽标 16px */
.hero-badge-bot.bot-sprite {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-size: 384px 16px;        /* 2592 * (16/108) */
  animation-name: bot-play-xs;
}
@keyframes bot-play-xs {
  from { background-position: 0 0; }
  to   { background-position: -384px 0; }
}

/* 每张卡错开相位，避免七张同时眨眼 */
.bot-hexagon  { animation-delay: 0s; }
.bot-egg      { animation-delay: -.35s; }
.bot-idle     { animation-delay: -.8s; }
.bot-wide     { animation-delay: -1.2s; }
.bot-notify   { animation-delay: -1.55s; }
.bot-play     { animation-delay: -1.9s; }
.bot-orbit    { animation-delay: -.6s; }

@media (prefers-reduced-motion: reduce) {
  .bot-sprite { animation: none !important; background-position: 0 0 !important; }
}

/* ================= 触屏设备：不用黑球，直接显示中文标题 ================= */
@media (hover: none), (pointer: coarse) {
  /* 隐藏英文层、黑球、圆点 */
  .hero-title-stack .hero-text-base,
  .hero-title-stack .hero-circle,
  .hero-hello-dot { display: none; }

  /* 中文层常显、无遮罩 */
  .hero-title-stack .hero-text-reveal {
    position: relative;
    visibility: visible;
    opacity: 1;
    -webkit-mask-image: none !important;
    mask-image: none !important;
    width: 100%;
    max-width: 100%;
  }
  .hero-title-stack .hero-text-reveal .hero-title-line {
    color: var(--text);
    text-shadow: none;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: clamp(28px, 7.2vw, 52px);
    line-height: 1.16;
    padding-inline-end: 0;
  }

  /* 触屏不需要“黑球”相关的提示 */
  .hero-badge { display: none; }
}

/* ================= 点击翻面（触屏/无 hover 设备） ================= */
/* 触屏点击后元素会残留 :hover 状态，必须显式禁用悬停规则，否则会卡在背面 */
@media (hover: none), (pointer: coarse) {
  .flip-card:hover .flip-card-inner {
    transform: none;
  }
  .flip-card.is-flipped .flip-card-inner,
  .flip-card.is-flipped:hover .flip-card-inner {
    transform: rotateY(180deg);
  }
}
/* 桌面鼠标悬停仍会翻；点击则锁定翻转状态，触屏、触控板、无 hover 环境都能用 */
/* 触屏设备额外提示可点 */
@media (hover: none), (pointer: coarse) {
  .flip-card-front::after {
    content: "点按查看简介";
    position: absolute;
    right: 16px;
    bottom: 14px;
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: .04em;
  }
  .flip-card.is-flipped .flip-card-front::after { content: none; }
}

/* ================= AI 客服面板（点 bloub 悬浮球打开） ================= */
#mc-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 116px;
  width: 380px;
  height: 600px;
  max-height: calc(100dvh - 150px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  z-index: 2147483001;
  display: none;
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, .3), 0 0 0 1px rgba(0, 0, 0, .06);
  animation: mc-chat-pop .22s ease;
}
@keyframes mc-chat-pop {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
#mc-chat-panel.open { display: block; }
#mc-chat-panel iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
#mc-chat-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, .06);
  color: #666;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s, color .15s;
}
#mc-chat-close:hover { background: rgba(0, 0, 0, .12); color: #111; }

/* 面板打开时，悬浮球变成"关闭"状态 */
body.mc-chat-open .bot-float-bubble { opacity: 0 !important; }

@media (max-width: 520px) {
  #mc-chat-panel {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #mc-chat-panel { animation: none; }
}
