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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #1a1a1a;
}

.container {
  width: 100%;
  max-width: 800px;
  height: 100vh;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

.video-slider {
  width: 100%;
  height: 100vh;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.video-container {
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background-color: #1a1a1a;
}

.video-container video {
  width: 100%;
  height: 100vh;
  object-fit: cover;
}

.loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  color: #fff;
  z-index: 300;
}

.loading.hidden {
  display: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-toast {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(244, 67, 54, 0.9);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 400;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.error-toast.show {
  opacity: 1;
}

.side-controls {
  position: absolute;
  right: 12px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 999;
}

.control-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.control-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.control-btn:active {
  transform: scale(0.95);
}

.control-btn svg {
  width: 20px;
  height: 20px;
}

.switch-source-btn svg {
  transform: rotate(0deg);
}

.control-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.switch {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.25);
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.switch.active {
  background: #4CAF50;
}

.switch-handle {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.switch.active .switch-handle {
  transform: translateX(20px);
}

.source-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.source-modal.show {
  display: flex;
}

.source-modal-content {
  width: 360px;
  max-height: 70vh;
  background: #2a2a2a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.source-modal-title {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.source-close-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.2s ease;
}

.source-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.source-close-btn svg {
  width: 16px;
  height: 16px;
}

.source-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.source-list-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  transition: background 0.15s ease;
}

.source-list-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.source-list-item.active {
  background: rgba(76, 175, 80, 0.2);
}

.source-list-item .tag {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 8px;
  flex-shrink: 0;
}

.source-list-item .tag.direct {
  background: rgba(76, 175, 80, 0.3);
  color: #81c784;
}

.source-list-item .tag.proxy {
  background: rgba(255, 152, 0, 0.3);
  color: #ffb74d;
}

.source-list-item .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-list-item .check {
  color: #4CAF50;
  flex-shrink: 0;
  margin-left: 8px;
}

.proxy-btn svg {
  transform: rotate(0deg);
}

.proxy-form {
  padding: 16px 20px;
}

.proxy-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.proxy-form input:focus {
  border-color: #4CAF50;
}

.proxy-form input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.proxy-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.proxy-btn-cancel,
.proxy-btn-confirm {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.proxy-btn-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.proxy-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
}

.proxy-btn-confirm {
  background: #4CAF50;
  color: #fff;
}

.proxy-btn-confirm:hover {
  background: #45a049;
}