/* =========================================================
   AI软件孵化营 暨 港澳青年及留学生"梦启航"训练营 — 照片墙
   设计语言：浅色 premium、暖橙强调、中文 sans
   部署：相对路径，可挂在任意子路径（含 /9_9pic/）
   ========================================================= */

:root {
  /* —— 浅色系 —— */
  --bg:        #f6f5f1;   /* 米白纸感底色 */
  --bg-soft:   #efece4;   /* 略深一点的面板背景 */
  --panel:     #ffffff;   /* 卡片白 */
  --line:      rgba(35, 28, 22, 0.08);
  --line-strong: rgba(35, 28, 22, 0.16);
  --text:      #1f1c17;   /* 主文字深墨 */
  --muted:     #6b665d;   /* 次级文字 */
  --ink:       #2a2620;
  --accent:    #e8502a;   /* 暖橙 — 创业热血 */
  --accent-deep:#c63d1e;
  --accent-soft: rgba(232, 80, 42, 0.10);
  --shadow-sm: 0 1px 2px rgba(35, 28, 22, 0.06);
  --shadow-md: 0 6px 24px rgba(35, 28, 22, 0.08);
  --shadow-lg: 0 18px 48px rgba(35, 28, 22, 0.18);
  --radius:    14px;
  --radius-lg: 22px;
  --gap:       14px;
  --maxw:      1400px;
  --nav-h:     68px;
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-feature-settings: "ss01", "cv11";
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(246, 245, 241, 0.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #ff8a4c);
  color: #fff;
  font-weight: 800; font-size: 20px;
  box-shadow: 0 6px 18px rgba(232, 80, 42, 0.32);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-line1 {
  font-weight: 700; font-size: 15px; letter-spacing: 0.5px;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-line2 {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 60vw;
}

.nav-links {
  display: flex; gap: 28px; font-size: 14px; color: var(--muted);
}
.nav-links a {
  position: relative;
  padding: 6px 2px;
  transition: color .25s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 2px; background: var(--accent);
  transition: right .35s var(--ease);
}
.nav-links a:hover::after { right: 0; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px; padding: 0;
  background: transparent; border: 1px solid var(--line-strong); border-radius: 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block; width: 18px; height: 2px; margin: 4px auto;
  background: var(--ink); border-radius: 2px;
  transition: transform .3s var(--ease), opacity .25s var(--ease);
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-menu {
  display: none;
  flex-direction: column;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  padding: 12px 24px 18px;
  gap: 4px;
}
.nav-menu a {
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}
.nav-menu a:last-child { border-bottom: 0; }
.nav-menu a:hover { color: var(--ink); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 24px 48px;
  overflow: hidden;
}
.hero-eyebrow {
  margin: 0 0 14px;
  font-size: 12px; letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-title {
  margin: 0 0 18px;
  font-size: clamp(28px, 4.6vw, 52px);
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.hero-sub {
  margin: 0 0 28px;
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--muted);
  max-width: 720px;
}
.hero-meta {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.chip::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
  box-shadow: 0 8px 20px rgba(232, 80, 42, 0.32);
}
.cta:hover { transform: translateY(-2px); background: var(--accent-deep); box-shadow: 0 12px 28px rgba(232, 80, 42, 0.45); }

.hero-decor {
  position: absolute;
  inset: -120px -160px auto auto;
  width: 540px; height: 540px;
  background: radial-gradient(closest-side, rgba(232, 80, 42, 0.10), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* ---------- GALLERY ---------- */
.section-head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 24px 18px;
}
.section-head h2 {
  margin: 0 0 6px;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
}
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }

.masonry {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 24px 8px;
  column-count: 4;
  column-gap: var(--gap);
}
.masonry-item {
  break-inside: avoid;
  margin: 0 0 var(--gap);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  transition: box-shadow .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease);
}
.masonry-item:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
}
.masonry-item img {
  width: 100%; height: auto;
  display: block;
  transition: transform .8s var(--ease);
}
.masonry-item:hover img { transform: scale(1.04); }
.masonry-item .shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(35,28,22,0.04) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  pointer-events: none;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* 滚动末尾的 sentinel / 加载提示 */
.sentinel {
  max-width: var(--maxw);
  margin: 20px auto 80px;
  text-align: center;
  padding: 0 24px;
  color: var(--muted);
  font-size: 13px;
}
.sentinel .dot {
  display: inline-block; width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%;
  margin-right: 8px; vertical-align: middle;
  animation: pulse 1.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.6); opacity: 0.5; }
}

/* ---------- ABOUT ---------- */
.about {
  max-width: var(--maxw);
  margin: 40px auto 80px;
  padding: 0 24px;
}
.about-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px clamp(20px, 4vw, 48px);
  box-shadow: var(--shadow-md);
}
.about-card h2 {
  margin: 0 0 18px;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
}
.about-card p { color: var(--muted); margin: 0 0 14px; }
.about-grid {
  list-style: none; padding: 0; margin: 24px 0 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.about-grid li {
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 4px;
}
.about-grid strong {
  font-size: 12px; color: var(--accent);
  letter-spacing: 1px; text-transform: uppercase;
}
.about-grid span { font-size: 14px; color: var(--text); }

/* ---------- FOOTER ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: var(--bg-soft);
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(246, 245, 241, 0.94);
  backdrop-filter: blur(10px);
  display: grid; place-items: center;
  animation: lb-fade .25s var(--ease);
}
.lightbox[hidden] { display: none; }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }

.lb-figure {
  margin: 0; padding: 24px 80px;
  max-width: 100vw; max-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
}
.lb-figure img {
  max-width: min(96vw, 1600px);
  max-height: 84vh;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.lb-cap {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  width: 48px; height: 48px;
  border-radius: 50%;
  font-size: 26px; line-height: 1;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .2s var(--ease), transform .2s var(--ease), color .2s var(--ease);
  user-select: none;
  box-shadow: var(--shadow-md);
}
.lb-close { top: 16px; right: 16px; }
.lb-prev  { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.lb-prev:hover { transform: translateY(-50%) scale(1.05); }
.lb-next:hover { transform: translateY(-50%) scale(1.05); }

/* ---------- RESPONSIVE ---------- */

/* Tablet */
@media (max-width: 1024px) {
  .masonry { column-count: 3; }
}

/* Phone */
@media (max-width: 720px) {
  :root { --nav-h: 60px; --gap: 10px; }
  .nav-inner { padding: 0 16px; gap: 12px; }
  .brand-line1 { font-size: 13px; }
  .brand-line2 { font-size: 11px; max-width: 58vw; }
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-menu.is-open { display: flex; }

  .hero { padding: 40px 16px 32px; }
  .section-head { padding: 18px 16px 12px; }
  .masonry { column-count: 2; padding: 4px 16px; }
  .sentinel { padding: 12px 16px 24px; margin-bottom: 56px; }
  .about { padding: 0 16px; margin: 24px auto 56px; }
  .about-card { padding: 28px 18px; }
  .footer { padding: 24px 16px; }

  /* Lightbox buttons closer together on mobile */
  .lb-figure { padding: 56px 8px 8px; }
  .lb-close { top: 8px; right: 8px; width: 40px; height: 40px; font-size: 22px; }
  .lb-prev, .lb-next {
    width: 40px; height: 40px; font-size: 22px;
  }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
  .lb-figure img { max-height: 78vh; }
}

/* Very small phones */
@media (max-width: 380px) {
  .masonry { column-count: 1; }
  .brand-line2 { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}
