/* =====================================================
 * 我的作品集 · 高级深色主题
 * 摄影作品集在线展示：首页分类总览 + 分类照片 + 沉浸轮播
 * ===================================================== */

:root {
  --bg: #0a0a0c;
  --bg-soft: #101015;
  --card: #16161d;
  --card-2: #1c1c25;
  --line: rgba(255,255,255,.09);
  --line-2: rgba(255,255,255,.16);
  --text: #f4f4f0;
  --muted: #8e8e99;
  --accent: #c9a86c;
  --accent-soft: rgba(201,168,108,.14);
  --danger: #e5484d;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --serif: Georgia, 'Songti SC', 'STSong', 'SimSun', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
::selection { background: var(--accent); color: #0a0a0c; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  max-width: 1200px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: .12em;
  color: var(--text);
}
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(201,168,108,.7); }
.top-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  transition: all .25s ease;
  letter-spacing: .04em;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0a0a0c; font-weight: 600; }
.btn.primary:hover { background: #d9b87d; border-color: #d9b87d; color: #0a0a0c; }
.btn.danger { border-color: rgba(229,72,77,.5); color: #e58b8f; }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn.solid { background: var(--card-2); border-color: var(--card-2); }

/* ---------- 首页 Hero ---------- */
.hero {
  max-width: 1200px;
  margin: 34px auto 0;
  padding: 0 28px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 4.6vw, 52px);
  letter-spacing: .06em;
  line-height: 1.25;
}
.hero .rule {
  width: 54px; height: 2px; background: var(--accent);
  margin: 18px 0 14px;
}
.hero p { color: var(--muted); font-size: 14px; letter-spacing: .05em; }

/* ---------- 相册（分类）网格 ---------- */
.section { max-width: 1200px; margin: 30px auto 60px; padding: 0 28px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.section-head h2 { font-family: var(--serif); font-weight: 500; font-size: 20px; letter-spacing: .08em; }
.section-head .muted { color: var(--muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px;
}
.album-card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  aspect-ratio: 3 / 3.6;
  transition: transform .35s ease, box-shadow .35s ease;
}
.album-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.album-card .cover {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  pointer-events: none;
}
.album-card:hover .cover { transform: scale(1.06); }
.album-card .mask {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,12,0) 38%, rgba(10,10,12,.82) 100%);
}
.album-card .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 18px;
}
.album-card .cap .name {
  font-family: var(--serif);
  font-size: 20px; letter-spacing: .06em;
  margin-bottom: 2px;
  text-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.album-card .cap .meta { color: rgba(255,255,255,.72); font-size: 12px; letter-spacing: .08em; }
.album-card .empty-cover {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; letter-spacing: .1em;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

/* ---------- 相册（分类）页 ---------- */
.album-head {
  max-width: 1200px; margin: 26px auto 0; padding: 0 28px;
  display: flex; align-items: flex-start; gap: 18px;
}
.back-btn {
  width: 42px; height: 42px; flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: transparent; color: var(--text);
  font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all .25s ease; margin-top: 4px;
}
.back-btn:hover { border-color: var(--accent); color: var(--accent); }
.album-head .titles { flex: 1; min-width: 0; }
.album-head h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(24px, 3.4vw, 36px); letter-spacing: .05em;
  line-height: 1.3;
}
.album-head .sub { color: var(--muted); font-size: 13px; letter-spacing: .08em; margin-top: 4px; }
.album-head .acts { display: flex; align-items: center; gap: 10px; margin-top: 6px; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.photo-cell {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
  aspect-ratio: 4 / 3;
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease;
}
.photo-cell:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.photo-cell img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  pointer-events: none;
  transition: transform .5s ease;
}
.photo-cell:hover img { transform: scale(1.05); }
.photo-cell .photo-del {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(10,10,12,.72);
  color: #fff; font-size: 15px; line-height: 1;
  opacity: 0;
  transition: opacity .2s ease;
  backdrop-filter: blur(4px);
}
.photo-cell:hover .photo-del { opacity: 1; }
.photo-cell .photo-del:hover { background: var(--danger); }

/* ---------- 轮播查看器 ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 100;
  background: #050506;
  display: flex; align-items: center; justify-content: center;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  animation: viewerIn .28s ease;
}
@keyframes viewerIn { from { opacity: 0; } to { opacity: 1; } }
.viewer canvas {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none;
  cursor: grab;
}
.viewer canvas.active { cursor: grabbing; }
.viewer-top, .viewer-bottom, .vbtn { transition: opacity .25s ease; }
.viewer .hide { opacity: 0; pointer-events: none; }
.viewer canvas.fade { animation: imgFade .3s ease; }
@keyframes imgFade { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: scale(1); } }
.viewer-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  color: rgba(255,255,255,.85);
  font-size: 13px; letter-spacing: .12em;
  background: linear-gradient(rgba(0,0,0,.5), transparent);
}
#viewer-close {
  width: 38px; height: 38px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  color: #fff; font-size: 15px;
  transition: all .2s ease;
}
#viewer-close:hover { background: rgba(255,255,255,.16); }
.vbtn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  background: rgba(20,20,24,.5);
  color: #fff; font-size: 26px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s ease;
  backdrop-filter: blur(6px);
}
.vbtn:hover { background: rgba(255,255,255,.18); }
.vbtn.prev { left: 18px; }
.vbtn.next { right: 18px; }
.viewer-bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
}
.vlink {
  color: #0a0a0c; font-size: 13px; font-weight: 600;
  padding: 9px 18px;
  background: var(--accent);
  border-radius: 999px;
  transition: all .25s ease;
}
.vlink:hover { background: #d9b87d; }
.vhint { color: rgba(255,255,255,.55); font-size: 12px; letter-spacing: .1em; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,5,8,.72);
  backdrop-filter: blur(6px);
  animation: viewerIn .2s ease;
}
.modal .card {
  width: min(420px, calc(100vw - 40px));
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 28px;
  box-shadow: var(--shadow);
}
.modal h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: 21px; letter-spacing: .06em;
  margin-bottom: 18px;
}
.modal label {
  display: block;
  color: var(--muted); font-size: 12px; letter-spacing: .1em;
  margin: 14px 0 6px;
}
.modal input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  padding: 11px 14px;
  outline: none;
  transition: border-color .2s ease;
}
.modal input:focus { border-color: var(--accent); }
.modal .row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal .pwd-hint { color: var(--muted); font-size: 12px; margin-top: 8px; }

/* ---------- 其他 ---------- */
.empty {
  color: var(--muted);
  text-align: center;
  padding: 60px 20px;
  font-size: 14px;
  letter-spacing: .06em;
}
.body { max-width: 1200px; margin: 0 auto; padding: 0 28px 50px; }

#toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: var(--card-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 999px;
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: var(--shadow);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
#toast.err { border-color: rgba(229,72,77,.6); color: #e58b8f; }

#loading {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,5,8,.5);
  color: var(--text); font-size: 14px; letter-spacing: .1em;
  backdrop-filter: blur(3px);
}

@media (max-width: 640px) {
  .top { padding: 16px 18px; }
  .hero { margin-top: 22px; padding: 0 18px; }
  .section { padding: 0 18px; }
  .album-head { padding: 0 18px; }
  .body { padding: 0 18px 40px; }
  .album-grid { gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .photo-grid { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); }
  .vbtn.prev { left: 10px; }
  .vbtn.next { right: 10px; }
}
