/* ==========================================================================
 * DyingInTheSun · 独立页面 / 分类 / 视频 / 专题 / 标签云 / 文章资源卡 布局增强
 * 参考 ripro.rizhuti.com 的卡片化、蓝紫渐变、清晰信息层级风格
 * 本文件在 header.php 最后加载，保证覆盖同级规则
 * ========================================================================== */

/* ---------- 通用页面头部横幅（ripro 风格蓝紫渐变） ---------- */
.hh-page-hero {
  position: relative;
  margin: 0 0 1.25rem;
  padding: 2.6rem 0 2.4rem;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 52%, #8b5cf6 100%);
  overflow: hidden;
}
.hh-page-hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 64px;
  background: linear-gradient(to top, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.hh-page-hero-title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: .5px;
  text-shadow: 0 2px 10px rgba(15, 23, 42, .25);
}
.hh-page-hero-sub {
  position: relative;
  z-index: 1;
  margin: .5rem 0 0;
  font-size: .95rem;
  opacity: .92;
}

/* ---------- 通用页面卡片 ---------- */
.hh-page-card {
  border: 1px solid var(--border-color-main);
  border-radius: var(--border-radius-large);
  background: var(--bg-color-main);
  box-shadow: var(--shadow-box-small);
}
.hh-page-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--font-color-main);
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--border-color-main);
}
.hh-page-card-title .iconfont { color: var(--color-primary); }
.hh-page-card-count { font-size: .8rem; font-weight: 500; color: var(--font-color-muted); }

