/* 个人照片网站 - 全局样式
   风格: 干净现代摄影作品集（米白底 / 深墨字 / 大图呼吸感） */

:root {
  --bg: #faf9f7;
  --ink: #1c1b1a;
  --muted: #8a8580;
  --accent: #b0603a;
  --line: #e8e4de;
  --card: #ffffff;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}
img { max-width: 100%; }

/* ---------- 布局 ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(250, 249, 247, 0.92);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(6px);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; padding-bottom: 14px;
}
.logo {
  font-family: "Songti SC", "Noto Serif CJK SC", STSong, serif;
  font-size: 20px; font-weight: 600; letter-spacing: 2px;
  color: var(--ink); text-decoration: none;
}
.site-nav a {
  margin-left: 18px; color: var(--muted); text-decoration: none; font-size: 14px;
  transition: color .2s;
}
.site-nav a:hover { color: var(--ink); }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 60px; padding: 22px 0;
  text-align: center; font-size: 13px; color: var(--muted);
}

.page-title {
  font-family: "Songti SC", "Noto Serif CJK SC", STSong, serif;
  font-weight: 600; font-size: 26px; letter-spacing: 1px;
  margin: 34px 0 22px;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- 照片墙（瀑布流） ---------- */
.masonry {
  columns: 4 240px;
  column-gap: 16px;
}
.card {
  display: block;
  margin-bottom: 16px;
  break-inside: avoid;
  text-decoration: none;
  color: inherit;
}
.thumb {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #eee9e2;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.thumb img {
  display: block; width: 100%; height: auto;
  transition: transform .45s ease;
}
.card:hover .thumb img { transform: scale(1.02); }
.thumb-title {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 12px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  color: #fff; font-size: 14px; letter-spacing: .5px;
  opacity: 0; transition: opacity .3s;
}
.card:hover .thumb-title { opacity: 1; }

/* ---------- 详情页 ---------- */
.detail { padding-top: 26px; }
.detail-img {
  text-align: center;
  background: #fff; border-radius: 14px; padding: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.detail-img img { border-radius: 8px; max-height: 78vh; }
.detail-meta { margin-top: 22px; }
.detail-title {
  font-family: "Songti SC", "Noto Serif CJK SC", STSong, serif;
  font-size: 24px; margin: 0 0 10px;
}
.detail-desc {
  color: #3a3836; font-size: 15px;
  white-space: normal;
}
.detail-time { margin-top: 12px; font-size: 13px; }
.detail-nav {
  display: flex; gap: 12px; margin-top: 26px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s;
}
.btn:hover { border-color: #c9c2b8; }
.btn-primary {
  background: var(--ink); border-color: var(--ink); color: #fff;
}
.btn-primary:hover { background: #333; border-color: #333; }
.btn.danger { color: #b03a2e; border-color: #e5c6c0; }
.btn.danger:hover { background: #b03a2e; color: #fff; border-color: #b03a2e; }
.btn.small { padding: 4px 12px; font-size: 13px; }
.btn-block { display: block; width: 100%; text-align: center; }
.inline { display: inline; }
.form-actions { display: flex; gap: 10px; margin-top: 14px; }

/* ---------- 分页 ---------- */
.pager {
  display: flex; align-items: center; gap: 14px;
  justify-content: center; margin: 34px 0;
}

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 70px 0; color: var(--muted); }

/* ---------- 面板 / 表单 ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 24px;
}
.panel h2 { margin-top: 0; font-size: 18px; }

form label { display: block; margin-bottom: 12px; font-size: 14px; color: #4a4642; }
form input[type="text"],
form input[type="password"],
form input[type="number"],
form textarea {
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
form input:focus, form textarea:focus {
  outline: none; border-color: #b5ada2;
  box-shadow: 0 0 0 3px rgba(176,96,58,.10);
}
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- 上传区 ---------- */
.upload-box {
  border: 2px dashed #d6d0c6;
  border-radius: 12px;
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  margin-bottom: 16px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.upload-box:hover, .upload-box.dragover { border-color: var(--accent); background: #fdf6f0; }
.upload-box input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}

/* 上传前多图预览 */
.preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.preview-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  aspect-ratio: 1 / 1;
}
.preview-item img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
}

/* ---------- 后台照片管理（按标题分组） ---------- */
.group {
  margin-bottom: 22px;
}
.group-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.group-title {
  font-size: 16px; font-weight: 600;
  font-family: "Songti SC", "Noto Serif CJK SC", STSong, serif;
}
.badge-count {
  font-size: 12px; color: var(--muted);
  background: #f2efe9; border-radius: 12px; padding: 1px 10px;
}
.group-more { margin-top: 8px; }
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.admin-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
}
.admin-card .thumb { border-radius: 0; }
.admin-info { padding: 12px; }
.admin-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.admin-desc { color: #6b6762; margin: 6px 0; }
.admin-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.admin-actions .inline { display: inline-flex; }

/* ---------- 安装 / 登录卡片 ---------- */
.install-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 30px 16px;
  background: linear-gradient(160deg, #f7f4ef 0%, #efe9e1 100%);
}
.install-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 40px rgba(0,0,0,.08);
  padding: 34px;
  width: 100%; max-width: 520px;
}
.install-card.narrow { max-width: 400px; }
.install-card h1 {
  font-family: "Songti SC", "Noto Serif CJK SC", STSong, serif;
  font-size: 22px; margin: 0 0 6px;
}
.install-card h2 {
  font-size: 15px; margin: 22px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line); color: #4a4642;
}

/* ---------- 提示 ---------- */
.alert {
  border-radius: 10px; padding: 12px 14px; margin: 14px 0;
  font-size: 14px;
}
.alert-error { background: #fdecec; color: #a03226; border: 1px solid #f3c8c2; }
.alert-success { background: #e9f5ec; color: #1e6b38; border: 1px solid #bfe0c8; }

.edit-preview { margin: 14px 0; text-align: center; }

/* ---------- 验证码 ---------- */
.captcha-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 5px;
}
.captcha-row input { flex: 1; margin-top: 0; }
.captcha-img {
  height: 40px; width: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  background: #f5f3ef;
}
