/* Readio 产品介绍页
   配色取自 App 的 Assets：AccentColor / AppBackground / AppSurface / AppSeparator
   浅色写在 :root，深色只覆盖变量（系统深色 + 手动切换两条路都盖到） */

/* ── 变量 ──────────────────────────────────────────────────────────────── */
:root {
  --bg:        #f0f2f4;
  --bg-2:      #e7eaed;
  --surface:   #ffffff;
  --surface-2: #f7f8f9;
  --text:      #16191b;
  --text-2:    #545c60;
  --text-3:    #868e93;
  --accent:    #2e6b54;
  --accent-on: #ffffff;
  --accent-soft: rgba(46, 107, 84, .10);
  --accent-line: rgba(46, 107, 84, .22);
  --line:      rgba(40, 37, 32, .12);
  --line-soft: rgba(40, 37, 32, .07);
  --shadow:    0 1px 2px rgba(16, 24, 28, .05), 0 12px 34px -14px rgba(16, 24, 28, .22);
  --shadow-lg: 0 2px 6px rgba(16, 24, 28, .06), 0 40px 90px -30px rgba(16, 24, 28, .38);
  --glow:      radial-gradient(58% 62% at 62% 18%, rgba(46, 107, 84, .16), transparent 70%);
  --device-body: linear-gradient(160deg, #d3d8dc, #a9b1b6 45%, #cfd5d9);

  --wrap: 1140px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC",
          "Hiragino Sans", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #131516;
    --bg-2:      #0e1011;
    --surface:   #1c1f21;
    --surface-2: #232729;
    --text:      #e7eaea;
    --text-2:    #a4acaf;
    --text-3:    #798185;
    --accent:    #5cae86;
    --accent-on: #0f1412;
    --accent-soft: rgba(92, 174, 134, .13);
    --accent-line: rgba(92, 174, 134, .28);
    --line:      rgba(214, 210, 200, .14);
    --line-soft: rgba(214, 210, 200, .08);
    --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 14px 40px -16px rgba(0, 0, 0, .7);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, .45), 0 46px 100px -34px rgba(0, 0, 0, .85);
    --glow:      radial-gradient(58% 62% at 62% 18%, rgba(92, 174, 134, .16), transparent 70%);
    --device-body: linear-gradient(160deg, #3a4043, #222628 45%, #34393c);
  }
}

:root[data-theme="dark"] {
  --bg:        #131516;
  --bg-2:      #0e1011;
  --surface:   #1c1f21;
  --surface-2: #232729;
  --text:      #e7eaea;
  --text-2:    #a4acaf;
  --text-3:    #798185;
  --accent:    #5cae86;
  --accent-on: #0f1412;
  --accent-soft: rgba(92, 174, 134, .13);
  --accent-line: rgba(92, 174, 134, .28);
  --line:      rgba(214, 210, 200, .14);
  --line-soft: rgba(214, 210, 200, .08);
  --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 14px 40px -16px rgba(0, 0, 0, .7);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, .45), 0 46px 100px -34px rgba(0, 0, 0, .85);
  --glow:      radial-gradient(58% 62% at 62% 18%, rgba(92, 174, 134, .16), transparent 70%);
  --device-body: linear-gradient(160deg, #3a4043, #222628 45%, #34393c);
}

/* ── 基础 ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 640; letter-spacing: -.022em; line-height: 1.16; }
p { margin: 0; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }

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

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--accent-on);
  padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none;
}
.skip:focus { left: 16px; }

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

/* ── 顶栏 ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg); /* 不支持 color-mix 时的兜底，否则顶栏会透明 */
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}
.topbar.is-stuck { border-bottom-color: var(--line-soft); }

.topbar-inner { display: flex; align-items: center; gap: 20px; height: 60px; }

.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 640; letter-spacing: -.01em; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-name { font-size: 17px; }

.topnav { display: flex; gap: 24px; margin-inline: auto; }
.topnav a { color: var(--text-2); text-decoration: none; font-size: 15px; transition: color .15s ease; }
.topnav a:hover { color: var(--text); }

.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.langswitch {
  display: inline-flex; padding: 2px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 999px;
}
.langswitch button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 13px; line-height: 1; color: var(--text-2);
  padding: 7px 11px; border-radius: 999px; transition: color .15s ease, background .15s ease;
}
.langswitch button:hover { color: var(--text); }
.langswitch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-on); font-weight: 600; }

.iconbtn {
  appearance: none; cursor: pointer;
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 999px;
  color: var(--text-2); transition: color .15s ease, border-color .15s ease;
}
.iconbtn:hover { color: var(--text); border-color: var(--line); }
.iconbtn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.ico-moon { display: none; fill: currentColor; stroke: none; }
:root[data-theme="dark"] .ico-sun { display: none; }
:root[data-theme="dark"] .ico-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ico-sun { display: none; }
  :root:not([data-theme="light"]) .ico-moon { display: block; }
}

