/* ============================================================
   打字学英语 - 中英输入法 · 产品页
   设计原则：少而大、留白、单一强调色、一屏一件事
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-tint: #f0f5ff;
  --ink: #101114;
  --ink-2: #55585f;
  --ink-3: #8b8f98;
  --line: #e8e9ed;
  --line-soft: #f0f1f4;
  --accent: #0a6cff;
  --accent-soft: rgba(10, 108, 255, .08);
  --green: #07c160;
  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 17, 20, .04), 0 4px 16px rgba(16, 17, 20, .04);
  --shadow-md: 0 2px 4px rgba(16, 17, 20, .04), 0 12px 40px rgba(16, 17, 20, .08);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body.im-minimal {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }
code { font-family: var(--font-mono); }

/* ---------- 布局容器 ---------- */
.wrap      { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap-text { max-width: 680px;  margin: 0 auto; padding: 0 24px; }

.section        { padding: 96px 0; }
.section--soft  { background: var(--bg-soft); }
.section--tight { padding: 72px 0; }

@media (max-width: 760px) {
  body.im-minimal { font-size: 16px; }
  .section { padding: 64px 0; }
  .section--tight { padding: 52px 0; }
}

/* ---------- 章节标题 ---------- */
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.sec-title {
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 16px;
}

.sec-sub {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-2);
  margin: 0;
  max-width: 620px;
}

.sec-head { margin-bottom: 52px; }
.sec-head--center { text-align: center; }
.sec-head--center .sec-sub { margin-left: auto; margin-right: auto; }

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-soft);
}

.header-content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.01em;
}

.logo-img { width: 30px; height: 30px; border-radius: 8px; }

.nav-links a {
  margin-left: 26px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .18s ease;
}
.nav-links a:hover { color: var(--accent); }

@media (max-width: 520px) {
  .nav-links a { margin-left: 16px; font-size: 13.5px; }
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 100px 0 64px;
  background:
    radial-gradient(900px 420px at 50% -12%, rgba(10, 108, 255, .07), transparent 70%),
    var(--bg);
}

.hero h1 {
  font-size: clamp(36px, 6.4vw, 62px);
  line-height: 1.16;
  font-weight: 750;
  letter-spacing: -.035em;
  margin: 0 auto 22px;
  max-width: 15em;
}

.hero-lead {
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 auto 40px;
  max-width: 22em;
  font-weight: 400;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.hero-note {
  margin: 22px 0 0;
  font-size: 14px;
  color: var(--ink-3);
}

@media (max-width: 760px) { .hero { padding: 68px 0 60px; } }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  font-size: 15.5px;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  transition: transform .18s cubic-bezier(.16,1,.3,1), box-shadow .18s ease, background-color .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 2px 10px rgba(16,17,20,.18);
}
.btn-primary:hover { background: #26282e; box-shadow: 0 8px 24px rgba(16,17,20,.22); }

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn-ghost:hover { color: var(--ink); border-color: #d3d5db; }

/* ---------- 演示：候选栏还原 ---------- */
.demo-stack {
  display: grid;
  gap: 22px;
  max-width: 720px;
  margin: 0 auto;
}

.demo {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .28s cubic-bezier(.16,1,.3,1), transform .28s cubic-bezier(.16,1,.3,1);
}
.demo:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.demo-cap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px 26px 0;
}
.demo-cap b {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.01em;
}
.demo-cap span { font-size: 14px; color: var(--ink-3); }

.demo-type {
  margin: 14px 26px 0;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink-2);
  letter-spacing: .01em;
  word-break: break-word;
}
.demo-type::before {
  content: "输入";
  display: block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--ink-3);
  margin-bottom: 5px;
}

.demo-out { padding: 6px 26px 22px; }

.demo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}
.demo-row:last-child { border-bottom: none; }

