:root {
  --bg: #0b0f19;
  --panel: rgba(17, 24, 39, 0.78);
  --ink: #e2e8f0;
  --white: #ffffff;
  --mute: #94a3b8;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: #1e293b;
  --cyan: #22d3ee;
  --cyan-btn: #0891b2;
  --purple: #a855f7;
  --emerald: #10b981;
  --amber: #f59e0b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.code-font, pre, code {
  font-family: "Fira Code", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* 顶部导航 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(17, 24, 39, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-strong);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand-logo { display: block; flex-shrink: 0; }

/* Hero */
.hero-wrap {
  border-bottom: 1px solid var(--line-strong);
  background: radial-gradient(ellipse at top, rgba(8, 145, 178, 0.18), #020617 70%);
  padding: 56px 0;
}

.hero-single { width: 100%; max-width: none; }

.hero-title {
  width: 100%;
  margin: 0;
  text-align: center;
  white-space: nowrap;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.58rem, 3.5vw, 3.2rem);
  line-height: 1.18;
  font-weight: 400;
  letter-spacing: 0.015em;
  color: transparent;
  background: linear-gradient(105deg, #94a3b8 0%, #f8fafc 35%, #67e8f9 70%, #fbbf24 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* 板块通用 */
main { padding: 56px 0 64px; }
.section { margin-bottom: 72px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.section-title {
  margin: 0;
  font-size: 1.5rem;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
}
.bar { width: 6px; height: 24px; border-radius: 999px; display: inline-block; }
.bar-cyan { background: var(--cyan-btn); }
.bar-purple { background: var(--purple); }
.bar-emerald { background: var(--emerald); }
.bar-amber { background: var(--amber); }
.section-sub { margin: 4px 0 0; font-size: 0.88rem; color: var(--mute); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: rgba(34, 211, 238, 0.35); }

/* 视频（与图库一致：封面直接叠加名称，无下方独立文字框） */
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.video-link { display: block; color: inherit; text-decoration: none; }
.thumb-wrap { position: relative; aspect-ratio: 16 / 9; background: #0f172a; overflow: hidden; }
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.video-link:hover .thumb-wrap img { transform: scale(1.05); }
.dur {
  position: absolute;
  right: 10px;
  top: 10px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
}
.video-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 24px 14px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
}

/* 图库（显示图片名称，支持点击放大） */
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.photo-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
  margin: 0;
  cursor: zoom-in;
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.photo-item:hover img { transform: scale(1.08); }
.photo-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 22px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
}

/* 图片点击放大灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox img {
  max-width: 92vw;
  max-height: 82vh;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  object-fit: contain;
}
.lightbox-caption {
  margin-top: 14px;
  color: #f8fafc;
  font-size: 0.95rem;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 26px;
  background: rgba(30, 41, 59, 0.85);
  color: #fff;
  border: 1px solid #475569;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  font-size: 1.2rem;
  cursor: pointer;
}
.lightbox-close:hover { background: #334155; }

/* 双栏：博客 + 开源 */
.split-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.blog-card { padding: 20px; }
.blog-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.76rem; color: var(--mute); margin-bottom: 8px; }
.pill-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.blog-title { margin: 0 0 8px; font-size: 1.08rem; }
.blog-title a { color: var(--white); text-decoration: none; }
.blog-title a:hover { color: #34d399; }
.blog-sum { margin: 0; font-size: 0.88rem; color: var(--mute); }

.repo-card { padding: 20px; }
.repo-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.repo-name { color: #fbbf24; font-weight: 700; font-size: 0.92rem; }
.repo-vis { font-size: 0.72rem; color: var(--mute); border: 1px solid #334155; padding: 1px 8px; border-radius: 999px; }
.repo-desc { margin: 0 0 12px; font-size: 0.82rem; color: #cbd5e1; }
.repo-foot { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: var(--mute); }
.repo-stats { display: flex; gap: 14px; align-items: center; }
.lang-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.copy-btn {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.74rem;
  cursor: pointer;
}
.copy-btn:hover { background: #334155; }

/* 视频详情 / 博客详情 / 筛选 / 静态页 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filters button {
  font: inherit;
  font-size: 0.86rem;
  padding: 6px 14px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--cyan-btn); border-color: var(--cyan-btn); color: #fff; }
video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; }
.watch { max-width: 960px; }
.watch h1, .text h1, .article-wrap h1 { color: var(--white); }
.meta { color: var(--mute); font-size: 0.9rem; }
.text { max-width: 66ch; }
.article-wrap { max-width: 780px; }
.article-body { margin-top: 24px; color: #cbd5e1; line-height: 1.85; white-space: pre-line; }

/* 页脚 */
footer {
  border-top: 1px solid var(--line-strong);
  padding: 28px 0 40px;
  color: #64748b;
  font-size: 0.82rem;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 960px) {
  .split-grid { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .video-grid, .gallery-grid { grid-template-columns: 1fr; }
}