:root {
  --navy: #0b1e4b;
  --navy-2: #102a6b;
  --cyan: #00c8d8;
  --cyan-2: #22d3ee;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --danger: #dc2626;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(90deg, var(--navy) 0%, #123a7a 55%, #0e7490 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(2, 20, 60, 0.25);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: #fff; flex: none; }
.brand-company { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-site { font-size: 12px; opacity: 0.85; margin-top: 2px; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  line-height: 1.2;
}
.btn-primary { background: linear-gradient(90deg, #0e7490, var(--cyan)); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-accent { background: #0ea5e9; color: #fff; }
.btn-accent:hover { filter: brightness(1.08); }
.btn-ghost { background: rgba(255, 255, 255, 0.14); color: #fff; border: 1px solid rgba(255, 255, 255, 0.35); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.22); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: wait; }

main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; }

/* ---------- 登录 ---------- */
.login-view { display: flex; justify-content: center; padding: 32px 0 8px; }
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 24px 22px;
  box-shadow: 0 10px 30px rgba(11, 30, 75, 0.12);
  text-align: center;
}
.login-logo { width: 96px; height: 96px; border-radius: 18px; object-fit: cover; }
.login-company { font-size: 19px; margin: 14px 0 4px; color: var(--navy); }
.login-sub { color: var(--muted); margin: 0 0 20px; font-size: 13px; }
.field { display: block; text-align: left; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 11px 12px;
  font-size: 15px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  outline: none;
  background: #fff;
}
.field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 200, 216, 0.18); }
.error { color: var(--danger); font-size: 13px; margin: 0 0 12px; min-height: 0; }
.login-note { color: var(--muted); font-size: 12px; margin: 16px 0 0; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar input[type="search"] {
  flex: 1 1 220px;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  outline: none;
  background: #fff;
}
.toolbar input[type="search"]:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 200, 216, 0.18); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
.filter-btn.active { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.count { color: var(--muted); font-size: 13px; margin-left: auto; }

/* ---------- 视频卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(11, 30, 75, 0.14); }
.card-cover { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; background: #0b1e4b; }
.card-body { padding: 10px 12px 12px; }
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 4px; color: var(--navy); }
.card-hook { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; gap: 8px; font-size: 12px; color: #94a3b8; }
.card-meta .tag { background: #e0f2fe; color: #0369a1; border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; }

/* ---------- 播放器 ---------- */
.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 8, 23, 0.88);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 20px 12px;
}
.player-box {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: #0f172a;
  border-radius: 18px;
  overflow: hidden;
  color: #e2e8f0;
  margin: auto 0;
}
.player-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
.player-video-wrap { background: #000; }
.player-video-wrap video { width: 100%; aspect-ratio: 9 / 16; max-height: 62vh; display: block; background: #000; }
.player-info { padding: 14px 16px 18px; }
.player-info h2 { margin: 0 0 6px; font-size: 18px; color: #fff; }
.player-hook { margin: 0 0 8px; color: #a5f3fc; font-size: 14px; line-height: 1.6; }
.player-narr { margin: 0 0 14px; color: #94a3b8; font-size: 13px; line-height: 1.7; }
.player-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.player-actions .btn { flex: 1 1 140px; }
.player-hint { font-size: 12px; color: #94a3b8; line-height: 1.7; margin: 12px 0 4px; }
.download-status { font-size: 12.5px; color: #fbbf24; margin: 4px 0 0; min-height: 18px; }
.player-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.player-nav .btn-ghost { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.25); padding: 8px 12px; font-size: 13px; }
.player-index { color: #94a3b8; font-size: 13px; }

@media (max-width: 560px) {
  .brand-company { font-size: 13px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .player-overlay { padding: 0; }
  .player-box { border-radius: 0; max-width: none; min-height: 100%; }
  .player-video-wrap video { max-height: 58vh; }
}
