:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --fg: #20201e;
  --muted: #6c6a64;
  --rule: #d9d6cf;
  --accent: #12635f;
  --accent-strong: #0a4c49;
  --card: #f0eee8;
  --focus: #bf6a38;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171816;
    --fg: #f3f1ea;
    --muted: #aaa79e;
    --rule: #3b3d38;
    --accent: #74c5bd;
    --accent-strong: #9ad8d2;
    --card: #222420;
    --focus: #eea06e;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0 24px 96px;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.68 -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Helvetica Neue", "PingFang SC", "PingFang TC", "Hiragino Sans",
    "Yu Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 760px; margin: 0 auto; }

.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  color: var(--fg);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
    Palatino, Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

/* 图标只在够大的时候才看得出是什么：缩到导航栏那个尺寸，塔身和图钉会糊成
   一团噪点。所以它只出现在首页标题上方。icon-hero.png 的画布比图标本体
   四周多 18% 的同色延伸边（透明渐变到页面底色），104px 里画面本体仍约
   76px，视觉尺寸与前版一致。 */
.hero-mark {
  display: block;
  width: 104px;
  height: 104px;
  margin-bottom: 16px;
}

.language-picker {
  display: none;
  align-items: center;
}

.js .language-picker { display: flex; }

.language-picker select {
  appearance: auto;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--card);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  max-width: 220px;
  cursor: pointer;
  transition: border-color 180ms ease;
}

.language-picker select:hover {
  border-color: var(--muted);
}

.language-picker select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

main:focus { outline: none; }

.language-panel {
  padding-top: 1px;
}

/* 没有 JS 时五种语言会全部堆在一起，靠这条分隔线区分。必须限定在没有 JS 的
   情况下：`+` 选的是 DOM 里的相邻关系，跟显不显示无关，不限定的话只要当前语言
   不是第一个面板，就会在标题上方白白多出一段空白和一条双线。 */
html:not(.js) .language-panel + .language-panel {
  margin-top: 96px;
  border-top: 3px double var(--rule);
}

.js .language-panel { display: none; }
.js .language-panel.is-active { display: block; }

header {
  padding: 72px 0 40px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 48px;
}

header .home {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 15px;
  color: var(--accent);
  text-decoration: none;
}

header .home:hover { text-decoration: underline; }

h1 {
  margin: 0 0 8px;
  max-width: 100%;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
    Palatino, Georgia, serif;
  font-size: clamp(42px, 7vw, 64px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h1:lang(zh-Hans),
h1:lang(zh-Hant),
h1:lang(zh-HK),
h1:lang(ja) {
  line-break: strict;
  letter-spacing: -0.02em;
}

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

h2 {
  margin: 56px 0 16px;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
    Palatino, Georgia, serif;
  font-size: 27px;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

h3 { margin: 32px 0 10px; font-size: 20px; letter-spacing: -0.01em; }

/* 正文列有 760px，英文在这个宽度下一行能排到九十多个字符，读起来会串行。
   38em 折算过来中文约 38 字、英文约 70 字符，都在舒服的范围内。 */
p, ul { max-width: 38em; }

p { margin: 0 0 16px; }

ul { margin: 0 0 16px; padding-left: 22px; }

li { margin-bottom: 8px; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-strong); }

.lede {
  max-width: 34em;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
    Palatino, Georgia, serif;
  font-size: 23px;
  line-height: 1.45;
  color: var(--fg);
}

/* 首页不需要标题下那条横线：下面紧接着就是特性列表，多一条边界只会显得碎。 */
.hero {
  padding: 76px 0 0;
  border-bottom: 0;
  margin-bottom: 40px;
}

.hero .lede { margin: 24px 0 0; }

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

.features {
  display: grid;
  gap: 28px;
  margin: 0 0 48px;
  padding: 0;
  list-style: none;
}

.features li {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.features strong {
  display: block;
  margin-bottom: 4px;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.features span {
  display: block;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.closing {
  max-width: 34em;
  margin-bottom: 0;
  color: var(--muted);
}

@media (min-width: 721px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

.note {
  max-width: 38em;
  background: var(--card);
  border-left: 3px solid var(--accent);
  border-radius: 2px 12px 12px 2px;
  padding: 18px 22px;
  margin: 28px 0;
  font-size: 16px;
  /* 提示框讲的是「删掉 App 不等于删干净」这类要紧事，用灰字会被当成脚注读过去。 */
  color: var(--fg);
}

.note p:last-child { margin-bottom: 0; }

.divider {
  margin: 80px 0 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 14px;
}

footer a { color: var(--muted); }

.cards { display: grid; gap: 16px; margin-top: 48px; }

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

.card {
  display: block;
  padding: 28px;
  background: var(--card);
  border: 1px solid transparent;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease;
}

.card:hover {
  color: inherit;
  border-color: var(--accent);
}

.card strong {
  display: block;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
    Palatino, Georgia, serif;
  font-size: 24px;
  margin-bottom: 4px;
}

.card span { color: var(--muted); font-size: 15px; }

code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--rule);
  border-radius: 5px;
  font: 0.88em/1.4 ui-monospace, "SFMono-Regular", Menlo, monospace;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  body { padding-inline: 18px; }

  .site-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .language-picker {
    width: 100%;
    flex-wrap: wrap;
    overflow: visible;
  }

  header { padding-top: 52px; }
  h1 { font-size: clamp(40px, 12vw, 54px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
