/* BitTide 官网样式 — 深空霓虹暗色主题
   颜色变量取自 bittide/ios/AppTheme.swift：
   bgDeep #040712 / bgCard #0A1022 / bgInset #131C36 / cyan #22D3EE / blue #3B82F6
   violet #8B5CF6 / mint #2ED4A7 / warn #F0B90B / textPrimary #FFFFFF
   textSecondary #8B94A7 / textDisabled #4A5265 / hairline rgba(255,255,255,.08)
   站点内容列宽度按官网需要放大（首页 1080px / 隐私政策正文 760px），App 内为 480pt。 */

:root {
  color-scheme: dark;

  --bg-deep: #040712;
  --bg-card: #0a1022;
  --bg-inset: #131c36;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --mint: #2ed4a7;
  --warn: #f0b90b;

  --text-primary: #ffffff;
  --text-secondary: #8b94a7;
  --text-disabled: #4a5265;
  --hairline: rgba(255, 255, 255, 0.08);

  --brand-gradient: linear-gradient(90deg, var(--cyan), var(--blue), var(--violet));
  /* 品牌渐变上的文字用近黑底墨色：渐变任一端与它的对比度都 ≥ 4.76:1（白字在青色端仅 2.5:1） */
  --on-gradient: #040712;
  --card-surface: linear-gradient(180deg, rgba(19, 28, 54, 0.55), rgba(10, 16, 34, 0.92));

  --radius-card: 20px;
  --radius-control: 14px;
  --content-max: 1080px;
  --prose-max: 760px;
  --page-padding: 20px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

/* 语言块显隐：默认中文；<html class="lang-en"> 时显示英文。
   同一份规则以首屏关键样式内联在页面 <head>，确保渲染前生效、不闪烁。 */
[data-lang="en"] {
  display: none;
}

html.lang-en [data-lang="en"] {
  display: revert;
}

html.lang-en [data-lang="zh"] {
  display: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg-deep);
  -webkit-text-size-adjust: 100%;
}

/* 极光光斑背景（对应 App 的 AuroraBackground） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(60vw 60vw at 12% 8%, rgba(139, 92, 246, 0.2), transparent 60%),
    radial-gradient(55vw 55vw at 92% 30%, rgba(59, 130, 246, 0.16), transparent 62%),
    radial-gradient(70vw 70vw at 50% 96%, rgba(34, 211, 238, 0.1), transparent 65%);
}

body {
  margin: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background-color: rgba(34, 211, 238, 0.3);
  color: var(--text-primary);
}

a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  color: var(--text-primary);
  line-height: 1.25;
}

svg {
  display: block;
}

.wrap {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--page-padding);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  padding: 12px 16px;
  background-color: var(--bg-inset);
  color: var(--text-primary);
  border-radius: 0 0 12px 0;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

/* ===== 页头 ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: rgba(4, 7, 18, 0.78);
  border-bottom: 1px solid var(--hairline);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding-block: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.brand-name {
  color: var(--cyan);
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .brand-name {
    background-image: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background-color: var(--bg-inset);
  border: 1px solid var(--hairline);
  border-radius: 999px;
}

.lang-btn {
  appearance: none;
  border: 0;
  background-color: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn[aria-pressed="true"] {
  background-image: var(--brand-gradient);
  color: var(--on-gradient);
  font-weight: 600;
}

/* ===== Hero ===== */

.hero {
  padding-block: clamp(48px, 9vw, 96px) clamp(24px, 5vw, 44px);
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(28px, 5.2vw, 44px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-sub {
  max-width: 720px;
  margin: 0 0 30px;
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 24px;
  border-radius: var(--radius-control);
  background-image: var(--brand-gradient);
  color: var(--on-gradient);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.32);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-primary:hover {
  color: var(--on-gradient);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(59, 130, 246, 0.44);
}

.btn-primary .icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background-color: var(--bg-inset);
  border: 1px solid var(--hairline);
  font-size: 14px;
}

.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--mint);
  box-shadow: 0 0 10px rgba(46, 212, 167, 0.8);
}

/* ===== 分区 ===== */

.section {
  padding-block: clamp(28px, 5vw, 52px);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 600;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background-image: var(--brand-gradient);
}

/* ===== 功能六宫格 ===== */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background-image: var(--card-surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background-image: var(--brand-gradient);
  opacity: 0.45;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: 12px;
  background-color: var(--bg-inset);
  border: 1px solid var(--hairline);
  color: var(--cyan);
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.card-list {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
  font-size: 15px;
  line-height: 1.65;
}

.card-list li {
  margin-bottom: 8px;
}

.card-list li:last-child {
  margin-bottom: 0;
}

.card-list li::marker {
  color: var(--cyan);
}

/* ===== 说明面板（数据来源与免责声明） ===== */

.panel {
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background-color: rgba(10, 16, 34, 0.9);
}

.panel p {
  margin: 0 0 12px;
  line-height: 1.8;
}

.panel p:last-child {
  margin-bottom: 0;
}

/* ===== 支持与联系 ===== */

.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 18px;
}

.support-card {
  padding: 22px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background-color: rgba(10, 16, 34, 0.8);
}

.support-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.support-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* ===== 隐私政策正文 ===== */

.prose {
  max-width: var(--prose-max);
  margin-inline: auto;
  padding-block: clamp(28px, 5vw, 48px);
}

.prose h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
}

.prose .updated {
  margin: 0 0 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}

.prose h2 {
  margin: 34px 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--cyan);
  font-size: clamp(18px, 2.6vw, 21px);
  font-weight: 600;
}

.prose p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.85;
}

.prose ul,
.prose ol {
  margin: 0 0 14px;
  padding-left: 22px;
  font-size: 16px;
  line-height: 1.85;
}

.prose li {
  margin-bottom: 10px;
}

.prose li:last-child {
  margin-bottom: 0;
}

.prose li::marker {
  color: var(--cyan);
}

.prose ol li::marker {
  color: var(--text-secondary);
}

.callout {
  margin-top: 34px;
  padding: 18px 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  background-color: var(--bg-inset);
  font-size: 15px;
}

.callout p {
  margin: 0;
  font-size: 15px;
}

/* ===== 页脚 ===== */

.site-footer {
  margin-top: clamp(24px, 5vw, 48px);
  padding-block: 26px 34px;
  border-top: 1px solid var(--hairline);
}

.footer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0;
  font-size: 14px;
}

.footer-brand {
  color: var(--text-secondary);
}

.footer-sep {
  color: var(--text-disabled);
}

@media (max-width: 600px) {
  :root {
    --page-padding: 18px;
  }

  .card,
  .support-card {
    padding: 20px;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