/* ---------- 标签云（大号，对应 ripro tags/） ---------- */
.tag-cloud-lg {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  line-height: 2.1;
}
.tag-cloud-lg .tag-item {
  display: inline-flex;
  align-items: baseline;
  gap: .2rem;
  padding: .28rem .85rem;
  font-weight: 600;
  color: var(--font-color-main);
  background: var(--bg-color-secondary);
  border: 1px solid var(--border-color-main);
  border-radius: 999px;
  text-decoration: none;
  transition: all .22s ease;
}
.tag-cloud-lg .tag-item:hover {
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 111, 245, .28);
}
.tag-cloud-lg .hh-tag-count {
  font-size: .68em;
  font-weight: 700;
  color: var(--color-primary);
  opacity: .85;
}
.tag-cloud-lg .tag-item:hover .hh-tag-count { color: #fff; opacity: .9; }

/* ---------- 专题合集（对应 ripro series/） ---------- */
.hh-series-grid { margin: 0 -.5rem; }
.hh-series-grid > [class*="col-"] { padding: 0 .5rem; }
.hh-series-card {
  display: block;
  margin-bottom: 1rem;
  border-radius: var(--border-radius-large);
  overflow: hidden;
  background: var(--bg-color-main);
  border: 1px solid var(--border-color-main);
  box-shadow: var(--shadow-box-small);
  text-decoration: none;
  transition: transform .22s ease, box-shadow .22s ease;
}
.hh-series-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(59, 111, 245, .18);
}
.hh-series-cover {
  position: relative;
  width: 100%;
  padding-top: 56%;
  overflow: hidden;
}
.hh-series-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.hh-series-card:hover .hh-series-cover img { transform: scale(1.06); }
.hh-series-count {
  position: absolute;
  right: .6rem;
  bottom: .6rem;
  z-index: 1;
  padding: .15rem .6rem;
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, .62);
  border-radius: 999px;
  backdrop-filter: blur(2px);
}
.hh-series-body { padding: .7rem .85rem .85rem; }
.hh-series-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--font-color-main);
}
.hh-series-desc {
  margin-top: .25rem;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--font-color-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 视频中心（对应 ripro mediasc） ---------- */
.hh-video-grid { margin: 0 -.5rem; }
.hh-video-grid > [class*="col-"] { padding: 0 .5rem; }
.hh-video-card {
  display: block;
  margin-bottom: 1rem;
  text-decoration: none;
  transition: transform .22s ease;
}
.hh-video-card:hover { transform: translateY(-3px); }
.hh-video-cover {
  position: relative;
  width: 100%;
  padding-top: 56%;
  overflow: hidden;
  border-radius: var(--border-radius-large);
  background: #0f172a;
  box-shadow: var(--shadow-box-small);
}
.hh-video-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease, opacity .3s ease;
}
.hh-video-card:hover .hh-video-cover img { transform: scale(1.05); opacity: .9; }
.hh-video-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px; height: 54px;
  border-radius: 50%;
  color: #fff;
  background: rgba(59, 111, 245, .92);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .35);
  transition: transform .2s ease, background .2s ease;
}
.hh-video-card:hover .hh-video-play { transform: translate(-50%, -50%) scale(1.08); background: #3b82f6; }
.hh-video-title {
  margin-top: .5rem;
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--font-color-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hh-video-card:hover .hh-video-title { color: var(--color-primary); }
.hh-video-meta {
  display: flex;
  gap: .8rem;
  margin-top: .3rem;
  font-size: .76rem;
  color: var(--font-color-muted);
}
.hh-video-meta .iconfont { margin-right: .2rem; }

/* ---------- 分类页横幅（覆盖 style.min.css .category-box，ripro 风格） ---------- */
.card.category-box {
  border: none;
  border-radius: var(--border-radius-large);
  overflow: hidden;
  height: 13.5rem;
  box-shadow: var(--shadow-box-small);
}
.card.category-box .category-item {
  background: linear-gradient(to top, rgba(15, 23, 42, .85) 0%, rgba(15, 23, 42, .25) 55%, rgba(15, 23, 42, 0) 100%);
}
.card.category-box .category-info {
  justify-content: flex-end;
  align-items: flex-start;
  text-align: left;
  padding: 1.1rem 1.3rem;
}
.card.category-box .category-name {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(15, 23, 42, .4);
}
.card.category-box .category-desc {
  color: rgba(255, 255, 255, .9);
  font-weight: 500;
  margin-top: .35rem;
}

/* ---------- 文章页面包屑（ripro 风格：小号、蓝色链接、柔和分隔） ---------- */
.yyds-crumb {
  padding: .55rem .8rem;
  margin-bottom: 12px;
  border: 1px solid var(--border-color-main);
  border-radius: 999px;
  background: var(--bg-color-secondary);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--font-color-muted);
}
.yyds-crumb a { color: var(--color-primary); }
.yyds-crumb a:hover { color: #274bb0; text-decoration: underline; }
.yyds-crumb-sep {
  margin: 0 7px;
  font-style: normal;
  color: var(--border-color-strong, #cfd6e4);
}
.yyds-crumb-current { color: var(--font-color-main); font-weight: 600; }

/* ---------- 文章内视频框（ripro 风格：圆角 + 阴影 + 暗底） ---------- */
.post-content .video-box,
.markdown-body .video-box {
  position: relative;
  overflow: hidden;
  text-align: center;
  margin: 1.1rem auto;
  border-radius: var(--border-radius-large);
  background: #0f172a;
  box-shadow: var(--shadow-box-small);
  max-width: 880px;
}
.post-content .video-box .video-content,
.markdown-body .video-box .video-content {
  width: 100%;
  max-height: 70vh;
  border-radius: var(--border-radius-large);
  background: #000;
  display: block;
}

/* ---------- 侧边栏资源下载卡（ripro 风格白卡 + 蓝紫渐变头） ---------- */
.sidebar-download.hh-widget {
  background-image: none;
  background-color: var(--bg-color-main);
  border: 1px solid var(--border-color-main);
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow-box-small);
  overflow: hidden;
}
.sidebar-download.hh-widget .download-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  padding: .75rem 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
}
.sidebar-download.hh-widget .download-title::before { display: none; }
.sidebar-download.hh-widget .download-buttons { padding: .9rem 1rem 1.1rem; }

/* 智能粘性侧边栏：内容高于视口时内部滚动，下载卡常驻顶部、底部信息可达 */
.main-sidebar .sidebar-sticky {
  max-height: calc(100vh - 88px - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.main-sidebar .sidebar-sticky::-webkit-scrollbar { width: 6px; }
.main-sidebar .sidebar-sticky::-webkit-scrollbar-thumb {
  background: var(--border-color-main);
  border-radius: 3px;
}
@media (max-width: 991.98px) {
  .main-sidebar .sidebar-sticky { max-height: none; overflow: visible; }
}

/* 资源信息（解压密码/分类/标签）小字 */
.resource-info {
  margin-top: .9rem;
  padding-top: .8rem;
  border-top: 1px dashed var(--border-color-main);
}
.resource-info-title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--font-color-main);
  margin-bottom: .4rem;
}
.resource-info-list { display: grid; gap: .2rem; }
.resource-info-item {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: .6rem;
  font-size: .78rem;
  align-items: baseline;
}
.resource-info-item .ri-key { color: var(--font-color-muted); }
.resource-info-item .ri-val {
  color: var(--font-color-main);
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 锁定封面：价格徽标（ripro 风格大号蓝价） */
.hh-dl-cover-price {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  color: #ef4444;
  text-shadow: 0 2px 8px rgba(239, 68, 68, .22);
}
.hh-dl-cover-coupon {
  font-size: 12px;
  font-weight: 600;
  color: #f59e0b;
}

/* ---------- [hide] 付费隐藏内容遮罩（对应 ripro 付费内容） ---------- */
.hh-hide-box {
  position: relative;
  margin: 1.1rem 0;
  padding: 1.4rem 1.2rem;
  border: 1px dashed var(--color-primary);
  border-radius: var(--border-radius-large);
  background: var(--bg-color-secondary);
  overflow: hidden;
  text-align: center;
}
.hh-hide-preview {
  font-size: .9rem;
  line-height: 1.7;
  color: var(--font-color-muted);
}
.hh-hide-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  margin-top: 1rem;
}
.hh-hide-ico { font-size: 1.6rem; line-height: 1; }
.hh-hide-title { font-size: 1.05rem; font-weight: 700; color: var(--font-color-main); }
.hh-hide-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: #ef4444;
}
.hh-hide-btn {
  margin-top: .3rem;
  padding: .55rem 1.6rem;
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  box-shadow: 0 6px 16px rgba(59, 111, 245, .3);
  transition: transform .18s ease, box-shadow .18s ease;
}
.hh-hide-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(59, 111, 245, .4); }

/* ---------- 暗色模式微调 ---------- */
:root[data-theme=dark] .hh-page-hero::after {
  background: linear-gradient(to top, var(--bg-color-body), rgba(255, 255, 255, 0));
}
:root[data-theme=dark] .tag-cloud-lg .tag-item { background: var(--bg-color-secondary); }
