/* ============================================
   云图 设计系统（金属反射 + 极简）
   与 app-ios/src/design-system 保持视觉一致
   ============================================ */

:root {
  /* Tokens — 同步 app theme/colors.js */
  --bg: #FFFFFF;
  --surface: #FAFAFC;
  --surface-elevated: #F2F2F7;
  --text: #1C1C1E;
  --text-secondary: #636366;
  --text-tertiary: #AEAEB2;
  --border: #E5E5EA;

  --metal-text: #3A3A3C;
  --metal-highlight: #48484A;
  --metal-light: #9C9CA3;
  --metal-shadow: rgba(28,28,30,0.04);

  --error: #FF3B30;
  --success: #34C759;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-base: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-xxl: 48px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 18px;

  /* Shimmer
     注：app useShimmer 用 cos/sin(137.5°) 数学坐标 → 亮带沿 TL→BR 对角。
     CSS linear-gradient 用 "from top 顺时针" 约定，需 47.5° (= 137.5° - 90°) 才视觉等价。 */
  --shimmer-duration: 550ms;
  --shimmer-angle: 47.5deg;
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'SF Pro Text', 'SF Pro', -apple-system, BlinkMacSystemFont,
               'Helvetica Neue', 'Segoe UI', Roboto, 'PingFang SC',
               'Microsoft YaHei', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: 'SF Pro Display', 'SF Pro', -apple-system, BlinkMacSystemFont,
               'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 { font-size: 4rem; line-height: 1.05; font-weight: 800; }
h2 { font-size: 2.25rem; line-height: 1.1; font-weight: 800; }
h3 { font-size: 1.25rem; line-height: 1.2; font-weight: 700; }

p { margin: 0; }

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

/* ========================
   Top bar
   ======================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-base) var(--sp-xl);
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'PingFang SC', 'Heiti SC', 'STHeiti', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  letter-spacing: -0.02em;
}

/* 品牌：nthu 斜体；y (.brand-y span) 不斜体 + 字号 1.5 + 平移
   注：原本想用 ::first-letter，但 CSS 规范禁止 ::first-letter 应用 transform，
   所以改成 HTML 里用 <span class="brand-y">y</span> 真元素来吃 transform。 */
.brand-nthu {
  font-family: 'PingFang SC', 'Heiti SC', 'STHeiti', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-weight: 800;
  font-style: oblique 0deg;
  display: inline-block;
  transform: skewX(-21.5deg);  /* 真几何倾斜，跟字体无关，可控 */
  transform-origin: 0 100%;
}
.brand-y {
  font-family: 'PingFang SC', 'Heiti SC', 'STHeiti', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-weight: 500;
  font-size: 1.5em;
  font-style: normal;
  display: inline-block;
  transform: translateX(0.18em);
}
.topbar nav {
  display: flex;
  gap: var(--sp-lg);
  align-items: center;
}
.topbar nav a {
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.topbar nav a:hover { color: var(--metal-text); }
.lang-toggle {
  background: transparent;
  border: 1.5px solid var(--metal-highlight);
  border-radius: var(--radius-sm);
  padding: 4px 24px 4px 10px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--metal-text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 5l3 3 3-3' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

/* ========================
   Sections
   ======================== */
main { padding: 0 var(--sp-xl); }

.hero, .features, .pricing, .faq, .download {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-xxl) 0;
}

.hero { text-align: center; padding: 120px 0 80px; }
.hero-title {
  font-family: 'PingFang SC', 'Heiti SC', 'STHeiti', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 6rem;
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-base);
}
/* hero 大 ynthu 右上角挂 「云图」小字标注 — 仅中文版显示 */
.brand-cn-sup { display: none; }
html[lang^="zh"] .brand-cn-sup {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 700;
  vertical-align: super;
  margin-left: 0.15em;
  letter-spacing: 0;
  transform: translateY(-1.5em);
}
.hero-sub {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--sp-xl);
}
.hero-cta { display: flex; gap: var(--sp-md); justify-content: center; flex-wrap: wrap; }

.section-title {
  font-size: 2.25rem;
  margin-bottom: var(--sp-sm);
  text-align: center;
}
.section-sub {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: var(--sp-xl);
}

/* ========================
   Metal frame (核心视觉)
   ============
   等价于 app 里 MetalFrame：单条均匀细线（#9C9CA3 1.5px stroke）
   边线本身不带渐变，金属感来自按下 / hover 时的光斑横扫
   ======================== */
