/* ============================================================
 * 页面级组件：面包屑 / 游戏大厅 / 详情 / 试玩 / 排行 / 搜索 / 专题
 * 依赖 main.css 的变量体系，不重复定义主题色
 * ============================================================ */

/* ---------- 面包屑 ---------- */
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-3); padding: 20px 0 0; flex-wrap: wrap; }
.crumbs a { color: var(--text-2); transition: color var(--fast); }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { opacity: .45; }

/* ---------- 页头小标题 ---------- */
.page-head { padding: 20px 0 18px; }
.page-head h1 { font-size: 26px; letter-spacing: -.02em; }
.page-head .sub { color: var(--text-2); font-size: 14px; margin-top: 6px; }

/* ---------- 大厅筛选栏 ---------- */
.hall-bar {
  position: sticky; top: var(--header-h); z-index: 30;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 12px 0; box-shadow: var(--shadow-xs);
}
.hall-bar-inner { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; }
.filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.filter-label { font-size: 13px; color: var(--text-3); flex: none; }
.view-toggle { display: flex; border: 1px solid var(--border-2); border-radius: var(--r-sm); overflow: hidden; margin-left: auto; }
.view-toggle button { padding: 7px 11px; background: transparent; color: var(--text-2); display: flex; transition: background var(--fast), color var(--fast); }
.view-toggle button:hover { background: var(--bg-sunken); }
.view-toggle button.on { background: var(--brand); color: #fff; }
.hall-count { font-size: 13px; color: var(--text-3); }

/* ---------- 列表视图 ---------- */
.grid-games.list { grid-template-columns: 1fr; gap: 12px; }
.grid-games.list .game-card {
  display: grid; grid-template-columns: 148px 1fr; align-items: stretch;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden;
  transition: border-color var(--fast), transform var(--fast), box-shadow var(--fast);
}
.grid-games.list .game-card:hover { border-color: var(--brand-400); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.grid-games.list .game-thumb { border-radius: 0; padding-top: 0; min-height: 96px; height: 100%; box-shadow: none; }
.grid-games.list .game-info { padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.grid-games.list .game-title { font-size: 15.5px; -webkit-line-clamp: 1; }
.g-summary { display: none; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.grid-games.list .g-summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 560px) {
  .grid-games.list .game-card { grid-template-columns: 104px 1fr; }
  .grid-games.list .g-summary { display: none; }
}

/* ---------- 侧边卡片 ---------- */
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 18px; }
.side-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; }
.side-head svg { color: var(--brand); }
.side-body { padding: 8px 8px 12px; }
.side-body.pad { padding: 14px 16px; }
.layout-2col { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
@media (max-width: 1024px) { .layout-2col { grid-template-columns: 1fr; } }

/* ---------- 详情头部 ---------- */
.detail-hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl);
  padding: 28px; margin-top: 20px;
  background: linear-gradient(135deg, rgba(108,92,231,.14), rgba(0,210,255,.10));
  border: 1px solid var(--border);
}
[data-theme="dark"] .detail-hero { background: linear-gradient(135deg, rgba(108,92,231,.24), rgba(0,210,255,.14)); }
.detail-hero::after {
  content: ''; position: absolute; width: 320px; height: 320px; right: -80px; top: -140px;
  background: radial-gradient(circle, rgba(108,92,231,.28), transparent 68%); pointer-events: none;
}
.detail-top { display: grid; grid-template-columns: 190px 1fr; gap: 24px; position: relative; z-index: 2; }
@media (max-width: 760px) { .detail-top { grid-template-columns: 1fr; gap: 16px; } .detail-hero { padding: 20px; } }
.detail-cover {
  position: relative; width: 100%; padding-top: 62%; border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-lg); background: var(--bg-sunken);
}
.detail-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-title { font-size: 27px; letter-spacing: -.02em; line-height: 1.25; }
.detail-sub { color: var(--text-2); font-size: 14.5px; margin: 10px 0 14px; }
.detail-metas { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13.5px; color: var(--text-2); margin-bottom: 16px; }
.detail-metas b { color: var(--text); font-weight: 600; }
.detail-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-acts .btn.on, .btn.liked { color: var(--pink); border-color: var(--pink); }
.detail-acts .btn.on svg { fill: var(--pink); }
.score-big { display: flex; align-items: center; gap: 6px; font-size: 22px; font-weight: 700; color: var(--warning); }
.score-big svg { color: var(--warning); }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 26px 0 18px; overflow-x: auto; }
.tabs::-webkit-scrollbar { height: 0; }
.tabs button {
  padding: 11px 16px; font-size: 14.5px; color: var(--text-2); white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color var(--fast), border-color var(--fast);
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.on { display: block; animation: fadeUp .3s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 富文本正文 ---------- */
.prose { font-size: 14.8px; line-height: 1.85; color: var(--text-2); }
.prose p { margin-bottom: 12px; }
.prose h4 { color: var(--text); margin: 18px 0 8px; font-size: 15.5px; }
.prose ul { list-style: disc; padding-left: 20px; margin-bottom: 12px; }
.prose strong { color: var(--text); }

/* ---------- 信息表 ---------- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.info-cell { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; }
.info-cell .k { font-size: 12.5px; color: var(--text-3); margin-bottom: 3px; }
.info-cell .v { font-size: 15px; font-weight: 600; }

/* ---------- 评论编辑框 ---------- */
.cmt-editor { display: flex; gap: 12px; margin-bottom: 18px; }
.cmt-editor .avatar { width: 40px; height: 40px; border-radius: var(--r-full); background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; flex: none; }
.cmt-editor .box { flex: 1; }
.cmt-editor textarea { min-height: 86px; resize: vertical; }
.cmt-editor .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 10px; flex-wrap: wrap; }
.reply-list { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.reply-list .cmt { padding-bottom: 0; border-bottom: 0; }

/* ---------- 弹幕 ---------- */
.danmaku-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 3; }
.danmaku-item {
  position: absolute; right: 100%; top: 0; white-space: nowrap; font-size: 14px; font-weight: 500;
  text-shadow: 0 1px 3px rgba(0,0,0,.55); animation: dmMove linear forwards; will-change: transform;
}
@keyframes dmMove { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 100%)); } }
.danmaku-send { display: flex; gap: 8px; align-items: center; }

