/**
 * 黑色橙色主题 - Thumbzilla 风格
 * 全面改版网站 UI
 */

/* ===== 变量定义 ===== */
:root {
  /* 主色调 */
  --bg-primary: #000000;
  --bg-secondary: #1a1a1a;
  --bg-card: #2a2a2a;
  --bg-hover: #333333;
  
  /* 强调色 */
  --primary-color: #ff9900;
  --primary-hover: #ffaa33;
  
  /* 文字颜色 */
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #666666;
  
  /* 边框 */
  --border-color: #333333;
  
  /* 阴影 */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.5);
  
  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* ===== 全局样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--primary-hover);
}

/* ===== 导航栏 ===== */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--primary-color);
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: bold;
  color: var(--primary-color);
}

.logo-mark {
  font-size: 24px;
}

/* 搜索框 */
.search-form {
  display: flex;
  max-width: 500px;
  flex: 1;
  margin: 0 20px;
}

.search-form input {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
}

.search-form input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.search-form button {
  padding: 10px 20px;
  background: var(--primary-color);
  border: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: #000;
  cursor: pointer;
  transition: background 0.3s;
}

.search-form button:hover {
  background: var(--primary-hover);
}

/* 按钮 */
.btn-login, .btn-signup, .upload-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-login {
  background: transparent;
  border: 1px solid var(--text-secondary);
  color: var(--text-primary);
}

.btn-login:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-signup {
  background: var(--primary-color);
  border: none;
  color: #000;
  font-weight: bold;
}

.btn-signup:hover {
  background: var(--primary-hover);
}

.upload-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.upload-btn:hover {
  background: var(--primary-color);
  color: #000;
}

/* ===== 主内容区 ===== */
.main-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== 视频网格 ===== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ===== 视频卡片 ===== */
.video-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.video-thumbnail {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  background: var(--bg-primary);
  overflow: hidden;
}

.thumb-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a2332 0%, #2a3a4a 25%, #0f1724 50%, #2a3a4a 75%, #1a2332 100%);
  background-size: 400% 400%;
  animation: gradientMove 6s ease infinite;
}

/* thumb-placeholder-gradient div 样式（与 thumb-placeholder 一致） */
.thumb-placeholder-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a2332 0%, #2a3a4a 25%, #0f1724 50%, #2a3a4a 75%, #1a2332 100%);
  background-size: 400% 400%;
  animation: gradientMove 6s ease infinite;
}

.video-card:hover .thumb-placeholder {
  animation: none;
  background: var(--primary-color);
}

/* 播放按钮 */
.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 153, 0, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.video-card:hover .play-button {
  opacity: 1;
}

.play-button i {
  font-size: 24px;
  color: #000;
  margin-left: 4px;
}

/* 时长标签 */
.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: bold;
}

/* 质量标签 */
.quality-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary-color);
  color: #000;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: bold;
}

/* 视频信息 */
.video-info {
  padding: 12px;
}

.video-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.video-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.video-views {
  display: flex;
  align-items: center;
  gap: 4px;
}

.video-date {
  color: var(--text-muted);
}

/* ===== 侧边栏 ===== */
.sidebar {
  position: fixed;
  left: 0;
  top: 60px;
  width: 280px;
  height: calc(100vh - 60px);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 32px 0;
  overflow-y: auto;
  z-index: 999;
}

.sidebar-section {
  margin-bottom: 40px;
}

.sidebar-section h3 {
  padding: 0 24px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  color: var(--text-secondary);
  transition: all 0.3s;
  font-size: 14px;
  line-height: 1.5;
}

.sidebar-link:hover, .sidebar-link.active {
  background: var(--bg-hover);
  color: var(--primary-color);
}

.sidebar-link i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

/* 广告合作卡片 */
.sidebar-ad-card {
  margin: 24px 16px 0;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: #fff;
}

.sidebar-ad-card h4 {
  font-size: 15px;
  margin-bottom: 12px;
  font-weight: 600;
}

.sidebar-ad-card p {
  font-size: 13px;
  margin-bottom: 16px;
  opacity: 0.9;
  line-height: 1.6;
}

.sidebar-ad-card .btn-contact {
  display: block;
  width: 100%;
  padding: 12px;
  background: #fff;
  color: #667eea;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: transform 0.3s;
}

.sidebar-ad-card .btn-contact:hover {
  transform: scale(1.05);
}

/* ===== 模态框 ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 400px;
  width: 90%;
  position: relative;
  border: 1px solid var(--border-color);
}

.modal-content h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 24px;
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
}

.close:hover {
  color: var(--text-primary);
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--primary-color);
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
  }
  
  .nav-center {
    order: 3;
    width: 100%;
    margin-top: 12px;
  }
  
  .search-form {
    margin: 0;
  }
  
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
  }
}

/* ===== 动画 ===== */
@keyframes gradientMove {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 加载动画 ===== */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.loading-spinner i {
  font-size: 40px;
  color: var(--primary-color);
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

/* ===== 提示消息 ===== */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary-color);
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== 广告合作浮动窗口 ===== */
.ad-float-window {
  position: fixed;
  top: 50%;
  right: -400px;
  transform: translateY(-50%);
  z-index: 9999;
  transition: right 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  max-width: 320px;
  width: 100%;
}

.ad-float-window.show {
  right: 20px;
}

.ad-float-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
  overflow: hidden;
}

.ad-float-header {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  background: rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: #fff;
}

.ad-float-header i:first-child {
  font-size: 20px;
  margin-right: 10px;
}

.ad-float-header span {
  flex: 1;
  font-weight: bold;
  font-size: 16px;
}

.ad-float-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 5px;
  font-size: 18px;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.ad-float-close:hover {
  opacity: 1;
}

.ad-float-body {
  padding: 20px;
}

.ad-float-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #667eea;
  padding: 12px 20px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  transition: all 0.3s;
  margin: 10px 0;
}

.ad-float-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255,255,255,0.3);
}

.ad-float-btn i {
  margin-right: 8px;
  font-size: 16px;
}
