:root {
        --bg: #f9f9f9;
        --surface: #ffffff;
        --ink: #111111;
        --ink-70: rgba(15, 15, 15, 0.7);
        --ink-40: rgba(15, 15, 15, 0.4);
        --film-amber: #8A1C1F;
        --border-color: rgba(0, 0, 0, 0.08);
        --header-bg: rgba(249, 249, 249, 0.85);
        --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        --pad: clamp(24px, 4vw, 72px);
        --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
        --font-sans: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
      }

      body.dark-mode {
        --bg: #0d0a08;
        --surface: #1a1613;
        --ink: #ffffff;
        --ink-70: rgba(255, 255, 255, 0.7);
        --ink-40: rgba(255, 255, 255, 0.4);
        --film-amber: #e6b45c;
        --border-color: rgba(255, 255, 255, 0.08);
        --header-bg: rgba(13, 10, 8, 0.85);
        --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
      }

      *, *::before, *::after { box-sizing: border-box; }
      
      body { 
        margin: 0; background: var(--bg); color: var(--ink); 
        font-family: var(--font-sans); font-size: 16px; line-height: 1.65; 
        overflow-x: hidden; -webkit-font-smoothing: antialiased;
        transition: background-color 0.4s ease, color 0.4s ease;
      }
      
      ::selection { background: var(--film-amber); color: #fff; }
      ::-webkit-scrollbar { width: 8px; }
      ::-webkit-scrollbar-track { background: var(--bg); }
      ::-webkit-scrollbar-thumb { background: var(--ink-40); border-radius: 999px; transition: background 0.4s; }

      header { 
        position: fixed; top: 0; left: 0; right: 0; z-index: 100; 
        display: flex; justify-content: space-between; align-items: center; 
        padding: 24px var(--pad); background: var(--header-bg); 
        backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
        transition: background-color 0.4s ease;
      }
      .logo { font-size: 14px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none; color: var(--ink); }
      
      .header-right { display: flex; align-items: center; gap: 20px; }

      .theme-toggle { background: transparent; border: none; color: var(--ink-70); cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; transition: color 0.3s; }
      .theme-toggle:hover { color: var(--ink); }
      .theme-toggle svg { width: 20px; height: 20px; display: none; }
      body:not(.dark-mode) .theme-toggle .icon-moon { display: block; }
      body.dark-mode .theme-toggle .icon-sun { display: block; }

      .back-btn { font-size: 13px; font-weight: 600; color: var(--ink-70); text-decoration: none; display: flex; align-items: center; gap: 8px; transition: color 0.3s; }
      .back-btn:hover { color: var(--ink); }

      .filter-section { padding-top: 120px; padding-bottom: 40px; text-align: center; }
      .filter-title { font-size: clamp(36px, 5vw, 60px); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 40px; color: var(--ink); }
      .filter-title em { font-family: 'Times New Roman', serif; font-style: italic; font-weight: 400; color: var(--film-amber); }
      .filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
      .filter-btn { padding: 10px 24px; border-radius: 999px; border: 1px solid var(--border-color); background: transparent; color: var(--ink-70); font-family: inherit; font-size: 14px; cursor: pointer; transition: all 0.4s var(--ease); }
      .filter-btn:hover { border-color: var(--ink-40); color: var(--ink); }
      .filter-btn.active { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }

      .gallery-wrap { padding: 0 var(--pad) 100px; max-width: 1600px; margin: 0 auto; }
      .masonry-grid { column-count: 3; column-gap: 24px; }
      
      .card { 
        break-inside: avoid; margin-bottom: 24px; border-radius: 12px; overflow: hidden; 
        background: var(--surface); position: relative; cursor: pointer; 
        box-shadow: var(--card-shadow);
        opacity: 1; transform: scale(1); 
        transition: opacity 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease, background-color 0.4s ease;
      }
      .card.hide { opacity: 0; transform: scale(0.95); }
      
      .card-media { 
        position: relative; width: 100%; overflow: hidden; 
        min-height: 250px; background: #222; 
        display: flex; align-items: center; justify-content: center;
      }
      
      /* 禁用图片拖拽 */
      .card-media img { 
        width: 100%; height: auto; display: block; object-fit: cover; 
        transition: transform 0.6s var(--ease); 
        -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none;
      }
      .card:hover .card-media img { transform: scale(1.05); }

      .card-media.error { background: #2a2a2a; }
      .card-media.error::after { content: "图片加载失败 (防盗链拦截)"; color: #888; font-size: 13px; letter-spacing: 0.1em; }

      .video-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center; opacity: 0.8; transition: opacity 0.3s; }
      .card:hover .video-overlay { opacity: 1; }
      .play-icon { width: 50px; height: 50px; background: rgba(255, 255, 255, 0.2); backdrop-filter: blur(4px); border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.4); transition: transform 0.3s; }
      .card:hover .play-icon { transform: scale(1.1); background: rgba(255,255,255,0.3); }
      .play-icon::before { content: ''; width: 0; height: 0; border-style: solid; border-width: 8px 0 8px 14px; border-color: transparent transparent transparent #fff; margin-left: 4px; }

      .card-info { position: absolute; bottom: 0; left: 0; right: 0; padding: 40px 20px 20px; background: linear-gradient(to top, rgba(0,0,0,0.85), transparent); opacity: 0; transform: translateY(10px); transition: all 0.4s var(--ease); pointer-events: none; }
      .card:hover .card-info { opacity: 1; transform: translateY(0); }
      .card-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; color: #fff; }
      .card-category { font-size: 11px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--film-amber); }

      .lightbox { position: fixed; inset: 0; z-index: 99999; background: rgba(0, 0, 0, 0.92); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
      .lightbox.active { opacity: 1; pointer-events: auto; }
      .lightbox-content { max-width: 90vw; max-height: 85vh; display: flex; align-items: center; justify-content: center; position: relative; }
      .lightbox-content img, .lightbox-content video { max-width: 100%; max-height: 85vh; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.8); outline: none; -webkit-user-drag: none; user-select: none; }
      
      .lightbox-btn { position: absolute; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); color: #fff; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; z-index: 10; }
      .lightbox-btn:hover { background: rgba(255, 255, 255, 0.25); transform: scale(1.05); }
      .lightbox-close { top: 20px; right: 20px; width: 48px; height: 48px; font-size: 24px; }
      .lightbox-nav { top: 50%; transform: translateY(-50%); width: 60px; height: 60px; font-size: 28px; }
      .lightbox-nav:hover { transform: translateY(-50%) scale(1.05); }
      .lightbox-prev { left: 20px; }
      .lightbox-next { right: 20px; }

      @media (max-width: 1024px) { .masonry-grid { column-count: 2; column-gap: 20px; } .card { margin-bottom: 20px; } }
      @media (max-width: 640px) { .masonry-grid { column-count: 1; } .filter-section { padding-top: 100px; } .lightbox-nav { width: 44px; height: 44px; font-size: 20px; } .lightbox-prev { left: 10px; } .lightbox-next { right: 10px; } }

