/* ══════════════════════════════════════════════════════════
   云影盘 · 模板补充样式
   main.css 里已包含绝大部分视觉；这里只补模板新增的几块：
   轮播、题材按钮、我的分组页签、加载更多、评论区、正文排版
   ══════════════════════════════════════════════════════════ */

/* ── 首页题材快捷筛选 ───────────────────────────────── */
.genre-chip {
  position: relative;
  flex-shrink: 0;
  white-space: nowrap;
  cursor: pointer;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--muted-foreground);
  background: transparent;
  border: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.genre-chip:hover {
  color: var(--foreground);
}

.genre-chip.is-on {
  color: var(--card);
  font-weight: 700;
  background: var(--foreground);
}

/* ── 焦点轮播 ───────────────────────────────────────── */
.yp-hero .yp-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 600ms ease, visibility 600ms;
}

.yp-hero .yp-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.yp-hero .yp-slide .feature-hero-inner {
  animation: yp-slide-in 420ms ease both;
}

@keyframes yp-slide-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.feature-poster-link {
  display: none;
  flex: 0 0 auto;
}

@media (min-width: 640px) {
  .feature-poster-link {
    display: block;
  }
}

.yp-hero .feature-poster {
  cursor: pointer;
  transition: transform 220ms ease;
}

.yp-hero .feature-poster:hover {
  transform: translateY(-2px);
}

.yp-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--r-tag);
  background: var(--gold);
  color: var(--gold-foreground);
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.yp-cta:hover {
  background: #ffffff;
  color: #0b0d11;
}

.yp-dots button {
  width: 6px;
  height: 3px;
  padding: 0;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.32);
  transition: width 240ms ease, background-color 240ms ease;
}

.yp-dots button.is-on {
  width: 16px;
  background: var(--gold);
}

/* ── 我的：分组页签 ─────────────────────────────────── */
.yp-tabs {
  padding-bottom: 1px;
}

.yp-tab {
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 9px 2px;
  margin-right: 22px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--muted-foreground);
  transition: color 160ms ease, border-color 160ms ease;
}

.yp-tab:hover {
  color: var(--foreground);
}

.yp-tab.is-on {
  color: var(--foreground);
  border-bottom-color: var(--gold);
}

.yp-tab b {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  margin-left: 2px;
  opacity: 0.7;
}

/* ── 加载更多 ───────────────────────────────────────── */
.yp-load-more {
  padding: 8px 22px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--r-tag);
  background: var(--card);
  color: var(--foreground);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.yp-load-more:hover {
  border-color: var(--foreground);
}

.yp-load-more b {
  font-variant-numeric: tabular-nums;
}

/* ── 评论区 ─────────────────────────────────────────── */
.yp-comment {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.yp-comment:first-child {
  border-top: 1px solid var(--border);
}

.yp-comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.yp-comment-head b {
  font-size: 12.5px;
  font-weight: 700;
}

.yp-comment-head span {
  font-size: 10.5px;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.yp-comment-body {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--foreground);
  opacity: 0.86;
  overflow-wrap: anywhere;
}

.yp-comment-children {
  margin: 8px 0 0 12px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

.yp-comment-child {
  border-bottom: none;
  padding: 8px 0 0;
}

.yp-comment-pager {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--muted-foreground);
}

.yp-comment-pager a {
  color: inherit;
  margin-right: 8px;
}

/* ── 正文排版（文章正文 / 独立页面） ────────────────── */
.markdown p {
  margin: 0 0 0.9em;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4 {
  margin: 1.4em 0 0.6em;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.markdown h1 {
  font-size: 1.35em;
}

.markdown h2 {
  font-size: 1.2em;
}

.markdown h3 {
  font-size: 1.06em;
}

.markdown ul,
.markdown ol {
  margin: 0 0 0.9em;
  padding-left: 1.4em;
  list-style: revert;
}

.markdown li {
  margin-bottom: 0.3em;
}

.markdown img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-tag);
  margin: 0.6em 0;
}

.markdown a {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown blockquote {
  margin: 0 0 0.9em;
  padding: 8px 14px;
  border-left: 3px solid var(--gold);
  background: var(--panel-bg);
  color: var(--muted-foreground);
}

.markdown code {
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--secondary);
  font-size: 0.92em;
}

.markdown pre {
  padding: 12px 14px;
  overflow-x: auto;
  border-radius: var(--r-tag);
  background: var(--secondary);
  margin-bottom: 0.9em;
}

.markdown table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.9em;
  font-size: 0.94em;
}

.markdown th,
.markdown td {
  padding: 7px 10px;
  border: 1px solid var(--border);
  text-align: left;
}

/* ── 移动端细节 ─────────────────────────────────────── */
@media (max-width: 639px) {
  .yp-hero .feature-hero-inner {
    padding: 0 18px;
    gap: 0;
  }

  .yp-hero .feature-text {
    max-width: 100%;
  }

  .yp-hero .feature-text p {
    display: none;
  }

  .yp-tab {
    font-size: 13px;
    margin-right: 16px;
  }

  .detail-hero-inner {
    padding: 18px var(--site-pad-x);
  }
}
