/* ============================================================
 * Candy Theme — 相册时光长廊（album-timeline）
 * 对齐 album-timeline-preview.html；作用域 .page-album-timeline
 * 避免与 list.css 扁平 .tl-era / theme.css .tag-pill / .album-grid 冲突（禁四）
 * 零裸 hex，全部走 CSS 变量（禁六）
 * ============================================================ */

/* ---------- 页面头部卡片（复用设计语言：底圆角卡片） ---------- */
.page-album-timeline .page-head{
  margin:0 0 24px;
  background:var(--bg);
  border:1px solid var(--line);
  border-top:none;
  border-radius:0 0 var(--radius) var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  max-width:100%;
}
.page-album-timeline .page-head .wrap{max-width:var(--maxw);margin:0 auto;padding:0 28px;}
.page-album-timeline .head-title{padding:24px 0 0;display:flex;align-items:baseline;gap:24px;flex-wrap:wrap;}
.page-album-timeline .head-title h1{font-family:var(--serif);font-weight:600;font-size:clamp(28px,3.4vw,40px);letter-spacing:.01em;margin:0;}
.page-album-timeline nav.breadcrumb{font-size:13px;color:var(--faint);display:flex;align-items:center;gap:8px;width:100%;margin-bottom:14px;}
.page-album-timeline nav.breadcrumb a:hover{color:var(--gold);}
.page-album-timeline nav.breadcrumb .sep{color:var(--faint);}
.page-album-timeline .page-head .sub{margin-top:10px;padding-bottom:20px;color:var(--muted);font-size:14.5px;max-width:44em;line-height:1.8;}
.page-album-timeline .page-head .stats{display:flex;gap:24px;padding:0 0 20px;border-bottom:1px solid var(--line);flex-wrap:wrap;}
.page-album-timeline .stat-item{display:flex;flex-direction:column;gap:2px;}
.page-album-timeline .stat-item .stat-num{font-family:var(--serif);font-size:22px;font-weight:600;color:var(--ink);}
.page-album-timeline .stat-item .stat-label{font-size:12px;color:var(--faint);}

/* ---------- 视图切换 ---------- */
.page-album-timeline .view-switcher{display:flex;gap:0;padding:0;border-top:1px solid var(--line);overflow-x:auto;}
.page-album-timeline .view-btn{flex:none;border:0;background:none;cursor:pointer;padding:12px 16px;font-size:13px;color:var(--muted);border-bottom:2px solid transparent;white-space:nowrap;transition:.12s;font-family:var(--sans);display:inline-flex;align-items:center;gap:6px;}
.page-album-timeline .view-btn:hover{color:var(--gold);}
.page-album-timeline .view-btn.active{color:var(--gold);font-weight:600;border-bottom-color:var(--gold);background:rgba(var(--gold-rgb), .04);}
.page-album-timeline .view-btn svg{width:15px;height:15px;flex-shrink:0;}

/* ---------- 视图区块（默认隐藏，active 显示） ---------- */
.page-album-timeline .view-section{display:none;}
.page-album-timeline .view-section.active{display:block;}

/* ---------- 朝代/网格 筛选 pills ---------- */
.page-album-timeline .tab-bar{display:flex;gap:8px;padding:0 0 28px;flex-wrap:wrap;align-items:center;}
.page-album-timeline .tab-pill{font-size:13px;color:var(--muted);padding:8px 16px;border:1px solid var(--line);border-radius:999px;background:var(--bg);cursor:pointer;transition:var(--transition);}
.page-album-timeline .tab-pill:hover{color:var(--ink);border-color:var(--line-strong);}
.page-album-timeline .tab-pill.active{background:var(--ink);color:var(--bg);border-color:var(--ink);}
.page-album-timeline .tab-pill .pill-cnt{margin-left:4px;font-size:11px;opacity:.7;}
.page-album-timeline .tab-pill.active .pill-cnt{opacity:.8;}

