/* ============ 字体 ============ */
@font-face {
  font-family: 'AlimamaShuHeiTi';
  src: url('/fonts/AlimamaShuHeiTi-Bold.otf') format('opentype'),
       url('/fonts/AlimamaShuHeiTi-Bold.ttf') format('truetype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'AlimamaFangYuanTi';
  src: url('/fonts/AlimamaFangYuanTiVF-Thin.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ============ 全局 ============ */
:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #6b7280;
  --card-bg: #ffffff;
  --card-border: #e5e7eb;
  --hover: #f3f4f6;
  --nav-bg: #ffffff;
  --nav-fg: #111111;
  --accent: #111111;
  --font-main: 'AlimamaShuHeiTi', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-card: 'AlimamaFangYuanTi', 'AlimamaShuHeiTi', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-main);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ============ 导航栏 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  color: var(--nav-fg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.nav-wrap {
  max-width: 2400px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand img {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--nav-fg);
  padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}

.nav-links a.active,
.nav-links a:hover {
  border-color: currentColor;
}

/* 移动端菜单按钮 */
.menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--nav-fg);
}

.menu-btn .bar {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

.menu-btn.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.open .bar:nth-child(2) { opacity: 0; }
.menu-btn.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 640px) {
  .menu-btn { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    color: var(--nav-fg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 1.5rem 1rem;
    gap: 1rem;
  }
  .nav-links.open { display: flex; }
}

/* ============ 主容器 ============ */
.container {
  max-width: 2400px;
  margin: 0 auto;
  padding: 1.5rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 1.5rem 0 1rem;
}

/* ============ 时间筛选栏 ============ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--hover);
  border-radius: 12px;
  font-family: var(--font-card);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.filter-group select {
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--fg);
  font-size: 0.9rem;
  font-family: var(--font-card);
  cursor: pointer;
}

.filter-group select option {
  font-family: var(--font-card);
}

.filter-reset {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  font-size: 0.85rem;
  font-family: var(--font-card);
  cursor: pointer;
  transition: background 0.2s;
}

.filter-reset:hover {
  background: var(--card-bg);
}

@media (max-width: 640px) {
  .filter-bar { gap: 0.75rem; }
}

/* ============ 相册 Tab ============ */
.album-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.album-tab {
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--fg);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font-card);
  cursor: pointer;
  transition: all 0.2s;
}

.album-tab:hover {
  background: var(--hover);
}

.album-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* 当前相册描述 */
.album-info {
  margin: 0 auto 1.25rem;
  max-width: 720px;
  text-align: center;
  padding: 0.6rem 1rem;
  background: var(--hover);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--fg);
}

/* ============ 瀑布流 ============ */
.masonry {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.masonry-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ============ 相框卡片 ============ */
.photo-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.photo-card .thumb-wrap {
  position: relative;
  width: 100%;
  background: var(--hover);
  overflow: hidden;
}

.photo-card .thumb-wrap img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.photo-card .card-info {
  padding: 0.75rem 0.9rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: var(--font-card);
}

.photo-card .card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.photo-card .card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.photo-card .exif-area {
  padding-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* EXIF 行：焦段/光圈/快门/ISO */
.photo-card .exif-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
}

.exif-item {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-card);
  white-space: nowrap;
}

/* 拍摄时间 */
.photo-card .taken-at {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ============ 灯箱 ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox.open {
  display: flex;
}

.lightbox-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 1rem 1.5rem;
  color: #fff;
}

.lightbox-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* 下载按钮：位于 EXIF 信息下方 */
.lightbox-download {
  margin-top: 1rem;
  padding: 0.55rem 1.8rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s;
}

.lightbox-download:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-download:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

.lightbox-info {
  width: 100%;
  max-width: 640px;
  margin-top: 1rem;
  color: #fff;
  text-align: center;
}

.lightbox-info .lb-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.lightbox-info .lb-desc {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 0.75rem;
}

.lightbox-info .lb-exif {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
}

.lightbox-info .lb-exif-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  font-family: var(--font-card);
  color: rgba(255,255,255,0.85);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: none;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

@media (max-width: 640px) {
  .lightbox-nav { font-size: 1.5rem; width: 40px; height: 40px; }
  .lightbox-prev { left: 0.25rem; }
  .lightbox-next { right: 0.25rem; }
}

/* ============ 页脚 ============ */
.site-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

/* 页脚版权 */
#footerCopyright {
  font-family: var(--font-card);
}

.footer-social a {
  color: var(--muted);
  font-size: 1.1rem;
  transition: color 0.2s;
}

.footer-social a:hover {
  color: var(--fg);
}

.footer-brand {
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.5rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.footer-brand img {
  height: 28px;
  width: auto;
}

/* ============ 关于/联系页 ============ */
.page-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (max-width: 768px) {
  .page-grid { grid-template-columns: 1fr; }
}

/* 头像列：限制相框尺寸，不占满整列 */
.avatar-col {
  display: flex;
  justify-content: center;
  padding: 1rem;
}

@media (min-width: 768px) {
  .avatar-col { padding: 1.5rem; }
}

/* 宝丽来相框：默认倾斜 -6°，悬停转正 */
.avatar-frame {
  position: relative;
  width: 100%;
  max-width: 700px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 1.25rem 1.25rem 5.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transform: rotate(-6deg);
  transition: transform 0.5s ease;
}

.avatar-frame:hover {
  transform: rotate(0deg);
}

.avatar-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  height: auto;
}

/* 相框底部 logo */
.avatar-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 5.75rem;
  padding-bottom: 0.6rem;
}

.avatar-caption img {
  max-height: 4.16rem;
  max-width: 96%;
  width: auto;
  object-fit: contain;
}

.about-text {
  margin: 0 0.75rem;
}

.about-text h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  font-family: var(--font-card);
}

.about-text .intro {
  font-size: 1rem;
  line-height: 1.75;
  margin: 0 0 1rem;
  font-family: var(--font-card);
}

.about-text .bio {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--muted);
  white-space: pre-line;
  margin: 0;
  font-family: var(--font-card);
}

@media (max-width: 768px) {
  .about-text { text-align: center; }
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-family: var(--font-card);
}

.contact-form label {
  font-size: 0.85rem;
  font-weight: 500;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--fg);
  font-size: 0.95rem;
  font-family: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid rgba(0, 0, 0, 0.5);
  outline-offset: 1px;
}

.contact-form button {
  padding: 0.65rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.contact-form button:hover { opacity: 0.85; }

/* 表单提交状态提示 */
.form-status {
  font-size: 0.9rem;
  min-height: 1.2em;
  font-family: var(--font-card);
}

.form-status.ok { color: #16a34a; }
.form-status.error { color: #dc2626; }

.contact-meta {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-family: var(--font-card);
}

.contact-meta p { margin: 0.35rem 0; }

/* ============ 空状态 ============ */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}

.empty-state .big {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

/* 无限滚动加载状态 */
.feed-status {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--muted);
  font-family: var(--font-card);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

/* 灯箱原图加载提示：顶部落徽标，不遮挡正在看的缩略图 */
.lb-loading {
  position: absolute;
  top: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--font-card);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  pointer-events: none;
  white-space: nowrap;
}

/* CSS 的 display 会覆盖 hidden 属性，必须显式压回来 */
.lb-loading[hidden] {
  display: none;
}

.lb-spinner {
  width: 12px;
  height: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: lb-spin 0.7s linear infinite;
  flex: none;
}

@keyframes lb-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .lb-spinner { animation-duration: 2s; }
}
