/* ============================================
   火耳周边游 · 官网 SSR 内容页样式（/news /news/:slug /faq /404）
   配套 server/src/modules/website/website-templates.ts 输出的 class；
   token 全部复用 style.css :root（纸暖墨香），不新造颜色/圆角/阴影。
   桌面优先，降档断点 1024 / 900 / 480（与 style.css 一致）。
   ============================================ */

/* ---- 页面骨架（--max-width 居中由内层 .container 承担） ---- */
.page-main { padding: calc(var(--nav-height) + 40px) 0 80px; min-height: 60vh; }

/* ---- 面包屑 ---- */
.breadcrumb { font-size: 0.875rem; color: var(--muted); line-height: 1.6; margin-bottom: 28px; overflow-wrap: anywhere; /* 长标题允许断行 */ }
.breadcrumb a { color: var(--ink-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold-text); }
.breadcrumb-sep { margin: 0 8px; }

/* ---- 页头 ---- */
.page-head { max-width: 720px; margin-bottom: 32px; }
.page-title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; margin-bottom: 10px; }
.page-sub { font-size: 1rem; color: var(--ink-2); line-height: 1.8; }

/* ---- 导航激活态（SSR 页当前栏目，坐标 style.css 导航） ---- */
.nav-links a.active { color: var(--ink); font-weight: 700; }
.nav-links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 3px; border-radius: 2px; background: var(--brand);
}

/* ---- 栏目筛选 chips ---- */
.cat-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 18px; font-size: 0.9rem; font-weight: 500;
  color: var(--ink-2); background: var(--card);
  border: 1px solid var(--line-strong); border-radius: 999px;
  text-decoration: none; transition: all 0.2s;
}
.chip:hover { border-color: var(--brand-line); color: var(--gold-text); }
.chip.active { background: var(--grad-brand); border-color: transparent; color: var(--on-brand); font-weight: 700; box-shadow: var(--shadow-brand); }

/* ---- 文章卡片列表 ---- */
.article-list { display: flex; flex-direction: column; gap: 20px; }
.article-card {
  display: grid; grid-template-columns: 320px 1fr;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: all 0.25s ease;
}
.article-card:hover,
.article-card:focus-within { transform: translateY(-3px); border-color: var(--brand-line); box-shadow: var(--shadow-brand); }
.article-card-cover { display: block; overflow: hidden; }
.article-card-cover img { width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.35s ease; }
.article-card:hover .article-card-cover img { transform: scale(1.04); }
.article-card-cover-placeholder { width: 100%; height: 100%; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--brand-soft) 0%, var(--brand-line) 100%); }
.article-card-body { display: flex; flex-direction: column; gap: 8px; padding: 20px 24px; }
.article-card-title { font-size: 1.12rem; font-weight: 700; line-height: 1.5; }
.article-card-title a { color: var(--ink); text-decoration: none; transition: color 0.2s; }
.article-card-title a:hover { color: var(--gold-text); }
.article-card-summary {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 0.92rem; color: var(--ink-2); line-height: 1.75;
}
.article-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 8px; font-size: 0.875rem; color: var(--muted); }
/* 栏目标签：列表卡片与详情页共用 */
.article-card-cat,
.article-cat { color: var(--gold-text); background: var(--brand-soft); border-radius: 999px; padding: 1px 10px; font-weight: 600; }

/* ---- 文章详情（760px 阅读宽） ---- */
.article-detail { max-width: 760px; }
.article-title { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; line-height: 1.35; letter-spacing: -0.01em; margin-bottom: 14px; }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; font-size: 0.875rem; color: var(--muted); padding-bottom: 18px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.article-author { color: var(--ink-2); font-weight: 500; }

/* 正文排版：行高 1.8+、段间距清晰 */
.article-body { font-size: 1.02rem; }
.article-body p { line-height: 1.85; margin-bottom: 1.4em; }
.article-figure { margin: 28px 0; }
.article-figure img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.article-video { display: block; width: 100%; max-width: 100%; margin: 28px 0; border-radius: var(--radius); background: var(--deep); }

/* 位置块：品牌淡底卡片 + 图标行 */
.article-location {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px;
  margin: 24px 0; padding: 14px 18px;
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm); font-size: 0.92rem;
}
.article-location-icon { width: 18px; height: 18px; flex-shrink: 0; align-self: center; color: var(--gold-text); }
.article-location-icon svg { display: block; width: 100%; height: 100%; }
.article-location-name { font-weight: 700; }
.article-location-text { color: var(--ink-2); }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.tag { font-size: 0.875rem; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; }

/* ---- 相关阅读（与正文同宽 760px） ---- */
.related-articles { max-width: 760px; margin-top: 48px; }
.related-articles h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 16px; }
.related-list { list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.related-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 14px 20px; }
.related-list li + li { border-top: 1px solid var(--line); }
.related-list a { color: var(--ink); font-size: 0.95rem; line-height: 1.6; text-decoration: none; }
.related-list a:hover { color: var(--gold-text); }
.related-list time { flex-shrink: 0; font-size: 0.875rem; color: var(--muted); }

/* ---- 结尾 CTA：品牌渐变底卡 ---- */
.article-cta { margin-top: 48px; padding: 36px 32px; text-align: center; background: var(--grad-brand); border-radius: var(--radius-lg); box-shadow: var(--shadow-brand); }
.article-cta p { font-size: 1.05rem; font-weight: 600; color: var(--on-brand); line-height: 1.7; margin-bottom: 18px; }
/* 渐变底上的主按钮反转为墨底，避免与底色相融 */
.article-cta .btn-primary { background: var(--ink); color: var(--paper); box-shadow: var(--shadow); }
.article-cta .btn-primary:hover { filter: brightness(1.2); }