.metal-frame {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius-lg);
  isolation: isolate;
  overflow: hidden;
  border: 1.5px solid var(--metal-highlight);
}
/* Shimmer overlay — JS 触发 .shining 时可见
   宽度 45% 带宽（27.5%-72.5%），单峰 alpha 0.85 — 同步 useShimmer 规范 */
.metal-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    var(--shimmer-angle),
    rgba(255,255,255,0) 27.5%,
    rgba(255,255,255,0.85) 50%,
    rgba(255,255,255,0) 72.5%
  );
  transform: translateX(-150%);
  pointer-events: none;
  opacity: 0;
}
.metal-frame.shining::after {
  animation: shimmer-sweep var(--shimmer-duration) cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes shimmer-sweep {
  0%   { transform: translateX(-150%); opacity: 1; }
  75%  { transform: translateX(150%);  opacity: 1; }
  100% { transform: translateX(150%);  opacity: 0; }
}

/* Metal text shimmer (h1 / brand) */
.metal-text {
  position: relative;
  display: inline-block;
  color: var(--metal-text);
  isolation: isolate;
}
.metal-text::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    var(--shimmer-angle),
    rgba(255,255,255,0) 27.5%,
    rgba(255,255,255,0.85) 50%,
    rgba(255,255,255,0) 72.5%
  );
  transform: translateX(-150%);
  pointer-events: none;
  opacity: 0;
}
.metal-text.shining::after {
  animation: shimmer-sweep var(--shimmer-duration) cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ========================
   Buttons
   ======================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-md) var(--sp-xl);
  background: var(--bg);
  color: var(--metal-text);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  min-width: 160px;
  min-height: 50px;
  text-align: center;
  transition: transform 100ms ease;
}
.btn.ghost { background: transparent; }

/* ========================
   Features — 6 个 feature，按屏宽 3/2/1 列分布（强制档位）
   ======================== */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-lg);
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-xxl) var(--sp-base);
}
.feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-sm);
  padding: var(--sp-base);
  background: transparent;
}
.feature-icon { font-size: 2.5rem; flex-shrink: 0; }
.feature-body h3 { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.feature-body p { font-size: 0.9rem; color: var(--text-secondary); }
.feature-body p.feature-detail { font-size: 0.8rem; line-height: 1.55; margin-top: 8px; opacity: 0.85; }
sup { font-size: 0.65em; vertical-align: super; }

/* ========================
   Use cases — 3 卡片场景，桌面 3 列 / 中屏 1 列（与 features 同断点）
   ======================== */
.usecases {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-xxl) var(--sp-base);
}
.usecase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr auto;
  column-gap: var(--sp-lg);
  row-gap: var(--sp-xl);
  margin-top: var(--sp-lg);
  align-items: stretch;
}
.usecase-card {
  padding: var(--sp-lg);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  background: transparent;
}
.usecase-icon { font-size: 2.5rem; }
.usecase-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
}
.usecase-card p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.usecase-cta {
  position: relative;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--metal-text);
  line-height: 1.15;
  padding: 0 var(--sp-sm);
  white-space: pre-line;
}
.usecase-cta-row1 {
  display: flex;
  justify-content: center;
  align-items: baseline;
  position: relative;
}
.usecase-cta-row1 [data-i18n="usecase-cta-verb"] {
  position: absolute;
  left: var(--sp-md);
  top: 0;
}
.usecase-cta-row1 .brand {
  transform: translate(-1rem, 0.85rem);
}

/* ========================
   Pricing
   ======================== */
.pricing-tabs {
  display: flex;
  justify-content: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
}
.region-btn {
  padding: var(--sp-sm) var(--sp-base);
  border: 1.5px solid var(--metal-highlight);
  background: var(--bg);
  color: var(--metal-text);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
}
.region-btn.active {
  background: var(--metal-text);
  color: white;
  border-color: var(--metal-text);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-lg);
}
.price-card {
  padding: var(--sp-lg) var(--sp-base);
  background: var(--bg);
  text-align: center;
  position: relative;
}
.price-card.highlight { background: var(--surface); }
.badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--metal-text);
  color: white;
  padding: 2px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
}
.price-card h3 { margin-bottom: var(--sp-md); }
.price {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: 'SF Pro Display', 'SF Pro', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  margin-bottom: 0;
}
.price-sub { color: var(--text-secondary); margin-bottom: var(--sp-base); }
.price-card ul { list-style: none; padding: 0; text-align: left; max-width: 200px; margin: 0 auto; }
.price-card li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 4px 0;
}
.price-card li::before { content: '· '; color: var(--metal-light); }

