:root {
  --bg: #0b0b0f;
  --panel: #151515;
  --muted: #a3a3a3;
  --text: #ffffff;
  --card: #141418;
  --border: #2a2a2a;
  --accent: #9b87f5; /* 纯色强调，无渐变 */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "PingFang SC", "Microsoft Yahei", "Noto Sans CJK", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container { width: 100%; max-width: 1600px; margin: 0 auto; padding: 0 16px; }

.site-header { border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; background: rgba(14, 14, 18, 0.5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { color: var(--text); font-weight: 700; text-decoration: none; letter-spacing: 0.5px; }
.nav-link { color: var(--muted); text-decoration: none; margin-left: 16px; }
.nav-link:hover { color: var(--text); }

/* 顶部搜索框 */
.search-box { flex: 1; max-width: 520px; margin: 0 16px; }
.search-form { display: flex; align-items: center; gap: 8px; }
.search-input { flex: 1; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: #1a1a1f; color: var(--text); outline: none; }
.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: #3a3a3a; }
.search-button { height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); background: #1a1a1f; color: var(--muted); cursor: pointer; }
.search-button:hover { color: #fff; border-color: #3a3a3a; }

@media (max-width: 640px) {
  .search-box { max-width: none; margin: 0 8px; }
}
.main-content { padding: 24px 0 64px; }
.section { margin-bottom: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 20px; margin: 0; }
.warn { color: #fbbf24; background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.25); padding: 8px 12px; border-radius: 8px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, 1fr); } }

/* 页面整体缩放优化 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* 左侧侧边栏布局下不需要额外右侧内边距 */
@media (min-width: 1200px) { .main-content { padding-right: 0; } }

/* 右侧悬浮标签筛选 */
.tag-filter-fixed { position: fixed; right: 16px; top: 96px; width: 240px; z-index: 20; }
.tag-filter-fixed .panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel-title { font-weight: 600; }
.panel-head .clear { color: var(--muted); text-decoration: none; font-size: 12px; }
.panel-head .clear:hover { color: var(--text); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 320px; overflow: auto; }
.tag-pill { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: #1a1a1f; color: var(--text); text-decoration: none; font-size: 12px; }
.tag-pill:hover { border-color: #3a3a3a; }
.tag-pill.active { background: #23232a; border-color: #3a3a3a; color: #fff; }

/* 小屏隐藏悬浮筛选 */
@media (max-width: 1023px) { .tag-filter-fixed { display: none; } }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text); display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.card-media { aspect-ratio: 16/9; background: #0f0f14; display: block; width: 100%; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 12px; }
.card-title { font-size: 16px; margin: 0 0 6px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.card-meta { margin: 0; color: var(--muted); font-size: 12px; display: flex; gap: 8px; align-items: center; }
.dot { opacity: .6; }

.empty { color: var(--muted); padding: 16px; border: 1px dashed var(--border); border-radius: 12px; text-align: center; }

/* 详情页 */
.game-hero { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 20px; }
@media (min-width: 900px) { .game-hero { grid-template-columns: 340px 1fr; } }
.hero-cover { background: #0f0f14; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.hero-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-info { display: flex; flex-direction: column; gap: 12px; }
.game-title { margin: 0; font-size: 28px; }
.game-meta { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 16px; }
.meta-item { display: flex; gap: 8px; color: var(--muted); }
.meta-item .label { min-width: 72px; color: #d1d5db; }

.game-desc { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; line-height: 1.7; color: #e5e7eb; white-space: pre-line; }

.subsection { margin-top: 24px; }
.subsection-title { font-size: 18px; margin: 0 0 12px; }

.shots { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 700px) { .shots { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1200px) { .shots { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.shot { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #0f0f14; aspect-ratio: 16 / 9; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; will-change: transform; }
.shot:hover img { transform: scale(1.04); }

.versions { display: grid; grid-template-columns: 1fr; gap: 12px; }
.version-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.version-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; user-select: none; }
.version-head:hover { background: rgba(255, 255, 255, 0.02); border-radius: 8px; margin: -4px; padding: 4px; }
.version-title { font-weight: 600; }
.version-meta { display: flex; align-items: center; gap: 12px; }
.version-date { color: var(--muted); font-size: 12px; }
.collapse-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 4px; transition: all 0.2s ease; }
.collapse-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.collapse-icon { font-size: 12px; transition: transform 0.2s ease; }
.version-card.collapsed .collapse-icon { transform: rotate(-90deg); }
.version-content { transition: all 0.3s ease; overflow: hidden; }
.version-changelog { color: #d1d5db; white-space: pre-wrap; line-height: 1.6; margin-bottom: 10px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: #1a1a1f; border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 13px; }
.btn:hover { border-color: #3a3a3a; }

.site-footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); }
.page-grid { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
@media (max-width: 1023px) { .page-grid { grid-template-columns: 1fr; } }

/* 左侧侧边栏 */
.sidebar { position: sticky; top: 88px; align-self: start; }
.sidebar .panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px; position: static; }
.sidebar .panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sidebar .panel-title { font-weight: 600; }
.sidebar .clear { color: var(--muted); text-decoration: none; font-size: 12px; }
.sidebar .clear:hover { color: var(--text); }
.sidebar .tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.sidebar .tag-pill { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); background: #1a1a1f; color: var(--text); text-decoration: none; font-size: 12px; }
.sidebar .tag-pill:hover { border-color: #3a3a3a; }
.sidebar .tag-pill.active { background: #23232a; border-color: #3a3a3a; color: #fff; }

/* 卡片更大一些 */
.grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 18px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .grid { grid-template-columns: repeat(4, 1fr); } }
/* ≥1536px 仍为4列，避免超过每行4个 */
.card-title { font-size: 18px; }
.card-body { 
  padding: 14px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* 移除右侧悬浮筛选相关样式（不再需要） */
.tag-filter-fixed { display: none !important; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text); display: grid; grid-template-rows: 1fr auto; transition: transform .2s ease, box-shadow .2s ease; aspect-ratio: 4 / 3; }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.card-media { background: #0f0f14; display: block; width: 100%; height: 100%; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 14px; }
.card-title { 
  position: relative;
  overflow: hidden; /* 保持单行省略时不换行 */
  white-space: nowrap;
}
.card-title .title-text {
  display: inline-block;
  will-change: transform;
}
.card-meta { margin: 0; color: var(--muted); font-size: 12px; display: flex; gap: 8px; align-items: center; }
.dot { opacity: .6; }

.empty { color: var(--muted); padding: 16px; border: 1px dashed var(--border); border-radius: 12px; text-align: center; }

/* 详情页 */
.game-hero { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 20px; }
@media (min-width: 900px) { .game-hero { grid-template-columns: 340px 1fr; } }
.hero-cover { background: #0f0f14; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.hero-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-info { display: flex; flex-direction: column; gap: 12px; }
.game-title { margin: 0; font-size: 28px; }
.game-meta { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 16px; }
.meta-item { display: flex; gap: 8px; color: var(--muted); }
.meta-item .label { min-width: 72px; color: #d1d5db; }

.game-desc { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; line-height: 1.7; color: #e5e7eb; white-space: pre-line; }

.subsection { margin-top: 24px; }
.subsection-title { font-size: 18px; margin: 0 0 12px; }

.shots { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 700px) { .shots { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1200px) { .shots { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.shot { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #0f0f14; aspect-ratio: 16 / 9; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; will-change: transform; }
.shot:hover img { transform: scale(1.04); }

.versions { display: grid; grid-template-columns: 1fr; gap: 12px; }
.version-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.version-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.version-title { font-weight: 600; }
.version-date { color: var(--muted); font-size: 12px; }
.version-changelog { color: #d1d5db; white-space: pre-wrap; line-height: 1.6; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: #1a1a1f; border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 13px; }
.btn:hover { border-color: #3a3a3a; }

.site-footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); }
.sidebar .panel + .panel { margin-top: 12px; }

/* 游戏详情页左右布局 */
.game-layout { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.game-left { display: grid; gap: 20px; }
.game-right { position: sticky; top: 88px; }
@media (min-width: 1024px) {
  .game-layout { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (max-width: 1023px) {
  .game-right { position: static; }
}

/* 截图轮播（大图 + 缩略图导航） */
.shots-carousel { display: grid; gap: 10px; }
.shots-viewer { position: relative; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #0f0f14; aspect-ratio: 16 / 9; }
.shots-viewer img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.45); color: #fff; border: 1px solid rgba(255,255,255,0.2); width: 36px; height: 36px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.nav-btn:hover { background: rgba(0,0,0,0.6); }
.nav-btn.prev { left: 8px; }
.nav-btn.next { right: 8px; }
.shots-thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.shots-thumbs::-webkit-scrollbar { height: 6px; }
.shots-thumbs::-webkit-scrollbar-thumb { background: #333; border-radius: 999px; }
.thumb { flex: 0 0 auto; width: 96px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); padding: 0; background: transparent; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.active { outline: none; border-color: var(--border); }
@media (min-width: 1200px) { .thumb { width: 110px; } }

/* Lightbox 预览 */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center; z-index: 200; }
.lightbox[hidden] { display: none !important; }
.lightbox-inner { position: relative; width: 92vw; height: 92vh; display: flex; align-items: center; justify-content: center; }
.lightbox-image { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close { position: absolute; top: 16px; right: 16px; background: rgba(0,0,0,0.6); color: #fff; border: 1px solid rgba(255,255,255,0.2); width: 40px; height: 40px; border-radius: 999px; cursor: pointer; }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.6); color: #fff; border: 1px solid rgba(255,255,255,0.2); width: 48px; height: 48px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

/* 玻璃化高斯模糊效果（统一应用到主要容器） */
.game-desc,
.version-card,
.sidebar .panel,
.card,
.shots-viewer,
.hero-cover {
  background: rgba(20, 20, 24, 0.5) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, 0.08) !important;
}
.hero-cover { position: relative; }
/* Header NSFW 滑动开关 */
.header-toggle { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; color: var(--muted); }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .slider { position: relative; width: 44px; height: 24px; background: #2a2a2a; border-radius: 999px; transition: background .2s ease; border: 1px solid var(--border); }
.toggle .slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .2s ease; }
.toggle input:checked + .slider { background: #ef4444; border-color: rgba(239,68,68,.7); }
.toggle input:checked + .slider::after { transform: translateX(20px); }
.toggle .label { font-size: 12px; color: var(--muted); }

/* 卡片内 NSFW 标签 */
.card-media { position: relative; }
.badge-nsfw {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5; /* 确保在模糊图片之上 */
  background: rgba(239, 68, 68, 0.45); /* 半透明红色 */
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  letter-spacing: 0.5px;
  -webkit-backdrop-filter: blur(8px); /* 高斯模糊背景 */
  backdrop-filter: blur(8px);
  pointer-events: none; /* 不阻挡卡片点击 */
}
/* NSFW 模糊效果：默认模糊，开启显示时移除该类 */
.blur-nsfw {
  filter: blur(14px);
  transition: filter .2s ease;
}
/* 简单的行内开关布局 */
.switch-line { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.switch-line input[type="checkbox"] { width: 16px; height: 16px; }
/* NSFW 占位提示样式 */
.nsfw-hidden { display: grid; place-items: center; width: 100%; height: 100%; color: #fca5a5; background: rgba(239,68,68,0.08); border: 1px dashed rgba(239,68,68,0.4); border-radius: 8px; font-size: 14px; }
.card-media .nsfw-hidden { aspect-ratio: 4 / 3; border: none; border-radius: 0; }
.hero-cover .nsfw-hidden { aspect-ratio: unset; height: 100%; border: none; border-radius: 0; }
.thumb.placeholder .nsfw-hidden { font-size: 12px; }
/* 顶部导航 登录按钮 */
.nav .btn { margin-left: 16px; height: 36px; }
/* 用户下拉菜单：内部按钮布局与指示图标动画 */
.user-menu .user-dropdown .btn { margin-left: 0; width: 100%; justify-content: flex-start; }
.user-menu .user-dropdown form { margin: 0; }
.user-menu .user-trigger svg { transition: transform 0.2s ease; }
.user-menu .user-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }

/* 登录弹窗 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 300; }
.modal[hidden] { display: none !important; }
.modal-inner { position: relative; width: min(92vw, 420px); background: rgba(20,20,24,0.8); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 20px; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.modal-title { margin: 0 0 12px; font-size: 20px; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 999px; background: rgba(0,0,0,0.4); color: #fff; border: 1px solid rgba(255,255,255,0.2); cursor: pointer; }
.login-form { display: grid; gap: 10px; margin-top: 6px; }
.login-form label { font-size: 12px; color: var(--muted); }
.login-form input { width: 100%; height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: #1a1a1f; color: var(--text); outline: none; }
.login-form input::placeholder { color: var(--muted); opacity: .8; }
.login-form input:focus { border-color: #3a3a3a; }
.login-form .actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.login-form .actions .btn { width: 100%; justify-content: center; }
.login-form .hint { color: var(--muted); font-size: 12px; text-align: center; margin-top: 4px; }
.card-media .nsfw-hidden { aspect-ratio: 4 / 3; border: none; border-radius: 0; }
.hero-cover .nsfw-hidden { aspect-ratio: unset; height: 100%; border: none; border-radius: 0; }
.thumb.placeholder .nsfw-hidden { font-size: 12px; }
/* 类型与语言：胶囊标签样式 */
.meta-item .value.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #1a1a1f;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.6;
}
.meta-tag:hover {
  border-color: #3a3a3a;
  background: #23232a;
  color: #fff;
}
.meta-tag:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-media .nsfw-hidden { aspect-ratio: 4 / 3; border: none; border-radius: 0; }
.hero-cover .nsfw-hidden { aspect-ratio: unset; height: 100%; border: none; border-radius: 0; }
.thumb.placeholder .nsfw-hidden { font-size: 12px; }