
  @import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Syne:wght@700;800&display=swap');
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  :root {
    --bg: #0a0a0f;
    --surface: #111118;
    --card: #16161f;
    --border: rgba(69, 14, 14, 0.07);
    --accent: #ff2d55;
    --accent2: #00d4ff;
    --accent3: #9b59ff;
    --text: #f0f0f8;
    --muted: #6a6a8a;
    --h: 100vh;
  }
  html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    overflow: hidden;
  }
  /* ── Layout ── */
  #app {
    display: flex;
    height: 100vh;
    width: 100vw;
  }
  /* ── Sidebar ── */
  #sidebar {
    width: 72px;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 0;
    gap: 10px;
    flex-shrink: 0;
    z-index: 10;
    overflow: auto;
    scrollbar-width: none;
  }
  .logo {
    font-family: 'Syne', sans-serif;
    font-size: 12px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    line-height: 1;
    text-align: center;
  }
  .nav-icons { display: flex; flex-direction: column; gap: 5vh; align-items: center;  overflow-x: hidden;overscroll-behavior-x: none; }
  .nav-icon {
    width: 44px; height: 44px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--muted);
    font-size: 20px;
    transition: all 0.2s;
    position: relative;
  }
.nav-icon.active {
    background: rgba(130, 6, 155, 0.667);
    color: var(--accent);
  }
@media (hover: hover) {
  .nav-icon:hover {
    background: rgba(255,45,85,0.12);
    color: var(--accent);
  }
}
| Value          | Meaning                                     |
| -------------- | ------------------------------------------- |
| `hover: hover` | device supports real hover (mouse/trackpad) |
| `hover: none`  | touch device                                |
  /* "jumped-to" flash animation */
  @keyframes navPop {
    0%   { transform: scale(1); background: rgba(255,45,85,0.12); }
    40%  { transform: scale(1.22); background: rgba(255,45,85,0.35); }
    100% { transform: scale(1); background: rgba(255,45,85,0.12); }
  }
  .nav-icon.jumping { animation: navPop 0.4s cubic-bezier(0.22,1,0.36,1) both; color: var(--accent); }
  .nav-icon .tooltip {
    position: absolute;
    left: 56px;
    background: var(--card);
    color: var(--text);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    border: 1px solid var(--border);
  }
  .nav-icon:hover .tooltip { opacity: 1; }
  /* ── Feed container ── */
  #feed-wrap {
    flex: 1;
    height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  /* Gradient overlays for immersive feel */
  #feed-wrap::before, #feed-wrap::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 120px;
    z-index: 5;
    pointer-events: none;
  }
  #feed-wrap::before {
    top: 0;
    background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
  }
  #feed-wrap::after {
    bottom: 0;
    background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  }
