/* 两个页面共用的设计令牌、顶栏、页脚与语言切换。
   语言切换刻意做成纯 CSS：两种语言都留在 DOM 里，靠 <html data-lang>
   决定显示哪一份。好处是 JS 没加载完也不会闪烁，搜索引擎两份都能收。 */

:root {
  --ink: #1d1d1f;
  --gray: #6e6e73;
  --gray-2: #86868b;
  --hair: #d2d2d7;
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --amber: #c9832b;
  --green: #117a44;
  --red: #c0392b;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 0 22px; }

/* ── 双语 ─────────────────────────────── */
html[data-lang="en"] [lang="zh"],
html[data-lang="zh"] [lang="en"] { display: none !important; }

.langtoggle {
  display: inline-flex; align-items: center;
  border: 1px solid var(--hair); border-radius: 980px;
  overflow: hidden; margin-left: 22px; vertical-align: middle;
}
.langtoggle button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--gray);
  padding: 3px 10px; line-height: 1.6;
}
.langtoggle button:hover { color: var(--ink); }
.langtoggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.langtoggle button:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }

/* ── 顶栏 ─────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.08);
}
nav .wrap {
  min-height: 48px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 15px;
  color: inherit; text-decoration: none;
}
.navlinks { display: flex; align-items: center; }

/* app icon 的复刻：不等长的等号，下杠琥珀 */
.mark { width: 22px; height: 22px; border-radius: 6px; background: #1d1d1f; position: relative; flex: none; }
.mark::before, .mark::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  height: 2.5px; border-radius: 2px;
}
.mark::before { top: 7px;  width: 8px;  background: #f5f1e8; }
.mark::after  { top: 12.5px; width: 12px; background: #d9a441; }

nav a { color: var(--gray); text-decoration: none; font-size: 13px; margin-left: 22px; }
nav a:hover { color: var(--ink); }
nav .brand { margin-left: 0; }

/* ── 页脚 ─────────────────────────────── */
footer {
  border-top: 1px solid var(--hair);
  margin-top: 72px; padding: 28px 0 44px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 12.5px; color: var(--gray-2);
}
footer a { color: var(--gray-2); }

/* ── 键帽 ─────────────────────────────── */
kbd {
  font-family: var(--sans); font-size: 12px;
  border: 1px solid var(--hair); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px;
  background: #fff; color: var(--ink); white-space: nowrap;
}

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