/* ---------- 选中朝代后的标题条 ---------- */
.page-album-timeline .detail-hero{display:none;align-items:center;gap:12px;padding:0 0 20px;color:var(--ink);font-family:var(--serif);font-size:22px;font-weight:600;}
.page-album-timeline .detail-hero.show{display:flex;}
.page-album-timeline .detail-hero .dh-back{font-size:13px;color:var(--gold);cursor:pointer;font-family:var(--sans);font-weight:400;display:flex;align-items:center;gap:4px;margin-right:8px;transition:.2s;}
.page-album-timeline .detail-hero .dh-back:hover{color:var(--gold-hover);}
.page-album-timeline .detail-hero .dh-back svg{width:16px;height:16px;}
.page-album-timeline .detail-hero .period{font-family:var(--sans);font-size:13px;color:var(--muted);font-weight:400;margin-left:auto;}

/* ---------- 时间线竖向轨道 ---------- */
.page-album-timeline .timeline{position:relative;padding:0 0 60px;}
.page-album-timeline .timeline::before{content:"";position:absolute;left:221px;top:12px;bottom:12px;width:1px;background:var(--line);}

/* ---- 时期层（朝代） ---- */
.page-album-timeline .tl-era{position:relative;padding-left:248px;margin-bottom:32px;}
.page-album-timeline .tl-era-label{position:absolute;left:0;top:0;width:200px;text-align:right;padding-right:28px;cursor:pointer;user-select:none;}
.page-album-timeline .tl-era-label .dynasty{font-family:var(--serif);font-size:22px;font-weight:600;color:var(--ink);}
.page-album-timeline .tl-era-label .period{font-size:13px;color:var(--faint);margin-top:2px;}
.page-album-timeline .tl-dot{position:absolute;left:214px;top:8px;width:14px;height:14px;border-radius:50%;background:var(--gold);border:3px solid var(--bg);z-index:2;cursor:pointer;transition:transform .3s;}
.page-album-timeline .tl-era.open .tl-dot{transform:scale(1.4);background:var(--bg);border-color:var(--gold);}
.page-album-timeline .tl-era.open .tl-era-label .dynasty{color:var(--gold);}
.page-album-timeline .tl-arrow{position:absolute;left:192px;top:10px;width:14px;height:14px;cursor:pointer;color:var(--faint);transition:transform .3s;z-index:3;}
.page-album-timeline .tl-era.open .tl-arrow{transform:rotate(90deg);}

/* ---- 展开内容行 ---- */
.page-album-timeline .tl-sub-row{display:none;margin-bottom:8px;}
.page-album-timeline .tl-era.open .tl-sub-row{display:block;}

/* ---------- 相册网格（时间轴内嵌 / 全部相册网格） ---------- */
.page-album-timeline .album-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;}
.page-album-timeline .album-card{background:var(--bg);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);transition:var(--transition);cursor:pointer;}
.page-album-timeline .album-card:hover{box-shadow:var(--shadow-hover);transform:translateY(-3px);}
/* 拼接马赛克封面 */
.page-album-timeline .album-cover{position:relative;aspect-ratio:4/3;overflow:hidden;background:var(--bg-deeper);display:grid;grid-template-columns:1.45fr 1fr;grid-template-rows:1fr 1fr;gap:2px;}
.page-album-timeline .album-cover img{width:100%;height:100%;object-fit:cover;transition:transform .4s cubic-bezier(.2,.8,.2,1);}
.page-album-timeline .album-cover .m-main{grid-row:1/3;}
.page-album-timeline .album-cover .m-sub{position:relative;overflow:hidden;}
.page-album-timeline .album-cover .m-sub img{position:absolute;inset:0;}
.page-album-timeline .album-cover-empty{background:var(--bg-deeper);}
.page-album-timeline .album-card:hover .album-cover img{transform:scale(1.05);}
.page-album-timeline .album-count{position:absolute;right:10px;bottom:10px;display:flex;align-items:center;gap:4px;background:rgba(var(--ink-rgb), .62);backdrop-filter:blur(6px);color:var(--bg);font-size:12px;padding:4px 10px;border-radius:999px;z-index:3;}
.page-album-timeline .album-count svg{width:13px;height:13px;}
.page-album-timeline .album-cover .m-more{position:absolute;inset:0;background:rgba(var(--ink-rgb), .45);color:var(--bg);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:2px;opacity:0;transition:var(--transition);z-index:2;font-size:13px;}
.page-album-timeline .album-card:hover .m-more{opacity:1;}
.page-album-timeline .album-cover .m-more b{font-size:18px;font-family:var(--serif);}
.page-album-timeline .album-vip{position:absolute;top:10px;left:10px;background:linear-gradient(135deg,var(--gold),var(--gold-hover));color:var(--bg);font-size:11px;padding:3px 9px;border-radius:999px;display:flex;align-items:center;gap:3px;z-index:3;}
.page-album-timeline .album-vip svg{width:11px;height:11px;}

