:root {
  --bg: #0A1220;
  --card: #152033;
  --bar: #101A2A;
  --lime: #C8F542;
  --text: #E8EEF6;
  --mute: #8A97A8;
  --line: #2A3A52;
}
* { box-sizing: border-box; }
html, body, #app { margin: 0; height: 100%; width: 100%; background: var(--bg); color: var(--text); font-family: system-ui, Segoe UI, sans-serif; overflow: hidden; }
#app { min-height: 0; }
button { font-family: inherit; }
.btn, .follow, .rail button.item, .rail .hot, .smile, .combtn, .fullbtn, .sidetab, .av {
  transition: transform .16s ease, filter .16s ease;
}
.btn:hover, .follow:hover, .rail .hot:hover { transform: scale(1.04); }
.rail button.item:hover { transform: translateX(6px); }
.smile:hover, .combtn:hover, .fullbtn:hover { transform: scale(1.18); }
.av:hover { transform: scale(1.08); }
.screen { height: 100%; width: 100%; min-height: 0; overflow: hidden; position: relative; display: flex; flex-direction: column; background: var(--bg); }
.stage { flex: 1 1 auto; position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; background: #070b14; overflow: auto; scrollbar-width: none; }
.stage::-webkit-scrollbar { width: 0; height: 0; display: none; }
.stage img { -webkit-user-drag: none; user-select: none; pointer-events: none; }
.stage img, .stage video {
  -webkit-user-drag: none;
  user-select: none;
  display: block;
  max-width: min(640px, 78%);
  max-height: calc(100% - 8px);
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}
.hit { position: absolute; top: 72px; bottom: 110px; height: auto; width: 30%; z-index: 5; cursor: pointer; }
.hit.left { left: 0; }
.hit.right { right: 0; }
.vctrl { position: absolute; left: 78px; bottom: 52px; z-index: 12; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vctrl button { background: #000b; color: #fff; border: 1px solid #fff4; border-radius: 18px; width: 42px; height: 42px; font-size: 20px; cursor: pointer; }
.vctrl #vbar { display: none; }
.vctrl #vol { width: 18px; height: 110px; writing-mode: vertical-lr; direction: rtl; appearance: slider-vertical; accent-color: var(--lime); opacity: 0; pointer-events: none; transition: opacity .15s; }
.vctrl:hover #vol, .vctrl:focus-within #vol { opacity: 1; pointer-events: auto; }
.sidetab { display: none; position: fixed; right: 0; top: 42%; z-index: 40; width: 18px; height: 72px; border: 0; border-radius: 10px 0 0 10px; background: var(--lime); color: #000; font-size: 18px; font-weight: 800; cursor: pointer; }
.sq.ban { aspect-ratio: 3 / 1; font-size: 18px; }
.hud { position: relative; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--bar); flex-shrink: 0; }
.hud b { font-size: 20px; }
.badge { background: #E53935; color: #fff; border-radius: 12px; padding: 2px 8px; font-size: 12px; font-weight: 800; }
.menu { background: none; border: 0; color: #fff; font-size: 28px; cursor: pointer; }
.smile { position: absolute; left: 22px; bottom: 52px; z-index: 12; text-align: center; cursor: pointer; }
.smile .ic { font-size: 34px; color: var(--lime); line-height: 1; }
.smile span { font-weight: 800; }
.smile.down { left: 132px; }
.smile.down .ic { color: #FF8A65; }
.combtn { position: absolute; right: 22px; bottom: 22px; z-index: 12; text-align: center; cursor: pointer; }
.fullbtn { position: absolute; right: 22px; bottom: 86px; z-index: 12; width: 42px; height: 42px; border: 0; border-radius: 21px; background: #000a; color: #fff; font-size: 18px; cursor: pointer; }
.author { position: relative; z-index: 12; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 16px 8px; flex-shrink: 0; }
.author b { font-weight: 800; }
.tick { color: var(--lime); font-size: 16px; }
.tick.mod { color: #4FC3F7; }
.follow { margin-left: auto; background: var(--lime); color: #000; border: 0; border-radius: 16px; padding: 6px 14px; font-weight: 800; cursor: pointer; }
.follow.on { background: var(--card); color: #fff; }
.clock { text-align: center; color: var(--text); }
.clock img { width: 140px; }
.clock .t { font-size: 42px; font-weight: 800; color: var(--lime); margin: 8px 0; }
.btn { background: var(--lime); color: #000; border: 0; border-radius: 24px; padding: 10px 18px; font-weight: 800; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--lime); }
.drawer-bg { position: absolute; inset: 0; background: #0009; z-index: 20; }
.drawer { position: absolute; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); background: var(--bar); z-index: 21; padding: 18px 0 10px; display: flex; flex-direction: column; overflow: auto; }
.drawer h1 { margin: 8px 20px 16px; color: var(--lime); font-size: 28px; }
.drawer button.item { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 12px 20px; cursor: pointer; font-size: 16px; }
.drawer .hot { margin: 0 12px 8px; background: var(--lime); color: #000; border-radius: 14px; padding: 12px 14px; font-weight: 800; text-align: left; border: 0; width: calc(100% - 24px); cursor: pointer; }
.drawer .hot small { display: block; color: #0008; font-weight: 600; }
.drawer .me { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--card); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; font-weight: 800; flex-shrink: 0; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.form { width: min(420px, 92vw); margin: 40px auto; display: flex; flex-direction: column; gap: 10px; }
.form input, .form textarea { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 12px; }
.err { color: #ff8a80; }
.sq { width: 100%; aspect-ratio: 1; border: 1px dashed var(--line); border-radius: 18px; background: var(--card); display: flex; align-items: center; justify-content: center; color: var(--lime); font-size: 48px; cursor: pointer; overflow: hidden; }
.sq img { width: 100%; height: 100%; object-fit: contain; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; overflow: auto; padding: 6px; }
.grid .cell { position: relative; width: 100%; aspect-ratio: 3 / 4; padding: 0; border: 0; background: #000; cursor: pointer; overflow: hidden; border-radius: 8px; transition: transform .16s ease; }
.grid .cell:hover { transform: scale(1.06); z-index: 2; }
.grid img, .grid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background:#000; }
.banner { height: 140px; background: var(--card); overflow: hidden; }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.prof { text-align: center; margin-top: -28px; padding: 0 16px 16px; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--bar); }
.search { flex: 1; background: var(--card); border: 0; color: var(--text); border-radius: 12px; padding: 8px 10px; }
.empty { color: var(--mute); }
.row { transition: transform .16s ease; }
.row:hover { transform: scale(1.02); background: #ffffff08; }
.sheet { position: absolute; inset: 0; background: var(--bg); z-index: 30; display: flex; flex-direction: column; }
.sheet .list { flex: 1; overflow: auto; padding: 8px 12px; }
.row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row p { margin: 4px 0 0; }
.side { display: none; }
.rail { display: none; }
.dl { display:block; margin: 8px 16px 0; text-align:center; text-decoration:none; }

@media (min-width: 960px) {
  .sidetab { display: block; }
  #app.desk { display: grid; grid-template-columns: 260px minmax(0, 1fr); height: 100%; min-height: 0; }
  #app.desk.open { grid-template-columns: 260px minmax(0, 1fr) 300px; }
  .rail { display: flex; flex-direction: column; background: var(--bar); padding: 18px 0; overflow: auto; }
  .rail h1 { margin: 8px 20px 16px; color: var(--lime); font-size: 28px; }
  .rail button.item { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 12px 20px; cursor: pointer; font-size: 16px; }
  .rail .hot { margin: 0 12px 8px; background: var(--lime); color: #000; border-radius: 14px; padding: 12px 14px; font-weight: 800; text-align: left; border: 0; width: calc(100% - 24px); cursor: pointer; }
  .rail .hot small { display: block; color: #0008; font-weight: 600; }
  .rail .me { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 10px; align-items: center; cursor: pointer; }
  .screen { grid-column: 2; min-height: 0; height: 100%; overflow: hidden; }
  .side { display: flex; flex-direction: column; background: #0d1626; border-left: 1px solid var(--line); overflow: auto; min-height: 0; height: 100%; }
  .side h3 { margin: 16px; }
  .drawer, .drawer-bg, .menu, .hint { display: none !important; }
  .stage { background: #05070d; overflow: hidden; min-height: 0; display: flex; align-items: center; justify-content: center; }
  .stage img { -webkit-user-drag: none; user-select: none; pointer-events: none; }
.stage img, .stage video { width: auto; height: auto; max-width: min(640px, 72%); max-height: calc(100vh - 170px); object-fit: contain; }
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .coms { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  .coms .list { flex: 1; overflow: auto; padding: 8px 12px; }
  .hit { width: 26%; }
}

.stage-media { max-width: min(640px, 78%); max-height: 100%; display:flex; align-items:center; justify-content:center; animation: popIn .28s ease; }
.stage-media.left { animation: slideL .28s ease; }
.stage-media.right { animation: slideR .28s ease; }
.stage-media img, .stage-media video { max-width: 100%; max-height: min(100%, calc(100vh - 170px)); width: auto; height: auto; object-fit: contain; }
@keyframes popIn { from { transform: scale(.96); opacity:.5 } to { transform:none; opacity:1 } }
@keyframes slideL { from { transform: translateX(72px); opacity:.25 } to { transform:none; opacity:1 } }
@keyframes slideR { from { transform: translateX(-72px); opacity:.25 } to { transform:none; opacity:1 } }
