/**
 * 988 前端主题 — 「影院终端」
 * 炭灰底 + 琥珀强调，无霓虹渐变背景；类名保持与模板兼容（如 .text-purple 实为强调色）
 */
:root {
  --bg: #0a0a0b;
  --bg-elevated: #111113;
  --surface: #161618;
  --surface-2: #1c1c1f;
  --border: #2e2e32;
  --border-soft: rgba(255, 255, 255, 0.06);
  --text: #e8e8e5;
  --muted: #8a8a8f;
  --accent: #c9a227;
  --accent-hover: #ddb33d;
  --accent-dim: rgba(201, 162, 39, 0.12);
  --accent-glow: rgba(201, 162, 39, 0.25);
  --danger: #c53d3d;
  --success: #3d8b6a;
  --radius: 10px;
  --radius-sm: 6px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  background-image: radial-gradient(ellipse 120% 80% at 50% -20%, rgba(201, 162, 39, 0.06), transparent 50%);
  color: var(--text);
  font-family: var(--font);
  padding-top: 80px;
  min-height: 100vh;
  overflow-x: hidden;
}

body.detail-body { padding-top: 60px; }

a { text-decoration: none; color: inherit; transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease; }

/* Google translate */
.goog-te-banner-frame, .goog-tooltip { display: none !important; }
body { top: 0 !important; }
font { background: transparent !important; box-shadow: none !important; }

/* ========== 导航 ========== */
.navbar-custom {
  background: rgba(10, 10, 11, 0.92) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  height: 70px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
}

.detail-body .navbar-custom { height: 60px; }

.loading-text {
  display: flex;
  gap: 6px;
  align-items: center;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.loading-text .text-white { color: var(--text); }
.loading-text .text-purple {
  background: var(--accent);
  color: #141210;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: none;
}

.search-bar {
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
  background: var(--bg-elevated);
}

.search-input {
  background: transparent;
  border: none;
  color: var(--text);
  flex: 1;
  outline: none;
  font-size: 14px;
}

.nav-news-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font-size: 20px;
  margin-right: 12px;
  border: 1px solid var(--border);
  transition: transform 0.15s ease, background 0.15s ease;
  text-decoration: none;
}

.nav-news-btn:hover {
  background: var(--accent-dim);
  color: var(--accent-hover);
  transform: translateY(-1px);
  border-color: var(--accent);
}

.news-notify-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border: 2px solid var(--bg);
  border-radius: 50%;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(197, 61, 61, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(197, 61, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(197, 61, 61, 0); }
}

.news-notify-dot { animation: pulse-red 2s infinite; }

/* 导航按钮：实色块，少用渐变 */
.btn-gradient-fire {
  background: #b8432f !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.btn-gradient-fire:hover {
  background: #d14e36 !important;
  transform: translateY(-1px);
}

.btn-gradient-purple {
  background: #3d4a5c !important;
  color: #fff !important;
  border: 1px solid var(--border) !important;
}
.btn-gradient-purple:hover {
  background: #4a5a70 !important;
}

.btn-gradient-pink {
  background: #8b3d5c !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}
.btn-gradient-pink:hover {
  background: #a04568 !important;
}

.mobile-nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 15px;
  padding: 0 5px;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 12px;
  transition: color 0.15s ease;
  background: none;
  border: none;
  padding: 0;
}

.mobile-nav-item:hover { color: var(--text); }

