/* 有余记账本官网：白底、大量留白、薄荷绿点缀；手机优先 */

:root {
  --mint: #2BB673;
  --mint-dark: #1f9a5e;
  --mint-soft: #eef8f2;
  --mint-line: #cfeedd;
  --ink: #17221c;
  --text: #3b4a42;
  --muted: #6b7a72;
  --line: #e6ece8;
  --bg: #ffffff;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(23, 34, 28, 0.04), 0 12px 32px rgba(23, 34, 28, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Source Han Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--mint-dark);
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.3;
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-left));
}

.narrow {
  max-width: 760px;
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.topbar.scrolled {
  border-bottom-color: var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
}

.topnav {
  display: flex;
  gap: 4px;
}

.topnav a {
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  padding: 6px 10px;
  border-radius: 999px;
}

.topnav a:hover {
  background: var(--mint-soft);
  color: var(--mint-dark);
}

/* ---------- 首屏 ---------- */

.hero {
  padding: 40px 0 64px;
  background: radial-gradient(120% 70% at 50% 0%, var(--mint-soft) 0%, rgba(238, 248, 242, 0) 70%);
}

.hero-inner {
  display: grid;
  gap: 48px;
  align-items: center;
}

.hero-text {
  text-align: center;
}

.hero-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(43, 182, 115, 0.28);
}

.hero h1 {
  font-size: 34px;
  letter-spacing: 0.02em;
}

.tagline {
  margin: 10px 0 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--mint-dark);
  letter-spacing: 0.04em;
}

.sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.soon-notice {
  margin: 24px auto 0;
  max-width: 420px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--mint-soft);
  border: 1px solid var(--mint-line);
  color: var(--ink);
  font-size: 15px;
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
}

.buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 360px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 28px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-primary {
  background: var(--mint);
  color: #fff;
  box-shadow: 0 8px 24px rgba(43, 182, 115, 0.32);
}

.btn-primary:hover {
  background: var(--mint-dark);
}

.btn-secondary {
  background: #fff;
  color: var(--mint-dark);
  box-shadow: inset 0 0 0 2px var(--mint);
}

.btn-secondary:hover {
  background: var(--mint-soft);
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible,
.tab:focus-visible,
summary:focus-visible,
.shot-row:focus-visible {
  outline: 3px solid rgba(43, 182, 115, 0.45);
  outline-offset: 3px;
}

.btn-soon {
  display: none;
}

/* iPhone 还没开放 */
.btn.is-soon {
  background: #f1f3f2;
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

.btn.is-soon .btn-label {
  display: none;
}

.btn.is-soon .btn-soon {
  display: inline;
}

/* 按访客设备排：显眼的放上面 */
[data-primary="android"] #btn-android {
  order: -1;
}

.qr {
  display: none;
  margin: 0;
  text-align: center;
}

.qr img {
  width: 120px;
  height: 120px;
  padding: 10px;
  background: #fff;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.qr figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.version {
  margin: 16px 0 0;
  min-height: 1.7em;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- 手机外框 ---------- */

.phone {
  position: relative;
  width: 100%;
  padding: 9px;
  border-radius: 46px;
  background: #101614;
  box-shadow: 0 0 0 1px #2a332f inset, 0 30px 60px rgba(23, 34, 28, 0.18), 0 8px 20px rgba(23, 34, 28, 0.1);
}

.phone img {
  width: 100%;
  height: auto;
  aspect-ratio: 750 / 1630;
  border-radius: 38px;
  background: #f4f8f5;
}

/* 手机上不放：下面的截图区第一张就是同一个画面 */
.hero-phone {
  display: none;
  margin: 0 auto;
}

/* ---------- 一般区块 ---------- */

.section {
  padding: 80px 0;
}

.section h2 {
  font-size: 28px;
  text-align: center;
}

.section-lead {
  margin: 10px 0 0;
  text-align: center;
  color: var(--muted);
}

/* ---------- 截图 ---------- */

.shots {
  background: var(--mint-soft);
}

.shot-row {
  position: relative;
  display: flex;
  gap: 20px;
  margin-top: 40px;
  padding: 8px max(20px, calc((100vw - 1120px) / 2 + 20px)) 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 20px;
  scrollbar-width: none;
}

.shot-row::-webkit-scrollbar {
  display: none;
}

.shot {
  flex: 0 0 min(240px, 64vw);
  margin: 0;
  scroll-snap-align: center;
}

.shot-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
}

/* 点的范围放大到 24px 方便按，看起来只有小圆点 */
.shot-dots button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.shot-dots button::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--mint-line);
  transition: width 0.2s, background-color 0.2s;
}

