/* ==========================================================
   DeepMei 下载页 · 深色高级感（Apple 式）
   - 近黑背景 #000 / 卡片 #1d1d1f
   - 大字号、负字距、克制留白
   - 白色胶囊主按钮，树莓红仅作细节点缀
   ========================================================== */

:root {
  --bg: #000000;
  --surface: #1d1d1f;
  --surface-hover: #262628;
  --border: rgba(255, 255, 255, 0.12);
  --text: #f5f5f7;
  --text-secondary: #86868b;
  --accent: #ff4d67;
  --accent-soft: rgba(255, 77, 103, 0.12);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
    "HarmonyOS Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* 键盘焦点态（Apple 规范：清晰可见的焦点环） */
:focus-visible {
  outline: 2px solid #2997ff;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13px;
  color: var(--text-secondary);
}

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

.nav-download {
  min-height: 34px;
  padding: 7px 16px;
  border-radius: 980px;
  background: var(--text);
  color: #000 !important;
  font-weight: 500;
}

.nav-download:hover { background: #d9d9db; color: #000 !important; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 24px 112px;
}

.hero-glow {
  position: absolute;
  top: -260px;
  left: 50%;
  transform: translateX(-50%);
  width: 760px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 77, 103, 0.16) 0%, transparent 65%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 980px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 77, 103, 0.25);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

h1 {
  margin-top: 24px;
  font-size: clamp(56px, 8vw, 88px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

/* 标题旁的大树莓 logo：下半部分逐渐淡出（Apple 式） */
.title-row {
  position: relative;
  display: flex;
  align-items: center;
}

.title-row h1 {
  position: relative;
  z-index: 2;
  margin-top: 24px;
}

.title-logo {
  position: absolute;
  right: -34px;
  top: 50%;
  transform: translateY(-52%);
  width: 240px;
  height: 240px;
  z-index: 1;
  pointer-events: none;
}

.title-logo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* 遮罩直接作用在 logo 图形上，避免外框/投影造成生硬边界 */
  -webkit-mask-image: linear-gradient(to bottom, #000 15%, #000 48%, transparent 90%);
  mask-image: linear-gradient(to bottom, #000 15%, #000 48%, transparent 90%);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.title-logo-glow {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 77, 103, 0.2) 0%, transparent 60%);
  z-index: 0;
}

.hero-sub {
  margin-top: 20px;
  max-width: 500px;
  color: var(--text-secondary);
  font-size: 19px;
  line-height: 1.55;
}

.hero-meta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 6px 14px;
  border-radius: 980px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: 980px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

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

.btn-primary:hover {
  background: #d9d9db;
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

/* ---------- Phone mockup ---------- */
.hero-phone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.phone-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 77, 103, 0.12) 0%, transparent 65%);
  pointer-events: none;
}

.phone-frame {
  position: relative;
  z-index: 1;
  width: 244px;
  padding: 12px 10px 14px;
  border-radius: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.phone-frame::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 27px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.phone-frame img {
  width: 100%;
  border-radius: 24px;
}

.phone-camera {
  position: absolute;
  top: 21px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #000;
  z-index: 2;
  box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.25);
}

/* 二维码默认隐藏，仅桌面/平板显示 */
.qr-card {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 980px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.qr-card img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
}

@media (min-width: 901px) {
  .qr-card { display: flex; }
}

/* ---------- 安装说明 ---------- */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px 96px;
}

.section-head {
  text-align: center;
  margin-bottom: 48px;
}

.section-head h2 {
  margin-top: 16px;
  font-size: clamp(32px, 4.5vw, 44px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

.step {
  padding: 32px 28px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.step:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: var(--surface-hover);
}

.step-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
}

.step h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--text-secondary); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px 28px;
  background: #0a0a0c;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand strong { display: block; font-size: 15px; }
.footer-brand span { font-size: 13px; color: var(--text-secondary); }

.footer-links {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-links a:hover { color: #2997ff; }

.footer-copy {
  max-width: 1100px;
  margin: 24px auto 0;
  font-size: 12px;
  color: #6e6e73;
}

/* ---------- 手机端固定底部下载栏 ---------- */
.mobile-download-bar {
  display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { padding: 72px 20px 80px; }
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-phone { order: -1; }
  .steps { grid-template-columns: 1fr; }
  .title-logo { width: 190px; height: 190px; right: -12px; }
}

@media (max-width: 700px) {
  .nav-links a:not(.nav-download) { display: none; }
  .nav-download {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* 首屏：一屏高度、垂直居中，手机上隐藏手机截图 */
  .hero {
    min-height: 100vh;
    min-height: calc(100svh - 46px);
    display: flex;
    align-items: center;
    padding: 28px 20px 40px;
  }
  .hero-inner { width: 100%; gap: 18px; }
  .hero-phone { display: none; }
  .title-logo { width: 128px; height: 128px; right: -8px; }
  .hero-glow { top: -180px; width: 520px; height: 420px; }
  .badge { padding: 5px 12px; font-size: 12px; }
  h1 { font-size: clamp(44px, 13vw, 56px); margin-top: 16px; }
  .hero-sub { font-size: 15px; margin-top: 14px; }
  .hero-meta { margin-top: 18px; gap: 8px; }
  .chip { padding: 4px 10px; font-size: 12px; }
  .hero-actions {
    margin-top: 24px;
    gap: 10px;
    flex-direction: column;
  }
  .hero-actions .btn { width: 100%; min-height: 50px; }

  /* 安装说明：一屏高度、垂直居中 */
  .section {
    min-height: 100vh;
    min-height: calc(100svh - 46px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 20px 56px;
  }
  .section-head { margin-bottom: 28px; }
  .steps { gap: 12px; }
  .step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 16px;
  }
  .step-num {
    width: 38px;
    height: 38px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .step h3 { font-size: 15px; margin-bottom: 2px; }
  .step p { font-size: 13px; }

  /* 固定底部下载栏 */
  body { padding-bottom: 84px; }
  .mobile-download-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(22, 22, 23, 0.82);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border);
  }
  .mobile-download-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
  }
  .mobile-download-info strong { font-size: 15px; }
  .mobile-download-info span { font-size: 12px; color: var(--text-secondary); }
  .btn-mobile {
    min-height: 44px;
    padding: 10px 24px;
    flex-shrink: 0;
  }
}

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