.pricing-foot {
  text-align: center;
  margin-top: var(--sp-xl);
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* ========================
   Pricing detail page
   ======================== */
.pricing-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--sp-base) var(--sp-xxl);
}
.pricing-hero {
  text-align: center;
  padding: 80px 0 40px;
}
.pricing-hero h1 {
  font-size: 3.5rem;
  margin-bottom: var(--sp-base);
}
.pricing-page .pricing {
  max-width: 100%;
  padding: var(--sp-lg) 0;
}
.pricing-page .pricing-tabs { margin-bottom: var(--sp-base); }

.price-matrix {
  padding: var(--sp-base);
  background: var(--bg);
  margin-bottom: var(--sp-md);
}
.price-matrix table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  /* table-layout: auto 让 display:none 的列空间被自动收回 */
  table-layout: auto;
}
.price-matrix th, .price-matrix td {
  padding: var(--sp-sm) var(--sp-base);
  text-align: center;
}
.price-matrix th:first-child, .price-matrix td:first-child {
  text-align: left;
}
.price-matrix th {
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.price-matrix tbody tr + tr td { border-top: 1px solid var(--border); }
.price-matrix td:first-child { font-weight: 600; }
.price-matrix td:not(:first-child) { color: var(--metal-text); }

.info-block {
  padding: var(--sp-lg);
  background: var(--bg);
}
.info-block p { margin-bottom: var(--sp-md); color: var(--text-secondary); line-height: 1.7; }
.info-block p:last-child { margin-bottom: 0; }
.info-block strong { color: var(--text); font-weight: 600; }

.note {
  text-align: center;
  margin-top: var(--sp-md);
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.pricing-cta { text-align: center; padding-top: var(--sp-xl); }
.pricing-cta .hero-cta { margin-top: var(--sp-base); }

/* ========================
   FAQ
   ======================== */
.faq details {
  background: var(--bg);
  margin-bottom: var(--sp-md);
  padding: var(--sp-base) var(--sp-lg);
  cursor: pointer;
}
.faq summary {
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  position: relative;
  padding-right: 24px;
  color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--metal-light);
  font-size: 1.4rem;
  transition: transform 200ms;
}
.faq details[open] summary::after { content: '−'; }
.faq details p {
  margin-top: var(--sp-md);
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ========================
   Download
   ======================== */
.download { text-align: center; }
.download p { color: var(--text-secondary); margin-bottom: var(--sp-xl); }
.download-cta { display: flex; gap: var(--sp-md); justify-content: center; }

/* ========================
   Footer
   ======================== */
footer {
  margin-top: var(--sp-xxl);
  padding: var(--sp-xl) var(--sp-xl);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-md);
}
.footer-brand { font-size: 1rem; font-weight: 800; font-family: 'PingFang SC', 'Heiti SC', 'STHeiti', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; letter-spacing: -0.02em; }
.footer-inner nav { display: flex; gap: var(--sp-base); }
.footer-inner nav a { color: var(--text-secondary); font-size: 0.85rem; }
.footer-inner nav a:hover { color: var(--metal-text); }
.footer-copy { color: var(--text-tertiary); font-size: 0.8rem; }

/* ========================
   Responsive
   ======================== */
/* features: 桌面 3 列 / 中屏 2 列 / 窄屏 1 列
   pricing-grid: 保留 4→2→1 渐进 */
@media (max-width: 1000px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 720px;
    margin: 0 auto;
  }
  .features {
    grid-template-columns: repeat(2, 1fr);
    max-width: 720px;
    margin: 0 auto;
  }
  .usecase-grid {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
}
@media (max-width: 600px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 1.75rem; }
  .hero-title { font-size: 4rem; }
  .hero-sub { font-size: 1rem; }
  main { padding: 0 var(--sp-base); }
  .topbar { padding: var(--sp-md) var(--sp-base); }
  .topbar nav { gap: var(--sp-md); }
  .features, .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
  .feature-card {
    flex-direction: row;
    text-align: left;
    align-items: center;
    gap: var(--sp-base);
  }
  .feature-icon { font-size: 2rem; width: 44px; }
  .footer-inner { flex-direction: column; text-align: center; }
}