.page-album-timeline .album-body{padding:14px 16px 16px;}
.page-album-timeline .album-title{font-family:var(--serif);font-size:16px;font-weight:600;margin-bottom:8px;line-height:1.4;}
.page-album-timeline .album-meta{display:flex;align-items:center;gap:8px;margin-bottom:10px;}
.page-album-timeline .album-author{width:24px;height:24px;border-radius:50%;background:var(--bg-soft);border:1px solid var(--line);overflow:hidden;display:grid;place-items:center;font-size:11px;color:var(--muted);font-family:var(--serif);flex-shrink:0;}
.page-album-timeline .album-author img{width:100%;height:100%;object-fit:cover;}
.page-album-timeline .album-author-name{font-size:12.5px;color:var(--muted);}
.page-album-timeline .album-tags{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px;}
.page-album-timeline .tag-pill{font-size:11.5px;color:var(--muted);background:var(--bg-soft);padding:3px 9px;border-radius:999px;}
.page-album-timeline .tag-pill.gold{color:var(--gold);background:var(--gold-soft);}

/* ---------- 空状态 ---------- */
.page-album-timeline .empty-state{display:none;text-align:center;padding:48px 20px 40px;}
.page-album-timeline .empty-state.show{display:block;}
.page-album-timeline .empty-state .es-icon{width:56px;height:56px;margin:0 auto 16px;border-radius:50%;background:var(--bg-deeper);display:grid;place-items:center;color:var(--faint);}
.page-album-timeline .empty-state .es-icon svg{width:26px;height:26px;}
.page-album-timeline .empty-state .es-title{font-family:var(--serif);font-size:17px;font-weight:600;color:var(--ink);}
.page-album-timeline .empty-state .es-desc{font-size:13px;color:var(--faint);margin-top:8px;line-height:1.6;}

/* ---------- detail-mode：聚焦单个朝代 ---------- */
.page-album-timeline .timeline.detail-mode .tl-era{display:none;margin-bottom:0;}
.page-album-timeline .timeline.detail-mode .tl-era.selected{display:block;padding-left:0;margin-bottom:0;}
.page-album-timeline .timeline.detail-mode .tl-era.selected .tl-era-label{display:none;}
.page-album-timeline .timeline.detail-mode .tl-era.selected .tl-sub-row{display:block;margin-left:0;padding-left:0;}
.page-album-timeline .timeline.detail-mode .tl-era.selected .tl-arrow,
.page-album-timeline .timeline.detail-mode .tl-era.selected .tl-dot{display:none;}

/* ---------- 响应式 ---------- */
@media (max-width:860px){
  .page-album-timeline .album-grid{grid-template-columns:repeat(2,1fr);gap:14px;}
  .page-album-timeline .timeline::before{left:25px;}
  .page-album-timeline .tl-era{padding-left:52px;}
  .page-album-timeline .tl-era-label{position:relative;left:auto;top:auto;width:auto;text-align:left;padding-right:0;margin-bottom:12px;}
  .page-album-timeline .tl-dot{left:18px;}
  .page-album-timeline .tl-arrow{left:18px;}
}
@media (max-width:540px){
  .page-album-timeline .album-grid{grid-template-columns:1fr;gap:14px;}
}
