/* ============================================
   Ai整活儿 - AI整活视频导航站样式
   设计原则：深色主题、卡片式布局、响应式
   ============================================ */

:root {
  --bg: #0f172a;
  --bg-elevated: #1e293b;
  --bg-hover: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #f97316;
  --primary-hover: #fb923c;
  --accent: #ef4444;
  --border: #334155;
  --success: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --max-width: 1280px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
}

.logo-icon {
  font-size: 24px;
}

.logo-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-nav {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: var(--text-muted);
  font-size: 14px;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--primary);
}

/* ---------- Main ---------- */
.site-main {
  padding: 32px 0 64px;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 24px;
}

.section-sub {
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- 热门排行 ---------- */
.hot-section {
  margin-bottom: 40px;
  padding: 24px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.hot-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  counter-reset: hot-rank;
}

.hot-list li {
  counter-increment: hot-rank;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
}

.hot-list li:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.hot-list li::before {
  content: counter(hot-rank);
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-hover);
  font-weight: 700;
  font-size: 13px;
}

.hot-list li:nth-child(1)::before { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #000; }
.hot-list li:nth-child(2)::before { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #000; }
.hot-list li:nth-child(3)::before { background: linear-gradient(135deg, #d97706, #92400e); }

.hot-title {
  flex: 1;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-count {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.hot-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
}

/* ---------- 筛选栏 ---------- */
.filter-bar {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.filter-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-label {
  color: var(--text-muted);
  font-size: 14px;
  padding-top: 6px;
  flex-shrink: 0;
  min-width: 48px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--text);
}

.chip-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.filter-result {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

.filter-result span {
  color: var(--primary);
  font-weight: 600;
}

/* ---------- 视频网格 ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.video-card {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.video-card.hidden {
  display: none;
}

.video-card-link {
  display: block;
}

.video-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-hover);
  overflow: hidden;
}

.video-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

.video-source {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
}

.video-meta {
  padding: 12px 14px 14px;
}

.video-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
  margin-bottom: 10px;
}

.video-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.video-category {
  color: var(--primary);
  font-weight: 500;
}

.video-views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.video-views::before {
  content: "👁";
  font-size: 12px;
}

.views-loading {
  opacity: 0.5;
}

.video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 2px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- 空状态 ---------- */
.empty-tip {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  margin-top: 64px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer-col h4 {
  margin-bottom: 12px;
  font-size: 15px;
}

.footer-col p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.footer-col a {
  color: var(--primary);
  font-size: 13px;
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- 页面正文（隐私政策等） ---------- */
.page-content {
  max-width: 800px;
  margin: 0 auto;
}

.prose {
  line-height: 1.8;
}

.prose h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.prose h2 {
  font-size: 20px;
  margin: 32px 0 12px;
  color: var(--primary);
}

.prose p,
.prose ul,
.prose ol {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.prose ul,
.prose ol {
  padding-left: 24px;
}

.prose a {
  color: var(--primary);
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .site-nav {
    gap: 16px;
  }
  .site-nav .nav-link:nth-child(3) {
    display: none;
  }
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .video-title {
    font-size: 13px;
    min-height: 36px;
  }
  .hot-section,
  .filter-bar {
    padding: 16px;
  }
}
