:root {
  --bg-dark: #111111;
  --bg-darker: #0a0a0a;
  --bg-card: #1a1a1a;
  --accent: #ffb400; /* 黄色高亮 */
  --accent-soft: #e29f00;
  --text-main: #f5f5f5;
  --text-sub: #b3b3b3;
  --border-soft: #333333;
  --danger: #ff4d4f;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition-fast: 0.15s ease-out;
  --shadow-soft: 0 6px 20px rgba(0, 0, 0, 0.4);
  --max-width: 1240px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* 顶部导航 */

.site-header {
  background: linear-gradient(
    to bottom,
    #000000 0%,
    #050505 60%,
    rgba(5, 5, 5, 0.9) 100%
  );
  border-bottom: 1px solid #000;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* logo */

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #ffffff;
  padding: 4px 8px;
  background: #000;
  border-radius: var(--radius-sm);
}

.logo span {
  background: var(--accent);
  color: #000;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  margin-left: 4px;
}

/* 主导航 */

.main-nav {
  display: flex;
  gap: 10px;
  margin-left: 12px;
}

.nav-link {
  color: var(--text-sub);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-link:hover {
  background: #1f1f1f;
  color: #ffffff;
}

.nav-link.active {
  background: var(--accent);
  color: #000;
}

/* 搜索 */

.search-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 12px;
  min-width: 0;
}

.search-input {
  flex: 1;
  min-width: 0;
  background: #1a1a1a;
  border: 1px solid #333;
  padding: 6px 10px;
  color: var(--text-main);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
}

.search-input::placeholder {
  color: #666;
}

.search-input:focus {
  border-color: var(--accent);
}

.search-btn {
  border: none;
  background: var(--accent);
  color: #000;
  font-size: 0.9rem;
  padding: 7px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  font-weight: 600;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.search-btn:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* 用户操作 */

.user-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.btn {
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), transform var(--transition-fast);
}

.ghost-btn {
  background: transparent;
  color: var(--text-main);
  border-color: #444;
}

.ghost-btn:hover {
  background: #222;
}

.primary-btn {
  background: var(--accent);
  color: #000;
  font-weight: 600;
}

.primary-btn:hover {
  background: var(--accent-soft);
}

/* 汉堡菜单（移动端） */

.burger {
  display: none;
  background: transparent;
  border: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.burger span {
  width: 18px;
  height: 2px;
  background: var(--text-main);
}

/* 次级导航 */

.sub-nav {
  border-bottom: 1px solid #141414;
  background: #050505;
}

.sub-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
}

.sub-nav-inner::-webkit-scrollbar {
  height: 4px;
}

.sub-nav-inner::-webkit-scrollbar-thumb {
  background: #333;
}

.chip {
  border-radius: 999px;
  border: 1px solid #333;
  background: #151515;
  color: var(--text-sub);
  font-size: 0.8rem;
  padding: 4px 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast), transform var(--transition-fast);
}

.chip:hover {
  border-color: var(--accent);
}

.chip-active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* 页面主体布局 */

.page-main {
  max-width: var(--max-width);
  margin: 12px auto 24px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr);
  gap: 16px;
}

/* 内容区域 */

.content-area {
  min-width: 0;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}

.section-title {
  font-size: 1.1rem;
  margin: 0;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-sub);
}

.sort-btn {
  border-radius: 999px;
  border: 1px solid #333;
  background: #141414;
  color: var(--text-sub);
  font-size: 0.75rem;
  padding: 3px 10px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast);
}

.sort-btn:hover {
  border-color: var(--accent);
}

.sort-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* 视频网格 */

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.video-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}

.thumb-wrapper {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
}

.thumb-placeholder {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #3a3a3a, #000000);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-icon {
  font-size: 2.4rem;
  color: rgba(255, 255, 255, 0.85);
}

.thumb-badges {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: #000;
  background: var(--accent);
  font-weight: 600;
}

.badge-hd {
  background: var(--accent);
}

.badge-uhd {
  background: #ff4d4f;
}

.badge-duration {
  margin-left: auto;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
}

/* 文本信息 */

