/* ==========================================================
   core.css · MoviesMatrix 风格锚点 + 全站通用组件
   加载顺序：3（依赖 tokens.css + themes.css）
   包含：重置 / 布局 / 导航 / 页脚 / 按钮 / 卡片 / FAQ /
         评论 / 面包屑 / 四类内链 / EEAT / L3专属 /
         作者头像 / 容器查询 / 移动端响应式
   ========================================================== */

/* ---------- 基础重置 ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  min-height: 100vh;
}
img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { text-decoration: underline; }
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- 排版 ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
  font-weight: var(--font-semibold);
}
h1 {
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--rhythm-loose);
}
h2 {
  font-size: var(--text-2xl);
  margin-top: var(--rhythm-loose);
  margin-bottom: var(--rhythm-normal);
}
h3 { font-size: var(--text-xl); margin: var(--rhythm-normal) 0; }
h4 { font-size: var(--text-lg); margin: var(--rhythm-tight) 0; }
p {
  margin-bottom: var(--rhythm-normal);
  color: var(--color-text-primary);
}
blockquote {
  border-left: 4px solid var(--color-accent);
  padding: var(--rhythm-normal) var(--rhythm-loose);
  margin: var(--rhythm-loose) 0;
  background: var(--color-surface);
  font-family: var(--font-serif);
  font-style: italic;
}

/* ---------- 全局容器 ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-narrow {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- 导航栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(8px);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--gutter);
  max-width: 1200px;
  margin: 0 auto;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  letter-spacing: var(--tracking-tight);
}
.nav-logo:hover { text-decoration: none; color: var(--color-accent); }
.nav-links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: var(--color-text-primary);
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
}
.nav-links a:hover { color: var(--color-accent); text-decoration: none; }
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-primary);
  transition: all var(--duration-normal);
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--rhythm-breath) var(--gutter) var(--rhythm-loose);
  margin-top: var(--rhythm-silence);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--rhythm-loose);
}
.footer-inner h4 {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-text-tertiary);
  margin-bottom: var(--rhythm-normal);
}
.footer-inner ul { list-style: none; }
.footer-inner li { margin-bottom: var(--space-2); }
.footer-inner a { color: var(--color-text-secondary); }
.footer-inner a:hover { color: var(--color-accent); }
.footer-copyright {
  text-align: center;
  margin-top: var(--rhythm-loose);
  padding-top: var(--rhythm-normal);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-tertiary);
  font-size: var(--text-xs);
}

/* ---------- CTA 按钮 ---------- */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  background: var(--color-accent);
  color: #fff;
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: all var(--duration-normal) var(--ease-out);
  min-height: 48px;
  text-align: center;
}
.btn-cta:hover {
  background: var(--color-accent-600, var(--color-accent));
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: #fff;
}
.btn-cta:active { transform: scale(0.97); transition: all 100ms ease; }
.btn-cta:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

/* ---------- 文章卡片 ---------- */
.article-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  container-type: inline-size;
  container-name: card;
}
.article-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.article-card a { display: block; color: inherit; }
.article-card a:hover { text-decoration: none; }
.article-card .card-cover {
  aspect-ratio: 16 / 9;
  width: 100%;
  background: var(--color-neutral-100);
  overflow: hidden;
}
.article-card .card-cover img,
.article-card .card-cover svg { width: 100%; height: 100%; object-fit: cover; }
.article-card .card-body { padding: var(--card-padding); flex: 1; display: flex; flex-direction: column; }
.article-card .card-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
  line-height: var(--leading-snug);
}
.article-card .card-summary {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
  flex: 1;
}
.article-card .card-meta {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}
.article-card .card-score {
  padding: 2px var(--space-2);
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  border-radius: var(--radius-sm);
  font-weight: var(--font-semibold);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  margin-bottom: var(--rhythm-normal);
}
.breadcrumb a { color: var(--color-text-secondary); }
.breadcrumb ol { display: flex; gap: var(--space-2); list-style: none; flex-wrap: wrap; }
.breadcrumb li::after { content: '›'; margin-left: var(--space-2); color: var(--color-text-tertiary); }
.breadcrumb li:last-child::after { content: ''; }
.breadcrumb [aria-current="page"] { color: var(--color-text-primary); font-weight: var(--font-medium); }

/* ---------- FAQ ---------- */
.faq-section {
  margin: var(--rhythm-loose) 0;
}
.faq-section h2 { margin-bottom: var(--rhythm-normal); }
.faq-section details {
  border-bottom: 1px solid var(--color-border);
  padding: var(--rhythm-normal) 0;
}
.faq-section summary {
  font-weight: var(--font-semibold);
  font-size: var(--text-lg);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  min-height: 44px;
}
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::after {
  content: '+';
  font-size: var(--text-xl);
  color: var(--color-accent);
  transition: transform var(--duration-normal);
}
.faq-section details[open] summary::after { transform: rotate(45deg); }
.faq-section details > p,
.faq-section details > div {
  padding-top: var(--rhythm-normal);
  color: var(--color-text-secondary);
}