/* ---------- 排行榜加强 ---------- */
.rank-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.rank-hero {
  border-radius: var(--r-xl); padding: 26px; margin-top: 20px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg,#5B4BD6,#6C5CE7 45%,#00A8CC);
}
.rank-hero::after { content:''; position:absolute; width:280px;height:280px;right:-60px;top:-120px;background:radial-gradient(circle,rgba(255,255,255,.22),transparent 70%); }
.rank-hero h1 { font-size: 27px; position: relative; z-index: 2; }
.rank-hero .sub { opacity: .85; font-size: 14px; margin-top: 6px; position: relative; z-index: 2; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; position: relative; z-index: 2; }
.podium-item { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: var(--r-md); padding: 14px; text-align: center; backdrop-filter: blur(6px); }
.podium-item .no { font-size: 26px; font-weight: 800; line-height: 1; }
.podium-item .nm { font-size: 13.5px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-item .sc { font-size: 12.5px; opacity: .85; }
@media (max-width: 640px) { .podium { grid-template-columns: 1fr; } }

/* ---------- 搜索页 ---------- */
.search-stat { font-size: 14px; color: var(--text-2); margin-bottom: 16px; }
.search-stat b { color: var(--brand); }
.hot-row { display: flex; gap: 8px; flex-wrap: wrap; }
.history-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.history-clear { font-size: 12.5px; color: var(--text-3); }

/* ---------- 专题合集 ---------- */
.collect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.collect-card { position: relative; display: block; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); background: var(--surface); transition: transform var(--norm), box-shadow var(--norm); }
.collect-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.collect-cover { position: relative; padding-top: 46%; overflow: hidden; }
.collect-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.collect-card:hover .collect-cover img { transform: scale(1.06); }
.collect-cover .fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 30px; font-weight: 700; }
.collect-info { padding: 15px 17px 17px; }
.collect-info h3 { font-size: 16.5px; margin-bottom: 6px; }
.collect-info p { font-size: 13.5px; color: var(--text-2); margin: 0; line-height: 1.6; }
.collect-num { position: absolute; right: 12px; top: 12px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 3px 9px; border-radius: var(--r-full); backdrop-filter: blur(4px); }

/* ---------- 试玩页加强 ---------- */
.player-wrap { display: flex; flex-direction: column; min-height: 100vh; background: #08091A; }
.player-side { width: 100%; }
/* 横屏提示：悬浮条，不遮挡游戏，可关闭 */
.rotate-tip {
  display: none; position: fixed; z-index: 300;
  left: 12px; right: 12px;
  bottom: calc(50px + env(safe-area-inset-bottom));
  align-items: center; gap: 12px;
  max-width: 430px; margin: 0 auto;
  padding: 10px 12px 10px 14px;
  border-radius: 16px;
  background: rgba(10,12,28,.92); color: #fff;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 14px 38px rgba(0,0,0,.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.rotate-tip .rt-ico {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  border: 2px solid rgba(255,255,255,.55);
  animation: rotTip 2.4s var(--ease) infinite;
}
.rotate-tip .rt-txt { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.rotate-tip .rt-txt b { font-size: 13.5px; font-weight: 600; }
.rotate-tip .rt-txt span { font-size: 11.5px; opacity: .72; }
.rotate-tip .rt-btn {
  flex: none; border: 0; color: #fff; cursor: pointer;
  background: rgba(255,255,255,.15); border-radius: 10px;
  padding: 8px 12px; font-size: 12.5px; font-weight: 600;
}
.rotate-tip .rt-btn:active { background: rgba(255,255,255,.28); }
@keyframes rotTip { 0%,40% { transform: rotate(0); } 60%,100% { transform: rotate(90deg); } }
@media screen and (max-width: 820px) and (orientation: portrait) {
  .need-landscape .rotate-tip { display: flex; }
}
.game-over-mask {
  position: absolute; inset: 0; display: none; place-items: center; z-index: 20;
  background: rgba(8,9,26,.88); backdrop-filter: blur(6px); color: #fff; text-align: center; padding: 24px;
}
.game-over-mask.show { display: grid; }
.over-score { font-size: 44px; font-weight: 800; letter-spacing: -.02em; background: linear-gradient(120deg,#fff,#9DE7FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.over-acts { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ---------- 分享页 ---------- */
.share-wrap { max-width: 560px; margin: 0 auto; padding: 40px 0; text-align: center; }
.share-img { border-radius: var(--r-lg); box-shadow: var(--shadow-lg); margin-bottom: 20px; }
