body {
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  padding:22px;
  line-height:1.55;
  color:#eaf2ff;

  /* 背景色 */
  background-color:#0b1225;

  /* 上层：同色半透明遮罩（alpha=0.92 ≈ 图片可见约 8%）
     下层：cosmos.png（随页面一起滚动） */
  background-image:
    linear-gradient(rgba(11,18,37,0.92), rgba(11,18,37,0.92)),
    url("cosmos.png");
  background-repeat: no-repeat, no-repeat;
  background-position: right 12px top 12px, right 12px top 12px;
  background-size: auto, clamp(180px, 42vw, 900px);
  background-attachment: scroll, scroll; /* 关键：随页面滚动 */
}

/* 确保标题/按钮永远压在图标上层（防遮挡） */
.topbar{ position: relative; z-index: 1; }

h1 { font-size:30px; margin:0 0 14px }
.card {
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  padding:16px;
  margin:10px 0;
}
.grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:12px;
}
.k { opacity:.8; font-size:13px }
.v { font-size:20px; font-weight:700; margin-top:4px; word-break:break-word }
code {
  background:rgba(255,255,255,.08);
  padding:2px 6px;
  border-radius:6px;
}
h2 { font-size:18px; margin:0 0 10px }
h3 { font-size:16px; margin:14px 0 8px }
p { margin:8px 0 }
ul { margin:8px 0 8px 18px }

/* 顶栏：标题在左、语言按钮在右 */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

/* 如果屏幕很窄，也尽量保持同一行；不够放时再换行 */
@media (max-width: 420px){
  .topbar{ flex-wrap:wrap; }
  .topbar .lang-switch{ margin-left:auto; }
}

/* 语言按钮（简洁版） */
#lang-switcher { 
  display: flex; 
  gap: 8px; 
  margin: 0 0 12px; 
}

#lang-switcher button {
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: #eaf2ff;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}

#lang-switcher button:hover { 
  background: rgba(255,255,255,.14); 
}

/* 视频栅格（统一列宽，避免某些块过大） */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
/* 大屏：固定 4 列（你也可改成 2 或 3） */
@media (min-width: 800px) {
  .video-grid { grid-template-columns: repeat(6, 1fr); }
}

/* —— 重要修改：缩略图模式（不裁剪、不拉伸，完整显示） —— */
.video-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding-top: 56.25%; /* 固定16:9外框 */
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
}

.video-thumb img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;        /* 覆盖填充，裁掉上下黑边 */
  object-position: center;
  border-radius: 12px;
  transition: transform .25s ease;
}

.video-thumb:hover img {
  transform: scale(1.05);
}

/* 如果页面上仍然存在旧的 .video 容器（用于 iframe），为避免影响，这里“取消强制16:9” */
.video {
  position: static;
  width: 100%;
  padding-top: 0;           /* 原来是 56.25% 的占位，这里清掉 */
  border-radius:12px;
  overflow:hidden;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
}
.caption { margin-top:6px; font-size:14px; opacity:.9 }

/* 链接列表 */
.link-list { display:grid; grid-template-columns:1fr; gap:12px }
.link-item {
  background:rgba(255,255,255,.1);
  border:1px solid rgba(255,255,255,.18);
  border-radius:12px;
  padding:12px;
  transition:background .25s ease, border-color .25s ease;
}
.link-item:hover {
  background:rgba(255,255,255,.15);
  border-color:rgba(255,255,255,.25);
}
.link-item a {
  font-weight:700;
  color:#4da3ff;               /* 明亮蓝色文字 */
  text-decoration:none;
  font-size:16px;
}
.link-item a:hover {
  color:#fff;                  /* 悬停时纯白 */
  text-decoration:underline;
}
.link-item p {
  margin:6px 0 0;
  opacity:.8;
  font-size:14px;
}
@media (min-width:700px){
  .link-list{grid-template-columns:repeat(2,1fr)}
}
