:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --card: #1c2128;
  --text: #e6edf3;
  --text2: #8b949e;
  --text3: #6e7681;
  --line: #30363d;
  --accent: #3fb950;
  --accent2: #e8433f;
  --melon: #ff6b6b;
  --radius: 12px;
  --max: 960px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --item-h: 96px;
  --visible-items: 10;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,17,23,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #238636);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.brand-text { font-size: 16px; font-weight: 700; }
.brand-text small { display: block; font-size: 11px; font-weight: 400; color: var(--text3); font-family: var(--mono); }
.brand a { color: inherit; text-decoration: none; }
.topnav { display: flex; gap: 6px; flex-wrap: wrap; }
.topnav a {
  font-size: 13px; color: var(--text2); padding: 6px 12px;
  border-radius: 8px; border: 1px solid transparent;
}
.topnav a:hover { color: var(--text); border-color: var(--line); background: var(--bg2); text-decoration: none; }

.page { max-width: var(--max); margin: 0 auto; padding: 24px 20px 56px; }

.hero { margin-bottom: 24px; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  background: rgba(63,185,80,.1); border: 1px solid rgba(63,185,80,.25);
  padding: 4px 12px; border-radius: 980px; margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 800; letter-spacing: -.03em;
  line-height: 1.25; margin-bottom: 12px;
}
.hero-lead { font-size: 16px; color: var(--text2); max-width: 640px; line-height: 1.7; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 18px;
}
.card-label {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  color: var(--accent); letter-spacing: .06em; text-transform: uppercase;
  margin-bottom: 8px;
}
.card-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.card-sub { font-size: 14px; color: var(--text2); margin-bottom: 16px; line-height: 1.6; }

/* 分类 Tab */
.cat-tabs {
  display: flex; gap: 8px; flex-wrap: nowrap;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 4px; scrollbar-width: thin;
}
.cat-tabs::-webkit-scrollbar { height: 4px; }
.cat-tabs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.cat-tab {
  appearance: none; border: 1px solid var(--line);
  background: var(--bg); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 10px 16px; border-radius: 10px;
  color: var(--text2); white-space: nowrap;
  transition: all .15s; flex-shrink: 0;
}
.cat-tab:hover { border-color: var(--accent); color: var(--accent); }
.cat-tab.is-active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.cat-tab-count {
  display: inline-block; font-size: 11px; font-weight: 700;
  margin-left: 6px; padding: 1px 6px; border-radius: 980px;
  background: rgba(255,255,255,.15);
}
.cat-tab:not(.is-active) .cat-tab-count {
  background: rgba(63,185,80,.12); color: var(--accent);
}

