/* ==========================================================================
   PETRA 官网样式 —— 配色 token 逐字取自《UI设计规范.md》§2.1（beUI 主题 token）
   仅用语义 token；圆角 4px（大容器 8px）；面板靠 1px 描边区分，不靠阴影。
   ========================================================================== */

:root {
  /* §2.1 浅色 token */
  --background: oklch(99% 0 0);
  --foreground: oklch(15% 0 0);
  --card: oklch(97% 0 0);
  --card-foreground: oklch(15% 0 0);
  --muted: oklch(94% 0 0);
  --muted-foreground: oklch(50% 0 0);
  --primary: oklch(15% 0 0);
  --primary-foreground: oklch(99% 0 0);
  --secondary: oklch(97% 0 0);
  --secondary-foreground: oklch(15% 0 0);
  --accent: oklch(72% 0.18 195);
  --destructive: oklch(62% 0.22 25);
  --destructive-foreground: oklch(99% 0 0);
  --success: oklch(70% 0.18 155);
  --warning: oklch(78% 0.18 75);
  --violet: oklch(68% 0.22 295);
  --neon: oklch(80% 0.22 145);
  --border: oklch(15% 0 0 / 0.06);
  --border-strong: oklch(15% 0 0 / 0.12);
  --input: oklch(15% 0 0 / 0.06);
  --ring: oklch(15% 0 0 / 0.12);

  /* §2.2 品牌色（仅点缀） */
  --brand-orange: #fc4c02;
  --brand-magenta: #ef2cc1;
  --brand-periwinkle: #bdbbff;
  --brand-gradient: linear-gradient(90deg, var(--brand-orange), var(--brand-magenta), var(--brand-periwinkle));

  /* §4 圆角 / §5 间距 / §6 阴影 */
  --radius: 4px;
  --radius-lg: 8px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  --shadow-card-rest: 0 1px 3px rgba(1, 1, 32, 0.10);
  --shadow-card-hover: 0 10px 24px rgba(1, 1, 32, 0.18);
  --shadow-pop: 0 10px 24px rgba(1, 1, 32, 0.18);

  /* §3 字体 */
  --font-body: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --font-display: "Inter", "Helvetica Neue", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

[data-theme="dark"] {
  /* §2.1 深色 token（选择器与桌面端一致：[data-theme="dark"]） */
  --background: #151515;
  --foreground: oklch(96% 0 0);
  --card: #1c1c1c;
  --card-foreground: oklch(96% 0 0);
  --muted: oklch(26% 0 0);
  --muted-foreground: oklch(62% 0 0);
  --primary: oklch(35% 0 0);
  --primary-foreground: oklch(96% 0 0);
  --secondary: #1c1c1c;
  --secondary-foreground: oklch(96% 0 0);
  --accent: oklch(80% 0.18 195);
  --border: rgb(255 255 255 / 0.05);
  --border-strong: rgb(255 255 255 / 0.10);
  --input: rgb(255 255 255 / 0.05);
  --ring: rgb(255 255 255 / 0.10);
  --shadow-card-rest: none;
  --shadow-card-hover: none;
}

/* ------------------------------------------------------------- 基础 */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  transition: background-color 200ms ease-out, color 200ms ease-out;
}

img, svg, video { max-width: 100%; display: block; }
a { color: inherit; }

::selection { background: var(--muted); }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.container {
  width: min(1080px, 100% - 48px);
  margin-inline: auto;
}

/* ------------------------------------------------- mono 技术标签 */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* --------------------------------------------------------- 顶栏 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  height: 68px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  text-decoration: none;
  font-weight: 700;
  font-family: var(--font-display);
}

/* 顶栏 LOGO：图形 40px、文字加粗放大（反馈：原 28px/16px 太小太细） */
.site-logo img { height: 40px; width: auto; }
.site-logo__word { font-size: 21px; font-weight: 700; letter-spacing: 0.02em; }

.site-nav {
  display: flex;
  gap: var(--space-lg);
  margin-left: auto;
  align-items: center;
}

.site-nav a {
  text-decoration: none;
  font-size: 14px;
  color: var(--muted-foreground);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease-out, border-color 150ms ease-out;
}

.site-nav a:hover { color: var(--foreground); }
.site-nav a[aria-current="page"] {
  color: var(--foreground);
  border-bottom-color: var(--foreground);
}

.header-actions { display: flex; gap: var(--space-sm); align-items: center; }

.nav-toggle {
  display: none;
  background: var(--secondary);
  color: var(--secondary-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
  cursor: pointer;
}

/* --------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out;
}

.btn--primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.btn--primary:hover { filter: brightness(1.15); }

.btn--secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-color: var(--border-strong);
}
.btn--secondary:hover { background: var(--muted); }

.btn--ghost {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--muted); }

.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--block { width: 100%; }

/* --------------------------------------------------------- 卡片 */
.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2xl);
}

