/* ===== 配色与全局变量 ===== */
:root {
  --bg: #f8f9fa;       /* 页面底色（你的偏好） */
  --card: #ffffff;     /* 卡片白底 */
  --text: #334155;     /* 主文字 */
  --muted: #64748b;    /* 次级文字 */
  --accent: #3b6df0;   /* 主蓝（你的偏好） */
  --border: #e2e8f0;   /* 浅边框 */
  --radius: 8px;       /* 统一圆角 */
  --maxw: 1100px;      /* 内容最大宽度 */
}

/* ===== Reset ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ===== 居中容器 ===== */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
}
.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.nav a {
  margin-left: 24px;
  color: var(--muted);
  font-weight: 500;
}
.nav a:hover { color: var(--accent); text-decoration: none; }

/* ===== 主区推到底（让 footer 贴底） ===== */
main { flex: 1; }

/* ===== 首页轮播 ===== */
.hero { margin-bottom: 40px; }
.slider {
  position: relative;
  max-width: var(--maxw);
  margin: 20px auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  aspect-ratio: 12 / 5;        /* 固定宽高比，所有图统一 */
  background: #000;
}
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.slide.active { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  font-size: 24px;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity 0.3s;
}
.slider:hover .slider-btn { opacity: 1; }
.slider-btn.prev { left: 12px; }
.slider-btn.next { right: 12px; }
.slider-btn:hover { background: rgba(0,0,0,0.7); }

.slider-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.3s;
}
.dot.active { background: #fff; }

/* ===== 瀑布流图墙（首页轮播下方） ===== */
.masonry {
  /* 4 列瀑布流：浏览器原生 columns，零 JS */
  column-count: 4;
  column-gap: 16px;
  max-width: var(--maxw);
  margin: 0 auto 40px;
  padding: 0 20px;
}
/* 移动端降级：2 列 / 1 列 */
@media (max-width: 900px) { .masonry { column-count: 2; } }
@media (max-width: 520px) { .masonry { column-count: 1; } }

.m-item {
  display: block;
  margin-bottom: 16px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  /* columns 关键：避免图片被切断到下一列 */
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  transition: transform 0.3s, box-shadow 0.3s;
}
.m-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.m-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* 4 种 size（极化设计）：高度差最大 2.4 倍，错落感强 */
.m-item.s-1x1   img { aspect-ratio: 1 / 1;   object-fit: cover; }  /* 1.00×  */
.m-item.s-2x3   img { aspect-ratio: 2 / 3;   object-fit: cover; }  /* 1.50×  */
.m-item.s-9x16  img { aspect-ratio: 9 / 16;  object-fit: cover; }  /* 1.78× 极瘦高 */
.m-item.s-4x3   img { aspect-ratio: 4 / 3;   object-fit: cover; }  /* 0.75× 横矮  */

/* ===== 首页简介 ===== */
.intro {
  padding: 40px 20px;
  text-align: center;
}
.intro h1 { font-size: 28px; margin-bottom: 12px; }
.intro p { color: var(--muted); max-width: 600px; margin: 0 auto; }

/* ===== Footer ===== */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ===== 导航当前页高亮 ===== */
.nav a.active {
  color: var(--accent);
  font-weight: 600;
}

/* ===== 图册页 ===== */
.page-header {
  padding: 30px 20px 10px;
  text-align: center;
}
.page-header h1 { font-size: 28px; margin-bottom: 6px; }
.page-header p { color: var(--muted); }

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 30px 20px 50px;
}
.page-btn, .page-num {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}
.page-btn:hover:not(:disabled),
.page-num:hover:not(.active) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-nums {
  display: flex;
  gap: 6px;
}
.page-num {
  min-width: 38px;
}
.page-num.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== 关于页 ===== */
.about-hero {
  text-align: center;
  padding: 40px 20px 20px;
}
.about-portrait {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border: 4px solid var(--card);
}
.about-hero h1 { font-size: 32px; margin-bottom: 8px; }
.subtitle { color: var(--muted); font-size: 16px; }

.about-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 20px 20px 50px;
}
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.info-card h2 {
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td {
  text-align: left;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 15px;
}
.info-table th { color: var(--muted); font-weight: 500; width: 80px; }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: none; }
.hobby-list { list-style: none; padding: 0; }
.hobby-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.hobby-list li:last-child { border-bottom: none; }
.info-card code {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--accent);
}
