* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #111; color: #e8e8e8; font: 15px/1.4 -apple-system, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif; }
body { padding-bottom: env(safe-area-inset-bottom); }
#video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
button, .btnlike, select { background: #2a2d33; color: #eee; border: 1px solid #3c4049; border-radius: 8px; padding: 8px 10px; font-size: 14px; cursor: pointer; display: inline-block; }
button:active, .btnlike:active { background: #3a3f48; }
button:disabled { opacity: .4; }
button.on { background: #1f5fbf; border-color: #2f7bff; }
.big { font-size: 18px; padding: 14px 22px; margin: 8px; }

#view { position: relative; background: #000; min-height: 45vh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#stage { position: relative; display: inline-block; line-height: 0; }
#gl { display: block; max-width: 100vw; max-height: 58vh; width: auto; height: auto; }
#ov { position: absolute; left: 0; top: 0; width: 100%; height: 100%; touch-action: none; }
#welcome { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: #000; }
#welcome h2 { margin: 0 0 4px; }
#welcome p { color: #999; margin: 0 0 16px; }
#toast { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(0,0,0,.75); color: #fff; padding: 6px 12px; border-radius: 16px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90%; text-align: center; }
#toast.show { opacity: 1; }
#recDot { position: absolute; right: 10px; top: 10px; color: #ff4040; font-weight: bold; background: rgba(0,0,0,.5); padding: 2px 8px; border-radius: 10px; }

#fileBar { display: flex; gap: 8px; align-items: center; padding: 6px 8px; background: #181a1e; }
#fileBar[hidden] { display: none; }
#fbSeek { flex: 1; }

#actions { display: grid; grid-template-columns: 1fr 1fr 1fr auto auto; gap: 6px; padding: 8px; background: #181a1e; }
#actions button { font-size: 16px; padding: 12px 6px; }
#aRec.on { background: #b02020; border-color: #e03030; }
#aLog.on { background: #1f7a3a; border-color: #2fae55; }

#tabs { display: flex; background: #1b1d22; border-bottom: 1px solid #333; position: sticky; top: 0; z-index: 5; }
#tabs button { flex: 1; border: 0; border-radius: 0; background: transparent; padding: 10px 0; color: #aaa; }
#tabs button.on { color: #fff; border-bottom: 2px solid #2f7bff; }
.panel { display: none; padding: 10px 12px 30px; }
.panel.on { display: block; }
.row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; align-items: center; }
.seg button { flex: 1; }
.sl { display: block; margin: 10px 0 2px; color: #ccc; font-size: 14px; }
.sl output { float: right; color: #fff; font-variant-numeric: tabular-nums; }
.sl input[type=range] { width: 100%; margin-top: 4px; }
.sl input[type=number] { width: 100%; margin-top: 4px; padding: 8px; font-size: 16px; background: #22252b; color: #fff; border: 1px solid #3c4049; border-radius: 6px; }
.chk { display: inline-flex; align-items: center; gap: 6px; margin: 6px 8px 6px 0; font-size: 14px; }
.chk input { width: 18px; height: 18px; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-left: 4px; border: 1px solid #555; }
.hint { color: #888; font-size: 12.5px; margin: 6px 0; }
.metrics { background: #1b1d22; border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-variant-numeric: tabular-nums; white-space: pre-wrap; font-size: 14px; }
.chart { width: 100%; height: 170px; background: #15171a; border-radius: 8px; margin: 6px 0; display: block; }
.kymo { width: 100%; height: 180px; background: #15171a; border-radius: 8px; image-rendering: pixelated; display: block; }

body.full #tabs, body.full .panel, body.full #fileBar { display: none !important; }
body.full #view { height: calc(100vh - 64px); }
body.full #gl { max-height: calc(100vh - 64px); }
body.full #actions { position: fixed; left: 0; right: 0; bottom: 0; }
button.primary { background: #1f5fbf; border-color: #2f7bff; font-size: 15px; padding: 10px 12px; width: 100%; }
button.danger { color: #ff8585; border-color: #6b2b2b; background: #2d1c1e; }
button.danger:active { background: #442428; }
.sub { margin: 14px 0 2px; color: #9ab; font-size: 13px; border-top: 1px solid #2a2d33; padding-top: 8px; }
details { margin: 10px 0; background: #17191d; border-radius: 8px; padding: 6px 10px; }
summary { color: #9ab; font-size: 14px; cursor: pointer; padding: 4px 0; }
