/* 记忆糖官网：首页 / 帮助 / 隐私 / 条款共用 */
:root {
  --text: #1a1a1a;
  --muted: #555;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --bg: #f8fafc;
  --card: #f1f5f9;
  --radius: 12px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  font-size: 16px;
  color: var(--text);
  margin: 0;
  background: #fff;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

img, svg, video {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover,
a:focus-visible {
  color: var(--accent-hover);
  text-decoration: underline;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 1rem 0.75rem;
}

.site-header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
}

.brand {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.brand:hover,
.brand:focus-visible {
  color: var(--text);
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
}

nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.55rem;
}

nav a:hover { text-decoration: underline; }
nav a[aria-current="page"] { font-weight: 600; }

.lang-switch {
  font-size: 0.85rem;
  color: var(--muted);
  border-left: 1px solid var(--border);
  margin-left: 0.25rem;
  padding-left: 0.35rem;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.meta a { color: var(--accent); }

h1 { font-size: 1.5rem; margin: 0 0 0.5rem; line-height: 1.3; }
h2 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.75rem;
  padding-top: 0.25rem;
  scroll-margin-top: 1rem;
}
h3 { font-size: 1rem; margin: 1.1rem 0 0.4rem; }

p { margin: 0.5rem 0; }
ol, ul { margin: 0.5rem 0; padding-left: 1.5rem; }
li { margin: 0.35rem 0; }
code {
  font-size: 0.9em;
  background: var(--card);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}

.section-en { display: none; }
.lang-label { display: none; }

.i18n-en { display: none; }
html.lang-en .i18n-zh { display: none; }
html.lang-en .i18n-en { display: inline; }
html.lang-en .section-zh { display: none; }
html.lang-en .section-en { display: block; }

footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem calc(2rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

footer a { color: var(--accent); }
footer .beian-gongan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  min-height: 44px;
}
footer .beian-gongan:hover,
footer .beian-gongan:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}
footer .beian-gongan img {
  width: 16px;
  height: 16px;
}

/* —— 首页 —— */
.hero {
  padding: 0.5rem 0 1.25rem;
}
.hero .sub {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0.35rem 0 1rem;
}
.hero .lead {
  font-size: 1.05rem;
  margin: 0 0 1.25rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1.2rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
}
.btn:hover,
.btn:focus-visible {
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: #fff;
}
.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.store-note {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.75rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin: 1.75rem 0;
}
.feature {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.feature h2 {
  margin: 0 0 0.4rem;
  padding: 0;
  font-size: 1.05rem;
}
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.home-contact {
  margin: 2rem 0 0;
  color: var(--muted);
}

/* —— 帮助目录 —— */
.toc {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 1rem;
  margin: 0 0 1.75rem;
}
.toc-title {
  font-weight: 600;
  margin: 0 0 0.4rem;
}
.toc ol {
  margin: 0;
  padding-left: 1.25rem;
}
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.callout {
  background: var(--bg);
  border-left: 3px solid var(--accent);
  padding: 0.65rem 0.9rem;
  margin: 1rem 0;
  border-radius: 0 8px 8px 0;
}

@media (min-width: 640px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  h1 { font-size: 1.75rem; }
}

@media (max-width: 399px) {
  nav a { padding: 0 0.4rem; font-size: 0.88rem; }
}
