:root {
      --bg:      #0D0B0A;
      --ink:     #EBE5DB;
      --accent:  #C87A4A;
      --muted:   rgba(235,229,219,0.50);
      --faint:   rgba(235,229,219,0.28);
      --hairline:rgba(235,229,219,0.07);

      --font:       "Source Han Sans CN","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
      --font-brand: "Ms Madi",cursive;

      --nav-h: 56px;
      --ease:  cubic-bezier(0.22,1,0.36,1);
    }

    /* Prevent FOUT — hide all text content until fonts ready */

            ::selection { background:var(--accent); color:#fff; }

    a:focus-visible,
    button:focus-visible {
      outline: 1px solid var(--muted);
      outline-offset: 4px;
    }

    /* ============================================================
       HERO
       ============================================================ */

    .hero {
      padding: calc(var(--nav-h) + 80px) 36px 48px;
    }

    .hero h1 {
      font-family: var(--font);
      font-size: 52px;
      font-weight: 400;
      letter-spacing: 0;
      line-height: 1.2;
      margin-bottom: 12px;
    }

    .hero p {
      font-size: 14px;
      color: var(--muted);
      line-height: 1.8;
      max-width: 420px;
      margin-bottom: 40px;
    }

    /* Filter row — minimal text links below hero */
    .filter-row {
      display: flex;
      flex-wrap: wrap;
      gap: 24px;
    }

    .filter-btn {
      font-size: 13px;
      color: var(--faint);
      min-height: 32px;
      padding: 0 0 4px;
      border: none;
      border-bottom: 1px solid transparent;
      border-radius: 0;
      transition: color 0.25s, border-color 0.25s;
      letter-spacing: 0.03em;
      background: none;
    }

    .filter-btn:hover { color: var(--muted); }

    .filter-btn.active {
      color: var(--ink);
      border-bottom-color: var(--ink);
    }

    /* ============================================================
       GALLERY — 4-column grid
       ============================================================ */

    .gallery-section {
      padding: 0 36px 100px;
    }

    .gallery-list {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
    }

    @media (max-width: 1100px) {
      .gallery-list { grid-template-columns: repeat(3, 1fr); }
    }
    @media (max-width: 768px) {
      .gallery-list { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    }
    @media (max-width: 480px) {
      .gallery-list { grid-template-columns: 1fr; gap: 16px; }
    }

    /* Each card */
    .gallery-card {
      opacity: 0;
      transform: translateY(14px);
      transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), border-color 0.5s var(--ease), background-color 0.5s var(--ease);
      cursor: pointer;
      border: 0.5px solid var(--hairline);
      border-radius: 6px;padding: 8px;
    }

    .gallery-card:hover {
      border-color: rgba(235, 229, 219, 0.2);
    }

    .gallery-card.visible {
      opacity: 1;
      transform: translateY(0);
    }

    /* Text above image */
    .card-text {
      padding: 0 0 8px;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .card-title {
      font-family: var(--font);
      font-size: 15px;
      font-weight: 400;
      line-height: 1.35;
      letter-spacing: 0.01em;
      transition: color 0.3s;
    }

    .gallery-card:hover .card-title {
      color: var(--ink);
    }

    .card-sub {
      font-size: 12px;
      color: var(--faint);
      letter-spacing: 0.04em;
    }

    /* Image box — uniform 4:3, blurred bg fill + sharp 80% centered */
    .card-img-wrap {
      position: relative;
      aspect-ratio: 4 / 3;
      overflow: hidden;
      border-radius: 4px;}

    .card-img-bg {
      position: absolute;
      inset: 0;
    }

    .card-img-bg img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
      filter: blur(24px);
      transform: scale(1.1);
      opacity: 0.6;
    }

    .card-img-inner {
      position: absolute;
      inset: 10%;
      line-height: 0;
      z-index: 1;
    }

    .card-img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: contain;
      object-position: center;
      transition: opacity 0.6s;
    }

    .card-img.loaded {
      animation: reveal 0.8s var(--ease) forwards;
    }

    @keyframes reveal {
      from { opacity: 0; }
      to   { opacity: 1; }
    }

    /* ============================================================
       LIGHTBOX — Full image with glass controls
       ============================================================ */

    .lightbox {
      position: fixed;
      inset: 0;
      z-index: 200;
      display: grid;
      place-items: center;
      padding: 32px;
      background: rgba(0, 0, 0, 0.72);
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.28s var(--ease), visibility 0.28s;
    }

    .lightbox.open {
      opacity: 1;
      visibility: visible;
    }

    .lb-body {
      position: relative;
      display: block;
      width: min(960px, calc(100vw - 96px));
      height: min(600px, calc(100dvh - 128px));
      overflow: hidden;
      background: #101010;
      border: 1px solid var(--hairline);
      border-radius: 14px;
      box-shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
      transform: translateY(12px) scale(0.985);
      transition: transform 0.32s var(--ease);
    }

    .lightbox.open .lb-body { transform: translateY(0) scale(1); }

    .lb-img-side {
      position: absolute;
      inset: 64px 0 64px;
      overflow: hidden;
      background: #080808;
      touch-action: pan-y;
    }

    .lightbox-img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: contain;
      user-select: none;
      -webkit-user-drag: none;
      transition: opacity 0.3s;
    }

    .lb-info-head {
      position: absolute;
      inset: 0 0 auto;
      z-index: 3;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 16px;
      height: 64px;
      padding: 0 16px;
      background: rgba(16, 16, 16, 0.7);
      border-bottom: 1px solid rgba(235, 229, 219, 0.08);
      backdrop-filter: blur(18px) saturate(125%);
      -webkit-backdrop-filter: blur(18px) saturate(125%);
    }

    .lb-info-head h2 {
      position: absolute;
      left: 50%;
      font-family: var(--font);
      min-width: 0;
      max-width: calc(100% - 140px);
      margin: 0;
      overflow: hidden;
      color: var(--ink);
      font-size: clamp(21px, 2.4vw, 30px);
      font-weight: 400;
      line-height: 1.25;
      letter-spacing: -0.02em;
      text-align: center;
      text-overflow: ellipsis;
      transform: translateX(-50%);
      white-space: nowrap;
    }

    .lb-bottom-bar {
      position: absolute;
      inset: auto 0 0;
      z-index: 3;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      min-height: 64px;
      padding: 0 16px;
      overflow: hidden;
      background: rgba(16, 16, 16, 0.7);
      border-top: 1px solid rgba(235, 229, 219, 0.08);
      backdrop-filter: blur(18px) saturate(125%);
      -webkit-backdrop-filter: blur(18px) saturate(125%);
    }

    .lb-meta {
      flex: 1 1 auto;
      display: flex;
      align-items: center;
      min-width: 0;
      gap: 18px;
    }

    .lb-exif {
      flex: 1 1 auto;
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 4px 14px;
      min-width: 0;
      font-size: 11px;
    }

    .lb-exif-row {
      display: inline-flex;
      align-items: baseline;
      gap: 5px;
      white-space: nowrap;
    }

    .lb-exif-row .lbl {
      color: var(--faint);
      letter-spacing: 0.06em;
    }

    .lb-exif-row .val {
      color: var(--muted);
    }

    .lb-date-badge {
      flex: 0 0 auto;
      color: var(--ink);
      font-size: 11px;
      letter-spacing: 0.04em;
    }

    .lb-close svg,
    .lb-arrow svg {
      display: block;
      width: 16px;
      height: 16px;
      stroke: currentColor;
      stroke-width: 1.8;
      fill: none;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    /* Controls */
    .lb-close {
      display: grid;
      place-items: center;
      flex: 0 0 auto;
      width: 38px;
      height: 38px;
      border: 1px solid rgba(235, 229, 219, 0.2);
      border-radius: 50%;
      background: rgba(11, 11, 11, 0.56);
      color: var(--ink);
      font-size: 0;
      line-height: 1;
      transition: background 0.22s var(--ease), border-color 0.22s var(--ease);
    }
    .lb-close:hover { background: rgba(235, 229, 219, 0.14); border-color: var(--muted); }

    .lb-arrow {
      position: absolute;
      top: 50%;
      display: grid;
      place-items: center;
      transform: translateY(-50%);
      z-index: 10;
      width: 38px;
      height: 38px;
      border: 1px solid rgba(235, 229, 219, 0.2);
      border-radius: 50%;
      background: rgba(11, 11, 11, 0.56);
      color: var(--ink);
      font-size: 0;
      line-height: 1;
      transition: background 0.22s var(--ease), border-color 0.22s var(--ease);
    }
    .lb-arrow:hover { background: rgba(235, 229, 219, 0.14); border-color: var(--muted); }
    .lb-arrow--prev { left: 18px; }
    .lb-arrow--next { right: 18px; }

    .lb-counter {
      flex: 0 0 auto;
      font-size: 11px;
      color: var(--faint);
      letter-spacing: 0.08em;
    }

    /* ============================================================
       FOOTER
       ============================================================ */

    /* ============================================================
       RESPONSIVE
       ============================================================ */

    @media (max-width: 768px) {
      .hero { padding: calc(var(--nav-h) + 48px) 20px 32px; }
      .hero h1 { font-size: 40px; }
      .hero p { font-size: 13px; margin-bottom: 28px; }

      .filter-row { gap: 18px; }
      .filter-btn { font-size: 12px; }

      .gallery-section { padding: 0 20px 72px; }
      .gallery-list { row-gap: 16px; column-gap: 12px; }
      .card-title { font-size: 17px; }

      .lightbox { padding: 12px; }
      .lb-body {
        width: 100%;
        height: calc(100dvh - 24px);
        border-radius: 12px;
      }
      .lb-info-head { height: 60px; padding: 0 14px; }
      .lb-img-side { inset: 60px 0 60px; }
      .lb-bottom-bar { min-height: 60px; padding: 0 14px; gap: 8px; }
      .lb-meta { gap: 10px; overflow: hidden; }
      .lb-exif { gap: 3px 8px; font-size: 10px; }
      .lb-date-badge { font-size: 10px; }
      .lb-info-head h2 { font-size: 21px; }
      .lb-arrow { font-size: 22px; }
      .lb-arrow--prev { left: 12px; }
      .lb-arrow--next { right: 12px; }
      .lb-counter { font-size: 10px; }

      .footer { padding: 28px 20px 32px; }
      .footer-inner { flex-direction: column; align-items: flex-start; }
    }

    /* Match the digital-tech preview window in portrait view. */
    @media (orientation: portrait) {
      .lightbox { padding: 24px; }
      .lb-body {
        width: 100%;
        height: calc(100dvw - 48px + 120px);
        border-radius: 12px;
      }

      /* 手机预览中，正方形图片区域与上下玻璃栏直接相接。 */
      .lb-img-side {
        inset: 60px 0;
        width: auto;
        height: auto;
        aspect-ratio: 1 / 1;
        transform: none;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
      .gallery-card { opacity: 1; transform: none; transition: none !important; }
      .card-img { transition: none !important; }
      .card-img-wrap:hover .card-img { transform: none; }
    }
