/* ========== 全局重置 - 去掉浏览器默认边距 ========== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========== CSS 变量 - 改配色/尺寸只改这里 ==========
   --color-bg:       全站背景色（当前 #0a0a0a 深黑）
   --color-text:     主文字颜色（当前 #e8e8e8 柔和白）
   --color-text-secondary:  次要文字（当前 #888888 中灰）
   --color-text-muted:      弱化文字（当前 #555555 深灰）
   --nav-height:     导航栏高度（当前 64px）
   --gap:            Portfolio 照片间距（当前 24px）
   ================================================== */
:root {
  --font-stack: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --color-bg: #0a0a0a;
  --color-surface: #111111;
  --color-text: #e8e8e8;
  --color-text-secondary: #888888;
  --color-text-muted: #555555;
  --color-border: #1a1a1a;
  --color-overlay: rgba(0, 0, 0, 0.65);
  --nav-height: 64px;
  --gap: 24px;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-stack);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== 顶部导航栏 ========== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  padding: 0 40px;
  background: var(--color-bg);
  position: relative;
  z-index: 10;
}

/* Journey 页面下导航栏脱离文档流 + 透明背景 */
body.journey-active .nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  z-index: 1000;
}

body.journey-active .nav-title {
  color: #ffffff;
  mix-blend-mode: difference;
}

body.journey-active .nav-link {
  color: rgba(255, 255, 255, 0.7);
  mix-blend-mode: difference;
}

body.journey-active .nav-link::after {
  background: #ffffff;
}

body.journey-active .nav-link.active {
  color: #ffffff;
}

body.journey-active .nav-menu-btn span {
  background: #ffffff;
  mix-blend-mode: difference;
}

.nav-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.nav-title:hover {
  opacity: 0.6;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-secondary);
  text-decoration: none;
  cursor: pointer;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-text);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--color-text);
}

.nav-link.active {
  color: var(--color-text);
  font-weight: 500;
}

.nav-link.active::after {
  width: 100%;
}

/* 移动端汉堡菜单按钮（桌面端隐藏） */
.nav-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-menu-btn span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--color-text);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* ========== 页面容器 ========== */
.page {
  display: none;
  min-height: 100vh;
  animation: fadeIn 0.5s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== Portfolio 页面 - 首页照片网格 ========== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.album-card {
  cursor: pointer;
}

.album-card-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  transition: filter 0.4s ease;
}

.album-card:hover .album-card-img {
  filter: brightness(0.7);
}

.album-info {
  padding-top: 10px;
}

.album-title {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

/* ========== Album Detail 页面 - 网格布局 ========== */
.album-detail {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  background: var(--color-bg);
  animation: fadeIn 0.5s ease;
}

.album-detail.active {
  display: block;
}

.album-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: var(--nav-height);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 10;
}

