* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #1a1a2e; }

/* ===== 导航栏 ===== */
header {
  background: rgba(26, 26, 46, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.6rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

nav {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-left .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e94560;
  text-decoration: none;
  transition: all 0.3s ease;
}

.nav-left .logo:hover {
  transform: scale(1.05);
  text-shadow: 0 0 20px rgba(233, 69, 96, 0.3);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(4px);
}

.nav-link:hover {
  background: rgba(233, 69, 96, 0.2);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(233, 69, 96, 0.15);
}

/* ===== 发布按钮 ===== */
.btn-upload {
  background: linear-gradient(135deg, #e94560, #c73652);
  color: white;
  padding: 0.4rem 1.4rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
  border: none;
  cursor: pointer;
}

.btn-upload:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 30px rgba(233, 69, 96, 0.4);
}

.btn-upload-video {
  background: linear-gradient(135deg, #4a90d9, #357abd);
  color: white;
  padding: 0.4rem 1.4rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(74, 144, 217, 0.3);
  border: none;
  cursor: pointer;
}

.btn-upload-video:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 30px rgba(74, 144, 217, 0.4);
}

/* ===== 登录/注册 ===== */
.btn-login {
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
}

.btn-login:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.btn-register {
  background: linear-gradient(135deg, #e94560, #c73652);
  color: white;
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(233, 69, 96, 0.25);
}

.btn-register:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 30px rgba(233, 69, 96, 0.35);
}

/* ===== 用户信息 ===== */
.user-info {
  display: none;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
}

.user-info .avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
}

.user-info .avatar-small:hover {
  border-color: #e94560;
  transform: scale(1.1);
}

.user-info #usernameDisplay {
  font-weight: 500;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.btn-logout {
  background: rgba(255, 255, 255, 0.05);
  color: #e94560;
  border: 1px solid rgba(233, 69, 96, 0.3);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.btn-logout:hover {
  background: rgba(233, 69, 96, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(233, 69, 96, 0.15);
}

.auth-buttons { display: flex; gap: 0.5rem; }

/* ===== 容器 ===== */
.container { max-width: 1400px; margin: 0 auto; padding: 2rem 1rem; }

/* ===== 卡片网格 ===== */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

.post-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeIn 0.5s ease-out;
}

.post-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.post-thumbnail {
  position: relative;
  width: 100%;
  height: 180px;
  background: #1a1a2e;
  overflow: hidden;
}

.post-thumbnail video, .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .post-thumbnail video,
.post-card:hover .post-thumbnail img {
  transform: scale(1.05);
}

.post-number {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 5;
}

.post-info { padding: 1rem; }
.post-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.3rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.post-user { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: #666; }
.post-user .avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.post-user .username-link { cursor: pointer; color: #1a1a2e; font-weight: 500; transition: color 0.3s ease; }
.post-user .username-link:hover { color: #e94560; }
.post-stats { display: flex; gap: 1rem; margin-top: 0.5rem; font-size: 0.8rem; color: #999; }

/* ===== 详情页 ===== */
.post-detail-page .post-detail-container { max-width: 900px; margin: 0 auto; background: white; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.08); animation: fadeIn 0.5s ease-out; }
.post-header { padding: 1.5rem 2rem; border-bottom: 1px solid #eee; }
.post-header h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.post-meta { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; font-size: 0.9rem; color: #666; }
.post-meta .avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; cursor: pointer; transition: all 0.3s ease; }
.post-meta .avatar:hover { transform: scale(1.1); border: 2px solid #e94560; }
.post-meta .username-link { font-weight: 600; color: #1a1a2e; cursor: pointer; transition: color 0.3s ease; }
.post-meta .username-link:hover { color: #e94560; }
.post-meta .post-time { color: #999; font-size: 0.8rem; }
.post-content { padding: 1.5rem 2rem; white-space: pre-wrap; line-height: 1.8; }

/* ===== 播放器 ===== */
.video-player-wrapper { padding: 1rem 2rem; }
.video-player-wrapper video { width: 100%; max-height: 500px; border-radius: 12px; background: #000; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }

/* ===== 分P ===== */
.part-list { padding: 0 2rem 1rem; }
.part-list-header { font-weight: 600; margin-bottom: 0.5rem; color: #333; }
.part-items { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.part-item { padding: 0.4rem 0.8rem; background: #f0f2f5; border-radius: 6px; cursor: pointer; font-size: 0.85rem; transition: all 0.3s ease; }
.part-item:hover { background: #e0e0e0; transform: translateY(-2px); }
.part-item.active { background: #e94560; color: white; }

/* ===== 操作按钮 ===== */
.action-buttons { padding: 0 2rem 0.5rem; display: flex; gap: 0.8rem; flex-wrap: wrap; }
.btn-action {
  padding: 0.5rem 1.5rem;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: white;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}
.btn-action:hover { background: #f0f2f5; transform: scale(1.05); box-shadow: 0 4px 15px rgba(233,69,96,0.3); }
.btn-action.liked { background: #e94560; color: white; border-color: #e94560; animation: pulse 0.3s ease; }
.btn-action.favorited { background: #ffd700; color: #1a1a2e; border-color: #ffd700; }
.btn-action.following { background: #4a90d9; color: white; border-color: #4a90d9; }

/* ===== 评论 ===== */
.comments-section { padding: 1.5rem 2rem; border-top: 1px solid #eee; }
.comments-section h3 { margin-bottom: 1rem; }
.comment-input { display: flex; gap: 0.8rem; margin-bottom: 1.5rem; }
.comment-input textarea { flex: 1; padding: 0.8rem; border: 1px solid #ddd; border-radius: 8px; resize: vertical; font-family: inherit; font-size: 0.95rem; transition: all 0.3s ease; }
.comment-input textarea:focus { outline: none; border-color: #e94560; transform: scale(1.01); box-shadow: 0 4px 20px rgba(233,69,96,0.1); }
.btn-submit { padding: 0.8rem 1.5rem; background: #e94560; color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; align-self: flex-end; transition: all 0.3s ease; }
.btn-submit:hover { background: #c73652; transform: scale(1.05); }
.comments-list { display: flex; flex-direction: column; gap: 0.8rem; max-height: 600px; overflow-y: auto; }
.comment-item { display: flex; gap: 0.8rem; padding: 0.8rem; background: #f8f9fa; border-radius: 8px; animation: fadeIn 0.3s ease-out; }
.comment-item .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-item .comment-body { flex: 1; }
.comment-item .comment-username { font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: color 0.3s ease; }
.comment-item .comment-username:hover { color: #e94560; }
.comment-item .comment-time { font-size: 0.75rem; color: #999; margin-left: 0.5rem; }
.comment-item .comment-content { margin-top: 0.3rem; font-size: 0.95rem; word-wrap: break-word; }

/* ===== 认证 ===== */
.auth-container { max-width: 400px; margin: 3rem auto; padding: 2rem; background: white; border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); animation: fadeIn 0.5s ease-out; }
.auth-container h2 { text-align: center; margin-bottom: 1.5rem; }
.auth-container input { width: 100%; padding: 0.8rem; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 1rem; font-size: 1rem; transition: all 0.3s ease; }
.auth-container input:focus { outline: none; border-color: #e94560; box-shadow: 0 0 0 3px rgba(233,69,96,0.1); }
.auth-container .btn-primary { width: 100%; padding: 0.8rem; background: #e94560; color: white; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; }
.auth-container .btn-primary:hover { background: #c73652; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(233,69,96,0.3); }

/* ===== 上传 ===== */
.upload-container { max-width: 700px; margin: 2rem auto; padding: 2rem; background: white; border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); animation: fadeIn 0.5s ease-out; }
.upload-container h2 { text-align: center; margin-bottom: 1.5rem; }
.upload-tabs { display: flex; gap: 1rem; margin-bottom: 1.5rem; border-bottom: 2px solid #eee; padding-bottom: 0.5rem; }
.upload-tabs button { padding: 0.5rem 1.5rem; border: none; background: none; cursor: pointer; font-size: 1rem; font-weight: 500; color: #999; border-radius: 8px; transition: all 0.3s ease; }
.upload-tabs button.active { color: #e94560; background: #fff5f7; }
.upload-tabs button:hover { background: #f0f2f5; }
.upload-form { display: flex; flex-direction: column; gap: 1rem; }
.upload-form input, .upload-form textarea { padding: 0.8rem; border: 1px solid #ddd; border-radius: 8px; font-size: 0.95rem; font-family: inherit; transition: all 0.3s ease; }
.upload-form input:focus, .upload-form textarea:focus { outline: none; border-color: #e94560; box-shadow: 0 0 0 3px rgba(233,69,96,0.1); }
.upload-form textarea { min-height: 100px; resize: vertical; }
.upload-form .file-zone { border: 2px dashed #ddd; border-radius: 12px; padding: 2rem; text-align: center; cursor: pointer; transition: all 0.3s ease; }
.upload-form .file-zone:hover { border-color: #e94560; background: rgba(233,69,96,0.02); transform: scale(1.01); }
.upload-form .file-zone .icon { font-size: 2.5rem; }
.btn-primary { padding: 0.8rem; background: #e94560; color: white; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; }
.btn-primary:hover { background: #c73652; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(233,69,96,0.3); }

/* ===== 动画 ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

html { scroll-behavior: smooth; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .post-grid { grid-template-columns: 1fr; }
  .post-header { padding: 1rem; }
  .post-header h1 { font-size: 1.2rem; }
  .post-content { padding: 1rem; }
  .video-player-wrapper { padding: 0.5rem 1rem; }
  .action-buttons { padding: 0 1rem 0.5rem; }
  .comments-section { padding: 1rem; }
  header { padding: 0.5rem 1rem; border-radius: 0; }
  .nav-right { gap: 0.3rem; }
  .nav-link { font-size: 0.8rem; padding: 0.3rem 0.6rem; }
  .btn-upload, .btn-upload-video { font-size: 0.75rem; padding: 0.3rem 0.8rem; }
}