:root {
  --bg: #0d0d0f;
  --bg2: #16161a;
  --card: #1a1a1f;
  --line: #2a2a32;
  --text: #e8e8ec;
  --muted: #9a9aa6;
  --accent: #e8e8ec;
  --zh: #f5c542;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}
a { color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg2); }
.header-inner { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 26px 20px 18px; }
.brand h1 { font-size: 26px; letter-spacing: .5px; font-weight: 700; }
.brand h1 a { text-decoration: none; }
.tagline { color: var(--muted); font-size: 14px; margin-top: 4px; }
.header-stats { color: var(--muted); font-size: 13px; text-align: right; }
.header-stats b { color: var(--text); }

/* toolbar */
.toolbar { position: sticky; top: 0; z-index: 40; background: rgba(13,13,15,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.toolbar-inner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 20px; }
#search {
  flex: 1; min-width: 220px; background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; font-size: 14px; outline: none;
}
#search:focus { border-color: #4a4a58; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button {
  background: var(--card); color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 13px; font-size: 13px; cursor: pointer;
}
.filters button.on { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 600; }

/* grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; padding: 24px 0; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform .15s ease, border-color .15s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); border-color: #44444f; }
.thumb { position: relative; aspect-ratio: 16/9; background: #222; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .num {
  position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.78); color: #fff;
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 6px; letter-spacing: .5px;
}
.thumb .no-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #555; font-size: 34px; font-weight: 800; letter-spacing: 2px; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 14.5px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.badges { display: flex; gap: 5px; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.zh { color: var(--zh); border-color: rgba(245,197,66,.4); }
.sentinel { text-align: center; color: var(--muted); padding: 30px 0 60px; font-size: 13px; }

/* detail */
.detail { position: fixed; inset: 0; background: var(--bg); z-index: 60; overflow-y: auto; }
.detail-bar { position: sticky; top: 0; background: rgba(13,13,15,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); z-index: 5; }
.detail-bar-inner { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 20px; }
#closeDetail { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 14px; }
.detail-links { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-links a { color: var(--muted); font-size: 13px; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; }
.detail-links a:hover { color: var(--text); border-color: #4a4a58; }
.detail-links a.hot { color: var(--zh); border-color: rgba(245,197,66,.4); }
.detail-body { padding: 26px 20px 80px; max-width: 900px; }
.detail-body h2 { font-size: 21px; line-height: 1.4; margin-bottom: 6px; }
.detail-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.video-wrap { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 26px; }
.video-wrap iframe { width: 100%; height: 100%; border: 0; }

/* zh article */
.zh-box { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 8px; }
.zh-label { color: var(--zh); font-size: 13px; font-weight: 700; letter-spacing: 2px; margin: 16px 0 6px; }
.zh-article { font-size: 15.5px; line-height: 1.9; }
.zh-article h2 { font-size: 19px; margin: 30px 0 12px; }
.zh-article h3 { font-size: 16.5px; margin: 24px 0 10px; }
.zh-article p { margin: 12px 0; }
.zh-article strong { color: #fff; }
.zh-article ul, .zh-article ol { padding-left: 22px; margin: 12px 0; }
.zh-article blockquote { border-left: 3px solid var(--line); padding-left: 14px; color: var(--muted); margin: 14px 0; }
.zh-article img { max-width: 100%; border-radius: 10px; }
.zh-pending { color: var(--muted); font-size: 14px; margin-top: 26px; border-top: 1px solid var(--line); padding-top: 24px; }

/* transcript text view */
.transcript-text { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 20px; white-space: pre-wrap; font-size: 14px; line-height: 1.85; color: #c9c9d2; max-height: 70vh; overflow-y: auto; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg2); margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; padding: 26px 20px 34px; }
.footer-note { color: var(--muted); font-size: 13px; max-width: 640px; }
.footer-note a { color: var(--text); }
.footer-links { margin-top: 10px; display: flex; gap: 16px; }
.footer-icons { display: flex; gap: 10px; }
.icon-btn { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 9px 14px; cursor: pointer; font-size: 14px; }
.icon-btn:hover { border-color: #4a4a58; }

/* modals */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; max-width: 320px; width: 100%; text-align: center; position: relative; }
.modal-card img { width: 220px; height: 220px; object-fit: contain; margin: 14px auto; display: block; border-radius: 8px; background: #fff; padding: 6px; }
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; }
.modal-sub { color: var(--muted); font-size: 13px; }
.modal-links { margin-top: 8px; font-size: 13px; }
.modal-links a { color: var(--text); }

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .header-inner { padding: 20px 20px 14px; }
  .detail-body { padding: 18px 16px 60px; }
}