/* ── 首屏 ──────────────────────────────────────────────────────────────── */
.hero { position: relative; padding: clamp(56px, 9vw, 104px) 0 clamp(40px, 6vw, 72px); overflow: hidden; }
.glow { position: absolute; inset: -20% -10% auto; height: 900px; background: var(--glow); pointer-events: none; }

.hero-grid {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(32px, 6vw, 72px); align-items: center;
}

.eyebrow {
  display: inline-block; margin-bottom: 20px;
  font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 6px 13px; border-radius: 999px;
}

.hero-title { font-size: clamp(34px, 5.4vw, 58px); letter-spacing: -.03em; }
.hero-copy .lead {
  margin-top: 22px; max-width: 34em;
  font-size: clamp(16px, 1.5vw, 18.5px); color: var(--text-2); line-height: 1.68;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-start; margin-top: 34px; }
.cta-center { justify-content: center; }

.cta { display: flex; flex-direction: column; gap: 7px; }
.cta-note { font-size: 12.5px; color: var(--text-3); padding-inline: 4px; }
.cta-center .cta { align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 15.5px; font-weight: 590; line-height: 1;
  padding: 14px 22px; border-radius: 999px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, opacity .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-on); }
.btn-primary:hover { opacity: .9; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: var(--shadow); }
.btn-secondary:hover { border-color: var(--accent-line); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--line); }
.btn-ghost:hover { color: var(--text); border-color: var(--line); }
.btn[aria-disabled="true"] { cursor: default; opacity: .55; }
.btn[aria-disabled="true"]:active { transform: none; }

/* ── 手机外壳 ──────────────────────────────────────────────────────────── */
.hero-visual { display: flex; justify-content: center; }

.device {
  position: relative; width: min(310px, 78vw); flex: none;
  padding: 9px; border-radius: 48px;
  background: var(--device-body);
  box-shadow: var(--shadow-lg);
}
.device::after { /* 灵动岛 */
  content: ""; position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 27%; height: 1.35%; min-height: 12px; border-radius: 999px;
  background: #06080a;
}
.device img { width: 100%; border-radius: 40px; background: #131516; }
.device-lg { width: min(330px, 82vw); }

/* 首屏并排两三台 */
.hero-visual.multi { flex-wrap: wrap; gap: 16px; }
.hero-visual.multi .device { width: min(210px, 40vw); border-radius: 34px; padding: 7px; }
.hero-visual.multi .device img { border-radius: 28px; }

/* 首屏小图墙：一排 5 个，9 张就是 5 + 4 两排。
   ⚠️ 用 flex + 定死的 flex-basis（不是 grid）——最后一排不满时要**居中**，
   grid 会把它按列吸到左边，看着像漏了一块。 */
.hero-visual.wall { flex-wrap: wrap; justify-content: center; gap: 10px; }
.hero-visual.wall .device {
  flex: 0 0 calc(20% - 8px); width: auto;
  padding: 3px; border-radius: 15px; box-shadow: var(--shadow);
}
.hero-visual.wall .device img { border-radius: 12px; }
/* ⚠️ 灵动岛那道横杠在这个尺寸下必须去掉：它的 top 是写死的 20px，
   缩到这么小就掉到屏幕中间去了，看着像一条脏东西。 */
.hero-visual.wall .device::after { display: none; }

/* ── 字幕演示 ──────────────────────────────────────────────────────────── */
.demo { padding: clamp(8px, 2vw, 24px) 0 clamp(48px, 7vw, 88px); }

.demo-card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: clamp(22px, 3.4vw, 40px);
  max-width: 780px; margin-inline: auto;
}
.demo-line { padding: 14px 16px; border-radius: var(--r-md); }
.demo-line + .demo-line { margin-top: 6px; }
.demo-src { font-size: clamp(17px, 2vw, 21px); line-height: 1.5; color: var(--text-2); letter-spacing: -.012em; }
.demo-tr { margin-top: 7px; font-size: clamp(13.5px, 1.5vw, 15px); line-height: 1.6; color: var(--text-3); }

.demo-line.is-active { background: var(--accent-soft); }
.demo-line.is-active .demo-src { color: var(--text); }
.demo-line.is-active .w { transition: color .28s ease; }
.demo-line.is-active .w.spoken { color: var(--accent); }

.demo-caption { margin-top: 18px; text-align: center; font-size: 13.5px; color: var(--text-3); }

/* ── 通用区块 ──────────────────────────────────────────────────────────── */
.band { padding: clamp(56px, 8vw, 104px) 0; }
.band-tint { background: var(--bg-2); border-block: 1px solid var(--line-soft); }

.section-title { font-size: clamp(25px, 3.2vw, 36px); }
.section-lead { margin-top: 14px; max-width: 46em; color: var(--text-2); font-size: 16.5px; }