/* Hidden default state — use transform, not left/right */
.ABOUT, .AITOOLS {
  position: fixed;          /* fixed so it escapes any parent's overflow */
  top: 56px;                /* below topbar */
  left: 72px;               /* beside sidebar */
  right: 0;
  bottom: 0;
  opacity: 0;
  pointer-events: none;
  background: rgba(10,10,18,0.9);
  backdrop-filter: blur(20px);
  transition: transform 0.45s cubic-bezier(0.22,1,0.36,1),
              opacity   0.45s cubic-bezier(0.22,1,0.36,1);
  z-index: 11;
}
.ABOUT { 
  transform: translateX(-100%);
}  /* starts off-left */
.AITOOLS      { 
  transform: translateX(100%);
}  /* starts off-right */
/* Active state: slide into view */
.ABOUT.active,
.AITOOLS.active {
  transform: translateX(0);   /* ← this is what you were missing */
  opacity: 1;
  pointer-events: auto;   /* ⭐关键修复 */
}
  /* ── Virtual scroll viewport ── */
  #viewport {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  #viewport::-webkit-scrollbar { display: none; }
  /* ── Spacer for virtual scrolling ── */
  #spacer-top, #spacer-bottom {
    width: 100%;
    flex-shrink: 0;
  }
  /* ── Video Card ── */
  /* ── Feed card — THE scrollable unit ──────────────────────────────────────
     Each card is exactly 100vh tall inside the snap container.
     overflow-y: auto  → gives it its own scrollbar / scroll context.
     overscroll-behavior: contain → when card reaches top or bottom,
       scroll does NOT chain into the parent viewport (no accidental snap).
     The JS wheel handler below enforces this for snap containers too.
  ── */
  .feed-card {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    flex-shrink: 0;
    position: relative;
    overflow-y: auto;             /* card scrolls internally */
    overflow-x: hidden;
    overscroll-behavior: contain; /* CSS layer: don't chain to parent */
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    animation: cardIn 0.35s cubic-bezier(0.22,1,0.36,1) both;
    scrollbar-width: none;
  }
  .feed-card::-webkit-scrollbar { display: none; }
  @keyframes cardIn {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
  }

  /* ── Hero section: always the first full-screen view of the card ── */
  .card-hero {
    position: relative;
    width: 100%;
    height: 100vh;          /* exactly one screen tall */
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
  }
  /* Background gradient — stays inside the hero */
  .card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 6s ease;
  }
  .feed-card:hover .card-hero .card-bg { transform: scale(1.04); }
  /* Dark gradient overlay */
  .card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to top,
      rgba(0,0,0,0.85) 0%,
      rgba(0,0,0,0.3) 40%,
      rgba(0,0,0,0.1) 70%,
      rgba(0,0,0,0.25) 100%
    );
    pointer-events: none;
  }
  /* Hero bottom content: user row, caption, tags, music */
  .card-content {
    position: relative;
    z-index: 2;
    padding: 0 16px 24px;
    width: 100%;
  }
  /* Scroll-down hint shown at bottom of hero */
  .scroll-down-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.08em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    animation: hintBob 2s ease-in-out infinite;
  }
  @keyframes hintBob {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
    50%       { opacity: 0.8; transform: translateX(-50%) translateY(4px); }
  }

  /* ── Article body: the content revealed by scrolling down inside card ── */
  .card-body {
    position: relative;
    z-index: 2;
    background: var(--card);
    padding: 24px 18px 48px;
    min-height: 60vh;      /* makes body tall enough to require scrolling */
  }
  .card-body .article-headline {
    font-family: 'Syne', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 16px;
  }
  .card-body .article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.04em;
  }
  .article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
  .card-body p {
    font-size: 14px;
    line-height: 1.8;
    color: rgba(255,255,255,0.72);
    margin-bottom: 14px;
  }
  .card-body .section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 10px;
    margin-top: 20px;
  }

  /* ── Horizontal photo strip inside card body ─────────────────────────────
     overflow-x: auto  → horizontal scroll within the strip.
     overscroll-behavior-x: contain → when strip hits left/right edge,
       it does NOT chain upward to the card's Y scroll (no accidental snap).
     The JS handler mirrors this for both axes.
  ── */
  .photo-strip-wrap {
    margin: 0 -18px 18px;  /* bleed to card edges */
  }
  .photo-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;  /* X chaining blocked */
    padding: 0 18px 10px;
    scrollbar-width: none;
    cursor: grab;
  }
  .photo-strip::-webkit-scrollbar { display: none; }
  .photo-strip:active { cursor: grabbing; }
  .photo-card {
    flex-shrink: 0;
    width: 160px;
    height: 110px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    display: flex;
    align-items: flex-end;
    padding: 8px;
  }
  .photo-card-label {
    position: relative;
    z-index: 1;
    font-size: 11px;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  }
  .strip-scroll-hint {
    font-size: 10px;
    color: var(--muted);
    padding: 0 18px;
    margin-bottom: 14px;
    letter-spacing: 0.04em;
  }

  /* End-of-card marker so user knows next swipe goes to next card */
  .card-end-marker {
    text-align: center;
    padding: 20px 0 12px;
    font-size: 11px;
    color: rgba(255,255,255,0.2);
    letter-spacing: 0.1em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
  .card-end-marker::before {
    content: '';
    width: 32px; height: 2px;
    border-radius: 1px;
    background: rgba(255,255,255,0.1);
  }

  /* ── Card content ── */
  .card-content {
    position: relative;
    z-index: 2;
    padding: 0 16px 24px;
    width: 100%;
  }
  .user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
  }
  .avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
  }
  .username {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.01em;
  }
  .follow-btn {
    margin-left: auto;
    background: var(--accent);
    border: none;
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 12px;
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.15s, background 0.2s;
    letter-spacing: 0.03em;
  }
  .follow-btn:hover { transform: scale(1.06); background: #e0193f; }
  .follow-btn.following { background: transparent; border: 1px solid rgba(255,255,255,0.3); }
  .caption {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255,255,255,0.9);
    margin-bottom: 10px;
    max-width: 320px;
  }
  .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
  }
  .tag {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent2);
    background: rgba(0,212,255,0.1);
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
  }
  .music-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.65);
    font-size: 12px;
  }
  .music-icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff2d55, #9b59ff);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    animation: spin 4s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  .feed-card:not(:hover) .music-icon { animation-play-state: paused; }
  /* ── Right action bar ── */
  .action-bar {
    position: absolute;
    right: 12px;
    bottom: 100px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  .action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
  }
  .action-circle {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    transition: all 0.2s;
  }
  .action-btn:hover .action-circle {
    background: rgba(255,45,85,0.25);
    border-color: var(--accent);
    transform: scale(1.1);
  }
  .action-btn.liked .action-circle { color: var(--accent); background: rgba(255,45,85,0.2); }
  .action-count { font-size: 11px; color: rgba(255,255,255,0.7); font-weight: 600; }
  /* ── Top bar ── */
  #topbar {
    position: fixed;
    top: 0;
    left: 72px;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    z-index: 20;
    pointer-events: none;
  }
  .tab {
    font-family: 'Syne', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    pointer-events: all;
    letter-spacing: 0.03em;
    transition: all 0.2s;
  }
  .tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
  }

  /* ── Debug counter ── */
  #debug {
    position: fixed;
    bottom: 16px;
    left: 80px;
    font-size: 11px;
    color: var(--muted);
    z-index: 99;
    letter-spacing: 0.05em;
  }