.shot-dots button[aria-current="true"]::before {
  width: 22px;
  background: var(--mint);
}

.shot figcaption {
  margin-top: 16px;
  text-align: center;
  font-size: 15px;
  color: var(--ink);
}

/* ---------- 功能 ---------- */

.feature-grid {
  display: grid;
  gap: 16px;
  margin-top: 40px;
}

.feature {
  padding: 28px 24px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  transition: box-shadow 0.2s, transform 0.2s;
}

.feature:hover {
  box-shadow: var(--shadow);
}

.feature svg {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 14px;
  background: var(--mint-soft);
  fill: none;
  stroke: var(--mint);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature h3 {
  margin-top: 18px;
  font-size: 18px;
}

.feature p {
  margin: 6px 0 0;
  color: var(--text);
}

/* ---------- 安装 ---------- */

.install {
  background: linear-gradient(180deg, #fff 0%, var(--mint-soft) 100%);
}

.tabs {
  display: flex;
  gap: 4px;
  width: fit-content;
  margin: 32px auto 0;
  padding: 4px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.tab {
  min-width: 112px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  background: var(--mint);
  color: #fff;
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 20px 20px 20px 72px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 20px;
  top: 20px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--mint);
  color: #fff;
  font-weight: 700;
}

.steps strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
}

.steps span {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 24px 0 0;
  padding: 16px 20px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--mint-line);
  color: var(--ink);
  font-weight: 600;
}

.callout svg {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  fill: none;
  stroke: var(--mint);
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---------- 常见问题 ---------- */

.faq-list {
  margin-top: 32px;
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  position: relative;
  padding: 20px 40px 20px 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -7px;
  border-right: 2px solid var(--mint);
  border-bottom: 2px solid var(--mint);
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -2px;
}

.faq details p {
  margin: 0 0 20px;
}

/* ---------- 结尾 ---------- */

.cta {
  padding: 72px 0;
  text-align: center;
  background: var(--mint);
}

.cta h2 {
  color: #fff;
  font-size: 26px;
}

.cta .btn {
  margin-top: 24px;
  background: #fff;
  color: var(--mint-dark);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.footer {
  padding: 40px 0 calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.contact {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

/* 客服还没设定好（没载入 Crisp）时不显示按钮 */
.support-link {
  display: none;
  margin-left: 6px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--mint-dark);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.has-support .support-link {
  display: inline-block;
}

.copy {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 浮现动画（有 JavaScript、没开「减少动态效果」才有） ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- 小手机 ---------- */

@media (max-width: 380px) {
  .topnav a:not(:last-child) {
    display: none;
  }

  .hero h1 {
    font-size: 30px;
  }

  .tagline {
    font-size: 20px;
  }
}

/* ---------- 平板 ---------- */

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section h2 {
    font-size: 32px;
  }
}

/* ---------- 电脑 ---------- */

@media (min-width: 960px) {
  .hero {
    padding: 72px 0 96px;
  }

  .hero-inner {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 64px;
  }

  .hero-text {
    text-align: left;
  }

  .hero-icon {
    margin-left: 0;
  }

  .hero h1 {
    font-size: 48px;
  }

  .tagline {
    font-size: 28px;
  }

  .sub {
    font-size: 17px;
  }

  .soon-notice {
    margin-left: 0;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .buttons {
    max-width: 300px;
  }

  [data-device="desktop"] .qr {
    display: block;
  }

  [data-device="desktop"] #btn-android {
    background: var(--mint);
    color: #fff;
    box-shadow: 0 8px 24px rgba(43, 182, 115, 0.32);
  }

  .hero-phone {
    display: block;
    width: 320px;
  }

  .section {
    padding: 112px 0;
  }

  .shot-row {
    justify-content: center;
    overflow: visible;
  }

  .shot {
    flex: 0 1 240px;
  }

  /* 电脑上 4 张并排，不用点 */
  .shot-dots {
    display: none;
  }

  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
  }
}