.mobile-nav-item .icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.bg-news { background: #6b5a2a; color: #fff; }
.bg-community { background: #3d4a5c; color: #fff; }
.bg-today { background: #b8432f; color: #fff; }
.bg-api { background: var(--surface-2); color: var(--text); }
.bg-hotel { background: #6b3d52; color: #fff; }

@media (max-width: 576px) {
  .loading-text { font-size: 1.15rem; }
  .nav-news-btn { width: 36px; height: 36px; font-size: 16px; margin-right: 5px; }
  .navbar-custom { padding-left: 10px !important; padding-right: 10px !important; }
}

/* ========== 广告 / 玻璃面板 ========== */
.ad-box {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--surface);
  width: 100%;
  border: 1px solid var(--border-soft);
  transition: transform 0.2s ease;
}
.ad-box:hover { transform: translateY(-2px); }
.ad-box img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ad-top-banner { height: 120px; margin-bottom: 20px; }
@media (min-width: 992px) { .ad-top-banner { height: 180px; } }
.ad-bottom-banner { height: 100px; margin-top: 20px; }
@media (min-width: 992px) { .ad-bottom-banner { height: 150px; } }
.ad-feed { height: 180px; margin-bottom: 30px; border: 1px solid var(--border); }

.side-ad, .float-side {
  position: fixed;
  top: 150px;
  width: 160px;
  z-index: 90;
  transition: opacity 0.2s ease;
}
.float-side { top: 120px; width: 140px; display: none; }
.float-side.show { display: block; }
.side-ad img, .float-side img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.side-left { left: 20px; }
.side-right { right: 20px; }
@media (max-width: 991.98px) {
  .side-ad { display: none !important; }
  .float-side.show { display: none !important; }
}

.glass-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.category-section { margin: 20px 0 30px; padding: 20px; }
.category-header {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.cat-item {
  display: block;
  text-align: center;
  padding: 10px 0;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cat-item.active, .cat-item:hover {
  background: var(--accent-dim);
  color: var(--accent-hover);
  border-color: var(--accent);
}

/* ========== 视频卡片 ========== */
.video-item {
  display: block;
  position: relative;
  cursor: pointer;
  border-radius: var(--radius);
  margin-bottom: 28px;
  transition: transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.video-item:hover .thumb-box {
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.thumb-box {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #0d0d0e;
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.thumb-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s ease; }
.video-item:hover .thumb-img { transform: scale(1.04); }

.badge-overlay {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

/* 仅首页列表卡片：勿用全局 .video-title / .video-info，详情页也复用类名会串版 */
.video-item .meta-box .video-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 12px 0 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.video-item:hover .meta-box .video-title { color: var(--accent-hover); }

.video-item .meta-box .video-info {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.preview-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  display: none;
  z-index: 10;
}

@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.preview-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  z-index: 2;
  pointer-events: none;
}

/* ========== 友链 / 推荐 ========== */
.flink-section { margin-top: 40px; margin-bottom: 20px; }
.flink-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.flink-item {
  display: block;
  background: var(--surface);
  text-align: center;
  padding: 10px 5px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  border: 1px solid var(--border);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flink-item:hover {
  background: var(--accent-dim);
  color: var(--accent-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.rec-item {
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  background: var(--surface);
  color: var(--text);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid var(--border);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.rec-item:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.rec-item i { margin-left: auto; font-size: 12px; color: var(--muted); }

@media (max-width: 768px) { .flink-grid { grid-template-columns: repeat(3, 1fr); } }

/* ========== Toast ========== */
.toast-container-custom {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 300px;
  pointer-events: none;
}

.toast-custom {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  pointer-events: auto;
  animation: slideDown 0.35s ease;
}

.toast-custom.success { border-left: 4px solid var(--success); }
.toast-custom.error { border-left: 4px solid var(--danger); }
.toast-custom.secondary { border-left: 4px solid var(--muted); }

@keyframes slideDown {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.user-card {
  background: var(--surface);
  padding: 15px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border);
  transition: border-color 0.15s ease;
  display: block;
}

.user-card:hover { border-color: var(--accent); }

.auth-tab {
  cursor: pointer;
  padding: 10px;
  text-align: center;
  width: 50%;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.auth-tab.active { border-color: var(--accent); color: var(--text); font-weight: 700; }

.auth-form { display: none; padding: 20px 0; }
.auth-form.active { display: block; }

.api-box {
  background: var(--bg);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, monospace;
  color: var(--accent);
  border: 1px solid var(--border);
  font-size: 13px;
  word-break: break-all;
}

.input-group-text-btn {
  cursor: pointer;
  background: var(--accent);
  border: none;
  color: #141210;
  font-size: 12px;
  font-weight: 600;
}

.input-group-text-btn:hover { background: var(--accent-hover); }

.modal-content {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.modal-header { border-bottom: 1px solid var(--border); }
.modal-footer { border-top: 1px solid var(--border); background: rgba(0, 0, 0, 0.2); }

.modal-title {
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* ========== 页脚 ========== */
.main-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  color: var(--muted);
  font-size: 13px;
  margin-top: 50px;
}

.footer-logo {
  font-size: 22px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.footer-address p { margin-bottom: 5px; }
.footer-address a { color: var(--accent); text-decoration: none; }
.footer-col-title { color: var(--text); font-size: 14px; margin-bottom: 15px; font-weight: 700; }

.footer-rec-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 30px; }
@media (max-width: 768px) { .footer-rec-grid { grid-template-columns: repeat(2, 1fr); } .footer-row-flex { flex-direction: column; gap: 30px; } }

.footer-friend-links { font-size: 13px; color: var(--muted); line-height: 1.8; margin-bottom: 40px; }
.footer-friend-links a { color: var(--muted); margin-right: 15px; }
.footer-friend-links a:hover { color: var(--text); }

.footer-link-list { list-style: none; padding: 0; margin: 0; }
.footer-link-list li { margin-bottom: 8px; }
.footer-link-list a { color: var(--muted); text-decoration: none; }
.footer-link-list a:hover { color: var(--accent); }

/* ========== 分页 ========== */
.pagination { gap: 8px; align-items: center; }
.page-link {
  border-radius: 50% !important;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border) !important;
  color: var(--muted);
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.page-link:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border) !important;
}

.page-item.active .page-link {
  background: var(--accent);
  border-color: var(--accent) !important;
  color: #141210;
  box-shadow: none;
}

.page-item.disabled .page-link { background: transparent; border-color: transparent !important; color: #555; }

/* ========== 悬浮条 ========== */
.float-bar {
  position: fixed;
  bottom: 120px;
  right: 20px;
  z-index: 990;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.float-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.float-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-hover);
  transform: translateY(-2px);
}

@keyframes pulse-live {
  0% { box-shadow: 0 0 0 0 rgba(139, 61, 92, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(139, 61, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(139, 61, 92, 0); }
}

/* ========== VIP 卡 ========== */
.vip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.vip-card:hover { background: var(--surface-2); }
.vip-card.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.price-tag { font-size: 1.5rem; font-weight: 800; margin-top: 5px; color: var(--accent); }
.plan-name { font-size: 0.9rem; color: var(--muted); }

/* ========== Auth 弹窗 ========== */
#authModal .modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

#authModal .auth-tab { font-size: 16px; padding: 15px 0; color: var(--muted); position: relative; border-bottom: none; }
#authModal .auth-tab.active { color: var(--text); font-weight: 700; }
#authModal .auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

#authModal .input-group-text {
  background: var(--bg);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--muted);
  border-radius: 10px 0 0 10px;
}

#authModal .form-control {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  height: 46px;
  font-size: 15px;
  border-radius: 0 10px 10px 0;
}

#authModal .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
  background: var(--bg-elevated);
}

#authModal .btn-primary, #authModal .btn-success {
  height: 46px;
  font-size: 16px;
  font-weight: 600;
  background: var(--accent);
  border: none;
  color: #141210;
  border-radius: 10px;
  box-shadow: none;
}

#authModal .btn-primary:hover, #authModal .btn-success:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

#authModal .btn-outline-light {
  border-color: var(--border);
  color: var(--muted);
  font-size: 13px;
  border-radius: 0 10px 10px 0;
}

#authModal .btn-outline-light:hover { background: var(--surface-2); color: var(--text); }

/* ========== 年龄 / 公告弹窗 ========== */
.age-warning-icon { font-size: 3rem; color: var(--danger); display: block; margin: 0 auto; text-align: center; }
#ageModal .modal-content { border: 2px solid rgba(197, 61, 61, 0.5); }
#siteNoticeModal .modal-content { border: 1px solid var(--border); background: var(--surface); }

#google_translate_element { display: inline-block; margin-right: 10px; }

/* ========== 详情页布局 ========== */
.banner-box {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--surface);
  width: 100%;
  border: 1px solid var(--border);
  transition: transform 0.2s ease;
}

.banner-box:hover { transform: translateY(-2px); }
.banner-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-label {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-top-left-radius: 4px;
}

.banner-top-full { height: 120px; margin-top: 20px; margin-bottom: 20px; }
@media (min-width: 992px) { .banner-top-full { height: 160px; } }
.banner-bottom-full { height: 100px; margin-top: 30px; }
@media (min-width: 992px) { .banner-bottom-full { height: 150px; } }

.main-container {
  max-width: 1700px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
}

.left-col { flex: 1; min-width: 0; width: 100%; }
.right-col {
  width: 400px;
  flex-shrink: 0;
  height: calc(100vh - 80px);
  position: sticky;
  top: 70px;
  overflow-y: auto;
  padding-right: 5px;
}

@media (max-width: 1000px) {
  .main-container { flex-direction: column; padding: 0; gap: 0; }
  .right-col { width: 100%; height: auto; position: static; overflow: visible; padding: 15px; }
  .left-col { padding-bottom: 20px; }
  .player-wrapper { border-radius: 0 !important; }
  .navbar-custom .container-fluid { padding-left: 15px; padding-right: 15px; }
}

.player-wrapper {
  position: relative;
  padding-top: 56.25%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.player-iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

/* 详情页：整块纵向排版（覆盖误用的列表卡片 flex 规则） */
.detail-body .video-info {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding: 0 clamp(12px, 3.5vw, 20px);
  max-width: 100%;
  box-sizing: border-box;
  font-size: inherit;
  color: inherit;
}

.detail-body .video-title.detail-title {
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  overflow: visible;
  font-size: clamp(1.05rem, 2.8vw, 1.35rem);
  font-weight: 700;
  line-height: 1.45;
  margin: 14px 0 12px;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.detail-body .video-stats {
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .detail-body .video-stats {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
}

.detail-body .video-stats-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}

.detail-body .video-stats-meta .stat-dot {
  opacity: 0.45;
  user-select: none;
}

.detail-body .video-stats-meta .stat-date {
  color: var(--muted);
}

.detail-body .video-stats-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

@media (min-width: 768px) {
  .detail-body .video-stats-actions {
    flex-shrink: 0;
    justify-content: flex-end;
  }
}

/* 详情页操作按钮：用 gap 代替 margin-left，避免移动端错位 */
.detail-body .video-stats-actions .action-btn {
  margin-left: 0;
}

.detail-body .uploader-bar {
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.detail-body .uploader-bar-main {
  flex: 1 1 180px;
  min-width: 0;
}

.detail-body .uploader-bar-actions {
  flex: 0 1 auto;
}

@media (max-width: 575.98px) {
  .detail-body .uploader-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-body .uploader-bar-actions {
    justify-content: flex-start !important;
    width: 100%;
  }
}

.detail-body .desc-box,
.detail-body .comment-section {
  width: 100%;
  min-width: 0;
  display: block;
}

.detail-body .desc-box .desc-text {
  white-space: pre-wrap;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.detail-body .comment-section-title {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.detail-body .comment-section-title .comment-count {
  color: var(--muted);
  font-weight: 600;
}

.goog-te-gadget-simple {
  background-color: var(--surface) !important;
  border: 1px solid var(--border) !important;
  padding: 4px 8px !important;
  border-radius: 20px;
  color: var(--text) !important;
}

.goog-te-gadget-simple a { color: var(--text) !important; font-weight: 600; text-decoration: none; }
.goog-te-gadget-simple img, .goog-te-gadget-icon, .goog-te-menu-value span:last-child { display: none !important; }
.goog-te-menu-value span { color: var(--text) !important; border-left: none !important; font-size: 13px; }

/* 详情操作按钮 */
.action-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

.action-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--text);
}

.action-btn.liked {
  color: #141210;
  background: var(--accent);
  border-color: var(--accent);
}

@keyframes pulse-like {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.action-btn.liked { animation: pulse-like 2s infinite; }

.uploader-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid var(--border);
  transition: border-color 0.15s ease;
}

.uploader-bar.can-click:hover { border-color: var(--accent); cursor: pointer; }

.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }

.btn-follow {
  background: var(--text);
  color: var(--bg);
  border: none;
  font-weight: 700;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 14px;
  transition: opacity 0.15s ease;
}

.btn-follow:hover { opacity: 0.9; }
.btn-follow.following { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

.desc-box {
  background: var(--surface);
  padding: 15px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.tag-chip {
  display: inline-block;
  background: var(--bg-elevated);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin: 0 5px 5px 0;
  border: 1px solid var(--border);
}

.rec-card {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
}

.rec-card:hover {
  background: var(--surface);
  border-color: var(--border);
  transform: translateX(-3px);
}

.rec-thumb {
  width: 168px;
  height: 94px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: #0d0d0e;
  border: 1px solid var(--border);
}

.rec-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rec-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 2px;
}

.rec-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.rec-meta { font-size: 12px; color: var(--muted); }
.loading-spinner { text-align: center; padding: 20px; display: none; color: var(--muted); font-size: 13px; }

/* 评论 */
.comment-user-link { text-decoration: none; }
.comment-user-link:hover img { border: 2px solid var(--accent); } 
.comment-section { margin-top: 30px; }
.comment-input-wrapper {
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
  transition: border-color 0.15s ease;
}

.comment-input-wrapper:focus-within { border-bottom-color: var(--accent); }

.comment-input {
  background: transparent;
  border: none;
  color: var(--text);
  width: 100%;
  padding: 10px 0;
  outline: none;
  font-size: 14px;
}

.comment-item { display: flex; gap: 15px; margin-bottom: 20px; animation: slideIn 0.3s ease-out; }
.comment-content { flex: 1; }
.comment-user { font-weight: 700; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.comment-text { color: var(--muted); font-size: 14px; line-height: 1.45; margin-bottom: 4px; }
.comment-time { font-size: 12px; color: var(--muted); margin-right: 15px; }

.reply-box {
  display: none;
  margin-top: 15px;
  background: var(--bg-elevated);
  padding: 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.reply-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  width: 100%;
  padding: 5px;
  outline: none;
  transition: border-color 0.15s ease;
}

.reply-input:focus { border-bottom-color: var(--accent); }

.reply-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.btn-cancel { background: transparent; color: var(--muted); border: none; font-size: 13px; }

.btn-send {
  background: var(--accent);
  color: #141210;
  border: none;
  padding: 5px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease;
}

.btn-send:hover { background: var(--accent-hover); }

.sub-comments { margin-left: 50px; margin-top: 10px; }
.sub-item { display: flex; gap: 10px; margin-bottom: 10px; }
.sub-avatar { width: 24px; height: 24px; border-radius: 50%; }

.speed-badge { font-size: 12px; padding: 3px 8px; border-radius: 4px; background: #eee; color: #333; margin-left: 10px; }
.speed-fast { background: rgba(61, 139, 106, 0.25); color: #8fd4b8; }
.speed-slow { background: rgba(197, 61, 61, 0.2); color: #e88; }

@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ========== 社区动态 ========== */
body.page-community {
  padding-top: 70px;
  background: var(--bg);
  background-image: radial-gradient(ellipse 100% 60% at 50% 0%, rgba(201, 162, 39, 0.05), transparent 55%);
}

.page-community .navbar-custom { border-bottom: 1px solid var(--border); }

.feed-item {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 0;
  transition: background 0.15s ease;
  cursor: pointer;
}

.feed-item:active { background: var(--surface-2); }

.feed-layout { display: flex; gap: 12px; }
.feed-avatar { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }
.feed-content { flex-grow: 1; min-width: 0; }
.feed-name { font-size: 16px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.feed-text { font-size: 15px; line-height: 1.55; color: var(--text); margin-bottom: 8px; word-wrap: break-word; }

.grid-9 { display: grid; gap: 4px; margin-top: 8px; max-width: 360px; }
.grid-9[data-count="1"] { grid-template-columns: 1fr; }
.grid-9[data-count="1"] img { max-height: 300px; object-fit: cover; border-radius: 6px; width: auto; max-width: 100%; }
.grid-9[data-count="2"], .grid-9[data-count="4"] { grid-template-columns: repeat(2, 1fr); }
.grid-9[data-count="3"], .grid-9[data-count="5"], .grid-9[data-count="6"],
.grid-9[data-count="7"], .grid-9[data-count="8"], .grid-9[data-count="9"] { grid-template-columns: repeat(3, 1fr); }
.grid-img-item { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 4px; background: #111; }

.feed-video-player { width: 100%; max-height: 400px; display: block; background: #000; border-radius: 8px; margin-top: 8px; border: 1px solid var(--border); }

.feed-footer { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.feed-actions { display: flex; gap: 20px; }

.action-btn.feed-action {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  padding: 5px 10px;
  border-radius: 20px;
}

.action-btn.liked { color: var(--danger); }

#loading-indicator { text-align: center; padding: 20px; color: var(--muted); display: none; }

.fab-upload {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #141210;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  z-index: 999;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.15s ease;
}

.fab-upload:active { transform: scale(0.9); }

.glass-composer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.composer-textarea {
  background: transparent !important;
  border: none !important;
  color: var(--text) !important;
  font-size: 16px;
  resize: none;
}

.media-preview-container { margin-top: 10px; max-height: 200px; overflow-x: auto; white-space: nowrap; padding-bottom: 5px; display: none; }
.preview-media-item { height: 100px; width: 100px; object-fit: cover; border-radius: 6px; margin-right: 8px; display: inline-block; }
.preview-video-item { height: 150px; width: auto; border-radius: 6px; display: inline-block; }

.feed-click-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.page-community .feed-layout { position: relative; pointer-events: none; }
.page-community .feed-avatar, .page-community .feed-name, .page-community .feed-media-box, .page-community .feed-actions { position: relative; z-index: 2; pointer-events: auto; }

/* ========== 独立登录页 ========== */
body.auth-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(201, 162, 39, 0.08), transparent 50%);
  color: var(--text);
  padding: 24px;
}

.auth-page .auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 36px 32px;
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.auth-page .auth-title { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 28px; letter-spacing: 0.02em; }
.auth-page .auth-title span { color: var(--accent); }

.auth-page .form-control {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 15px 12px 44px;
  border-radius: 10px;
  font-size: 15px;
}

.auth-page .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
  background: var(--bg-elevated);
}

.auth-page .input-group-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  z-index: 5;
  pointer-events: none;
}

.auth-page .input-wrapper { position: relative; margin-bottom: 18px; }

.auth-page .btn-primary {
  background: var(--accent);
  border: none;
  color: #141210;
  padding: 12px;
  font-weight: 700;
  width: 100%;
  border-radius: 10px;
  font-size: 16px;
  margin-top: 8px;
}

.auth-page .btn-primary:hover { background: var(--accent-hover); }

.auth-page .footer-links { text-align: center; margin-top: 22px; font-size: 13px; color: var(--muted); }
.auth-page .footer-links a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-page .footer-links a:hover { color: var(--accent-hover); }

.auth-page .bg-shape { display: none; }

/* ========== 404 ========== */
body.page-404 {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  text-align: center;
  padding: 24px;
}

.page-404 .error-code {
  font-size: clamp(72px, 18vw, 120px);
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: -0.04em;
}

.page-404 .error-msg { font-size: 20px; margin-bottom: 8px; }
.page-404 .sub-msg { color: var(--muted); font-size: 14px; margin-bottom: 32px; }

.page-404 .countdown-box {
  background: var(--surface);
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 15px;
  color: var(--muted);
}

.page-404 .seconds { color: var(--accent); font-weight: 800; font-size: 1.1rem; margin: 0 6px; }

.page-404 .home-btn {
  margin-top: 28px;
  padding: 12px 36px;
  border-radius: 999px;
  background: var(--accent);
  color: #141210;
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  border: 1px solid transparent;
}

.page-404 .home-btn:hover { background: var(--accent-hover); color: #141210; }

/* ========== 注册页 ========== */
body.page-register {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(201, 162, 39, 0.08), transparent 50%);
  color: var(--text);
  padding: 24px;
}

.page-register .reg-box {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 36px 32px;
  border-radius: 14px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.page-register .brand {
  font-size: 28px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 28px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.page-register .text-purple {
  color: var(--accent);
  background: none;
  -webkit-text-fill-color: unset;
}

.page-register .form-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.page-register .form-control {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 15px;
  font-size: 15px;
}

.page-register .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
  background: var(--bg-elevated);
}

.page-register .btn-reg {
  background: var(--accent);
  border: none;
  color: #141210;
  padding: 14px;
  border-radius: 10px;
  font-weight: 700;
  width: 100%;
  font-size: 16px;
  margin-top: 10px;
}

.page-register .btn-reg:hover { background: var(--accent-hover); }

.page-register .btn-code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  border-radius: 0 10px 10px 0;
  padding: 0 16px;
}

.page-register .btn-code:hover { background: var(--bg-elevated); }

.page-register .ip-tip {
  font-size: 12px;
  color: var(--danger);
  text-align: center;
  margin-top: 20px;
  background: rgba(197, 61, 61, 0.08);
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(197, 61, 61, 0.25);
}

.page-register .footer-text {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
}

.page-register .footer-text a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.page-register .footer-text a:hover { color: var(--accent-hover); }

.page-register .bg-shape { display: none; }

/* 社区页 View Transitions（可选） */
@supports (view-transition-name: none) {
  ::view-transition-old(root) {
    animation: vt-fade-out 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  ::view-transition-new(root) {
    animation: vt-fade-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
}

@keyframes vt-fade-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); filter: blur(5px); }
}

@keyframes vt-fade-in {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
