/* ═══════════════════════════════════════════════════════════════
   帧序 · 自适应
   ═══════════════════════════════════════════════════════════════ */

/* ── 1180px ───────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .topbar { grid-template-columns: 250px minmax(0, 1fr) auto; }
  .topnav a { padding: 8px 9px; font-size: 12px; }
  .hero { gap: 34px; }
  .hero-visual { min-height: 430px; }
  .sv-prompt { width: 214px; right: -1%; }
  .sv-badge { left: -2%; }
  .sv-vertical { right: -1%; }
  .project-grid { grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 18px; }
  .step { padding: 18px 15px 20px; gap: 9px; }
  .step-t { font-size: 12px; }
}

/* ── 960px ────────────────────────────────────────────────── */
@media (max-width: 960px) {
  :root { --topbar-h: 62px; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; padding: 0; }
  .brand { padding-left: 20px; border-right: 0; }
  .top-actions { padding-right: 20px; }
  .brand-en { display: none; }
  .brand-cn { font-size: 17px; }
  .brand-mark { width: 34px; height: 34px; }
  .topnav { display: none; }
  .hero {
    grid-template-columns: 1fr;
    gap: 56px;
    padding-top: 48px;
    padding-bottom: 56px;
  }
  .hero-copy { max-width: 640px; }
  .hero h1 { font-size: clamp(40px, 8vw, 62px); }
  .hero-visual { min-height: 470px; max-width: 560px; width: 100%; margin: 0 auto; }
  .sv-stage { width: min(330px, 66%); }
  .sv-prompt { right: 2%; bottom: 4%; }
  .sv-strip { width: min(380px, 86%); }
  .flowmap-inner { grid-template-columns: repeat(3, 1fr); }
  .step:nth-child(4) { border-left: 0; border-top: 1px solid var(--line); }
  .step:nth-child(5) { border-top: 1px solid var(--line); }
  .step:nth-child(3)::after { display: none; }
  .step:nth-child(4)::after { display: block; }
}

/* ── 720px ────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .topbar { padding: 0; }
  .brand { padding-left: 16px; }
  .top-actions { padding-right: 16px; }
  .save-state { display: none; }
  .theme-toggle { width: 36px; padding: 0; justify-content: center; }
  .theme-toggle span { display: none; }
  .top-actions .btn { --btn-h: 34px; padding: 0 11px; font-size: 11.5px; }
  .hero { padding: 36px 18px 40px; gap: 46px; }
  .hero h1 { margin-top: 18px; font-size: clamp(35px, 9.6vw, 48px); line-height: 1.22; }
  .hero-lead { margin-top: 18px; font-size: 13.5px; line-height: 1.9; }
  .hero-actions { margin-top: 24px; gap: 9px; }
  .hero-actions .btn { --btn-h: 42px; font-size: 12.5px; flex: 1 1 auto; justify-content: center; }
  .hero-hint { font-size: 9px; }
  .hero-stats { display: none; }
  .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 18px; }
  .home-stat { padding: 18px 16px 20px; }
  .home-stat:nth-child(3) { border-left: 0; }
  .home-stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .hero-visual { min-height: 420px; }
  .sv-stage { width: min(288px, 74%); padding: 9px 9px 34px; transform: rotate(-1.6deg); }
  .sv-prompt { display: none; }
  .sv-badge { left: 0; top: 8%; font-size: 7px; padding: 6px 8px; }
  .sv-vertical { display: none; }
  .sv-coord { left: 0; font-size: 6.5px; }
  .sv-caption .cn { font-size: 12px; }
  .sv-strip { width: 92%; bottom: -6px; }
  .flowmap { padding: 0 18px; }
  .flowmap-inner { grid-template-columns: repeat(2, 1fr); }
  .step { border-top: 1px solid var(--line); }
  .step:nth-child(1), .step:nth-child(2) { border-top: 0; }
  .step:nth-child(3) { border-left: 0; }
  .step:nth-child(3)::after { display: block; }
  .step:nth-child(5) { border-left: 0; }
  .step:nth-child(2)::after, .step:nth-child(4)::after { display: none; }
  .step::after { right: -1px; }
  .library { padding: 34px 18px 30px; }
  .library-title h2 { font-size: 21px; }
  .library-tools { width: 100%; }
  .search-box { flex: 1; }
  .search-box input { width: 100%; }
  .project-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 20px; }
  .proj-cover { height: 156px; }
  .new-card { min-height: 150px; }
  .home-footer { padding: 20px 18px 26px; font-size: 8px; flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ── 560px ────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .hero h1 em { white-space: normal; }
  .home-stat b { font-size: 25px; }
  .home-stat span { font-size: 10px; }
  .sv-stage { width: 256px; }
  .hero-visual { min-height: 380px; }
  .sv-caption .ratio { font-size: 7px; }
  .flowmap-inner { grid-template-columns: 1fr; }
  .step { border-left: 0 !important; border-top: 1px solid var(--line) !important; }
  .step:first-child { border-top: 0 !important; }
  .step::after { display: none !important; }
  .library-head { gap: 14px; }
}

/* ── 横屏矮视口 ───────────────────────────────────────────── */
@media (max-height: 680px) and (min-width: 961px) {
  .hero { padding-top: 40px; padding-bottom: 40px; }
  .hero-visual { min-height: 400px; }
  .sv-stage { width: min(280px, 62%); }
  .hero h1 { font-size: clamp(38px, 4.4vw, 58px); }
  .hero-lead { margin-top: 18px; }
  .hero-stats { margin-top: 26px; }
}

/* ── 减少动态偏好 ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .sv-rain i { animation: none; opacity: .25; }
  .sv-prompt, .sv-badge, .lantern-flicker, .sv-lantern { animation: none !important; }
}
