/* PLAYGROUND 游戏大厅 —— 按 Stitch 设计稿实现（深色 + 紫霓虹街机风） */

:root {
  --bg: #0b0b13;
  --bg-soft: #101019;
  --panel: #15151f;
  --panel-2: #191926;
  --line: rgba(255, 255, 255, 0.07);
  --text: #f2f2f8;
  --text-dim: #9a9aad;
  --accent: #7c5cff;
  --accent-2: #9d7bff;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --green: #3ddc97;
  --radius: 14px;
  --sidebar-w: 232px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.shell { display: flex; min-height: 100vh; }

/* ---------- 侧栏 ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.brand-mark {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #5b3df0);
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.35);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; letter-spacing: 0.06em; }
.brand-text small { color: var(--text-dim); font-size: 11px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 13.5px;
  transition: background 0.15s, color 0.15s;
}
.nav a svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: 0.9; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav a.active { background: linear-gradient(135deg, var(--accent), #6a48f2); color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(124, 92, 255, 0.35); }
.nav .nav-divider { height: 1px; background: var(--line); margin: 10px 6px; }
.nav a.picks { color: var(--accent-2); }

.sidebar-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 10px 8px; border-top: 1px solid var(--line); }
.live-dot { display: flex; align-items: center; gap: 7px; color: var(--text-dim); font-size: 12px; }
.live-dot .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
.cdn-badge { font-size: 10.5px; color: var(--text-dim); border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; letter-spacing: 0.04em; }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
  background: rgba(11, 11, 19, 0.88);
  backdrop-filter: blur(10px);
}
.crumbs { color: var(--text-dim); font-size: 13px; white-space: nowrap; }
.crumbs .sep { margin: 0 8px; opacity: 0.5; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  width: min(360px, 42vw);
}
.search svg { width: 16px; height: 16px; color: var(--text-dim); }
.search input { background: none; border: 0; outline: 0; color: var(--text); width: 100%; font-size: 13.5px; }
.search input::placeholder { color: var(--text-dim); }

#view { flex: 1; padding: 22px 26px 40px; outline: none; }

/* ---------- Hero ---------- */
.hero-row { display: grid; grid-template-columns: 1fr 300px; gap: 18px; margin-bottom: 26px; }
@media (max-width: 1080px) { .hero-row { grid-template-columns: 1fr; } }
.hero {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 320px;
  background: var(--panel);
}
.hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: saturate(1.05); transform: scale(1.02); transition: opacity 0.6s; }
.hero .shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 8, 14, 0.92) 0%, rgba(8, 8, 14, 0.55) 45%, rgba(8, 8, 14, 0.15) 100%); }
.hero .content { position: relative; z-index: 1; padding: 34px 36px; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 12px; max-width: 560px; }
.badge {
  display: inline-flex; align-self: flex-start;
  background: var(--accent-soft); color: var(--accent-2);
  border: 1px solid rgba(124, 92, 255, 0.4);
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  padding: 5px 12px; border-radius: 999px;
}
.hero h1 { margin: 0; font-size: 34px; line-height: 1.15; letter-spacing: 0.01em; }
.hero p { margin: 0; color: #c9c9d9; max-width: 430px; }
.hero .actions { display: flex; gap: 12px; margin-top: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 12px; padding: 11px 22px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #6a48f2); color: #fff; box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { background: rgba(255, 255, 255, 0.06); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.hero .dots { position: absolute; left: 36px; bottom: 22px; display: flex; gap: 6px; z-index: 1; }
.hero .dots i { width: 18px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.25); transition: background 0.2s; }
.hero .dots i.on { background: var(--accent); }

.ad-box {
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 12px, rgba(255,255,255,0.04) 12px 24px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-dim); font-size: 12.5px; text-align: center;
  padding: 18px; min-height: 320px;
}
.ad-box .tag { font-size: 10px; letter-spacing: 0.2em; color: #6b6b7e; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }
.ad-box strong { color: #c9c9d9; font-size: 15px; }

/* ---------- 行标题 ---------- */
.section { margin: 26px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 19px; }
.section-head .see-all { color: var(--accent-2); font-size: 13px; }
.section-head .see-all:hover { text-decoration: underline; }

/* ---------- 卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: 220px; gap: 14px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }

.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  display: block;
}
.card:hover { transform: translateY(-3px); border-color: rgba(124, 92, 255, 0.55); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45); }
.card .cover { aspect-ratio: 16 / 10; background: #1c1c2a center/cover no-repeat; display: block; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 10px 12px 12px; }
.card .title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta { color: var(--text-dim); font-size: 11.5px; margin-top: 2px; display: flex; gap: 6px; align-items: center; }
.card .play-fab {
  position: absolute; right: 10px; top: calc(62.5% - 34px);
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #6a48f2);
  color: #fff; box-shadow: 0 4px 14px rgba(124, 92, 255, 0.5);
  opacity: 0; transition: opacity 0.15s;
}
.card:hover .play-fab { opacity: 1; }
.card .play-fab svg { width: 13px; height: 13px; }
.card .bar { height: 4px; background: rgba(255, 255, 255, 0.09); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.card .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 4px; }

.empty { color: var(--text-dim); padding: 40px 0; text-align: center; }

/* ---------- 游戏详情页 ---------- */
.game-page { display: flex; flex-direction: column; gap: 14px; }
.game-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.game-head h1 { margin: 0; font-size: 22px; }
.game-head .tagchip { color: var(--text-dim); font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.game-head .spacer { flex: 1; }
.stage {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #101018;
  overflow: hidden;
  height: min(72vh, 760px);
}
.stage iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.game-info { display: grid; grid-template-columns: 1fr 300px; gap: 18px; }
@media (max-width: 1080px) { .game-info { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.panel h3 { margin: 0 0 8px; font-size: 15px; }
.panel p { margin: 6px 0; color: #c5c5d5; font-size: 13.5px; }
.panel .license { color: var(--text-dim); font-size: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.panel .license a { color: var(--accent-2); }

/* ---------- 静态页 ---------- */
.doc { max-width: 760px; }
.doc h1 { font-size: 24px; }
.doc h2 { font-size: 17px; margin-top: 26px; }
.doc p, .doc li { color: #c5c5d5; font-size: 13.5px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 13px; }
.doc td, .doc th { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.doc a { color: var(--accent-2); }

/* ---------- 页脚 ---------- */
.footer {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border-top: 1px solid var(--line);
  padding: 16px 26px 22px;
  color: var(--text-dim); font-size: 12.5px;
  flex-wrap: wrap;
}
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer a:hover { color: var(--text); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { position: static; height: auto; width: auto; flex: none; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px 14px; gap: 12px; }
  .nav { flex-direction: row; }
  .sidebar-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  #view { padding: 18px 16px 30px; }
  .hero h1 { font-size: 26px; }
  .stage { height: 64vh; }
}
