/* ============================================================
   梦想芽SEO · 优化服务官网
   纯 HTML + CSS + JS 实现（无框架、无构建工具）
   设计系统复刻自 Vite+React 原版（Tailwind v4 色值 → 原生 CSS）
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  --radius: 0.75rem;

  --font-display: "Noto Serif SC", "Songti SC", serif;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --background: oklch(0.985 0.002 264.542);
  --foreground: oklch(0.145 0.021 264.695);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0.021 264.695);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0.021 264.695);
  --primary: oklch(0.215 0.034 264.695);
  --primary-foreground: oklch(0.985 0.002 264.542);
  --secondary: oklch(0.96 0.008 264.542);
  --secondary-foreground: oklch(0.215 0.034 264.695);
  --muted: oklch(0.96 0.008 264.542);
  --muted-foreground: oklch(0.552 0.016 264.542);
  --accent: oklch(0.62 0.18 142.5);
  --accent-foreground: oklch(0.985 0.002 264.542);
  --success: oklch(0.62 0.18 142.5);
  --success-foreground: oklch(0.985 0.002 264.542);
  --warning: oklch(0.72 0.18 85);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.985 0.002 264.542);
  --border: oklch(0.92 0.01 264.542);
  --input: oklch(0.92 0.01 264.542);
  --ring: oklch(0.62 0.18 142.5);

  /* 常用阴影（Tailwind shadow-lg / shadow-md / shadow-sm 等值） */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* ---------- Base ---------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 图标基础（lucide 风格 stroke 图标，尺寸由使用处控制） */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  flex-shrink: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ---------- 世界天际线（固定背景） ---------- */
.skyline {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 220px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  color: var(--primary);
}

.skyline svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Hero 首屏 ---------- */
.hero {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    oklch(0.96 0.008 264.542 / 0.3),
    var(--background)
  );
  padding: 4rem 1rem;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  text-align: center;
  padding: 1rem 0;
}

.hero-logo {
  height: 40px;
  margin: 0 auto 1rem;
  object-fit: contain;
}

@media (min-width: 768px) {
  .hero-logo {
    height: 56px;
  }
}

.current-city {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.current-city svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

.current-city strong {
  color: var(--accent);
  font-weight: 500;
}

.hero h1 {
  font-family: SimHei, "Microsoft YaHei", sans-serif;
  font-size: 36px;
  font-weight: 900;
  color: #121212;
  margin: 30px 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero h1 span {
  font-weight: 700;
}

/* 搜索框（毛玻璃效果） */
.search-box {
  max-width: 768px;
  margin: 0 auto 2rem;
  background-color: oklch(1 0 0 / 0.9);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-box-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem 0 1rem;
  flex: 1;
  min-width: 0;
}

.search-box-inner > svg {
  width: 20px;
  height: 20px;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--foreground);
  padding: 0.75rem 0;
  font-size: 1rem;
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--muted-foreground);
}

.search-btn {
  background-color: var(--accent);
  color: var(--accent-foreground);
  border: none;
  padding: 0.625rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.search-btn:hover {
  background-color: oklch(0.56 0.18 142.5);
}

/* ---------- 数据统计 + 搜索引擎 ---------- */
.stats-section {
  position: relative;
  z-index: 1;
  padding: 3rem 0;
  background-color: var(--background);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  transition: box-shadow 0.3s;
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
}

.stat-card svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
  margin: 0 auto 0.75rem;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.stat-value em {
  font-style: normal;
  color: var(--accent);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 2rem;
  color: var(--foreground);
  line-height: 1.3;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 1.875rem;
  }
}

.engines-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .engines-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .engines-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.engine-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}

.engine-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.engine-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  transition: transform 0.3s;
}

.engine-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.engine-card:hover .engine-icon {
  transform: scale(1.1);
}

.engine-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--foreground);
}

