* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #f6821f;
  --primary-hover: #e0740f;
  --bg: #0f0f11;
  --card: #1a1a1e;
  --card-hover: #24242a;
  --border: #2a2a30;
  --text: #f0f0f2;
  --text-muted: #8a8a94;
  --danger: #e5484d;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* 导航栏 */
#navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo { font-size: 20px; font-weight: 700; }

.nav-right { display: flex; gap: 12px; align-items: center; }

.nav-btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-btn:hover { background: var(--card-hover); }

/* 主体 */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.section-title {
  font-size: 20px;
  margin-bottom: 16px;
  font-weight: 600;
}

.loading, .empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty a { color: var(--primary); }

/* 视频网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.15s, background 0.15s;
}

.card:hover { background: var(--card-hover); transform: translateY(-2px); }

.thumb {
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-placeholder { font-size: 40px; opacity: 0.4; }

.card-body { padding: 12px; }

.card-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta { font-size: 12px; color: var(--text-muted); }

/* 播放页 */
.watch { max-width: 900px; margin: 0 auto; }

.player-wrap {
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}

.player-wrap video { width: 100%; display: block; }

.watch-title { font-size: 22px; margin-bottom: 12px; }

.watch-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.author { color: var(--primary); font-weight: 500; }

.watch-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  margin-bottom: 20px;
}

.btn-danger {
  padding: 8px 16px;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-danger:hover { background: rgba(229, 72, 77, 0.1); }

/* 个人主页 */
.profile-header {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 24px;
  background: var(--card);
  border-radius: 12px;
  margin-bottom: 32px;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-info h1 { font-size: 24px; margin-bottom: 6px; }
.bio { color: var(--text-muted); margin-bottom: 8px; font-size: 14px; }
.profile-meta { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }

.btn-secondary {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.btn-secondary:hover { background: var(--card-hover); }

/* 上传页 */
.upload-page { max-width: 600px; margin: 0 auto; }

.upload-page h1 { font-size: 24px; margin-bottom: 24px; }

.field { display: block; margin-bottom: 20px; }

.field span {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.field input[type="text"],
.field input[type="password"],
.field textarea,
.field input[type="file"] {
  width: 100%;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); }

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* 进度条 */
.progress-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.progress-bar-track {
  flex: 1;
  height: 8px;
  background: var(--card);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #ffb26b);
  border-radius: 999px;
  transition: width 0.15s ease-out;
}

.progress-text {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 42px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 登录页 */
.auth-container {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--card);
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
}

.auth-card h1 { font-size: 24px; margin-bottom: 24px; text-align: center; }

.tabs {
  display: flex;
  background: var(--bg);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
}

.tab.active {
  background: var(--card);
  color: var(--text);
}

#auth-form { display: flex; flex-direction: column; gap: 12px; }

#auth-form input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  font-size: 14px;
}

#auth-form input:focus { outline: none; border-color: var(--primary); }

.error { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center; }

@media (max-width: 600px) {
  .profile-header { flex-direction: column; text-align: center; }
  .watch-title { font-size: 18px; }
}