/* static/css/styles.css */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

#video-container {
  position: relative;
  width: 100vw;
  height: 100%;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
}

video {
  max-width: 92%;
  max-height: 88%;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: auto;
  z-index: 1;
  background: #000;
}

video::-webkit-media-controls {
  opacity: 1 !important;
  z-index: 10 !important;
}

video::-webkit-media-controls-panel {
  background-color: rgba(0, 0, 0, 0.55);
  border-radius: 0 0 16px 16px;
  padding: 6px;
}

@supports (-webkit-appearance: none) {
  video::-internal-media-controls-download-button {
    display: none;
  }
}

/* 手机端全屏 */
@media (max-width: 768px) {
  video {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    border-radius: 0;
    box-shadow: none;
    z-index: 1;
  }
}

/* ========== 浮动菜单 ========== */
/* 默认手机端位置（与 JS 保持一致） */
#floating-menu {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px;
  z-index: 10000;
  right: 5%;
  bottom: 20vh;
  will-change: transform;
}

#floating-menu button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s ease;
  outline: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#floating-menu button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

#floating-menu button:active {
  transform: translateY(0);
}

#floating-menu button svg {
  flex-shrink: 0;
  opacity: 0.9;
}

#select-display {
  width: 100%;
  min-width: 110px;
}

#select-display .icon-chevron {
  margin-left: 2px;
}

/* ========== 下拉菜单 ========== */
#custom-select-wrapper {
  position: relative;
}

#custom-options-list {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  min-width: 120px;
  max-height: 360px;
  overflow-y: auto;
  z-index: 10100;
  margin-bottom: 6px;
  padding: 6px 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#custom-options-list::-webkit-scrollbar {
  width: 5px;
}
#custom-options-list::-webkit-scrollbar-track {
  background: transparent;
}
#custom-options-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.custom-option {
  padding: 9px 14px;
  color: #e2e8f0;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.875rem;
  text-align: center;
  transition: background 0.15s;
}

.custom-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.custom-option.selected {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

/* 电脑端由 JS 动态定位 */
@media (min-width: 769px) {
  #floating-menu {
    position: absolute;
    bottom: auto;
    right: auto;
  }
}