.engine-en {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.service-desc {
  margin-top: 3rem;
  text-align: center;
}

.service-desc-inner {
  display: inline-block;
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 768px;
  text-align: left;
  color: var(--muted-foreground);
  line-height: 1.75;
}

.service-desc-inner .hl {
  color: var(--accent);
  font-weight: 500;
}

/* ---------- 全球城市目录 ---------- */
.city-directory {
  position: relative;
  z-index: 1;
  padding: 4rem 0;
  background: linear-gradient(
    to bottom,
    oklch(0.96 0.008 264.542 / 0.2),
    var(--background)
  );
}

.city-directory .section-title .hl {
  color: var(--accent);
}

.section-subtitle {
  text-align: center;
  color: var(--muted-foreground);
  max-width: 640px;
  margin: 0 auto 3rem;
  font-size: 1rem;
}

.country-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .country-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .country-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .country-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.country-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s, transform 0.3s;
}

.country-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.country-header {
  padding: 1.25rem;
  background: linear-gradient(
    to right,
    oklch(0.215 0.034 264.695 / 0.1),
    oklch(0.62 0.18 142.5 / 0.05),
    transparent
  );
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.country-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.country-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.country-flag {
  font-size: 1.875rem;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

.country-name {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--foreground);
  line-height: 1.3;
}

.country-en {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
}

.country-meta {
  text-align: right;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.region-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background-color: oklch(0.62 0.18 142.5 / 0.1);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

.city-count {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--foreground);
}

.city-count em {
  font-style: normal;
  color: var(--accent);
  margin-left: 0.25rem;
}

.country-cities {
  padding: 1rem;
  flex-grow: 1;
}

.cities-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
}

.cities-list::-webkit-scrollbar {
  width: 6px;
}

.cities-list::-webkit-scrollbar-thumb {
  background-color: oklch(0.92 0.01 264.542);
  border-radius: 3px;
}

.cities-list::-webkit-scrollbar-track {
  background: transparent;
}

.city-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s;
}

.city-link:hover {
  background-color: oklch(0.62 0.18 142.5 / 0.05);
}

.city-link-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.city-link-left svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
  opacity: 0.6;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.city-link:hover .city-link-left svg {
  opacity: 1;
}

.city-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  transition: color 0.2s;
}

.city-link:hover .city-name {
  color: var(--accent);
}

.city-link-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.city-en {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  display: none;
}

@media (min-width: 640px) {
  .city-en {
    display: inline;
  }
}

.city-link-arrow {
  width: 14px;
  height: 14px;
  color: var(--accent);
  opacity: 0;
  transform: translateX(0);
  transition: opacity 0.2s, transform 0.2s;
}

.city-link:hover .city-link-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* 搜索无结果提示 */
.search-empty {
  display: none;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted-foreground);
  background-color: var(--card);
  border: 1px dashed var(--border);
  border-radius: 1rem;
}

.search-empty.visible {
  display: block;
}

.search-empty strong {
  display: block;
  color: var(--foreground);
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.bottom-cta {
  margin-top: 3rem;
  text-align: center;
}

.bottom-cta-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
}

.bottom-cta-inner svg {
  width: 20px;
  height: 20px;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.bottom-cta-text {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.bottom-cta-text strong {
  color: var(--foreground);
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background-color: var(--background);
  padding: 2rem 0;
}

.footer-content {
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.footer-content p {
  margin: 0 0 0.5rem;
}

.footer-content p:last-child {
  margin-bottom: 0;
}

/* ---------- 滚动渐入（reveal engine） ----------
   说明：默认内容可见（fail-visible）；JS 运行时注入 html.reveal-ready
   后才隐藏并监听 IntersectionObserver 触发 .visible 动画。 */
html.reveal-ready .reveal,
html.reveal-ready .reveal-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  transition-delay: var(--reveal-delay, 0ms);
}

html.reveal-ready .reveal.visible,
html.reveal-ready .reveal-up.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html.reveal-ready .reveal,
  html.reveal-ready .reveal-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- 辅助 ---------- */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
