:root {
  --bg: #0b0e14;
  --bg2: #11141d;
  --card: #1a1f2b;
  --line: #232a38;
  --text: #eef2f8;
  --muted: #9aa6b8;
  --accent: #35e0a1;
  --accent2: #4aa8ff;
  --pink: #ff6b9d;
  --yellow: #ffd166;
  --danger: #ff6b6b;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", "Microsoft JhengHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- 左側圖示欄 ---------- */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 64px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  background: #090c12;
  border-right: 1px solid var(--line);
  overflow: hidden;
  transition: width .18s ease, box-shadow .18s ease;
}
.rail:hover, .rail:focus-within {
  width: 232px;
  box-shadow: 24px 0 48px rgba(0, 0, 0, .55);
}
.rail-group { display: flex; flex-direction: column; gap: 2px; }
.rail-sep { height: 1px; background: var(--line); margin: 8px 4px; }
.rail-brand {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--bg2);
  border: 1px solid var(--line);
  margin: 0 0 10px 2px;
  overflow: hidden;
  flex: 0 0 auto;
}
.rail-brand img { width: 34px; height: 34px; object-fit: contain; }
.rail-item {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.rail-item .ico { flex: 0 0 20px; text-align: center; font-size: 17px; }
.rail-item .lbl { opacity: 0; transition: opacity .12s ease; flex: 1 1 auto; overflow: hidden; }
.rail:hover .rail-item .lbl,
.rail:focus-within .rail-item .lbl { opacity: 1; }
.rail-item:hover { background: var(--bg2); color: var(--text); }
.rail-item.active { background: rgba(53, 224, 161, .14); color: var(--accent); }

/* ---------- 頁面容器 ---------- */
.page { flex: 1; min-width: 0; margin-left: 64px; }
body.no-rail .page { margin-left: 0; width: 100%; }

/* ---------- 頂欄 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(11, 14, 20, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.logo { height: 40px; width: auto; }
.mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #04121a; font-weight: 900;
}
.brandname { font-size: 17px; letter-spacing: -.01em; }

.search {
  flex: 0 1 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color .15s ease;
}
.search:focus-within { border-color: var(--accent2); }
.search-ico { opacity: .55; font-size: 14px; }
.search input {
  flex: 1;
  min-width: 0;
  background: none; border: 0; outline: none;
  color: var(--text);
  font: inherit;
  padding: 12px 0;
}
.search input::placeholder { color: var(--muted); }

.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.account {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--line);
  font-size: 13px;
  min-height: 36px;
  display: grid; place-items: center;
}
.account:hover { border-color: var(--accent); }

.langs { display: flex; gap: 4px; }
.langs a {
  padding: 5px 8px; border-radius: 8px;
  font-size: 12px; color: var(--muted);
  border: 1px solid transparent;
}
.langs a.on { color: var(--accent); border-color: rgba(53,224,161,.5); }
.langs a:hover { color: var(--text); }

main { padding: 18px 24px 70px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 6;
  background-size: cover;
  background-position: center;
  margin-bottom: 26px;
  isolation: isolate;
}
.hero .shade {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(5,8,12,.88) 0%, rgba(5,8,12,.55) 45%, rgba(5,8,12,.1) 100%);
}
.hero-content { position: absolute; left: 32px; bottom: 28px; right: 32px; max-width: 560px; }
.hero .tag {
  display: inline-block;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(255,255,255,.12);
  margin-bottom: 10px;
}
.hero h1 { margin: 0 0 8px; font-size: clamp(24px, 3.4vw, 44px); letter-spacing: -.02em; }
.hero p { margin: 0 0 16px; color: #cbd6e6; font-size: 15px; max-width: 440px; }

/* ---------- 按鈕 ---------- */
.btn-primary {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 800;
  color: #04121a;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: 2px solid rgba(0,0,0,.25);
  box-shadow: 0 4px 0 #0b5f4a;
  min-height: 44px;
}
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #0b5f4a; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }

/* ---------- 陳列 ---------- */
.shelf { margin-bottom: 30px; }
.shelf-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.shelf-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.shelf-head .chev { color: var(--muted); font-size: 20px; line-height: 1; }

.scroller {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.scroller::-webkit-scrollbar { display: none; }
.scroller .card { flex: 0 0 auto; width: 260px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  scroll-snap-align: start;
  transition: transform .12s ease, filter .12s ease;
}
.card:hover { transform: translateY(-3px); filter: brightness(1.07); }
.card .shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 42%, rgba(0,0,0,.82) 100%);
}
.card .tag {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(0,0,0,.55); color: #dcecff;
}
.card .name {
  position: absolute; left: 12px; right: 46px; bottom: 10px;
  font-weight: 700; font-size: 15px; line-height: 1.2;
  text-shadow: 0 1px 6px rgba(0,0,0,.7);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .plays {
  position: absolute; right: 10px; bottom: 10px;
  font-size: 11px; color: #b9c6d8;
}
.lang-chips {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  display: flex; gap: 4px;
}
.lang-chips i {
  font-style: normal; font-size: 10px; line-height: 1;
  padding: 3px 5px; border-radius: 4px;
  background: rgba(0, 0, 0, .55); color: #dcecff;
}

/* ---------- 遊戲頁 ---------- */
.gamehead { padding: 4px 0 12px; }
.back { color: var(--muted); font-size: 14px; }
.gamehead h1 { margin: 8px 0 4px; font-size: 26px; }
.byline { margin: 0; color: var(--muted); font-size: 13px; }

.stage { position: relative; border-radius: 14px; overflow: hidden; background: #000; }
.stage:fullscreen { border-radius: 0; }
.stage:fullscreen .frame-wrap { height: 100%; aspect-ratio: auto; }
.stage:fullscreen .controlbar { display: none; }

.controlbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 10px; background: var(--bg2); border-top: 1px solid var(--line);
}
.cb-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cb-icon {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 7px;
  background-size: cover; background-position: center; background-color: #141a24;
}
.cb-title {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cb-right { display: flex; gap: 6px; flex: 0 0 auto; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-size: 16px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn[aria-pressed="true"] { color: var(--danger); border-color: rgba(255,107,107,.5); }

.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .2s ease; }
.fx.on { opacity: 1; }
.fx canvas { width: 100%; height: 100%; display: block; }
.fx-label {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  font-size: 34px; font-weight: 900; letter-spacing: .06em; color: #fff;
  text-shadow: 0 0 20px rgba(53, 224, 161, .9), 0 2px 10px rgba(0, 0, 0, .7);
  animation: fxpop .5s ease;
}
@keyframes fxpop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.72); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.frame-wrap { position: relative; width: 100%; aspect-ratio: 16 / 10; background: #05080c; }
#game-frame { width: 100%; height: 100%; border: 0; display: block; }

.loader { position: absolute; inset: 0; display: grid; place-items: center; background: #05080c; transition: opacity .3s ease; }
.loader.gone { opacity: 0; pointer-events: none; }
.loader-inner { text-align: center; color: var(--muted); }
.loadbar-track { width: 190px; height: 4px; margin: 14px auto 0; background: rgba(255,255,255,.12); border-radius: 999px; overflow: hidden; }
.loadbar { height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }

/* 遊戲頁：主區 + 下一款側欄 */
.game-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px; align-items: start; padding-top: 8px;
}
.game-main { min-width: 0; }

.game-rail {
  position: sticky; top: 84px;
  display: flex; flex-direction: column; gap: 8px;
  max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 4px;
}
.game-rail h3 { margin: 0 0 4px; font-size: 14px; }
.rail-card {
  display: flex; gap: 9px; align-items: center;
  padding: 6px; border-radius: 10px;
  border: 1px solid transparent;
}
.rail-card:hover { background: var(--card); border-color: var(--line); }
.rail-thumb {
  width: 96px; height: 56px; flex: 0 0 96px;
  border-radius: 7px; background-size: cover; background-position: center;
  background-color: #141a24;
}
.rail-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rail-meta b {
  font-size: 13px; line-height: 1.25; font-weight: 600;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.rail-meta small { color: var(--muted); font-size: 11px; }

.crumbs { font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

.detail-top { display: flex; gap: 14px; align-items: flex-start; }
.detail-thumb {
  width: 96px; height: 96px; flex: 0 0 96px; border-radius: 14px;
  background-size: cover; background-position: center; background-color: #141a24;
  border: 1px solid var(--line);
}
.detail-intro { min-width: 0; }
.detail-head { display: flex; align-items: center; gap: 12px; }
.detail-head h1 { margin: 0; font-size: 26px; }
.detail-intro > p { margin: 4px 0 0; }
.shortdesc { color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.share-btn {
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 12px; cursor: pointer;
}
.share-btn:hover { border-color: var(--accent); }

.statrow {
  display: flex; flex-wrap: wrap; gap: 36px;
  margin: 18px 0 4px; padding: 14px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.statcell { display: flex; flex-direction: column; gap: 2px; }
.statcell b { font-size: 20px; font-weight: 700; }
.statcell small { color: var(--muted); font-size: 12px; }

.about-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.about-table th {
  text-align: left; font-weight: 400; color: var(--muted);
  width: 150px; padding: 10px 0; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.about-table td { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.tags .pill { font-size: 11px; }
.tags a.pill:hover { border-color: var(--accent); color: var(--accent); }

.gamedetail h2 { font-size: 16px; margin: 22px 0 6px; }
.gamedetail .desc { color: var(--muted); font-size: 14px; line-height: 1.75; white-space: pre-line; max-width: 880px; }
.gamedetail .attrib { margin-top: 18px; font-size: 12px; }
.gamedetail .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 10px; }

@media (max-width: 1080px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .game-rail {
    position: static; max-height: none; overflow: visible;
    flex-direction: row; flex-wrap: wrap; gap: 8px;
  }
  .game-rail h3 { width: 100%; }
  .rail-card { width: calc(50% - 4px); }
}

/* 功能頁 */
.panel { padding: 28px 0; }
.panel.narrow { max-width: 460px; }
.form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; margin: 14px 0 26px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.form input, .form textarea, .form select {
  padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); font: inherit; outline: none; min-height: 44px;
}
.form input:focus, .form textarea:focus, .form select:focus { border-color: var(--accent2); }
.form button {
  align-self: flex-start; min-width: 140px; min-height: 44px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; font-weight: 700;
}
.form button:hover { border-color: var(--accent); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 26px; }
.table th, .table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { display: flex; gap: 6px; }
.actions input { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); }
.actions button {
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; min-height: 38px;
}
.actions .ok { border-color: rgba(53,224,161,.5); color: var(--accent); }
.actions .bad { border-color: rgba(255,107,107,.45); color: var(--danger); }

.pill { padding: 3px 9px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.pill.live { color: var(--accent); border-color: rgba(53,224,161,.5); }
.pill.pending { color: var(--yellow); border-color: rgba(255,209,102,.5); }
.pill.rejected, .pill.delisted { color: var(--danger); border-color: rgba(255,107,107,.5); }
.pill.draft { color: #c9b6ff; border-color: rgba(201, 182, 255, .5); }

/* 提交流程 */
.steps { margin-left: auto; font-size: 12px; color: var(--muted); }
.steps b { color: var(--accent); }
.hintbox {
  border-left: 3px solid var(--accent);
  background: rgba(53, 224, 161, .06);
  padding: 12px 14px; border-radius: 0 10px 10px 0; margin: 0 0 20px;
}
.hintbox p { margin: 4px 0 0; }
.check {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 0; border-bottom: 1px solid var(--line);
  font-size: 14px; color: var(--text); cursor: pointer;
}
.check input { margin-top: 3px; }
fieldset.radios, fieldset.checks {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin: 0;
}
fieldset legend { font-size: 13px; color: var(--muted); padding: 0 6px; }
fieldset label { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-size: 14px; }
.form fieldset label { flex-direction: row; align-items: center; color: var(--text); }
.form fieldset label input { margin: 0; }

.preview-shell { display: flex; gap: 16px; align-items: flex-start; }
.preview-player { flex: 1 1 auto; min-width: 0; }
.preview-side { width: 300px; flex: 0 0 300px; }
.preview-side h3 { font-size: 14px; margin: 18px 0 6px; }
.checklist { padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.9; }

/* SDK 測試面板 */
.qa-panel {
  margin-top: 18px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px;
}
.qa-head { display: flex; align-items: center; justify-content: space-between; }
.qa-head h3 { margin: 0; }
.qa-panel p { margin: 6px 0 0; font-size: 12px; }
.qa-list { list-style: none; padding: 0; margin: 8px 0 0; }
.qa-list li {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 3px 0; font-size: 12.5px; color: var(--muted);
}
.qa-list li b { width: 14px; flex: 0 0 14px; text-align: center; font-weight: 700; }
.qa-list li.pass b { color: var(--accent); }
.qa-list li.fail b { color: var(--danger); }
.qa-list li.fail { color: var(--text); }
.qa-list li.na { opacity: .55; }
.qa-list li small { margin-left: 4px; font-size: 11px; opacity: .8; }
.qa-list code { font-size: 11.5px; }
.btn-mini {
  font-size: 11px; padding: 4px 9px; border-radius: 7px;
  border: 1px solid var(--line); background: transparent;
  color: var(--text); cursor: pointer;
}
.btn-mini:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 860px) {
  .preview-shell { flex-direction: column; }
  .preview-side { width: auto; flex: none; }
}

/* 統計卡 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0 26px; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.stat span { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat small { color: var(--muted); font-size: 12px; }

.chart svg { width: 100%; height: 120px; display: block; }
.chart rect { fill: var(--accent); }
.chart .axis { stroke: var(--line); stroke-width: 1; }

/* 評分 */
.rate { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 10px; }
.rate-label { color: var(--muted); font-size: 14px; }
.rate-btn {
  font-size: 20px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text); cursor: pointer;
  min-height: 44px;
}
.rate-btn:hover { border-color: var(--accent); }
.rate-box { width: 100%; display: flex; gap: 8px; align-items: flex-start; }
.rate-text {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); font: inherit;
}
.attrib { margin: 0 0 26px; font-size: 13px; }
.attrib a { color: var(--accent2); }

.hidden { display: none !important; }

/* 頭像與帳號面板 */
.avatar-btn {
  width: 44px; height: 44px; border-radius: 50%; padding: 0;
  overflow: hidden; border: 1px solid var(--line); background: var(--bg2);
  display: grid; place-items: center; cursor: pointer;
}
.avatar-btn img { width: 40px; height: 40px; object-fit: contain; }
.avatar-btn:hover { border-color: var(--accent); }

.drawer-mask {
  position: fixed; inset: 0; z-index: 85;
  background: rgba(0, 0, 0, .55);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: 380px; max-width: 92vw;
  background: #131822;
  border-left: 1px solid var(--line);
  padding: 22px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .22s ease;
}
.drawer.open { transform: none; }

.drawer-close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; border-radius: 10px;
  border: 0; background: transparent; color: var(--muted);
  font-size: 18px; cursor: pointer;
}
.drawer-close:hover { background: var(--bg2); color: var(--text); }

.drawer-head { text-align: center; padding: 16px 0 12px; }
.drawer-avatar {
  width: 104px; height: 104px; border-radius: 50%;
  background: var(--bg2); object-fit: contain; margin: 0 auto 12px;
}
.drawer-name { font-weight: 800; font-size: 18px; }
.drawer-mail { color: var(--muted); font-size: 13px; margin-top: 2px; }

.drawer-profile { display: block; text-align: center; margin: 16px 0 18px; }

.drawer-menu { display: flex; flex-direction: column; }
.drawer-menu a, .drawer-item {
  padding: 13px 4px; font-size: 15px; text-align: left;
  border-bottom: 1px solid var(--line);
  background: none; border-left: 0; border-right: 0; border-top: 0;
  color: var(--text); cursor: pointer; width: 100%; font: inherit;
}
.drawer-menu a:hover, .drawer-item:hover { color: var(--accent); }
.drawer-menu form { margin: 0; }

.drawer-links {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  margin-top: 12px; font-size: 12px; color: var(--muted);
}
.drawer-links a:hover { color: var(--text); }

.drawer-sep { height: 1px; background: var(--line); margin: 16px 0; }

.drawer-langs { display: flex; gap: 8px; margin-bottom: 16px; }
.drawer-langs a {
  flex: 1; text-align: center; padding: 8px 0;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; color: var(--muted);
}
.drawer-langs a.on { color: var(--accent); border-color: rgba(53,224,161,.5); }

.drawer-logout {
  width: 100%; padding: 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg2);
  color: var(--text); font-weight: 600; cursor: pointer; min-height: 44px;
}
.drawer-logout:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- 開發者後台 ---------- */
.dev-shell { display: flex; margin: -20px; min-height: calc(100dvh - 64px); }.dev-nav {
  width: 220px; flex: 0 0 220px;
  border-right: 1px solid var(--line);
  padding: 14px 10px;
}
.dev-brand { display: flex; align-items: baseline; gap: 6px; padding: 6px 10px 14px; }
.dev-logo { font-weight: 900; font-size: 16px; }
.dev-sub { font-size: 10px; letter-spacing: .14em; color: var(--muted); }
.dev-group { font-size: 10px; letter-spacing: .14em; color: var(--muted); padding: 14px 10px 6px; }
.dev-nav a { display: block; padding: 9px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.dev-nav a:hover { background: var(--bg2); color: var(--text); }
.dev-nav a.active { background: rgba(53, 224, 161, .12); color: var(--accent); }
.dev-bottom { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 10px; }

.dev-main { flex: 1; min-width: 0; padding: 22px 26px 70px; }.dev-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.dev-head h1 { margin: 0; font-size: 26px; }
.dev-filters { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.dev-filters label { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.dev-filters select {
  background: var(--bg2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 13px;
}
.dev-table th { white-space: nowrap; }
.dev-game { font-weight: 600; }
.dev-foot {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 4px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}
.code {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; overflow-x: auto; font-size: 13px; line-height: 1.5;
}
.profile-top { display: flex; align-items: center; gap: 16px; margin: 0 0 20px; }
.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--bg2); object-fit: contain;
}

/* 卡片 hover 影片 */
.hover-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}
.card .shade, .card .tag, .card .name, .card .plays { z-index: 2; }

/* 素材上傳 */
.asset-row {
  display: flex; gap: 18px; padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.asset-preview {
  width: 260px; flex: 0 0 260px; aspect-ratio: 16 / 9;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; display: grid; place-items: center;
}
.asset-preview img, .asset-preview video { width: 100%; height: 100%; object-fit: cover; }
.asset-empty { color: var(--muted); font-size: 13px; }
.asset-body { flex: 1; min-width: 0; }
.asset-body h3 { margin: 0 0 4px; font-size: 16px; }
.asset-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.asset-form input[type=file] { color: var(--muted); font-size: 13px; max-width: 100%; }
.asset-form button {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; min-height: 40px;
}
.asset-form button:hover { border-color: var(--accent); }
@media (max-width: 860px) {
  .asset-row { flex-direction: column; }
  .asset-preview { width: 100%; flex: none; }
}
@media (max-width: 860px) {
  .dev-shell { display: block; margin: -14px; }
  .dev-nav { width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .dev-group { display: none; }
  .dev-nav a { display: inline-block; margin: 2px; font-size: 13px; }
  .dev-brand { padding: 4px 8px 8px; }
  .dev-main { padding: 16px 14px 96px; }
  .drawer { width: 100%; max-width: 100%; }
  .dev-head h1 { font-size: 22px; }
  .dev-filters { margin-left: 0; width: 100%; }
  .dev-filters label { flex: 1; }
  .dev-filters select { width: 100%; }
}
.muted { color: var(--muted); font-size: 14px; }
.muted a { color: var(--accent2); }
.hint { margin: -6px 0 4px; color: var(--muted); font-size: 12px; }
.okmsg { color: var(--accent); font-size: 14px; }
.error { color: var(--danger); }
.empty { color: var(--muted); }
.whoami { color: var(--text); font-weight: 600; }
.inline-form { display: inline; margin: 0; }
.inline-form button {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 12px;
}
.devbox {
  margin: 14px 0; padding: 12px 14px; border: 1px dashed #6b5d2a;
  border-radius: 10px; background: rgba(255, 209, 102, .07);
  font-size: 13px; color: #e6d8a8; word-break: break-all;
}
.devbox a { color: var(--yellow); }

.phone-row { display: flex; gap: 8px; }
.phone-row select {
  flex: 0 0 auto; max-width: 52%;
  padding: 11px 8px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); font: inherit; min-height: 44px;
}
.phone-row input { flex: 1; min-width: 0; }

.foot {
  border-top: 1px solid var(--line);
  padding: 22px 20px;
  color: var(--muted);
  font-size: 13px;
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
}
.dot { opacity: .5; }

.tabbar { display: none; }

/* ---------- 手機 ---------- */
@media (max-width: 860px) {
  body { display: block; }
  .rail { display: none; }
  .page { margin-left: 0; }

  .topbar { flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .brandname { font-size: 16px; }
  .search { order: 3; flex: 1 1 100%; margin: 0; }
  .top-actions { gap: 8px; }
  .langs a { padding: 4px 6px; }

  main { padding: 14px 14px 100px; }

  .hero { aspect-ratio: 16 / 10; }
  .hero-content { left: 18px; right: 18px; bottom: 18px; }
  .hero p { display: none; }

  .scroller .card { width: 190px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .shelf-head h2 { font-size: 18px; }

  .frame-wrap { aspect-ratio: auto; height: min(70dvh, 560px); }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 70;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(9, 12, 18, .96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 0; font-size: 11px; color: var(--muted);
    border-radius: 10px; min-height: 48px; justify-content: center;
  }
  .tabbar a.active { color: var(--accent); }
  .tabbar .ico { font-size: 19px; line-height: 1; }

  .foot { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .frame-wrap { height: calc(100dvh - 92px); aspect-ratio: auto; }
  .hero, .gamehead { display: none; }
}

/* ---- 創作者上傳：轉圈 → 打勾 ---- */
.up-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  min-height: 18px;
  font-size: 12.5px;
  color: var(--muted);
}
.up-line[data-state="done"] { color: var(--accent); }
.up-line[data-state="error"] { color: #ff8f8f; }
.up-spin {
  display: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .16);
  border-top-color: var(--accent);
  animation: up-spin .8s linear infinite;
}
.up-line[data-state="busy"] .up-spin { display: inline-block; }
.up-ok {
  display: none;
  font-weight: 900;
  color: var(--accent);
}
.up-line[data-state="done"] .up-ok { display: inline-block; }
.btn-primary[disabled] {
  opacity: .45;
  filter: grayscale(1);
  cursor: not-allowed;
  box-shadow: none;
}
@keyframes up-spin { to { transform: rotate(360deg); } }

/* ---------- 個人檔案 ---------- */
.small { font-size: 12px; }

.phero {
  position: relative; height: 240px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(120deg, #1b2a3a, #0e1620);
  background-size: cover; background-position: center;
}
.phero-fade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,14,20,.1) 30%, rgba(11,14,20,.92) 100%);
}
.phero-edit {
  position: absolute; right: 14px; bottom: 14px;
  padding: 7px 12px; border-radius: 9px; font-size: 13px;
  background: rgba(10,14,20,.7); border: 1px solid rgba(255,255,255,.18);
  color: #fff;
}
.phero-edit:hover { border-color: var(--accent); color: var(--accent); }

.phead-row {
  display: flex; align-items: flex-end; gap: 16px;
  margin-top: -46px; padding: 0 10px; position: relative;
}
.pavatar {
  width: 112px; height: 112px; border-radius: 20px;
  border: 4px solid var(--bg); background: #0e1620;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.pidentity { padding-bottom: 6px; min-width: 0; }
.pidentity h1 { margin: 0; font-size: 24px; }
.pidentity p { margin: 2px 0 0; font-size: 13px; }
.pactions { margin-left: auto; display: flex; gap: 8px; padding-bottom: 6px; }
.btn-ghost {
  padding: 8px 13px; border-radius: 9px; font-size: 13px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.pgrid {
  display: grid; grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px; align-items: start; margin-top: 20px;
}
.pcol { display: flex; flex-direction: column; gap: 12px; }
.pcard {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px;
}
.pcard h3 { margin: 0 0 8px; font-size: 15px; }
.pcard-row { display: flex; align-items: baseline; justify-content: space-between; }
.pnum { font-size: 18px; font-weight: 700; }

.pstats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pstats li { display: flex; flex-direction: column; gap: 1px; }
.pstats b { font-size: 18px; }
.pstats span { color: var(--muted); font-size: 12px; }

.pactivity { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.pthumb {
  width: 84px; height: 48px; flex: 0 0 84px; border-radius: 8px;
  background-size: cover; background-position: center; background-color: #141a24;
}
.pmeta { min-width: 0; }
.pmeta small { display: block; color: var(--muted); font-size: 11px; }
.pmeta b { font-size: 13px; }

.ptabs { display: flex; gap: 8px; margin-bottom: 12px; }
.ptab-btn {
  padding: 8px 15px; border-radius: 999px; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.ptab-btn.on {
  background: rgba(53,224,161,.14); color: var(--accent);
  border-color: rgba(53,224,161,.5);
}

.plb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.plb-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px;
}
.plb-head { display: flex; justify-content: space-between; gap: 12px; }
.plb-head h3 { margin: 0 0 3px; font-size: 15px; }
.plb-thumb {
  width: 56px; height: 56px; flex: 0 0 56px; border-radius: 10px;
  background-size: cover; background-position: center; background-color: #141a24;
}
.plb-empty { margin: 12px 0; }
.pill-btn {
  display: inline-block; padding: 7px 16px; border-radius: 999px;
  background: var(--accent); color: #06261c; font-weight: 700; font-size: 13px;
}
.pill-btn:hover { filter: brightness(1.06); }

.pgrid-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }

#edit { margin-top: 18px; }
.avatar-pick { flex-direction: row !important; align-items: center; gap: 10px; }
.avatar-pick img {
  width: 46px; height: 46px; border-radius: 9px; border: 1px solid var(--line);
}

@media (max-width: 960px) {
  .pgrid { grid-template-columns: 1fr; }
  .phead-row { flex-wrap: wrap; }
  .pactions { margin-left: 0; width: 100%; }
  .phero { height: 180px; }
}

.pnote {
  margin: 12px 0 0; padding: 9px 12px; border-radius: 9px;
  background: rgba(53,224,161,.1); color: var(--accent); font-size: 13px;
}
.friend-add { display: flex; gap: 6px; margin: 8px 0; }
.friend-add input {
  flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  font: inherit; font-size: 13px;
}
.fcode { letter-spacing: .12em; }
.fhead { margin: 12px 0 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.frow { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.frow img { width: 26px; height: 26px; border-radius: 6px; }
.frow span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini {
  padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-size: 11px; cursor: pointer;
}
.mini:hover { border-color: var(--accent); color: var(--accent); }
.psec { margin-top: 22px; }

.lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.lb-row span { width: 34px; color: var(--muted); }
.lb-row b { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row em { font-style: normal; color: var(--accent); font-weight: 700; }

/* ---------- 錢包 ---------- */
.wcard {
  display: flex; gap: 48px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px 24px; margin: 16px 0 10px;
}
.wbalance { font-size: 42px; font-weight: 900; margin: 2px 0; line-height: 1.1; }
.wbalance small { font-size: 14px; color: var(--muted); font-weight: 600; }
.wtopup { min-width: 260px; }
.wamounts { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.wamounts .btn-ghost[disabled] { opacity: .45; cursor: not-allowed; }
.table td.plus { color: var(--accent); font-weight: 700; }
.table td.minus { color: var(--danger); font-weight: 700; }