.album-detail-back {
  font-size: 14px;
  color: var(--color-text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.album-detail-back:hover {
  color: var(--color-text);
}

.album-detail-back svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.album-detail-header-title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.album-detail-header-spacer {
  width: 80px;
}

/* 网格布局 */
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 0 40px 40px
}

.album-grid-item img {
  width: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.album-grid-item {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.album-grid-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.album-grid-item:hover img {
  transform: scale(1.03);
  filter: brightness(0.85);
}

.album-grid-item.skeleton {
  background: linear-gradient(110deg, #1a1a1a 30%, #222 50%, #1a1a1a 70%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  aspect-ratio: 3 / 4;
  border-radius: 2px;
  cursor: default;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== Lightbox ========== */
.album-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  cursor: zoom-out;
}

.album-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.album-lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 2px;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.album-lightbox.active img {
  transform: scale(1);
}

/* ========== Journey 页面 ========== */
#page-journey {
  padding-top: 0;
}

.journey-list {
  padding: 0;
  max-width: 100%;
}

#page-journey .footer {
  display: none;
}

.journey-item:first-child {
  position: relative;
  z-index: 1;
}

body.journey-active .nav {
  background: transparent;
  z-index: 10;
}

.journey-item {
  position: relative;
  width: 100%;
  cursor: pointer;
  margin-bottom: 8px;
}

.journey-item:last-child {
  margin-bottom: 0;
}

.journey-item img {
  width: 100%;
  height: auto;
  display: block;
}

.journey-overlay {
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.journey-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.journey-overlay-content {
  transform: scale(0.95);
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.journey-overlay.visible .journey-overlay-content {
  transform: scale(1);
}

.journey-overlay-date {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.journey-overlay-title {
  font-size: 22px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.journey-overlay-note {
  font-size: 15px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 300;
  max-width: 480px;
}

.journey-overlay-hint {
  margin-top: 24px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.05em;
}

/* ========== About 页面 ========== */
.about-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 80px 40px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 64px;
  align-items: start;
}

.about-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border-radius: 2px;
}

.about-content {
  padding-top: 8px;
}

.about-name {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.about-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  font-weight: 300;
}

.about-text:last-of-type {
  margin-bottom: 40px;
}

.about-contact {
  font-size: 14px;
  color: var(--color-text-muted);
}

.about-contact a {
  color: var(--color-text-secondary);
  text-decoration: none;
  border-bottom: 1px solid #333;
  transition: border-color 0.2s, color 0.2s;
}

.about-contact a:hover {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

.about-social {
  margin-top: 16px;
  display: flex;
  gap: 20px;
}

.about-social a {
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.about-social a:hover {
  color: var(--color-text);
}

/* ========== 页脚 ========== */
.footer {
  padding: 40px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.visit-footer-count {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  opacity: 0.7;
}

/* ========== 悬浮按钮组 ========== */
.float-btns {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 999;
}

.float-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
}

.float-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.float-btn:active {
  transform: scale(0.96);
}

/* 回到顶部 */
.back-to-top {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top svg {
  width: 16px;
  height: 16px;
  stroke: var(--color-text-secondary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 访客计数悬浮按钮 */
.visit-float-btn {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  position: relative;
  color: var(--color-text-secondary);
}

.visit-float-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.visit-float-btn svg {
  width: 18px;
  height: 18px;
  position: absolute;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.visit-icon-pin {
  opacity: 1;
  transform: scale(1);
}

.visit-icon-check {
  opacity: 0;
  transform: scale(0.5);
}

.visit-float-btn.visited .visit-icon-pin {
  opacity: 0;
  transform: scale(0.5);
}

.visit-float-btn.visited .visit-icon-check {
  opacity: 1;
  transform: scale(1);
}

.visit-float-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--color-text-secondary);
  color: var(--color-bg);
  font-size: 10px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-stack);
}

.visit-float-btn.visited {
  color: var(--color-text-muted);
  cursor: default;
}

.visit-float-btn.visited:hover {
  background: rgba(255, 255, 255, 0.08);
}

.visit-float-btn.visited .visit-float-count {
  background: var(--color-text-muted);
}

/* ========== 点击粒子效果 ========== */
.visit-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-text-secondary);
  pointer-events: none;
  animation: particle-burst 0.6s ease-out forwards;
}

@keyframes particle-burst {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0.3);
  }
}

/* ========== 响应式适配 ========== */
/* --- 平板（<=1024px） --- */
@media (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 24px;
  }

  .album-grid {
    grid-template-columns: repeat(3, 1fr);
    padding: 0 24px 24px;
  }

  .about-container {
    grid-template-columns: 240px 1fr;
    gap: 48px;
  }
}

/* --- 手机（<=768px） --- */
@media (max-width: 768px) {
  .nav {
    padding: 0 24px;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    font-size: 18px;
  }

  .nav-menu-btn {
    display: block;
  }

  .nav-menu-btn.open span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
  }

  .nav-menu-btn.open span:nth-child(2) {
    opacity: 0;
  }

  .nav-menu-btn.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 24px;
    gap: 16px;
  }

  .album-detail-header {
    padding: 0 24px;
  }

  .album-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 0 24px 24px;
  }

  .journey-overlay {
    padding: 32px 24px;
  }

  .about-container {
    grid-template-columns: 1fr;
    padding: 48px 24px;
    gap: 32px;
  }

  .about-photo {
    max-width: 240px;
    margin: 0 auto;
  }

  .about-content {
    text-align: center;
  }

  .about-social {
    justify-content: center;
  }

  .float-btns {
    bottom: 20px;
    right: 20px;
  }

  .float-btn {
    width: 36px;
    height: 36px;
  }
}

/* --- 小屏手机（<=480px） --- */
@media (max-width: 480px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .album-detail-header {
    padding: 0 24px;
  }

  .journey-overlay {
    padding: 24px 16px;
  }

  .journey-overlay-title {
    font-size: 18px;
  }

  .journey-overlay-note {
    font-size: 14px;
  }
}