/* 与 Figma 设计一致的深色主题变量 */
:root {
  --bg-card: linear-gradient(145.07deg, rgba(22, 36, 86, 0.4) 0%, rgba(28, 57, 142, 0.2) 100%);
  --bg-card-search: linear-gradient(170.35deg, rgba(22, 36, 86, 0.4) 0%, rgba(28, 57, 142, 0.2) 100%);
  --bg-tip: linear-gradient(172.38deg, rgba(5, 51, 69, 0.4) 0%, rgba(28, 57, 142, 0.2) 100%);
  --border-cyan: rgba(0, 184, 219, 0.3);
  --border-cyan-strong: rgba(0, 184, 219, 0.4);
  --text-white: #fff;
  --text-cyan: rgba(0, 211, 243, 0.8);
  --text-cyan-dim: rgba(0, 211, 243, 0.4);
  --text-cyan-desc: rgba(0, 211, 243, 0.7);
  --text-tag: #53eafd;
  --text-date: rgba(142, 197, 255, 0.6);
  --bg-input: rgba(22, 36, 86, 0.6);
  --bg-tag: rgba(0, 184, 219, 0.2);
  --bg-glow: rgba(0, 184, 219, 0.1);
  --radius: 10px;
  --radius-sm: 4px;
  --font-sans: "Inter", "Noto Sans SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #0d1428;
  color: var(--text-white);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 32px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ========== 统计卡片 ========== */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  height: 162px;
}

.stat-card {
  position: relative;
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}

.stat-card-glow {
  position: absolute;
  left: 150px;
  top: 0;
  width: 80px;
  height: 80px;
  background: var(--bg-glow);
  border-radius: 50%;
  filter: blur(40px);
}

.stat-card-inner {
  position: relative;
  padding: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: rgba(0, 184, 219, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.stat-value {
  margin: 0;
  font-weight: 700;
  font-size: 30px;
  line-height: 36px;
  letter-spacing: 0.4px;
  color: var(--text-white);
}

.stat-label {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-cyan);
  letter-spacing: -0.15px;
}

/* ========== 搜索与筛选 ========== */
.search-filters {
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius);
  background: var(--bg-card-search);
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-row,
.filter-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.search-input-wrap {
  flex: 1;
  position: relative;
  height: 50px;
}

.filter-row .date-picker-wrap {
  flex: 1;
  position: relative;
  height: 50px;
}

.filter-btn-wrap {
  position: relative;
  width: 120px;
  min-width: 120px;
  height: 50px;
}

.refresh-btn-wrap {
  width: 140px;
  min-width: 140px;
  height: 50px;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 1;
}

.search-input,
.date-input {
  width: 100%;
  height: 50px;
  padding: 12px 16px 12px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius);
  color: var(--text-white);
  font-size: 16px;
  font-family: inherit;
  outline: none;
}

.search-input::placeholder,
.date-input::placeholder {
  color: var(--text-cyan-dim);
}

.filter-btn {
  width: 100%;
  height: 50px;
  padding: 12px 16px 12px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius);
  color: var(--text-cyan);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
}

.refresh-btn {
  width: 100%;
  height: 50px;
  border: 1px solid rgba(0, 184, 219, 0.5);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(0, 184, 219, 0.25), rgba(28, 57, 142, 0.25));
  color: #d6f7ff;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
}

.refresh-btn:hover {
  filter: brightness(1.08);
}

.refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ========== 视频列表区 ========== */
.video-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-bar {
  width: 4px;
  height: 24px;
  border-radius: 2px;
  background: linear-gradient(180deg, #00d3f3 0%, #2b7fff 100%);
  flex-shrink: 0;
}

.section-title {
  margin: 0;
  font-weight: 500;
  font-size: 20px;
  line-height: 28px;
  color: var(--text-white);
  letter-spacing: -0.45px;
}

.result-count {
  margin-left: 8px;
  font-size: 14px;
  font-weight: 400;
  color: rgba(0, 211, 243, 0.6);
  letter-spacing: -0.15px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.video-card {
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius);
  background: linear-gradient(132.64deg, rgba(22, 36, 86, 0.4) 0%, rgba(28, 57, 142, 0.2) 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 184, 219, 0.15);
}

.video-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-input);
  overflow: hidden;
}

.video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #162456 0%, transparent 50%, transparent 100%);
  opacity: 0.6;
  pointer-events: none;
}

.video-card-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-tag);
}

.video-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.video-card-title {
  margin: 0;
  font-weight: 500;
  font-size: 18px;
  line-height: 27px;
  color: var(--text-white);
  letter-spacing: -0.44px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-cyan);
  letter-spacing: -0.15px;
}

.video-card-meta svg,
.video-card-meta .meta-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.video-card-date {
  color: var(--text-date);
}

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

.video-card-tag {
  padding: 5px 9px;
  background: var(--bg-tag);
  border: 1px solid rgba(0, 184, 219, 0.4);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-tag);
}

.video-grid .loading-text,
.video-grid .empty-text,
.video-grid .error-text {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: var(--text-cyan);
}

.video-grid .error-text {
  color: #f87171;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.page-btn {
  min-width: 88px;
  height: 36px;
  border: 1px solid rgba(0, 184, 219, 0.45);
  border-radius: 8px;
  background: rgba(22, 36, 86, 0.6);
  color: #cfefff;
  font-family: inherit;
  cursor: pointer;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  color: rgba(0, 211, 243, 0.85);
  font-size: 14px;
}

.video-card-playable {
  cursor: pointer;
}

.video-card-playable:hover .video-card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-card-playable:hover .video-card-thumb::before {
  content: "▶";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  color: rgba(255, 255, 255, 0.9);
  z-index: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ========== 视频播放器弹窗 ========== */
.video-player-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.video-player-overlay.active {
  opacity: 1;
  visibility: visible;
}

.video-player-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.video-player-box {
  position: relative;
  width: 90%;
  max-width: 900px;
  background: #0d1428;
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.video-player-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
}

.video-player-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.video-player-title {
  margin: 0 40px 16px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-white);
}

.video-player {
  width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-sm);
  background: #000;
}

/* ========== 底部提示 ========== */
.tip-banner {
  border: 1px solid var(--border-cyan-strong);
  border-radius: var(--radius);
  background: var(--bg-tip);
  padding: 25px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.tip-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: rgba(0, 184, 219, 0.2);
  padding: 8px;
  flex-shrink: 0;
}

.tip-icon-wrap img {
  width: 20px;
  height: 20px;
  display: block;
}

.tip-content {
  flex: 1;
  min-width: 0;
}

.tip-title {
  margin: 0 0 8px;
  font-weight: 500;
  font-size: 18px;
  line-height: 27px;
  color: var(--text-white);
  letter-spacing: -0.44px;
}

.tip-desc {
  margin: 0;
  font-size: 14px;
  line-height: 22.75px;
  color: var(--text-cyan-desc);
  letter-spacing: -0.15px;
}

/* 定位/日历图标占位 */
.meta-icon {
  width: 16px;
  height: 16px;
  background: url("/assets/icons/pin.svg") center/contain no-repeat;
}

.meta-icon.calendar {
  background-image: url("/assets/icons/calendar.svg");
}

/* 响应式：小屏 2 列 */
@media (max-width: 900px) {
  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
    height: auto;
  }

  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-row {
    flex-wrap: wrap;
  }

  .filter-btn-wrap {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .main-content {
    padding: 16px 12px;
    gap: 24px;
  }

  .stats-cards {
    grid-template-columns: 1fr;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 24px;
  }
}