.card--lg { border-radius: var(--radius-lg); }

/* 可点击内容卡：轻投影（§6 允许的两类之一） */
.card--clickable {
  box-shadow: var(--shadow-card-rest);
  transition: box-shadow 200ms ease-out;
  text-decoration: none;
}
.card--clickable:hover { box-shadow: var(--shadow-card-hover); }

/* --------------------------------------------------------- Hero */
.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
}

.hero__eyebrow { margin-bottom: var(--space-lg); }

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 40px);
  line-height: 1.2;
  font-weight: 500;
  margin: 0 0 var(--space-lg);
  letter-spacing: -0.01em;
}

.hero__lead {
  font-size: 18px;
  color: var(--muted-foreground);
  max-width: 640px;
  margin: 0 0 var(--space-2xl);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-md); }

.hero__note {
  margin-top: var(--space-lg);
  font-size: 14px;
  color: var(--muted-foreground);
}

/* 品牌渐变细条：小面积点缀 */
.brand-rule {
  width: 96px;
  height: 3px;
  border-radius: 9999px;
  background: var(--brand-gradient);
  margin-bottom: var(--space-xl);
}

/* ------------------------------------------ 英雄区：居中文案 + 产品展示滑块 */
.hero--center { text-align: center; padding-top: 80px; }
.hero--center .brand-rule { margin-left: auto; margin-right: auto; }
.hero--center .hero__title { font-size: clamp(38px, 6.5vw, 52px); font-weight: 700; }
.hero--center .hero__lead { margin-left: auto; margin-right: auto; }
.hero--center .hero__actions { justify-content: center; }
.hero--center .hero__note { max-width: 640px; margin-left: auto; margin-right: auto; }

/* 展示滑块：仿应用窗口（标题栏 + 画面 + 指示点） */
.slider--showcase {
  max-width: 960px;
  margin: var(--space-3xl) auto 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-card-hover);
  text-align: left;
}

.slider__chrome {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 var(--space-lg);
  background: var(--secondary);
  border-bottom: 1px solid var(--border);
}
.slider__chrome span {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: var(--border-strong);
}
.slider__chrome em {
  margin-left: var(--space-md);
  font-style: normal;
  font-size: 12px;
  color: var(--muted-foreground);
}

.slider__stage {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--muted);
}

.slider__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 450ms ease-out;
}
.slider__slide.is-active { opacity: 1; visibility: visible; }

.slider__slide img,
.slider__slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slider__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: var(--space-2xl) var(--space-lg) var(--space-md);
  font-size: 13px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  pointer-events: none;
}

/* 悬停浮层箭头（SaaS 展示滑块惯例） */
.slider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  opacity: 0;
  transition: opacity 150ms ease-out, background-color 150ms ease-out;
}
.slider--showcase:hover .slider__arrow,
.slider--showcase:focus-within .slider__arrow { opacity: 1; }
.slider__arrow:hover { background: rgba(0, 0, 0, 0.7); }
.slider__arrow--prev { left: var(--space-lg); }
.slider__arrow--next { right: var(--space-lg); }
/* 触屏设备没有 hover：常显 */
@media (hover: none) {
  .slider__arrow { opacity: 1; }
}

/* 指示点：滑块底部居中 */
.slider__dots {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  background: var(--card);
}

.slider__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: var(--border-strong);
  cursor: pointer;
  transition: background-color 150ms ease-out, width 150ms ease-out;
}
.slider__dot.is-active { background: var(--foreground); width: 20px; }

/* 城市禾场横幅（新 LOGO 图）：横排，logo 在左文字在右 */
.tfoc-banner {
  width: min(460px, 100%);
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.brand-dev {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  flex-wrap: nowrap;
}
.brand-dev .feature__text { max-width: 520px; margin: 0; }

@media (max-width: 700px) {
  .brand-dev { flex-direction: column; align-items: flex-start; gap: var(--space-lg); }
  .brand-dev .feature__text { max-width: none; }
}

/* --------------------------------------------------------- 区块 */
.section { padding: 56px 0; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: 0; }

/* 底部 CTA 收口区：弱化分隔线、突出按钮 */
.cta-band {
  background: var(--card);
  padding: 72px 0;
}
.cta-band .section__title { font-size: 32px; font-weight: 700; }

.section__head { margin-bottom: var(--space-2xl); }
.section__title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  margin: var(--space-sm) 0 0;
}

.grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.feature__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  margin: var(--space-md) 0 var(--space-sm);
}

