:root {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.72);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.hidden {
  display: none !important;
}

.app {
  width: 100%;
  height: 100%;
  position: relative;
}

.feed {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

.video-card {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 100vh;
  background: #000;
  scroll-snap-align: start;
  overflow: hidden;
}

.video-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.video-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 14px calc(env(safe-area-inset-bottom, 0px) + 22px);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent 45%);
}

.video-overlay h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.video-overlay p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.hint {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 52px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
}

.current-drama {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.switch-btn {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #10131f;
  background: #6ca8ff;
}

.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
}

.sheet-panel {
  width: 100%;
  max-height: 70vh;
  background: #15171f;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sheet-header h3 {
  margin: 0;
  font-size: 16px;
}

.sheet-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.sheet-list {
  max-height: calc(70vh - 56px);
  overflow-y: auto;
  padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 12px);
}

.sheet-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-radius: 10px;
  padding: 14px 12px;
  margin-bottom: 10px;
  text-align: left;
  cursor: pointer;
}

.sheet-item strong {
  font-size: 15px;
}

.sheet-item span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.sheet-item.active {
  border-color: #6ca8ff;
  background: rgba(108, 168, 255, 0.12);
}

.login-sheet {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
  background: radial-gradient(circle at top, #1c1f2e, #0a0b10 60%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 18px;
  backdrop-filter: blur(8px);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

.login-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.login-card label {
  display: block;
  font-size: 13px;
  margin-bottom: 12px;
}

.login-card input {
  width: 100%;
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
}

.login-card button {
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding: 11px 12px;
  font-size: 15px;
  font-weight: 600;
  color: #10131f;
  background: #6ca8ff;
}

.desktop-mask {
  position: fixed;
  inset: 0;
  background: #0a0b10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 90;
}

.desktop-mask__card {
  max-width: 380px;
  text-align: center;
  color: #d4dbff;
}

.desktop-mask__card h2 {
  margin-top: 0;
}

.desktop-mask__btn {
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  background: #6ca8ff;
  color: #10131f;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

body.pc-preview {
  background: #111;
}

body.pc-preview .app,
body.pc-preview .login-sheet {
  width: min(100%, 420px);
  max-width: 420px;
  height: min(100vh, 860px);
  margin: 0 auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

body.pc-preview .video-card {
  height: min(100dvh, 860px);
  min-height: min(100vh, 860px);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  transform: translateX(-50%);
  z-index: 60;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
}
