/* 基础变量 */
:root {
  --bg: #0b0c0d;
  --bg-alt: #121315;
  --card: #16181a;
  --text: #e8eaed;
  --muted: #aeb3bb;
  --primary: #7cc4ff;
  --primary-600: #4cb0ff;
  --border: #26292c;
  --shadow: 0 6px 24px rgba(0,0,0,0.28);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

/* 画廊部分使用更宽的容器 */
#portfolio .container {
  width: min(1800px, 96%) !important;
  max-width: 1800px !important;
}

/* 头部 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(11,12,13,0.7);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.logo { font-size: 20px; }
.brand-text { letter-spacing: 1px; }

.site-nav { display: flex; gap: 20px; }
.site-nav a { color: var(--muted); }
.site-nav a:hover, .site-nav a.active { color: var(--text); }

.nav-toggle { display: none; background: transparent; border: 0; color: var(--text); font-size: 22px; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .site-nav { 
    position: absolute; 
    right: 4%; 
    top: 56px; 
    background: var(--bg-alt); 
    border: 1px solid var(--border); 
    border-radius: 10px; 
    padding: 10px; 
    flex-direction: column; 
    gap: 10px; 
    display: none;
    z-index: 1001;
  }
  .site-nav.open { display: flex; }
}

/* Hero */
.hero { position: relative; min-height: 64vh; display: grid; place-items: center; overflow: clip; }
.hero-inner { position: relative; z-index: 1; text-align: center; padding: 64px 0; }
.hero h1 { font-size: clamp(28px, 6vw, 60px); margin: 0 0 10px; }
.hero p { margin: 0 0 24px; color: var(--muted); }
.hero .btn { font-size: 16px; }
.hero-bg { position: absolute; inset: 0; background: url('https://photo-art.pages.dev/file/1762158106829_E44AA241-F19F-41A7-AA49-0E2CFA906447_1_105_c-拷贝.jpg') center/cover no-repeat; filter: brightness(0.6) contrast(1.1); }

/* 按钮与标签 */
.btn { display: inline-block; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-600)); color: #06233a; border: 0; font-weight: 700; }
.btn:hover { transform: translateY(-1px); }

.chip { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--muted); cursor: pointer; }
.chip.active, .chip:hover { color: var(--text); border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,196,255,0.15) inset; }

/* 区块 */
.section { padding: 80px 0; background: var(--bg); }
.section.alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section h2 { margin: 0; font-size: clamp(22px, 3.4vw, 32px); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }

/* 地图容器 */
.photo-map-container {
  width: 100%;

  margin: 32px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
}

/* 地图页面专用样式 */
.map-page-container {
  height: calc(100vh - 300px);
  min-height: 600px;
  margin: 0;
  position: relative;
}

/* 确保地图容器有明确的高度 */
#photoMap {
  width: 100% !important;
  height: 100% !important;
}

.photo-map-container .leaflet-container {
  background: var(--bg-alt);
}

.photo-map-container .leaflet-popup-content-wrapper {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.photo-map-container .leaflet-popup-content {
  margin: 16px;
  min-width: 280px;
}

.photo-map-container .leaflet-popup-tip {
  background: var(--card);
  border: 1px solid var(--border);
}

.photo-map-container .photo-marker {
  background: transparent !important;
  border: none !important;
}

.photo-map-container .leaflet-popup-close-button {
  color: var(--muted);
  font-size: 20px;
  padding: 4px 8px;
}

.photo-map-container .leaflet-popup-close-button:hover {
  color: var(--text);
}

.map-popup-title {
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 16px;
}

.map-popup-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.map-popup-photos-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 500px;
  overflow-y: auto;
  margin-top: 12px;
}

.map-popup-photo-item {
  display: flex;
  gap: 12px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  background: var(--card);
}

.map-popup-photo-item:hover {
  border-color: var(--primary);
  background: rgba(124, 196, 255, 0.05);
  transform: translateX(2px);
}