.feature__text { font-size: 14px; color: var(--muted-foreground); margin: 0; }

.icon-dot {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: var(--accent);
  display: inline-block;
}

/* --------------------------------------------------------- 列表/表格 */
.meta-list { display: grid; gap: var(--space-md); margin: 0; }
.meta-list div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.meta-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.meta-list dt { color: var(--muted-foreground); }
.meta-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

.code-block {
  background: var(--muted);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  margin: var(--space-md) 0;
}

.notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--space-lg);
  font-size: 14px;
  margin: var(--space-lg) 0;
}
.notice strong { font-weight: 500; }

/* --------------------------------------------------------- 时间线（更新日志） */
.timeline { display: grid; gap: var(--space-xl); }

.timeline__item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-xl);
}

.timeline__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.timeline__version {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
}

.timeline__date { font-family: var(--font-mono); font-size: 12px; color: var(--muted-foreground); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: var(--muted);
  color: var(--foreground);
  border-radius: var(--radius);
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.timeline__list { margin: 0; padding-left: 18px; font-size: 14px; }
.timeline__list li { margin-bottom: 6px; }

/* --------------------------------------------------------- 页脚 */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: var(--space-3xl) 0;
  font-size: 14px;
  color: var(--muted-foreground);
}

.site-footer__grid {
  display: grid;
  gap: var(--space-2xl);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.site-footer h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted-foreground);
  margin: 0 0 var(--space-md);
}

.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--foreground); text-decoration: underline; }

.site-footer__bottom {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: space-between;
  font-size: 13px;
}

.tfoc-logo { height: 40px; width: auto; }

/* ----------------------------------------- 品牌 LOGO 深浅两套切换
   brand-logo-light.svg 浅色主题用（深色标记）；brand-logo-dark.svg 深色主题用（白色标记） */
[data-theme="light"] .logo--dark { display: none; }
[data-theme="dark"] .logo--light { display: none; }

/* --------------------------------------------------------- 主题切换 */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;   /* 无底色：与页面背景融为一体（浅色主题即纯白） */
  border: 0;                 /* 无框线 */
  border-radius: var(--radius);
  color: var(--foreground);  /* 图标取正文色，随主题自动适配 */
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.15s ease;
}
.theme-toggle:hover { background: var(--muted); }   /* 悬停只铺一层淡淡底色 */
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
/* 主题切换图标（内联 SVG，随主题用 CSS 显隐，不再由 JS 改字符）：
   浅色主题显示月亮（点击进入深色），深色主题显示太阳（点击回到浅色） */
.theme-toggle .theme-icon {
  width: 18px;
  height: 18px;
  display: block;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.theme-toggle:hover .theme-icon--moon { transform: rotate(-14deg) scale(1.08); }
.theme-toggle:hover .theme-icon--sun { transform: rotate(45deg) scale(1.06); }
.theme-toggle .theme-icon--sun { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon--moon { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon--sun { display: block; }

/* --------------------------------------------------------- 响应式 */
@media (max-width: 760px) {
  .hero--center { padding-top: 56px; }
  .slider--showcase { margin-top: var(--space-2xl); }
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: var(--space-sm) 24px var(--space-lg);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--border); color: var(--foreground); }
  .site-header__inner { height: 60px; }
  .site-logo img { height: 34px; }
  .site-logo__word { font-size: 18px; }
  .hero { padding: 48px 0 40px; }
  .section { padding: 40px 0; }
  .card { padding: var(--space-lg); }
  .meta-list div { flex-direction: column; gap: 2px; }
  .meta-list dd { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- 首页：核心承诺——桌面端固定单行三列（不换行），窄屏堆叠 ---------- */
.promise-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}
.promise-row > * { flex: 1 1 0; min-width: 0; }
@media (max-width: 1024px) {
  .promise-row { flex-direction: column; align-items: center; }
  .promise-row > * { max-width: 520px; }
}

/* ---------- 首页：适用场景多列——≥1024 每行 3 个，768–1023 每行 2 个，更小 1 个 ---------- */
.scene-cols { margin-top: 2rem; column-gap: 2rem; }
.scene-cols > * { width: 100%; break-inside: avoid; margin-bottom: 2rem; }
@media (min-width: 768px) { .scene-cols { column-count: 2; } }
@media (min-width: 1024px) { .scene-cols { column-count: 3; } }

/* ---------- 首页：定价卡清单——图标与文字分列，条目换行时续行与文字左缘对齐（悬挂缩进） ---------- */
#pricing ul { margin: 0; padding: 0; list-style: none; }
#pricing ul li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
#pricing ul li > i {
  flex: 0 0 auto;
  margin-top: 2px;
}