/* ---------- 评论区 ---------- */
.user-reviews-section {
  margin: var(--rhythm-loose) 0;
  padding: var(--rhythm-loose) 0;
  border-top: 1px solid var(--color-border);
}
.user-reviews-section h3 { margin-bottom: var(--rhythm-normal); }
.review-card {
  display: flex;
  gap: var(--space-4);
  padding: var(--rhythm-normal);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  margin-bottom: var(--rhythm-normal);
}
.review-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary-200);
  color: var(--color-primary-800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-bold);
  flex-shrink: 0;
}
.review-body { flex: 1; }
.review-meta { display: flex; gap: var(--space-3); font-size: var(--text-xs); color: var(--color-text-tertiary); margin-bottom: var(--space-2); }
.review-rating { color: var(--color-warning); }
.review-helpful {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  min-height: 36px;
  transition: all var(--duration-fast);
}
.review-helpful:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ---------- 作者头像（CSS 渐变圆） ---------- */
.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: var(--font-bold);
  font-size: 28px;
  flex-shrink: 0;
}
.avatar-jake-morrison {
  background: linear-gradient(135deg, hsl(220, 40%, 35%), hsl(220, 50%, 55%));
}
.avatar-elena-rodriguez {
  background: linear-gradient(135deg, hsl(280, 35%, 40%), hsl(280, 45%, 60%));
}
.avatar-marcus-chen {
  background: linear-gradient(135deg, hsl(180, 35%, 35%), hsl(180, 45%, 55%));
}
.avatar-priya-sharma {
  background: linear-gradient(135deg, hsl(25, 60%, 45%), hsl(25, 70%, 65%));
}

/* ---------- 作者签名区 ---------- */
.author-signature {
  display: flex;
  gap: var(--space-4);
  padding: var(--rhythm-loose);
  margin: var(--rhythm-loose) 0;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-accent);
}
.author-signature .author-info { flex: 1; }
.author-signature .author-name { font-weight: var(--font-semibold); font-size: var(--text-lg); margin-bottom: var(--space-2); }
.author-signature .author-bio { font-size: var(--text-sm); color: var(--color-text-secondary); margin-bottom: var(--space-2); }
.author-signature .author-conflict { font-size: var(--text-xs); color: var(--color-text-tertiary); padding-top: var(--space-2); border-top: 1px solid var(--color-border); }

/* ---------- E-E-A-T 视觉化组件 ---------- */
.trust-banner {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  margin-bottom: var(--rhythm-normal);
  font-size: var(--text-sm);
  align-items: center;
}
.trust-banner > span { color: var(--color-text-secondary); }
.trust-banner > span + span::before { content: '·'; margin-right: var(--space-2); color: var(--color-text-tertiary); }

.author-credential-card {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  margin-bottom: var(--rhythm-normal);
  align-items: center;
}
.author-credential-card .author-avatar { width: 48px; height: 48px; font-size: 22px; }

.testing-methodology {
  background: var(--color-neutral-50);
  border-radius: var(--radius-md);
  padding: var(--rhythm-normal);
  margin: var(--rhythm-normal) 0;
  font-size: var(--text-sm);
}
.testing-methodology summary { font-weight: var(--font-semibold); cursor: pointer; min-height: 44px; display: flex; align-items: center; }

.conflict-of-interest {
  padding: var(--space-3) var(--space-4);
  background: hsl(40, 90%, 96%);
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius-sm);
  margin: var(--rhythm-normal) 0;
  font-size: var(--text-sm);
}

.article-timestamps {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin: var(--rhythm-normal) 0;
  padding: var(--space-2) 0;
}
.article-timestamps > span { display: inline-flex; align-items: center; gap: 4px; }
.article-timestamps > span + span::before { content: '·'; margin-right: var(--space-2); color: var(--color-text-tertiary); }
.ts-recent { color: var(--color-success); }
.ts-warn { color: var(--color-warning); }
.ts-stale { color: var(--color-error); }

/* ---------- 聚合页模块 ---------- */
.trust-bar {
  display: flex;
  gap: var(--rhythm-normal);
  flex-wrap: wrap;
  padding: var(--rhythm-normal) 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--rhythm-normal);
}
.trust-bar > span { display: inline-flex; align-items: center; gap: 6px; }

.page-alive {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-bottom: var(--rhythm-normal);
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.page-alive .under-review {
  color: var(--color-warning);
  font-weight: var(--font-semibold);
}

.topic-intro {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  margin: var(--rhythm-loose) 0;
  padding: var(--rhythm-normal) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.judgment-framework {
  background: var(--color-primary-50);
  border-left: 4px solid var(--color-primary-500);
  border-radius: var(--radius-md);
  padding: var(--rhythm-normal);
  margin: var(--rhythm-loose) 0;
}
.judgment-framework h2,
.judgment-framework h3 { font-size: var(--text-lg); margin-bottom: var(--space-3); color: var(--color-primary-700); }
.judgment-framework p { margin-bottom: 0; color: var(--color-text-primary); }

.intent-funnel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin: var(--rhythm-loose) 0;
}
.intent-funnel a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  min-height: 48px;
  text-align: center;
  transition: all var(--duration-normal);
}
.intent-funnel a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  text-decoration: none;
}