.video-info {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.video-title {
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.35;
}

.video-meta {
  font-size: 0.75rem;
  color: var(--text-sub);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.meta-dot {
  opacity: 0.6;
}

.video-tags {
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: #222;
  color: var(--text-sub);
}

/* 分页 */

.pagination {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.page-btn {
  border: 1px solid #333;
  background: #121212;
  color: var(--text-main);
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast),
    border-color var(--transition-fast);
}

.page-btn:hover {
  border-color: var(--accent);
}

.page-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: default;
}

/* 右侧侧栏 */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-block {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.sidebar-title {
  font-size: 0.95rem;
  margin: 0 0 6px;
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.8rem;
}

.sidebar-list li {
  padding: 4px 0;
}

.sidebar-list a {
  color: var(--text-sub);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.sidebar-list a:hover {
  color: var(--accent);
}

.hot-keywords li {
  color: var(--accent);
}

/* 页脚 */

.site-footer {
  border-top: 1px solid #111;
  background: var(--bg-darker);
  padding: 16px 0;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-sub);
}

.footer-links {
  display: flex;
  gap: 12px;
}

.footer-links a {
  color: var(--text-sub);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

/* 响应式 */

@media (max-width: 960px) {
  .page-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    order: -1;
  }

  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .main-nav {
    display: none;
  }

  .user-actions {
    display: none;
  }

  .burger {
    display: flex;
    margin-left: auto;
  }

  .search-wrapper {
    order: 10;
    width: 100%;
    margin-left: 0;
  }

  .video-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 移动端展开菜单样式（JS 控制 .nav-open） */

.nav-open .main-nav {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  background: #000;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-open .user-actions {
  position: absolute;
  top: 52px;
  right: 16px;
  flex-direction: column;
  margin-left: 0;
}

/* ============ 登录 / 注册 弹窗 ============ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.auth-modal {
  width: 380px;
  max-width: 100%;
  background: #151515;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  padding: 16px 18px 18px;
  display: none;
  animation: modalPopIn 0.18s ease-out;
}

.auth-modal.active {
  display: block;
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.auth-header h2 {
  font-size: 1rem;
  margin: 0;
}

.auth-close {
  border: none;
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.15s ease-out, color 0.15s ease-out;
}

.auth-close:hover {
  background: #222;
  color: #fff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-field label {
  font-size: 0.78rem;
  color: var(--text-sub);
}

.auth-field input {
  border-radius: var(--radius-sm);
  border: 1px solid #333;
  background: #101010;
  padding: 7px 9px;
  font-size: 0.86rem;
  color: var(--text-main);
  outline: none;
}

.auth-field input::placeholder {
  color: #666;
}

.auth-field input:focus {
  border-color: var(--accent);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-sub);
  gap: 8px;
}

.auth-row-wrap {
  flex-wrap: wrap;
  align-items: flex-start;
}

.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.auth-checkbox input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.auth-link {
  color: var(--accent);
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-footer-text {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-sub);
}

.auth-switch {
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0 2px;
  text-decoration: underline;
}

/* 打开弹窗时禁止页面滚动（可选） */
body.modal-open {
  overflow: hidden;
}

/* 弹出登录/注册时，背景整体模糊 + 禁止操作 */
body.modal-open .site-header,
body.modal-open .sub-nav,
body.modal-open .page-main,
body.modal-open .site-footer {
  filter: blur(6px);
  transition: filter 0.2s ease-out;
  pointer-events: none;   /* 防止点击 */
  user-select: none;      /* 防止选中文本 */
}

/* 让遮罩本身可以点（用来点击空白区域关闭弹窗） */
body.modal-open .modal-backdrop {
  pointer-events: auto;
}

/* === 禁用 JavaScript 时的效果 === */

/* 当 JavaScript 被禁用时，模糊整个页面 */
body.no-js {
  filter: blur(6px); /* 设置页面模糊效果 */
  pointer-events: none; /* 禁止点击页面 */
}

/* 提示框的样式 */
.no-js-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 1); /* 半透明黑色背景 */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  pointer-events: auto; /* 确保可以点击提示框 */
}

/* 提示信息的样式 */
.no-js-overlay p {
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  z-index: 9999;
}

/* 确保模糊的内容不会干扰提示框 */
body.no-js .modal-backdrop,
body.no-js .auth-modal {
  pointer-events: auto; /* 允许点击弹窗 */
}

/* 让底部区域在模糊时被遮盖 */
body.no-js .site-footer {
  filter: blur(6px);
  transition: filter 0.2s ease-out;
}