.demo-tag {
  flex: none;
  width: 30px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.demo-val { font-size: 17px; line-height: 1.5; word-break: break-word; }
.demo-val--en { color: var(--accent); font-weight: 550; }

/* ---------- 能力清单（短标签，不写长段落）---------- */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.spec {
  background: #fff;
  padding: 28px 26px;
}

.spec h3 {
  font-size: 16px;
  font-weight: 650;
  margin: 0 0 8px;
  letter-spacing: -.01em;
}

.spec p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0;
}

@media (max-width: 900px) { .spec-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .spec-grid { grid-template-columns: 1fr; } }

/* ---------- 数字条 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.stat b {
  display: block;
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
}
.stat b small { font-size: .48em; font-weight: 650; margin-left: 3px; letter-spacing: 0; }
.stat span {
  display: block;
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--ink-2);
}
@media (max-width: 620px) { .stats { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; } }

/* ---------- 下载卡 ---------- */
.download-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.download-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s ease;
}
.download-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.platform-info { display: flex; align-items: center; gap: 11px; }
.platform-icon { flex: none; }
.android-icon { color: var(--green); }
.apple-icon { color: #000; }
.platform-info h3 { font-size: 15.5px; font-weight: 650; margin: 0; line-height: 1.25; }
.platform-info span { font-size: 12.5px; color: var(--ink-3); }

.qr-wrapper {
  width: 150px; height: 150px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 7px;
}
.qr-wrapper img { width: 100%; height: 100%; display: block; }

.mac-preview {
  width: 150px; height: 150px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #f8f9fb, #eef0f4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.mac-app-icon { width: 66px; height: 66px; border-radius: 15px; box-shadow: 0 8px 20px rgba(0,0,0,.12); }

.download-card .btn { width: 100%; padding: 11px; font-size: 14.5px; border-radius: var(--r-md); }
.btn-android { background: var(--green); color: #fff; }
.btn-android:hover { background: #06ad56; }
.btn-ios { background: #000; color: #fff; }
.btn-ios:hover { background: #26282e; }
.btn-mac { background: var(--accent); color: #fff; }
.btn-mac:hover { background: #0a5ad6; }

.card-note { font-size: 12.5px; color: var(--ink-3); text-align: center; }

@media (max-width: 860px) {
  .download-section { grid-template-columns: 1fr; max-width: 340px; }
}

/* ---------- FAQ（默认折叠）---------- */
.faq { max-width: 720px; margin: 0 auto; }

.faq details {
  border-bottom: 1px solid var(--line);
}
.faq details[open] { background: linear-gradient(#fff, #fff); }

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 24px 44px 24px 0;
  position: relative;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: -.01em;
  scroll-margin-top: 90px;
  transition: color .18s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent); }

.faq summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 32px;
  width: 9px; height: 9px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform .22s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); }

.faq-a {
  padding: 0 8px 26px 0;
  margin: -6px 0 0;
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--ink-2);
}
.faq-a code {
  font-size: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 5px;
  padding: 2px 6px;
}
.faq-a a { color: var(--accent); }

/* ---------- 引用块 ---------- */
.quote {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
.quote p {
  font-size: clamp(20px, 2.8vw, 27px);
  line-height: 1.6;
  font-weight: 550;
  letter-spacing: -.02em;
  margin: 0 0 18px;
}
.quote small {
  display: block;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-2);
  font-weight: 400;
}

/* ---------- Footer ---------- */
.footer {
  padding: 56px 24px;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}

.social-links { display: flex; justify-content: center; gap: 14px; margin-bottom: 22px; }

.social-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  transition: all .22s cubic-bezier(.16,1,.3,1);
}
.social-btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; transform: translateY(-2px); }
.qr-toggle[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.qr-panel { margin: 20px auto 4px; max-width: 220px; }
.qr-panel[hidden] { display: none; }
.qr-panel img { width: 100%; display: block; border-radius: var(--r-md); border: 1px solid var(--line); background: #fff; }

.footer p { margin: 6px 0; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.sep { margin: 0 8px; color: var(--line); }

/* ---------- 可访问性 ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

a:focus-visible, summary:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