/* 三步 */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 40px; }
.step {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  padding: 26px 24px 28px; box-shadow: var(--shadow);
}
.step-k {
  font-size: 12px; font-weight: 680; letter-spacing: .12em; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.step h3 { margin-top: 12px; font-size: 19px; }
.step p { margin-top: 10px; color: var(--text-2); font-size: 15.5px; line-height: 1.66; }

/* 功能 */
.features { margin-top: 44px; display: grid; gap: clamp(48px, 6vw, 76px); }
/* 一张配图都没有时排成卡片网格，免得变成六段秃文字 */
.features.as-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.features.as-grid .feature {
  display: block; max-width: none;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: 28px 26px 30px; box-shadow: var(--shadow);
}
.features.as-grid .feature h3 { font-size: 19.5px; }
.features.as-grid .feature p { margin-top: 12px; font-size: 15.5px; line-height: 1.66; }
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.feature.no-media { grid-template-columns: minmax(0, 1fr); max-width: 52em; }
.feature:nth-child(even) .feature-media { order: -1; }
.feature h3 { font-size: clamp(21px, 2.4vw, 27px); }
.feature p { margin-top: 14px; color: var(--text-2); font-size: 16.5px; line-height: 1.7; }
.feature-media { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
/* 一块里放两台以上就自动缩小并排 */
.feature-media.multi .device { width: min(210px, 40vw); border-radius: 34px; padding: 7px; }
.feature-media.multi .device img { border-radius: 28px; }

/* 画廊 */
.gallery {
  display: flex; gap: 22px; margin-top: 40px;
  padding: 8px max(24px, calc((100vw - var(--wrap)) / 2 + 24px)) 26px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.gallery.is-single { justify-content: center; }
.gallery figure { margin: 0; flex: none; scroll-snap-align: center; text-align: center; }
.gallery figcaption { margin-top: 14px; font-size: 13.5px; color: var(--text-3); }

/* 视频 */
.videoframe { margin-top: 36px; }
.videoframe video {
  width: 100%; border-radius: var(--r-lg);
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-lg); background: #000;
}

/* 关于 */
.notes { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.note { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 22px 22px 24px; }
.note h3 { font-size: 16.5px; }
.note p { margin-top: 9px; color: var(--text-2); font-size: 15px; line-height: 1.65; }

/* 结尾 */
.closing { padding: clamp(64px, 9vw, 116px) 0; text-align: center; }
.closing-title { font-size: clamp(26px, 3.6vw, 40px); letter-spacing: -.028em; }

/* 页脚 */
.footer { border-top: 1px solid var(--line-soft); padding: 36px 0 56px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.footer-line { color: var(--text-2); font-size: 14.5px; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--text-2); font-size: 14.5px; text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.footer-copy { margin-left: auto; color: var(--text-3); font-size: 13.5px; font-variant-numeric: tabular-nums; }

.noscript { padding: 40px 24px; color: var(--text-2); }

/* ── 入场动画 ──────────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s cubic-bezier(.22, .8, .3, 1); }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
}

/* ── 窄屏 ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { order: -1; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .feature, .feature:nth-child(even) { grid-template-columns: minmax(0, 1fr); }
  .feature .feature-media, .feature:nth-child(even) .feature-media { order: -1; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  /* 📏 手机上一排 5 个只有 60pt 出头，什么都看不出来——退到一排 3 个。
     ⛔ 别为了保住「两排」把它压得更小，那样这块图就白放了。 */
  .hero-visual.wall .device { flex-basis: calc(33.333% - 7px); }
  .topnav { display: none; }
  .wrap { padding-inline: 20px; }
  .gallery { padding-inline: 20px; }
  .footer-copy { margin-left: 0; width: 100%; }
}

/* ── 条款 / 隐私那两页 ───────────────────────────────────────────────────
   正文在 content.js 的 legal 里，这里只管排版。
   ⚠️ 行宽刻意压到 68ch：这两页是要被人真的读完的，
   通栏的 1140px 一行三十多个字，读两段就想关掉。 */
.legal { max-width: 68ch; padding-block: clamp(48px, 8vw, 88px) clamp(64px, 10vw, 112px); }
.legal-title { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.025em; }
.legal-updated { margin-top: 10px; font-size: 13.5px; color: var(--text-3); }
.legal-intro {
  margin-top: 22px; font-size: clamp(16px, 1.8vw, 18px); line-height: 1.7; color: var(--text-2);
  padding: 16px 18px; background: var(--accent-soft);
  border: 1px solid var(--accent-line); border-radius: var(--r-md);
}
.legal-block { margin-top: 38px; }
.legal-block h2 {
  font-size: clamp(18px, 2.2vw, 21px); letter-spacing: -.015em;
  padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
}
.legal-block p { margin-top: 14px; line-height: 1.75; color: var(--text-2); }
.legal-block p strong { color: var(--text); font-weight: 620; }
.legal-back {
  display: inline-block; margin-top: 48px; font-size: 15px;
  color: var(--text-2); text-decoration: none;
}
.legal-back:hover { color: var(--accent); }
