/* ==========================================================================
   良心工厂 · LiangXin GongChang —— 全局样式表 / Global stylesheet
   --------------------------------------------------------------------------
   1) 缩放模型 / Scaling model
      根字号随视口宽度等比增长，所有尺寸一律用 rem 书写：
      大屏（2K/4K）上整页等比放大，普通笔记本（≤1920px）保持 16px 基准，
      与设计稿像素级一致，不会因为「尺寸写死」而在宽屏上留出大片空白。
      The root font-size scales with the viewport width and every size is
      written in rem, so the whole page scales proportionally on large
      displays while staying pixel-identical on ordinary laptops.
        · ≤1920px  → 16px 基准（与原设计完全一致）
        · 2560px   → 约 20.6px（等比放大 ~1.29x）
        · ≥3030px  → 24px 封顶（防止超宽屏无节制放大）
      缩放边界 / Boundaries：≤960px 切平板布局，≤640px 切移动端单列布局，
      更窄时布局继续流式收缩（不会出现横向滚动条）。
   2) 字体 / Typography
      只使用操作系统自带的 UI 字体：不加载 webfont，也不强制任何仅存在于
      单一平台的字族。Windows / Linux 用各自系统字体，macOS 用 San Francisco
      并由系统自行回退中文，避免跨平台字体度量差异导致的错位。
      System UI fonts only — no webfonts, no platform-specific family forced.
   ========================================================================== */

:root {
  --bg: #fbfbfd; --bg-elevated: #ffffff; --bg-subtle: #f5f5f7;
  --text-primary: #1d1d1f; --text-secondary: #6e6e73; --text-tertiary: #86868b;
  --coming: #aeaeb2;
  --separator: rgba(0,0,0,0.06); --border: rgba(0,0,0,0.08);
  --accent: #0071e3;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.03), 0 8px 24px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 2px 6px rgba(0,0,0,0.05), 0 16px 40px rgba(0,0,0,0.06);
  --shadow-browser: 0 1px 2px rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.10);
  --nav-bg: rgba(251,251,253,0.8);
}
[data-theme="dark"] {
  --bg: #000; --bg-elevated: #1c1c1e; --bg-subtle: #2c2c2e;
  --text-primary: #f5f5f7; --text-secondary: #98989d; --text-tertiary: #636366;
  --coming: #6e6e73;
  --separator: rgba(255,255,255,0.08); --border: rgba(255,255,255,0.10);
  --accent: #0a84ff;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.3);
  --shadow-card-hover: 0 2px 6px rgba(0,0,0,0.45), 0 16px 40px rgba(0,0,0,0.35);
  --shadow-browser: 0 1px 2px rgba(0,0,0,0.5), 0 12px 32px rgba(0,0,0,0.5);
  --nav-bg: rgba(0,0,0,0.8);
}
* { box-sizing: border-box; margin: 0; padding: 0; }

/* 等比缩放的基准：所有 rem 尺寸都跟随这里的根字号
   Scaling base — every rem below follows this root font-size. */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  font-size: clamp(16px, calc(0.72vw + 2.2px), 24px);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text-primary);
  font-size: 1rem; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img, svg { display: block; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 100; background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); }