.editor-picks {
  margin: var(--rhythm-loose) 0;
}
.editor-picks h2 { margin-bottom: var(--rhythm-normal); }
.editor-picks .pick-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--rhythm-normal);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  transition: all var(--duration-normal);
}
.editor-picks .pick-card:hover { background: var(--color-surface-hover); }
.editor-picks .pick-score {
  font-weight: var(--font-semibold);
  color: var(--color-primary-700);
  flex-shrink: 0;
}

.quick-recommend {
  margin: var(--rhythm-loose) 0;
  padding: var(--rhythm-normal);
  background: var(--color-surface);
  border-radius: var(--radius-md);
}
.quick-recommend h3 { margin-top: 0; }

.subcategory-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--rhythm-loose) 0;
}
.subcategory-nav a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  min-height: 40px;
  transition: all var(--duration-normal);
}
.subcategory-nav a:hover {
  background: var(--color-primary-50);
  border-color: var(--color-primary-500);
  color: var(--color-primary-700);
  text-decoration: none;
}

.exploration-hook {
  display: block;
  padding: var(--space-4) var(--space-5);
  margin: var(--rhythm-loose) 0;
  border: 1px solid var(--color-accent-200, var(--color-accent));
  border-radius: var(--radius-md);
  background: var(--color-accent-50, hsl(25, 70%, 97%));
  color: var(--color-accent-700, var(--color-accent));
  font-weight: var(--font-medium);
  position: relative;
  transition: all var(--duration-normal);
}
.exploration-hook::after {
  content: '→';
  float: right;
  transition: transform var(--duration-normal);
}
.exploration-hook:hover {
  border-color: var(--color-accent);
  text-decoration: none;
  transform: translateX(2px);
}
.exploration-hook:hover::after { transform: translateX(4px); }

/* ---------- 四类内链视觉样式 ---------- */
.link-pillar {
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
}
.link-hub2 {
  color: var(--color-primary-700);
  border-bottom: 1px dotted var(--color-primary-300);
}
.link-advanced {
  background: var(--color-primary-50);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  color: var(--color-primary-700);
}
.link-lateral {
  color: var(--color-primary-600);
}
.link-lateral::after { content: ' →'; }
.link-exploration {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-accent-50, hsl(25, 70%, 97%));
  border: 1px solid var(--color-accent-200, var(--color-accent));
  border-radius: var(--radius-sm);
  color: var(--color-accent-700, var(--color-accent));
  font-weight: var(--font-medium);
  font-size: 0.95em;
}

/* ---------- L3 页面专属样式 ---------- */
body.is-l3 {
  background: var(--color-l3-bg);
}
body.is-l3 .site-header,
body.is-l3 .site-footer { display: none; }
.l3-container {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--rhythm-breath) var(--gutter);
}
.l3-header {
  border-bottom: 1px solid var(--color-l3-border);
  padding-bottom: var(--rhythm-normal);
  margin-bottom: var(--rhythm-loose);
}
.l3-header h1 {
  font-size: var(--text-3xl);
  position: relative;
  padding-left: var(--space-5);
}
.l3-header h1::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: var(--color-l3-accent);
  border-radius: var(--radius-sm);
}
.l3-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--rhythm-normal);
  min-height: 44px;
}
.l3-copyright {
  margin-top: var(--rhythm-silence);
  padding-top: var(--rhythm-normal);
  border-top: 1px solid var(--color-l3-border);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  text-align: center;
  font-style: italic;
}

/* ---------- 空状态 ---------- */
.empty-state {
  padding: var(--rhythm-loose);
  text-align: center;
  color: var(--color-text-tertiary);
  font-style: italic;
  background: var(--color-surface);
  border-radius: var(--radius-md);
}

/* ---------- 骨架屏基础 ---------- */
.skeleton {
  background: linear-gradient(90deg,
    var(--skeleton-bg) 0%,
    var(--skeleton-shimmer) 50%,
    var(--skeleton-bg) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer var(--loading-shimmer) ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- 容器查询 ---------- */
@container card (max-width: 320px) {
  .article-card .card-summary { display: none; }
  .article-card .card-title { font-size: var(--text-base); }
}
@container card (min-width: 480px) {
  .article-card .card-title { font-size: var(--text-xl); }
}

/* ---------- 移动端响应式 ---------- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-bg);
    padding: var(--rhythm-normal);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    gap: var(--space-1);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: var(--space-3); min-height: 48px; display: flex; align-items: center; }
  .nav-toggle { display: flex; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .intent-funnel { grid-template-columns: 1fr 1fr; }
  .author-signature { flex-direction: column; }
  .author-avatar { width: 48px; height: 48px; font-size: 22px; }
  .trust-bar { font-size: var(--text-xs); gap: var(--space-3); }
  .topic-intro { font-size: var(--text-base); }
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-xl); }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .intent-funnel { grid-template-columns: 1fr; }
  .review-card { flex-direction: column; }
  .author-signature { padding: var(--rhythm-normal); }
}
