﻿* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --bg:#101014; --card:#1c1c22; --line:#2a2a33; --accent:#ff5722; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: "Microsoft YaHei", system-ui, -apple-system, sans-serif; background: var(--bg); color: #eee; min-height: 100vh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* 顶栏 */
.top { display: flex; align-items: center; gap: 14px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); background: #1c1c22; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.brand { font-size: 20px; font-weight: 800; color: var(--accent); flex: 0 0 auto; }
.topnav { display: flex; gap: 4px; }
.nav-link { padding: 8px 14px; border-radius: 8px; color: #bbb; }
.nav-link:hover { color: #fff; background: var(--line); }
.nav-link.active { background: var(--accent); color: #fff; }
.searchbox { margin-left: auto; display: flex; gap: 6px; flex: 1 1 auto; max-width: 420px; }
.searchbox input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 8px; border: 1px solid #333; background: var(--bg); color: #eee; font-size: 15px; }
.searchbox button { padding: 9px 16px; border: none; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; font-size: 15px; }

/* 主体 */
main { flex: 1; padding: 16px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* 卡片流 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.card { background: var(--card); border-radius: 10px; overflow: hidden; cursor: pointer; transition: transform .15s; }
.card:hover { transform: translateY(-3px); }
.card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #000; }
.card .info { padding: 8px 10px 10px; }
.card .title { font-size: 14px; line-height: 1.45; height: 40px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card .meta { margin-top: 6px; font-size: 12px; color: #888; display: flex; justify-content: space-between; gap: 6px; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 22px 0; }
.pager button { padding: 10px 18px; border: none; border-radius: 8px; background: var(--line); color: #eee; cursor: pointer; font-size: 15px; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager span { min-width: 78px; text-align: center; color: #aaa; }

.placeholder { color: #666; text-align: center; padding: 70px 16px; font-size: 15px; }
.error { color: #ff6b6b; padding: 30px 16px; text-align: center; }

/* 播放页 */
.play-wrap { display: flex; flex-direction: column; gap: 14px; }
.player { background: #000; border-radius: 12px; overflow: hidden; width: 100%; }
.player video { width: 100%; aspect-ratio: 16/9; max-height: 62vh; display: block; background: #000; }
.play-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.play-head h1 { font-size: 19px; line-height: 1.5; max-width: 70%; font-weight: 600; }
.btn-download { background: var(--accent); color: #fff; border: none; padding: 12px 24px; border-radius: 10px; font-size: 16px; cursor: pointer; white-space: nowrap; }
.btn-download:hover { filter: brightness(1.1); }
.play-sub { color: #888; font-size: 13px; }
.back { color: var(--accent); margin-bottom: 10px; display: inline-block; font-size: 15px; }

/* 页脚 */
.foot { text-align: center; color: #555; font-size: 12px; padding: 16px 0 24px; }

/* 底部标签栏（手机） */
.bottom-nav { display: none; }

/* ===== 手机适配 ===== */
@media (max-width: 600px) {
  .topnav { display: none; }
  .searchbox { margin-left: 0; width: 100%; max-width: none; order: 3; }
  main { padding: 12px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .card .info { padding: 6px 7px 8px; }
  .card .title { font-size: 12px; height: 34px; }
  .card .meta { font-size: 11px; margin-top: 4px; }
  .card .meta span:last-child { display: none; }
  .play-head { flex-direction: column; }
  .play-head h1 { max-width: 100%; }
  .btn-download { width: 100%; text-align: center; }
  .player video { max-height: 56vh; }
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .foot { padding-bottom: 24px; }
  /* 底部固定标签栏 */
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: 56px; background: #1c1c22; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav .nav-link { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 0; color: #888; background: transparent; }
  .bottom-nav .nav-link.active { background: transparent; color: var(--accent); }
  .bottom-nav .ico { font-size: 20px; line-height: 1; }
  .bottom-nav .lbl { font-size: 12px; }
}
@media (max-width: 379px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
