:root {
  --bg: #ffffff;
  --fg: #1f2328;
  --muted: #5b6570;
  --line: #e4e7eb;
  --card: #f7f8fa;
  --accent: #1a6fc4;
  --radius: 10px;
  --maxw: 1200px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans", "Noto Sans", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 700; font-size: 18px; color: var(--fg); }
.main-nav { display: flex; gap: 14px; flex-wrap: wrap; }
.main-nav a { color: var(--muted); font-size: 14px; }
.search-form { display: flex; gap: 6px; margin-left: auto; }
.search-form input { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; min-width: 180px; }
.search-form button { padding: 6px 12px; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 6px; cursor: pointer; }

/* language switcher */
.lang-switcher { position: relative; }
.lang-switcher summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 14px; }
.lang-switcher summary::-webkit-details-marker { display: none; }
.lang-switcher ul { position: absolute; right: 0; top: 100%; margin: 4px 0 0; padding: 6px; list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.08); min-width: 150px; z-index: 30; }
.lang-switcher li a { display: block; padding: 6px 10px; color: var(--fg); font-size: 14px; border-radius: 4px; }
.lang-switcher li a:hover, .lang-switcher li a.active { background: var(--card); }

/* hero */
.hero { padding: 40px 0 8px; }
.hero h1 { font-size: 28px; margin: 0 0 8px; }

/* sections */
.section { margin: 32px 0; }
.section h2 { font-size: 20px; margin: 0 0 16px; }

/* category grid */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.cat-card { display: flex; justify-content: space-between; align-items: center; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--fg); }
.cat-card:hover { text-decoration: none; border-color: var(--accent); }
.cat-name { font-weight: 600; }
.cat-count { color: var(--muted); font-size: 13px; }

/* video grid + card */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.video-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.video-card .thumb { display: block; aspect-ratio: 16/9; background: #e9ecf0; }
.video-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-placeholder { width: 100%; height: 100%; }
.card-title { font-size: 15px; margin: 10px 12px 6px; line-height: 1.4; }
.card-title a { color: var(--fg); }
.card-desc { font-size: 13px; color: var(--muted); margin: 0 12px 12px; }

/* detail */
.video-detail { margin: 24px 0; }
.detail-title { font-size: 24px; margin: 0 0 16px; line-height: 1.3; }
.player-wrap { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player { width: 100%; height: 100%; border: 0; display: block; }
.player-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; text-align: center; color: #fff; padding: 20px; background: #111; }
.btn { display: inline-block; padding: 8px 16px; background: var(--accent); color: #fff; border-radius: 6px; }
.meta-list { list-style: none; display: flex; flex-wrap: wrap; gap: 18px; padding: 0; margin: 16px 0; font-size: 14px; }
.meta-list .k { color: var(--muted); margin-right: 6px; }
.summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.summary-body { white-space: pre-wrap; }
.source-link { font-size: 14px; }

/* pagination */
.pagination { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 28px 0; }
.pagination .cur { color: var(--muted); }

/* prose (trust pages) */
.prose p { max-width: 70ch; color: var(--fg); }
.empty { color: var(--muted); }
.contact-email { font-weight: 600; }

/* error */
.error-page { text-align: center; padding: 60px 0; }

/* AdSense 手动广告位：与内容保持距离，避免误贴播放器 */
.ad-wrap {
  margin: 28px 0;
  min-height: 90px;
  display: block;
  overflow: hidden;
  /* 留出可识别边界但不突兀 */
  background: transparent;
}
.ad-wrap ins { display: block; width: 100%; }
/* 内容稀疏页（少卡片时）不给广告位加过多留白 */
.section .ad-wrap:last-child { margin-bottom: 8px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 28px 0; color: var(--muted); font-size: 13px; }
.footer-nav { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; }

/* responsive */
@media (max-width: 640px) {
  .main-nav { display: none; }
  .search-form { width: 100%; }
  .search-form input { flex: 1; }
}
