/* ============================================
   Tokens
   ============================================ */
:root {
  --bg: #FFFFFF;
  --bg-alt: #F5F5F7;
  --text: #1D1D1F;
  --secondary: #6E6E73;
  --accent: #0071E3;
  --accent-hover: #0077ED;
  --divider: #D2D2D7;
  --link: #06C;
  --max-width: 980px;
  --nav-height: 48px;

  /* 全局直角，除了按钮和特定元素 */
  --radius-lg: 0;
  --radius-md: 0;
  --radius-sm: 0;
  
  --nav-bg: rgba(255, 255, 255, 0.72);
  --nav-blur: saturate(180%) blur(30px);
  --nav-border: rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #1D1D1F;
    --text: #F5F5F7;
    --secondary: #86868B;
    --accent: #2997FF;
    --accent-hover: #47A9FF;
    --divider: #424245;
    --link: #2997FF;
    --nav-bg: rgba(0, 0, 0, 0.72);
    --nav-border: rgba(255, 255, 255, 0.08);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.47059;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================
   Nav Shell
   ============================================ */
.nav-shell {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: var(--nav-blur);
  -webkit-backdrop-filter: var(--nav-blur);
  border-bottom: 1px solid var(--nav-border);
}

.global-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 22px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.global-nav .brand {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.global-nav .brand:hover { text-decoration: none; opacity: 0.7; }

.desktop-nav {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-left: auto;
  margin-right: 8px;
}
.desktop-nav a {
  font-size: 12px;
  color: var(--text);
  opacity: 0.8;
  text-decoration: none;
  transition: opacity 0.3s;
}
.desktop-nav a:hover { opacity: 1; text-decoration: none; }

/* ============================================
   Hero
   ============================================ */
.hero { text-align: center; padding: 100px 22px 80px; background: var(--bg); }
.hero-inner { max-width: 640px; margin: 0 auto; }
.hero .eyebrow { font-size: 14px; font-weight: 500; color: var(--accent); margin-bottom: 12px; }
.hero h1 { font-size: 64px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 18px; }
.hero .subhead { font-size: 28px; color: var(--secondary); margin-bottom: 32px; }
.hero .intro { font-size: 17px; color: var(--secondary); max-width: 560px; margin: 0 auto 12px; }

/* ============================================
   Section
   ============================================ */
.section { padding: 80px 22px; border-top: 1px solid var(--divider); }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.section-header { margin-bottom: 48px; }
.section-header .eyebrow { font-size: 14px; font-weight: 500; color: var(--accent); margin-bottom: 8px; }
.section-header h2 { font-size: 48px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; }

/* ============================================
   Project Module (直角卡片)
   ============================================ */
.project {
  padding: 40px 0;
  border-top: 1px solid var(--divider);
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 48px;
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.project:first-child { border-top: none; padding-top: 0; }
.project:hover { transform: translateY(-2px); }
.project-meta h3 { font-size: 28px; font-weight: 600; margin-bottom: 8px; }
.project-meta .tagline { font-size: 17px; color: var(--secondary); font-style: italic; }
.project-body p { font-size: 15px; line-height: 1.6; margin-bottom: 16px; }
.project-body .stack {
  font-size: 13px;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  color: var(--secondary);
  margin-bottom: 20px;
  line-height: 1.8;
}
.project-body .links { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.project-body .links a { font-size: 15px; }

/* ============================================
   Detail Page
   ============================================ */
.detail-hero { text-align: center; padding: 80px 22px 60px; }
.detail-hero .eyebrow { font-size: 14px; font-weight: 500; color: var(--accent); margin-bottom: 12px; }
.detail-hero h1 { font-size: 56px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 16px; }
.detail-hero .tagline { font-size: 21px; color: var(--secondary); font-style: italic; max-width: 600px; margin: 0 auto; }

.detail-body { max-width: 680px; margin: 0 auto; padding: 0 22px 80px; }
.detail-body p { font-size: 17px; line-height: 1.6; margin-bottom: 20px; }
.detail-body h2 { font-size: 28px; font-weight: 600; margin: 48px 0 16px; }

.detail-specs {
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  padding: 24px 0;
  margin: 32px 0;
}
.detail-specs .row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.detail-specs .row .label { color: var(--secondary); }
.detail-specs .row .value { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 13px; }

.download-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 32px 0; }
.download-note { font-size: 13px; color: var(--secondary); }

/* ============================================
   Buttons (恢复圆角)
   ============================================ */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 400;
  padding: 12px 24px;
  /* 圆角按钮 */
  border-radius: 980px;
  text-decoration: none;
  transition: background 0.3s;
}
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; color: #FFFFFF; }

.btn-secondary {
  display: inline-block;
  font-size: 15px;
  color: var(--accent);
  padding: 6px 0;
  text-decoration: none;
}
.btn-secondary:hover { text-decoration: underline; }

/* ============================================
   Footer & Language Switch
   ============================================ */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--divider); padding: 32px 22px; text-align: center; }
.site-footer p { font-size: 12px; color: var(--secondary); max-width: var(--max-width); margin: 0 auto; }

.site-footer .footer-links {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 12px;
  color: var(--secondary);
}

.site-footer .lang-switch-footer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--secondary);
}
.site-footer .lang-switch-footer a {
  font-size: 12px;
  color: var(--secondary) !important;
  opacity: 0.7;
  text-decoration: none;
  transition: opacity 0.2s;
}
.site-footer .lang-switch-footer a:hover {
  opacity: 1;
  text-decoration: underline;
  color: var(--secondary) !important;
}
.site-footer .lang-switch-footer a.active {
  opacity: 1;
  font-weight: 500;
  color: var(--text) !important;
}
.site-footer .lang-switch-footer .lang-label {
  color: var(--secondary);
  opacity: 0.7;
  margin-right: 2px;
}
.site-footer .lang-switch-footer .lang-sep {
  color: var(--divider);
  font-size: 12px;
}

/* ============================================
   Motion & Responsive
   ============================================ */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.8s, transform 0.8s; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.hero h1, .hero .eyebrow, .hero .subhead, .hero .intro { animation: heroFadeUp 1s cubic-bezier(0.25, 0.1, 0.25, 1) both; }
.hero .eyebrow { animation-delay: 0s; }
.hero h1 { animation-delay: 0.05s; }
.hero .subhead { animation-delay: 0.12s; }
.hero .intro:nth-of-type(1) { animation-delay: 0.18s; }

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 734px) {
  .hero { padding: 64px 22px 48px; }
  .hero h1 { font-size: 40px; }
  .hero .subhead { font-size: 21px; }
  .section { padding: 56px 22px; }
  .section-header h2 { font-size: 32px; }
  .project { grid-template-columns: 1fr; gap: 20px; padding: 32px 0; }
  .project-meta h3 { font-size: 22px; }
  .detail-hero h1 { font-size: 36px; }
  .detail-hero .tagline { font-size: 17px; }
  .desktop-nav { display: none; }
}