/* ---- FAQ：页首目录卡 ---- */
.faq-toc {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px;
  padding: 26px 28px; margin-bottom: 40px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.faq-toc-cat { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; font-weight: 800; margin-bottom: 10px; }
.faq-toc-cat::before { content: ''; width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--brand); }
.faq-toc-group ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.faq-toc-group a { color: var(--ink-2); font-size: 0.875rem; line-height: 1.6; text-decoration: none; }
.faq-toc-group a:hover { color: var(--gold-text); text-decoration: underline; text-underline-offset: 2px; }

/* ---- FAQ：分组手风琴（details/summary） ---- */
.faq-group { margin-bottom: 36px; }
.faq-group-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 16px; padding-left: 12px; border-left: 4px solid var(--brand); border-radius: 2px; }
.faq-item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: 10px; scroll-margin-top: calc(var(--nav-height) + 16px); /* 锚点跳转避开固定导航 */
  transition: border-color 0.2s, box-shadow 0.2s;
}
.faq-item[open] { border-color: var(--brand-line); box-shadow: var(--shadow-sm); }
.faq-question {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; font-size: 0.98rem; font-weight: 600; cursor: pointer; user-select: none;
}
.faq-question::-webkit-details-marker { display: none; }
/* +/- 指示：展开时旋转成 × */
.faq-question::after { content: '+'; flex-shrink: 0; width: 24px; font-size: 1.4rem; font-weight: 400; line-height: 1; text-align: center; color: var(--muted); transition: transform 0.25s ease, color 0.2s; }
.faq-item[open] .faq-question::after { transform: rotate(45deg); color: var(--gold-text); }
/* 答案区：品牌黄左边界 */
.faq-answer { margin: 0 20px 18px; padding: 12px 0 2px 14px; border-left: 3px solid var(--brand); font-size: 0.92rem; color: var(--ink-2); line-height: 1.8; overflow-wrap: anywhere; /* 长 URL 允许断行 */ }
.faq-answer a { color: var(--gold-text); text-decoration: underline; text-underline-offset: 2px; }
.faq-answer a:hover { color: var(--brand-text); }

/* ---- 分页 ---- */
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px; font-size: 0.9rem;
  color: var(--ink-2); background: var(--card); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); text-decoration: none; transition: all 0.2s;
}
a.page-link:hover { border-color: var(--brand-line); color: var(--gold-text); }
.page-link.current { background: var(--grad-brand); border-color: transparent; color: var(--on-brand); font-weight: 700; }
.page-link.disabled { color: var(--muted); background: transparent; border-color: var(--line); opacity: 0.6; }
.page-prev,
.page-next { font-weight: 600; }
.page-ellipsis { padding: 0 4px; color: var(--muted); }

/* ---- 空态 / 404 ---- */
.empty-state { padding: 56px 24px; text-align: center; font-size: 0.95rem; color: var(--muted); background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.notfound { max-width: 560px; margin: 0 auto; padding: 48px 0 32px; text-align: center; }
.notfound-title { font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 800; margin-bottom: 12px; }
.notfound-desc { color: var(--ink-2); margin-bottom: 28px; }
.notfound-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
/* 模板里第二个按钮只有 .btn（无修饰类），补成 btn-secondary 的描边样式 */
.notfound-actions .btn:not(.btn-primary) { color: var(--ink); border: 1.5px solid var(--line-strong); }
.notfound-actions .btn:not(.btn-primary):hover { border-color: var(--ink); }

/* ---- 键盘可见焦点（WCAG 2.2 AA） ---- */
.breadcrumb a:focus-visible,
.chip:focus-visible,
.faq-toc-group a:focus-visible,
.faq-question:focus-visible,
.related-list a:focus-visible,
.page-link:focus-visible,
.article-card-title a:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 2px; border-radius: 4px; }

/* ---- 减弱动效偏好 ---- */
@media (prefers-reduced-motion: reduce) {
  .article-card, .article-card-cover img, .chip, .page-link, .faq-item, .faq-question::after { transition: none; }
  .article-card:hover, .article-card:focus-within, .article-card:hover .article-card-cover img { transform: none; }
}

/* ---- 降档断点（与 style.css 一致） ---- */
@media (max-width: 1024px) {
  .article-card { grid-template-columns: 280px 1fr; }
}

@media (max-width: 900px) {
  .page-main { padding: calc(var(--nav-height) + 28px) 0 64px; }
  .article-card { grid-template-columns: 1fr; } /* 卡片降单列：封面上置 16:9 */
  .article-card-cover img,
  .article-card-cover-placeholder { height: auto; aspect-ratio: 16 / 9; }
  .faq-toc { grid-template-columns: 1fr; gap: 20px; padding: 22px; }
}

@media (max-width: 480px) {
  .page-main { padding: calc(var(--nav-height) + 24px) 0 56px; }
  .breadcrumb { margin-bottom: 22px; }
  .page-head { margin-bottom: 24px; }
  .article-card-body { padding: 16px 18px 18px; }
  .article-body { font-size: 1rem; }
  .article-meta { gap: 10px; }
  .article-cta { margin-top: 40px; padding: 28px 20px; }
  .article-cta p { font-size: 1rem; }
  .faq-question { padding: 14px 16px; font-size: 0.95rem; }
  .faq-answer { margin: 0 16px 16px; }
  .related-list li { flex-direction: column; gap: 2px; }
  .pagination { gap: 6px; }
  .page-link { min-width: 36px; height: 36px; padding: 0 10px; }
}
