/* ============================================================
   BEYOND相册 —— 独立版式
   版式来源：F:/AI开发/LOVEBEYOND/restore-site/photo/index.html（原站真身）
     · 顶部 bann3.jpg 横幅 (777×89)
     · 左 210px 栏（原站 iframe daohan.htm）：相册公告 / 最新更新 / 照片统计信息
       三段都是 169 宽，图条 kk_t.gif(头) + kk_c.gif(体) + kk_b.gif(尾)
     · 1px #CCCCCD 竖线
     · 右 566 宽：01.gif 页头图 + 每分类一块 519 宽装饰表
       02.gif(顶条5) → 03.gif 底纹标题条(21) → 04/05.gif 边饰 + 内容行 → 06.gif(收尾17)
   ============================================================ */

.album-wrap { padding: 10px 0 22px; }
/* 原版相册页内容区就是 777 宽（bann3.jpg 777×89 原尺寸），
   全站 .wrap 只有 776-16=760 可用，banner 会被压扁 —— photo 页单独放宽 */
body.mod-photo .wrap { width: 793px; }
.album-bann { margin-bottom: 8px; }
.album-bann img { display: block; width: 777px; max-width: 100%; height: auto; }

.album-cols { display: flex; align-items: flex-start; }
.album-divider { flex: 0 0 1px; width: 1px; align-self: stretch; background: #CCCCCD; margin: 0 9px; }
.album-main { flex: 1; min-width: 0; }

/* ---------- 左栏：三段小盒子（原站 daohan.htm） ---------- */
.album-side { flex: 0 0 210px; width: 210px; text-align: center; padding-top: 4px; }
.album-side .as-box {
  width: 169px; margin: 0 auto 12px; border-collapse: collapse;
  font-size: 12px; line-height: 1.6;
}
.album-side .as-h {
  height: 24px; text-align: center; font-size: 12px;
  line-height: 24px; white-space: nowrap;
}
.album-side .as-c {
  padding: 6px 8px; vertical-align: top;
  text-align: left; word-break: break-all;
  /* kk_c.gif 是竖向平铺的底纹：要 background-repeat:repeat-y，
     否则内容一长就露出白底、看着像「框裂开了」 */
  background-repeat: repeat-y; background-position: left top;
}
/* 公告盒固定一个最矮高度（原站观感），更新/统计盒让它随内容长 */
.album-side .as-box:nth-of-type(1) .as-c { min-height: 92px; }
.album-side .as-box:nth-of-type(2) .as-c,
.album-side .as-box:nth-of-type(3) .as-c { min-height: 0; }
/* 公告盒：靠 CSS 自动换行（原站的 <br> 硬换行会从词中间断开，很难看） */
.album-side .as-box:nth-of-type(1) .as-c { text-align: left; }
.album-side .as-c-note { line-height: 1.75; word-break: break-word; }
.album-side .as-c a {
  color: #172E5B; text-decoration: underline; font-size: 12px;
  display: inline; line-height: 1.75;
}
.album-side .as-c a:hover { color: #C0392B; text-decoration: none; }
.as-red  { color: #FF0000; }
.as-blue { color: #172E5B; }
.as-dim  { color: #99A3AE; }
.album-side img { border: 0; }

/* ---------- 右栏页头图 ---------- */
table.am-headimg { border-collapse: collapse; margin-bottom: 12px; }
table.am-headimg img { display: block; width: 356px; max-width: 100%; height: auto; }

/* ---------- 分类装饰块 ---------- */
table.am-sec {
  width: 519px; max-width: 100%; border-collapse: collapse;
  margin: 0 auto;
}
table.am-sec > tbody > tr > td > img,
table.am-sec img { display: block; width: 100%; max-width: 519px; height: auto; }
td.am-sec-h {
  height: 21px; padding: 2px 0 0; vertical-align: top;
  background-color: #E9EEF4;
  background-repeat: repeat-x; background-position: left top;
  background-size: 100% 100%;
}
.am-sec-t { color: #172E5B; font-size: 13px; font-weight: 700; }
td.am-sec-b {
  padding: 8px 10px 10px; vertical-align: top;
  font-size: 12px; line-height: 1.85; color: #172E5B;
  word-break: break-word;
}
td.am-sec-l, td.am-sec-r { width: 11px; }

/* 页码/子相册链接行：原站是「※第一页 第二页 …」这种朴素链接串 */
.am-star { color: #172E5B; }
td.am-sec-b a {
  color: #0000CC; text-decoration: none; font-size: 12px;
  line-height: 1.9; margin-right: 2px;
}
td.am-sec-b a:hover { color: #C0392B; text-decoration: underline; }
.am-extra { color: #172E5B; }
.am-dim { color: #99A3AE; font-size: 12px; }
.am-intro { text-align: center; margin: 0 0 8px; line-height: 1.85; font-size: 12px; }
.am-dark { color: #000000; }
.am-red { color: #FF0000; }

/* ---------- 相册内页：缩略图网格（照原站 koma_page1.html 的 341px 网格） ---------- */
.album-main .am-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 10px;
  border: 1px solid #FFFFFF;
  padding: 4px;
}
a.am-cell {
  display: block; overflow: hidden;
  border: 1px solid #FFFFFF; background: #F4F7FA;
  line-height: 0;
}
a.am-cell img {
  display: block; width: 100%; height: 92px; object-fit: cover;
  transition: transform .22s;
}
a.am-cell:hover { border-color: #1E5B9E; box-shadow: 0 2px 10px rgba(30,91,158,.2); }
a.am-cell:hover img { transform: scale(1.06); }

.am-empty { color: #99A3AE; text-align: center; padding: 30px 0; font-size: 13px; }
.am-desc { color: #5A6B80; font-size: 12px; line-height: 1.8; margin: 10px 0 0; text-align: center; }

/* 子相册名后的张数小注 */
.am-cnt { color: #8A97A6; font-size: 11px; }
/* 分类标题做成可点链接（原站标题不可点，这里不改变观感） */
td.am-sec-h a.am-sec-link,
a.am-sec-link { color: #172E5B; font-size: 13px; text-decoration: none; }
a.am-sec-link:hover { color: #C0392B; text-decoration: underline; }
/* 分类页里「当前分类」高亮 */
td.am-sec-b a.on { color: #C0392B; font-weight: 700; }

/* ============================================================
   灯箱（相册点图原地放大）
   需求：原地放大，ESC 或右上角 X 关闭，不开新窗口
   ============================================================ */
.lb-mask {
  position: fixed; inset: 0; z-index: 9990;
  background: rgba(8, 14, 22, .9);
  display: none; align-items: center; justify-content: center;
  flex-direction: column;
  padding: 40px 18px 54px;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.lb-mask.on { display: flex; animation: lbFade .18s ease-out; }
@keyframes lbFade { from { opacity: 0 } to { opacity: 1 } }

.lb-fig {
  margin: 0; max-width: 96vw; max-height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  min-height: 0;
}
.lb-img {
  display: block; max-width: 96vw; max-height: calc(100vh - 150px);
  width: auto; height: auto; object-fit: contain;
  background: #0B1118; border: 1px solid #2A3644; border-radius: 4px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .6);
  animation: lbZoom .2s ease-out;
}
@keyframes lbZoom { from { transform: scale(.94); opacity: .4 } to { transform: scale(1); opacity: 1 } }

.lb-cap {
  color: #D6DEE8; font-size: 12.5px; text-align: center;
  max-width: 92vw; line-height: 1.7; word-break: break-all;
}
.lb-cap .lb-idx { color: #7E8B99; margin-left: 6px; }

/* 关闭按钮：右上角 X */
.lb-close {
  position: fixed; top: 14px; right: 16px; z-index: 9992;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid #3A4756; border-radius: 50%;
  background: rgba(20, 28, 38, .85); color: #EAF0F6;
  font-size: 22px; line-height: 38px; text-align: center;
  cursor: pointer; font-family: Arial, sans-serif; font-weight: 400;
  transition: background .15s, border-color .15s, transform .15s;
}
.lb-close:hover { background: #C0392B; border-color: #C0392B; transform: rotate(90deg); }
.lb-close:focus-visible { outline: 2px solid #6FA8DC; outline-offset: 2px; }

/* 左右切换（多图时才有用） */
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 9992;
  width: 44px; height: 62px; padding: 0; cursor: pointer;
  border: 1px solid #3A4756; background: rgba(20, 28, 38, .8); color: #EAF0F6;
  font-size: 24px; line-height: 60px; text-align: center; font-family: Arial, sans-serif;
  border-radius: 6px; transition: background .15s;
}
.lb-nav:hover { background: rgba(30, 91, 158, .9); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-nav[hidden] { display: none; }

/* 提示条 */
.lb-hint {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  z-index: 9991; color: #8B98A6; font-size: 11.5px; letter-spacing: .3px;
  background: rgba(12, 18, 26, .7); padding: 4px 12px; border-radius: 12px;
  white-space: nowrap; pointer-events: none;
}

/* 锁住背景滚动 */
body.lb-open { overflow: hidden; }

@media (max-width: 640px) {
  .lb-mask { padding: 52px 8px 46px; }
  .lb-img { max-width: 98vw; max-height: calc(100vh - 140px); }
  .lb-nav { width: 36px; height: 52px; line-height: 50px; font-size: 20px; }
  .lb-prev { left: 4px; } .lb-next { right: 4px; }
  .lb-close { top: 8px; right: 8px; width: 36px; height: 36px; line-height: 34px; font-size: 19px; }
  .lb-hint { font-size: 10.5px; }
}

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  .album-bann img { width: 100%; }
  .album-cols { display: block; }
  .album-divider { display: none; }

  /* 左栏三段改成两列并排，不占满整屏高度 */
  .album-side {
    width: 100%; flex: none; margin-bottom: 12px; padding-top: 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start;
  }
  .album-side .as-box { width: 100%; margin: 0; }
  .album-side .as-c { padding: 6px; font-size: 11.5px; }

  table.am-headimg img { width: 100%; }
  table.am-sec { width: 100%; }
  td.am-sec-l, td.am-sec-r { width: 6px; }
  td.am-sec-b { padding: 6px 7px 8px; }
  .album-main .am-grid { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
  a.am-cell img { height: 72px; }
}