.map-popup-photo {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.map-popup-photo:hover {
  border-color: var(--primary);
}

.map-popup-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-popup-photo-count {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.map-popup-photo-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.map-popup-photo-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-popup-photo-exif {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 640px) {
  .photo-map-container {
    height: calc(100vh - 160px); /* 减去 header/footer */
    min-height: 500px;
  }
  .map-popup-photos {
    grid-template-columns: repeat(2, 1fr);
  }
  .map-popup-photo-item {
    flex-direction: column;
  }
  .map-popup-photo {
    width: 100%;
    height: 120px;
  }
}

/* 作品网格 - 瀑布流布局 */
:root {
  --card-width: 320px;
  --masonry-gap: 24px;
}

.gallery { 
  position: relative;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 20px;
}
.card { 
  background: transparent; 
  border: none; 
  border-radius: 16px; 
  overflow: hidden; 
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.2s ease;
  position: absolute;
  display: flex;
  flex-direction: column;
  margin-bottom: var(--masonry-gap);
}
.card:hover { 
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}
.card-image {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
}
.card img { 
  width: 100%; 
  height: auto; 
  object-fit: cover; 
  display: block;
  border-radius: 16px;
}
.card-info {
  background: #0f0f10;
  border-radius: 16px;
  padding: 16px 20px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.card-location {
  color: #eaecef;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 4px;
}
.card-country {
  color: #8b949e;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}
.card figcaption { display: none; }
.meta { display: none; }
.tag { display: none; }

.camera-brand-logo {
  width: 0.9em;
  height: 0.9em;
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block;
  margin-right: 0.3em;
  vertical-align: middle;
  /* SVG 优化 */
  fill: currentColor;
  color: var(--muted);
}

.camera-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.camera-name {
  display: inline;
  vertical-align: middle;
}

/* 如果logo加载失败，隐藏logo但保持布局 */
.camera-brand-logo[style*="display: none"] {
  display: none !important;
}

@media (max-width: 1024px) {
  .gallery {
    max-width: 100%;
    padding: 0 16px;
  }
  :root {
    --card-width: 280px;
    --masonry-gap: 20px;
  }
}
@media (max-width: 640px) {
  #portfolio .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 16px;
  }
  .gallery {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 auto;
  }
  :root {
    --card-width: 100%;
    --masonry-gap: 16px;
  }
  .card {
    position: relative !important;
    left: 0 !important;
    top: auto !important;
    width: 100% !important;
    margin: 0 auto 16px;
  }
  .gallery {
    height: auto !important;
  }
  .section-head {
    padding: 0;
    text-align: center;
  }
  .section-head h2 {
    text-align: center;
  }
  .filters {
    justify-content: center;
    width: 100%;
  }
}

/* 关于 */
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.features { display: flex; flex-direction: column; padding: 0; gap: 8px; list-style: none; color: var(--muted); }

.about-photo { min-height: 280px; border-radius: 14px; background: url('https://images.unsplash.com/photo-1487412720507-e7ab37603c6f?w=1200&q=80&auto=format&fit=crop') center/cover no-repeat; border: 1px solid var(--border); }
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}

/* 故事（极简版式） */
.prose { max-width: 70ch; }
.story + .story { margin-top: 24px; }
.story h3 { margin: 0 0 8px; font-size: 20px; }
.story p { margin: 0; color: var(--muted); }

/* 故事卡片流（微博风） */
.feed { display: grid; gap: 12px; max-width: 820px; }
.story-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.story-card { cursor: pointer; }
.story-card .card-link { display: block; color: inherit; }
.story-card .head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.story-card .avatar { width: 36px; height: 36px; border-radius: 999px; background: #111316; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--border); font-weight: 700; }
.story-card .title { margin: 0; font-size: 16px; font-weight: 700; }
.story-card .meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; margin-left: auto; }
.story-detail { max-width: 820px; margin: 0 auto; }
.story-detail h1 { margin: 0 0 8px; font-size: clamp(20px, 3vw, 28px); }
.story-detail .meta { color: var(--muted); margin-bottom: 12px; font-size: 14px; }
.story-detail .media img { width: 100%; border-radius: 10px; border: 1px solid var(--border); margin: 10px 0; }
.story-detail .body { margin-top: 20px; }
.story-detail .body p { margin: 1em 0; line-height: 1.8; }
.story-detail .body .story-image { margin: 24px 0; }
.story-detail .body .story-image img { width: 100%; border-radius: 10px; border: 1px solid var(--border); display: block; }
.story-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.story-nav a { color: var(--muted); }
.story-nav a:hover { color: var(--text); }
.story-card .body { color: var(--muted); }
.story-card .media { margin-top: 10px; }
.story-card .media img { width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.story-card.collapsed .body, .story-card.collapsed .media { display: none; }

/* 灯箱 */
.lightbox { 
  position: fixed; 
  inset: 0; 
  background: rgba(0,0,0,.95); 
  display: none; 
  align-items: center; 
  justify-content: center; 
  z-index: 100;
  overflow-y: auto;
}
.lightbox.open { display: flex; }
.lightbox-container {
  width: 100%;
  max-width: 1400px;
  margin: 20px auto;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
  padding: 0 20px;
  max-height: calc(100vh - 40px);
}
.lightbox-image-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  max-height: calc(100vh - 40px);
  overflow: hidden;
}
.lightbox img { 
  max-width: min(calc(100vw - 420px), 100%);
  max-height: calc(100vh - 40px);
  width: auto;
  height: auto;
  border-radius: 12px; 
  box-shadow: var(--shadow);
  object-fit: contain;
}
.lightbox-info { 
  width: 360px;
  flex-shrink: 0;
  background: rgba(15, 15, 16, 0.95);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 日期时间（顶部右侧） */
.lightbox-date {
  text-align: right;
  color: #8b949e;
  font-size: 11px;
  margin-bottom: 4px;
}

/* 位置信息 */
.lightbox-location {
  color: #eaecef;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 4px;
}

/* 相机和镜头 */
.lightbox-camera-lens {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}

.lightbox-camera {
  color: #eaecef;
  font-size: 12px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lightbox-camera .camera-brand-logo {
  width: 0.85em;
  height: 0.85em;
}

.lightbox-lens {
  color: #eaecef;
  font-size: 12px;
  line-height: 1.5;
}

/* 曝光设置 */
.lightbox-exposure {
  color: #eaecef;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 4px;
}

.lightbox-info-empty {
  color: #8b949e;
  text-align: center;
  padding: 20px;
}

.lightbox-map-container {
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
}

.lightbox-map {
  width: 100%;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1b1e;
  position: relative;
}

.lightbox-map .leaflet-container {
  background: #1a1b1e;
  width: 100% !important;
  height: 100% !important;
}
.lightbox-close { position: absolute; top: 24px; right: 24px; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 999px; width: 40px; height: 40px; font-size: 22px; cursor: pointer; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 999px; width: 44px; height: 44px; font-size: 26px; cursor: pointer; }
.lightbox .nav.prev { left: 24px; }
.lightbox .nav.next { right: 24px; }

/* 响应式：小屏幕时信息移到下方 */
@media (max-width: 1024px) {
  .lightbox-container {
    flex-direction: column;
    align-items: center;
    max-height: calc(100vh - 40px);
    margin: 20px auto;
  }
  .lightbox-image-wrapper {
    max-height: calc(100vh - 400px);
    width: 100%;
  }
  .lightbox img {
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 400px);
  }
  .lightbox-info {
    width: 100%;
    max-width: 800px;
    max-height: 360px;
  }
  .lightbox-map {
    height: 200px;
  }
}

/* 响应式：超小屏幕 */
@media (max-width: 640px) {
  .lightbox-container {
    margin: 10px auto;
    padding: 0 10px;
    gap: 16px;
    max-height: calc(100vh - 20px);
  }
  .lightbox-image-wrapper {
    max-height: calc(100vh - 350px);
  }
  .lightbox img {
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 350px);
  }
  .lightbox-info {
    max-height: 320px;
    padding: 16px;
  }
  .lightbox-map {
    height: 180px;
  }
}

/* 页脚 */
.site-footer { border-top: 1px solid var(--border); background: #0f0f10; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; gap: 16px; }
.social { display: flex; gap: 14px; }
.social a { color: var(--muted); }
.social a:hover { color: var(--text); }


