/* Reset & Base */
* {
  box-sizing: border-box;
}

body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 850px;
  /* 限制最大宽度 */
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #000;
}

.video-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.video-content {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.center-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  z-index: 5;
  opacity: 0.8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.center-play-btn img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.8));
}

/* Loading Spinner */
.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  z-index: 20;
  display: none;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Top Bar */
.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 0.8rem;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-left {
  display: flex;
  align-items: center;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  opacity: 0.9;
}

.top-logo {
  height: 24px;
  width: auto;
  object-fit: contain;
}

.menu-btn {
  opacity: 0.8;
  padding: 8px;
  position: relative;
  cursor: pointer;
}

.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: 160px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 4px 0;
  z-index: 100;
  margin-top: 8px;
}

.menu-item {
  display: block;
  padding: 12px 16px;
  color: #666;
  font-size: 14px;
  text-decoration: none;
  text-align: left;
  transition: background-color 0.2s;
}

.menu-item:first-child {
  border-bottom: 1px solid #f0f0f0;
}

.menu-item:active {
  background-color: #f5f5f5;
}

/* Right Sidebar */
.right-sidebar {
  position: absolute;
  right: 10px;
  bottom: 80px;
  /* Adjust based on bottom info height */
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.avatar-container {
  position: relative;
  margin-bottom: 10px;
}

.avatar-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid #fff;
  overflow: hidden;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.follow-btn {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  background: #fa334d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-wrapper {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.icon-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.action-text {
  font-size: 12px;
  font-weight: 500;
}

/* Bottom Info */
.bottom-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 20;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.fullscreen-toggle-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.fullscreen-toggle {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 12px;
  padding: 6px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fullscreen-toggle img {
  width: 14px;
  height: 14px;
  margin-right: 4px;
}

.info-content {
  margin-bottom: 12px;
  color: #fff;
  text-align: left;
}

.user-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
}

.verified-icon {
  width: 14px;
  height: 14px;
  margin: 0 6px;
}

.post-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: normal;
}

.video-desc {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  width: 80%;
}

/* Progress Bar */
.progress-container {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  margin-top: 4px;
}

.progress-track {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 8px;
  border-radius: 1px;
  position: relative;
  cursor: pointer;
  /* 增加点击手型 */
  overflow: visible;
  /* 确保 thumb 不会被裁剪 */
  z-index: 10;
  /* 确保 track 在正确层级 */
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: #008EFE;
  /* Use theme color */
  width: 0%;
  border-radius: 1px;
}

.time-current,
.time-total {
  font-variant-numeric: tabular-nums;
}

/* Progress Thumb */
.progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  /* 稍微加大尺寸 */
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  /* 加深阴影 */
  z-index: 100;
  /* 提高层级 */
  cursor: pointer;
  display: block;
  /* 默认显示 */
}

/* 增加触摸区域 */
.progress-thumb::after {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
}

/* 播放状态隐藏 thumb */
.video-playing .progress-thumb {
  display: none;
}