.date-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 14px;
}
.date-bar input {
  font: inherit; font-size: 14px; padding: 8px 12px;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text);
}
.btn {
  appearance: none; border: 1px solid var(--line); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px;
  background: var(--bg2); color: var(--text);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-src { background: rgba(63,185,80,.12); border-color: rgba(63,185,80,.3); color: var(--accent); flex-shrink: 0; }
.btn-src:hover { filter: brightness(1.1); text-decoration: none; color: var(--accent); }
.btn:hover { filter: brightness(1.08); }

.meta { font-size: 13px; color: var(--text3); margin-bottom: 12px; }

/* 吃瓜视频网格：PC 3 列 */
.card--videos { border-color: rgba(63,185,80,.35); }
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.video-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column;
  color: inherit; text-decoration: none;
}
.video-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.video-cover-wrap {
  position: relative; aspect-ratio: 3 / 4;
  background: var(--bg2); overflow: hidden;
}
.video-play-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: #fff;
  background: rgba(0,0,0,.28);
  opacity: 0; transition: opacity .15s;
  pointer-events: none;
}
.video-card:hover .video-play-icon { opacity: 1; }
.video-cover {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.video-cover-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; background: rgba(63,185,80,.08);
}
.video-status {
  position: absolute; top: 8px; right: 8px;
  font-size: 11px; font-weight: 700; padding: 3px 8px;
  border-radius: 6px; background: rgba(0,0,0,.65); color: #fff;
}
.video-body { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; }
.video-title {
  font-size: 15px; font-weight: 700; line-height: 1.45; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.video-desc {
  font-size: 12px; color: var(--text2); line-height: 1.55; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.video-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; font-size: 11px; color: var(--text3);
}
.video-tag {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 4px; background: rgba(232,67,63,.15); color: var(--accent2);
}
.video-more-wrap {
  text-align: center; margin-top: 18px;
}
.video-more-btn { min-width: 160px; padding: 12px 28px; }

@media (max-width: 900px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .video-grid { grid-template-columns: 1fr; }
}

/* 列表滚动区：默认可见约 10 条 */
.news-scroll {
  max-height: calc(var(--item-h) * var(--visible-items));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.scroll-hint {
  text-align: center; font-size: 12px; color: var(--text3);
  margin-top: 10px; font-family: var(--mono);
}

.news-list { list-style: none; }
.list-empty, .list-loading {
  text-align: center; padding: 40px 16px; color: var(--text3); font-size: 14px;
}

.news-card {
  display: flex; align-items: stretch; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.news-card:last-child { border-bottom: 0; }

.news-card-main {
  flex: 1; display: flex; gap: 12px; align-items: flex-start;
  min-width: 0; cursor: pointer; border: none; background: none;
  font: inherit; color: inherit; text-align: left; padding: 0;
  border-radius: 8px; transition: background .12s;
}
.news-card-main:hover { background: rgba(63,185,80,.06); }

.news-rank {
  flex: 0 0 28px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 12px; font-weight: 800;
  background: var(--bg2); color: var(--text2); font-family: var(--mono);
  margin-top: 4px;
}
.news-card:nth-child(-n+3) .news-rank {
  background: linear-gradient(135deg, var(--melon), var(--accent2));
  color: #fff;
}

.news-thumb {
  flex: 0 0 72px; width: 72px; height: 72px;
  border-radius: 8px; object-fit: cover; background: var(--bg2);
}
.news-ph {
  flex: 0 0 72px; width: 72px; height: 72px;
  border-radius: 8px; background: rgba(63,185,80,.08);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}

.news-body { flex: 1; min-width: 0; }
.news-title {
  font-size: 15px; font-weight: 600; line-height: 1.45; margin-bottom: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-info { font-size: 12px; color: var(--text3); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.news-tag {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px;
  background: rgba(232,67,63,.12); color: var(--accent2);
}

.about p { font-size: 14px; color: var(--text2); line-height: 1.7; margin-bottom: 10px; }
.about ul { margin: 12px 0 0 18px; color: var(--text2); font-size: 14px; }
.about li { margin-bottom: 6px; }

.footer {
  text-align: center; font-size: 12px; color: var(--text3);
  padding: 24px 0 8px; border-top: 1px solid var(--line); margin-top: 8px;
}

/* 详情弹窗 */
.modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; opacity: 0; visibility: hidden; transition: .2s;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.75);
}
.modal-panel {
  position: relative; z-index: 1;
  width: min(560px, 100%); max-height: 90vh;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
}
.modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff; font-size: 20px; cursor: pointer;
}
.modal-body {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 20px;
}

.ad-slot {
  margin-bottom: 16px;
  text-align: center;
}
.ad-slot:empty {
  min-height: 80px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text3); font-family: var(--mono);
}
.ad-slot:empty::before { content: '广告位（预留）'; }
.ad-banner {
  width: 88%; max-width: 100%;
  height: auto; border-radius: 10px;
  cursor: pointer; display: block; margin: 0 auto;
}
@media (max-width: 640px) {
  .ad-banner { width: 100%; }
}

.modal-cover {
  display: block; width: 100%; height: auto;
  border-radius: 10px; margin-bottom: 16px;
  background: var(--bg);
}
.modal-badge {
  display: inline-block; font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 980px; margin-bottom: 10px;
  background: linear-gradient(135deg, var(--melon), var(--accent2)); color: #fff;
}
.modal-title {
  font-size: 20px; font-weight: 800; line-height: 1.35;
  margin-bottom: 12px; letter-spacing: -.02em;
}
.modal-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
  font-size: 13px; color: var(--text2);
}
.modal-meta span { padding: 4px 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.modal-meta .heat { color: var(--accent2); border-color: rgba(232,67,63,.3); }

.modal-facts { margin-bottom: 18px; }
.modal-facts div {
  display: grid; grid-template-columns: 80px 1fr; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.modal-facts dt { color: var(--text3); font-weight: 600; }
.modal-facts dd { color: var(--text); word-break: break-all; }
.modal-facts a { word-break: break-all; }

.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; min-width: 120px; padding: 12px; }

@media (max-width: 640px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; }
  .card { padding: 18px 16px; }
  .news-card { flex-direction: column; gap: 8px; }
  .news-card .btn-src { width: 100%; padding: 10px; }
  .news-thumb, .news-ph { width: 64px; height: 64px; flex-basis: 64px; }
  :root { --item-h: 110px; }
}

/* 播放页 */
.back-link { font-size: 13px; color: var(--text2); white-space: nowrap; }
.page--play { max-width: 800px; }
.crumb { font-size: 13px; color: var(--text3); margin-bottom: 16px; line-height: 1.6; }

.pass-gate { text-align: center; max-width: 420px; margin: 40px auto; }
.pass-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.pass-form--inline { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.pass-form--inline .pass-input { flex: 1; min-width: 160px; max-width: 240px; }
.pass-input {
  font: inherit; font-size: 16px; padding: 12px 16px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); text-align: center;
  letter-spacing: .2em;
}
.pass-err { color: var(--accent2); font-size: 13px; margin-top: 10px; }
.btn-ghost { background: rgba(255,255,255,.08); border: 1px solid var(--line); }

.source-panel { margin-top: 16px; }
.source-facts { margin-top: 16px; }

.player-wrap {
  position: relative; background: #000; border-radius: 12px;
  overflow: hidden; margin-bottom: 18px;
}
.player-wrap video {
  display: block; width: 100%; aspect-ratio: 16/9;
  background: #000; max-height: 56vh;
}
.player-tip {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); font-size: 14px; background: rgba(0,0,0,.6);
}
.play-title { font-size: clamp(20px, 4vw, 26px); font-weight: 800; margin-bottom: 12px; line-height: 1.35; }
.play-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-size: 13px; color: var(--text2); }
.play-meta span { padding: 4px 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.play-meta .heat { color: var(--accent2); border-color: rgba(232,67,63,.3); }
.play-desc { font-size: 15px; color: var(--text2); line-height: 1.65; margin-bottom: 18px; }
.play-facts { margin-bottom: 18px; }
.play-actions { display: flex; flex-wrap: wrap; gap: 10px; }