.nav-inner { max-width: 70rem; margin: 0 auto; padding: 0 2rem; height: 3.75rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.logo { font-size: 1.3125rem; font-weight: 800; letter-spacing: 0.01em;
  transition: opacity 0.2s; }
.logo:hover { opacity: 0.7; }
.nav-actions { display: flex; align-items: center; gap: 0.25rem; }
.icon-btn { width: 2.125rem; height: 2.125rem; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; color: var(--text-secondary);
  transition: color 0.2s, background-color 0.2s; }
.icon-btn:hover { color: var(--text-primary); background: var(--separator); }
.icon-btn svg { width: 1.125rem; height: 1.125rem; }
.lang { position: relative; }
.lang-toggle { display: inline-flex; align-items: center; gap: 0.3125rem; font-size: 0.875rem;
  color: var(--text-secondary); padding: 0.4375rem 0.75rem; border-radius: 980px;
  transition: color 0.2s, background-color 0.2s; }
.lang-toggle:hover { color: var(--text-primary); background: var(--separator); }
.lang-toggle svg { width: 1rem; height: 1rem; }
.lang-menu { position: absolute; top: calc(100% + 0.5rem); right: 0; min-width: 8.125rem;
  background: var(--bg-elevated); border-radius: 0.875rem; box-shadow: var(--shadow-card-hover);
  border: 1px solid var(--separator); padding: 0.375rem; display: none; }
.lang.open .lang-menu { display: block; }
.lang-menu button { display: block; width: 100%; text-align: left; padding: 0.5rem 0.875rem;
  font-size: 0.875rem; border-radius: 0.5625rem; color: var(--text-primary);
  transition: background-color 0.15s; }
.lang-menu button:hover { background: var(--separator); }
.lang-menu button.active { color: var(--accent); font-weight: 500; }

/* ---------- Main ----------
   内容区在可视高度内垂直居中，使大屏上剩余的留白上下均分，
   而不是全部堆在页面底部。When the content is shorter than the viewport it
   is centred vertically, so the leftover space is split evenly instead of
   piling up at the bottom on large displays. */
.main { flex: 1; width: 100%; max-width: 70rem; margin: 0 auto;
  padding: 2.25rem 2rem 2.5rem; display: flex; flex-direction: column;
  justify-content: center; }
.hero { text-align: center; margin-bottom: 2.75rem; }
.hero h1 { font-size: clamp(2.5rem, 5.4vw, 3.75rem); font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.05; margin-bottom: 1rem; }
.hero p { font-size: clamp(1rem, 1.8vw, 1.1875rem); color: var(--text-secondary);
  max-width: 32.5rem; margin: 0 auto; line-height: 1.5; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.card {
  background: var(--bg-elevated); border-radius: 1rem; padding: 0;
  box-shadow: var(--shadow-card); overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease, background-color 0.4s ease;
  display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-3px); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.card-body { padding: 1.75rem 2rem 2rem; }
.card-title { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 0.5rem; }
.card-desc { font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.6; }

/* ---------- Thumb: browser mockup ---------- */
.thumb { width: 100%; aspect-ratio: 16 / 10; background: var(--bg-subtle);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 1.75rem 1.75rem 0; overflow: hidden; }
.browser { width: 100%; max-width: 29.375rem; background: var(--bg-elevated);
  border: 1px solid var(--border); border-bottom: none;
  border-radius: 0.75rem 0.75rem 0 0; box-shadow: var(--shadow-browser);
  overflow: hidden; transition: background-color 0.4s ease, border-color 0.4s ease; }
.browser-bar { display: flex; align-items: center; gap: 0.375rem;
  padding: 0.5625rem 0.75rem; background: var(--bg-subtle); border-bottom: 1px solid var(--separator); }
.dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex: none; }
.dot-r { background: #ff5f57; } .dot-y { background: #febc2e; } .dot-g { background: #28c840; }
.browser-url { margin-left: 0.5rem; font-size: 0.6875rem; color: var(--text-tertiary);
  background: var(--bg-elevated); border-radius: 0.375rem; padding: 0.125rem 0.75rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser img { width: 100%; height: auto; }

/* ---------- Thumb: coming soon ---------- */
.thumb-coming { align-items: center; padding: 1.75rem; }
.coming-soon { font-size: clamp(1.5rem, 3vw, 2.125rem); font-weight: 700;
  color: var(--coming); letter-spacing: 0.06em; text-transform: uppercase;
  transition: color 0.4s ease; }

/* ---------- Footer ---------- */
.footer { padding: 2rem; text-align: center; font-size: 0.8125rem;
  color: var(--text-tertiary); line-height: 2; }
.footer a { color: var(--text-tertiary); }
.footer a:hover { color: var(--text-primary); }

/* ---------- Responsive ----------
   断点用 px 书写，保证与根字号的缩放互不干扰。
   Media queries stay in px so they never interact with the scaling root. */
@media (max-width: 960px) {
  .main { padding: 2.25rem 1.5rem 2.5rem; }
  .nav-inner { padding: 0 1.25rem; }
  .grid { gap: 1.5rem; }
  .thumb { padding: 1.25rem 1.25rem 0; }
}
@media (max-width: 640px) {
  .main { padding: 1.75rem 1rem 2rem; }
  .nav-inner { height: 3.25rem; }
  .logo { font-size: 1.125rem; }
  .grid { grid-template-columns: 1fr; }
  .card { border-radius: 0.75rem; }
  .card-body { padding: 1.25rem 1.5rem 1.5rem; }
  .card-title { font-size: 1.25rem; }
  .thumb { aspect-ratio: 16 / 11; padding: 1rem 1rem 0; }
  .browser-url { display: none; }
  .footer { padding: 1.5rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  html { scroll-behavior: auto; }
}
