/* 前台样式:参考 CrazyGames 的深色游戏站结构——顶栏搜索、左侧图标导航、分类彩色横幅、大小混排封面墙。
   颜色、间距、圆角集中在 :root,改风格只需要改这里。 */
:root {
  --bg: #0d0c14;
  --bg-2: #14131e;
  --panel: #1a1927;
  --panel-2: #222135;
  --line: #2b2a3d;
  --text: #f2f1fa;
  --muted: #9d9bb4;
  --accent: #7c5cff;
  --accent-2: #a58bff;
  --lime: #c6f432;
  --ok: #3ecf8e;
  --warn: #ffb020;
  --bad: #ff5d6c;
  --radius: 16px;
  --radius-sm: 10px;
  --rail: 76px;
  --top: 64px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 18px; background: rgba(13, 12, 20, 0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: 0.2px; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: conic-gradient(from 210deg, var(--accent), #ff6aa5, var(--lime), var(--accent)); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18); }
.search { flex: 1; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 16px; border-radius: 999px; background: var(--panel); border: 1px solid transparent; color: var(--muted); transition: border-color 0.15s, background 0.15s; }
.search:focus-within { border-color: var(--accent); background: var(--panel-2); color: var(--text); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; }
.search input::placeholder { color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.pill { height: 38px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-weight: 600; font-size: 14px; transition: background 0.15s, border-color 0.15s; white-space: nowrap; }
.pill:hover { background: var(--panel-2); border-color: #3a3955; }
.pill.lime { background: var(--lime); color: #17200a; border-color: transparent; }
.pill.lime:hover { background: #d4ff4d; }
.pill.ghost { background: transparent; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: transparent; border: 0; color: var(--muted); }
.icon-btn:hover { background: var(--panel); color: var(--text); }
.menu-toggle { display: none; }
.who { color: var(--muted); font-size: 13px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 布局 ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.rail { position: sticky; top: var(--top); align-self: start; height: calc(100vh - var(--top)); padding: 14px 8px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); overflow-y: auto; }
.rail a { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; color: var(--muted); font-size: 11px; font-weight: 600; text-align: center; transition: background 0.15s, color 0.15s; }
.rail a svg { width: 22px; height: 22px; }
.rail a:hover { background: var(--panel); color: var(--text); }
.rail a.active { background: rgba(124, 92, 255, 0.16); color: var(--accent-2); }
.rail .sep { height: 1px; background: var(--line); margin: 8px 6px; }
.main { padding: 22px 26px 64px; min-width: 0; }
.scrim { display: none; }

/* ---------- 分类横幅 ---------- */
.chips { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-width: 150px; height: 84px; padding: 14px 16px; border-radius: var(--radius); display: flex; align-items: flex-end; font-weight: 800; font-size: 15px; border: 1px solid transparent; transition: transform 0.15s, border-color 0.15s; position: relative; overflow: hidden; }
.chip::after { content: ""; position: absolute; right: -14px; top: -14px; width: 70px; height: 70px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.chip:hover { transform: translateY(-2px); }
.chip.active { border-color: #fff; }
.chip.c0 { background: linear-gradient(135deg, #0f6b57, #1b3d44); color: #7ff0cf; }
.chip.c1 { background: linear-gradient(135deg, #7a2a5c, #3a2146); color: #ff8fd0; }
.chip.c2 { background: linear-gradient(135deg, #7a4b12, #3b2c14); color: #ffc66b; }
.chip.c3 { background: linear-gradient(135deg, #2d4aa6, #1e2a52); color: #9fb7ff; }
.chip.c4 { background: linear-gradient(135deg, #5a7a14, #2b3a14); color: #d4ff6a; }
.chip.c5 { background: linear-gradient(135deg, #5b3ac4, #2a2150); color: #c2b0ff; }

/* ---------- 区块标题 ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 14px; gap: 12px; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
.section-head .meta { color: var(--muted); font-size: 13px; }

/* ---------- 封面墙:大小混排 ---------- */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); grid-auto-flow: dense; grid-auto-rows: auto; gap: 14px; }
.tile { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--panel); isolation: isolate; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset; transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.18s; }
.tile.big { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.tile img, .tile .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s; }
.tile .ph { display: grid; place-items: center; color: var(--muted); font-size: 13px; background: linear-gradient(135deg, var(--panel-2), var(--panel)); }
.tile:hover { transform: translateY(-4px) scale(1.015); box-shadow: var(--shadow), 0 0 0 2px var(--accent) inset; z-index: 2; }
.tile:hover img { transform: scale(1.06); }
.tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 12px 10px; background: linear-gradient(to top, rgba(8, 7, 14, 0.92), rgba(8, 7, 14, 0)); transform: translateY(35%); opacity: 0.0; transition: transform 0.2s, opacity 0.2s; z-index: 1; }
.tile:hover .cap, .tile:focus-visible .cap, .tile.big .cap { transform: none; opacity: 1; }
.tile .cap b { display: block; font-size: 14px; line-height: 1.25; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.tile .cap span { display: block; margin-top: 2px; color: #cfcde4; font-size: 12px; }
.tile.big .cap b { font-size: 20px; }
.tile.big .cap { padding-top: 70px; }
.tile .play-btn { position: absolute; right: 12px; top: 12px; z-index: 1; padding: 6px 12px; border-radius: 999px; background: var(--lime); color: #17200a; font-weight: 800; font-size: 12px; opacity: 0; transform: translateY(-4px); transition: opacity 0.2s, transform 0.2s; }
.tile:hover .play-btn, .tile:focus-visible .play-btn { opacity: 1; transform: none; }
.tile .kicker { position: absolute; left: 12px; top: 12px; z-index: 1; padding: 4px 10px; border-radius: 999px; background: rgba(13, 12, 20, 0.7); backdrop-filter: blur(6px); font-size: 11px; font-weight: 800; letter-spacing: 0.4px; color: var(--lime); }
.tile .badge { position: absolute; left: 10px; top: 10px; z-index: 1; }

/* ---------- 徽标 / 通用 ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid currentColor; background: rgba(13, 12, 20, 0.6); }
.badge.draft { color: var(--muted); }
.badge.pending { color: var(--warn); }
.badge.approved { color: var(--ok); }
.badge.rejected { color: var(--bad); }
.badge.verdict-pass { color: var(--ok); }
.badge.verdict-warn { color: var(--warn); }
.badge.verdict-fail { color: var(--bad); }
.meta { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 64px 0; text-align: center; }
.error { color: var(--bad); font-size: 13px; min-height: 18px; }
.pager { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 28px; }
.btn { height: 40px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; transition: background 0.15s, border-color 0.15s; }
.btn:hover:not(:disabled) { background: var(--panel-2); border-color: #3a3955; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover:not(:disabled) { background: #8b6dff; }
.btn.lime { background: var(--lime); border-color: transparent; color: #17200a; }
.btn.lime:hover:not(:disabled) { background: #d4ff4d; }
.btn.danger { background: transparent; color: var(--bad); border-color: rgba(255, 93, 108, 0.5); }
.btn.danger:hover:not(:disabled) { background: rgba(255, 93, 108, 0.1); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }

/* ---------- 播放页 ---------- */
.play { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.stage-wrap { min-width: 0; }
.stage { height: min(72vh, 720px); min-height: 380px; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.stage iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.stage .poster { width: 100%; height: 100%; object-fit: cover; display: block; }
.stage .noplay { height: 100%; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); background: var(--panel); }
.stage-bar { display: flex; align-items: center; gap: 12px; padding: 12px 4px; flex-wrap: wrap; }
.stage-bar h1 { margin: 0; font-size: 22px; font-weight: 800; flex: 1 1 200px; min-width: 0; }
.stage-bar .tools { display: flex; gap: 8px; }
.about { margin-top: 8px; padding: 20px 22px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.about h2 { margin: 0 0 8px; font-size: 16px; }
.about p { margin: 0 0 10px; white-space: pre-wrap; color: #dcdaf0; }
.about .howto { color: var(--muted); font-size: 14px; }
.side { display: grid; gap: 18px; min-width: 0; }
.card { padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.card h3 { margin: 0 0 12px; font-size: 14px; color: var(--muted); font-weight: 700; letter-spacing: 0.3px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.mini { display: grid; gap: 10px; }
.mini a { display: flex; gap: 12px; align-items: center; padding: 6px; border-radius: 12px; transition: background 0.15s; }
.mini a:hover { background: var(--panel-2); }
.mini img, .mini .ph { width: 76px; aspect-ratio: 4 / 3; border-radius: 10px; object-fit: cover; flex: none; background: var(--panel-2); }
.mini b { display: block; font-size: 14px; line-height: 1.3; }

/* ---------- 表单 / 面板 ---------- */
.narrow { max-width: 760px; margin: 0 auto; }
h1.page { margin: 4px 0 18px; font-size: 26px; font-weight: 800; }
.panel { padding: 22px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
form.stack { display: grid; gap: 16px; }
label.field { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input:not([type]), select, textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; color: var(--text); transition: border-color 0.15s; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); }
textarea { min-height: 120px; resize: vertical; }
.auth { max-width: 420px; margin: 40px auto; }
.oauth-box { display: grid; gap: 10px; margin-bottom: 4px; }
.oauth-box[hidden] { display: none; }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 700; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.oauth-btn:hover:not(:disabled) { background: #2a2943; border-color: #3a3955; }
.oauth-btn:disabled { opacity: 0.5; cursor: default; }
.oauth-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 6px 0 2px; }
.oauth-sep::before, .oauth-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth .alt { margin-top: 14px; text-align: center; }
.auth .alt a { color: var(--accent-2); }

.flow { display: grid; gap: 22px; }
.flow h2 { margin: 0 0 10px; font-size: 17px; }
.drop { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 38px 20px; border: 2px dashed #3a3955; border-radius: var(--radius); cursor: pointer; background: var(--bg-2); transition: border-color 0.15s, background 0.15s; }
.drop strong { font-size: 16px; }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(124, 92, 255, 0.08); }
.drop.busy { opacity: 0.6; pointer-events: none; }
.findings { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.findings li { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); font-size: 14px; }
.findings li b { margin-right: 6px; font-size: 12px; }
.findings .lv-fail { border-color: rgba(255, 93, 108, 0.6); }
.findings .lv-fail b { color: var(--bad); }
.findings .lv-warn b { color: var(--warn); }
.findings .lv-info b { color: var(--muted); }
.found { margin: 12px 0; padding: 14px 16px; border-radius: 12px; background: rgba(198, 244, 50, 0.07); border: 1px solid rgba(198, 244, 50, 0.3); }
.found h3 { margin: 0 0 6px; font-size: 14px; color: var(--lime); }
.found p { margin: 0 0 8px; color: #e4e2f5; }
.found .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.busy { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
.cover-box { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.cover-preview { position: relative; width: 260px; aspect-ratio: 3 / 2; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2) center / contain no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 13px; overflow: hidden; }
.cover-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-actions { display: grid; gap: 8px; justify-items: start; }
.cover-actions .row2 { display: flex; gap: 8px; flex-wrap: wrap; }
.cover-spec { flex-basis: 100%; margin-top: 4px; padding: 12px 14px; border-radius: 12px; background: rgba(124, 92, 255, 0.08); border: 1px solid rgba(124, 92, 255, 0.28); font-size: 13px; color: #d9d6f2; }
.cover-spec b { color: var(--text); }
.cover-spec ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.cover-spec li { margin: 2px 0; }
.cover-badge { position: absolute; right: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(13, 12, 20, 0.78); font-size: 11px; font-weight: 700; }
.cover-badge.warn { color: var(--warn); }
.cover-badge.ok { color: var(--ok); }

/* ---------- 封面编辑器(弹窗) ---------- */
.cropper-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(5, 5, 10, 0.72); backdrop-filter: blur(4px); }
.cropper-card { width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 18px 20px 16px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.cropper-head { display: flex; align-items: center; justify-content: space-between; }
.cropper-head h2 { margin: 0; font-size: 18px; }
.cropper-tip { margin: 6px 0 10px; }
.cropper-stage { position: relative; aspect-ratio: 3 / 2; width: 100%; border-radius: 12px; overflow: hidden; background: #0a0a12; cursor: grab; touch-action: none; user-select: none; border: 1px solid var(--line); }
.cropper-stage.dragging { cursor: grabbing; }
.cropper-stage canvas { width: 100%; height: 100%; display: block; }
/* 首页卡片是 4:3:在 3:2 的取景框里,左右各有 1/16 的宽度会被卡片裁掉。用两条竖带标出来。 */
.cropper-safe { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to right, rgba(0, 0, 0, 0.55) 0, rgba(0, 0, 0, 0.55) 6.25%, transparent 6.25%, transparent 93.75%, rgba(0, 0, 0, 0.55) 93.75%); }
.cropper-safe::before, .cropper-safe::after { content: ""; position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed rgba(198, 244, 50, 0.85); }
.cropper-safe::before { left: 6.25%; } .cropper-safe::after { left: 93.75%; }
.cropper-safe[hidden] { display: none; }
.cropper-hint { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(13, 12, 20, 0.78); font-size: 11px; color: var(--muted); pointer-events: none; }
.cropper-controls { display: grid; gap: 10px; margin-top: 12px; }
.cp-row { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.cp-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.cp-row input[type="color"] { width: 44px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.cp-modes { display: flex; gap: 8px; flex-wrap: wrap; }
.cp-modes .btn.primary { background: var(--accent); }
.cp-check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.cropper-warn { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 176, 32, 0.1); border: 1px solid rgba(255, 176, 32, 0.4); color: #ffd58a; font-size: 13px; }
.cropper-warn[hidden] { display: none; }
.cropper-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
@media (max-width: 560px) { .cropper-card { padding: 14px 14px 12px; } .cover-preview { width: 100%; } }
.ghost-file { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; cursor: pointer; }
.ghost-file:hover { background: var(--panel-2); }
.rows { display: grid; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.row .thumb { width: 84px; aspect-ratio: 4 / 3; border-radius: 10px; object-fit: cover; background: var(--panel-2); flex: none; }
.row .title { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .right { display: flex; align-items: center; gap: 10px; flex: none; }

.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(10px); background: var(--panel-2); border: 1px solid #3a3955; padding: 11px 20px; border-radius: 12px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 60; box-shadow: var(--shadow); font-weight: 600; }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) { .play { grid-template-columns: 1fr; } .stage { height: min(64vh, 560px); } }
@media (max-width: 860px) {
  :root { --rail: 0px; }
  /* 窄屏只有两列:大图改成横跨两列、保持 16:10,不再占两行,避免把相邻小图压扁 */
  .tile.big { grid-column: span 2; grid-row: auto; aspect-ratio: 16 / 10; }
  .tile.big .cap { padding-top: 48px; }
  .tile.big .cap b { font-size: 17px; }
  .topbar { gap: 8px; padding: 0 10px; }
  .search { min-width: 0; margin: 0; }
  .top-actions { gap: 6px; }
  .pill { padding: 0 12px; height: 36px; }
  .top-actions .pill.lime span { display: none; }
  .top-actions .pill.lime { padding: 0 10px; }
  .menu-toggle { display: grid; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; z-index: 40; top: var(--top); left: 0; width: 84px; background: var(--bg); transform: translateX(-100%); transition: transform 0.2s; }
  .rail.open { transform: none; }
  .scrim.show { display: block; position: fixed; inset: var(--top) 0 0 0; background: rgba(0, 0, 0, 0.55); z-index: 35; }
  .main { padding: 16px 14px 56px; }
  .wall { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .search { max-width: none; }
  .brand span:last-child { display: none; }
  .who { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
