/* VideoHub Pro — 前端样式
   设计参考 example.com 的「克制美学」：中性低饱和配色、充足留白、
   system-ui 字体、扁平柔和（去掉霓虹辉光）、低对比沉稳质感。 */

/* ── 变量 ─────────────────────────────────────────────────────────────────── */
:root {
  /* 中性近黑（去掉偏紫），层次更干净 */
  --bg:        #0d0d10;
  --bg2:       #141417;
  --bg3:       #1c1c21;
  --card:      #151519;
  --border:    #26262d;
  --text:      #e9e9ee;
  --muted:     #9595a3;   /* 略柔和，呼应 example 的低对比 */
  --primary:   #6e79e8;   /* 更克制的靛蓝（呼应 example 沉稳的 #348 蓝）*/
  --secondary: #5b8cf0;
  --gold:      #d9b46a;   /* 收敛的金，点缀用 */
  --grad:      linear-gradient(135deg, #6e79e8 0%, #5b8cf0 100%);
  --grad-gold: linear-gradient(135deg, #e6c98a 0%, #c8a24f 100%);
  --grad-soft: linear-gradient(135deg, rgba(110,121,232,.14), rgba(91,140,240,.14));
  --glass:        rgba(21,21,26,.6);
  --glass-strong: rgba(15,15,19,.82);
  --glass-border: rgba(255,255,255,.06);
  --radius:    16px;
  --radius-sm: 11px;
  --radius-lg: 20px;
  /* 阴影改为中性柔和，去掉彩色辉光（example 的扁平感） */
  --shadow:     0 4px 20px rgba(0,0,0,.40);
  --shadow-hov: 0 10px 30px rgba(0,0,0,.46);
  --shadow-gold:0 6px 20px rgba(0,0,0,.40);
  --ease: cubic-bezier(.2, .9, .4, 1.1);   /* 统一弹性缓动 */
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* 原生顺滑滚动（不再全局 smooth，避免黏滞感）；程序化滚动仍由 JS 显式 smooth 控制 */
html { scroll-behavior: auto; }
/* 交互元素去掉双击缩放的 300ms 延迟，触摸更跟手 */
a, button, .video-card, .tag, .chip, .side-cat, .nav-link, .page-btn, .drawer-cat { touch-action: manipulation; }
body {
  background: var(--bg); color: var(--text);
  /* system-ui 优先，呼应 example.com 的系统原生字体 */
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  min-height: 100vh; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, select, textarea { font: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::selection { background: rgba(110,121,232,.3); }

/* ── 顶部公告栏（毛玻璃 + 渐变 + 发光 + 动效）──────────────────────────────── */
.announce {
  --ann-c: var(--announce-color, #6366f1);
  position: relative; overflow: hidden; max-height: 0;
  transition: max-height .35s var(--ease, ease), filter .2s ease;
  color: #fff; text-align: center;
  background: var(--ann-c);                       /* 兜底纯色（任何颜色都好看）*/
}
/* 玻璃渐变 + 模糊（支持 color-mix 的浏览器；从主题色渐变到紫罗兰，并带轻微透明做毛玻璃）*/
@supports (background: color-mix(in srgb, red, blue)) {
  .announce {
    background: linear-gradient(135deg,
      color-mix(in srgb, var(--ann-c), transparent 5%),
      color-mix(in srgb, var(--ann-c), #8b5cf6 45%));
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
}
.announce.show { max-height: 88px; box-shadow: 0 6px 24px rgba(0,0,0,.28); }
@supports (background: color-mix(in srgb, red, blue)) {
  .announce.show { box-shadow: 0 6px 24px rgba(0,0,0,.28), 0 0 18px color-mix(in srgb, var(--ann-c), transparent 55%); }
}
/* 底部发光细边框 */
.announce.show::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
}
.announce-inner {
  position: relative; min-height: 46px; display: flex; align-items: center; justify-content: center;
  gap: .55rem; padding: .5rem 2.9rem; font-size: .875rem; font-weight: 600; line-height: 1.35;
}
.announce.show .announce-inner { animation: annSlideDown .35s var(--ease, ease) both; }
.announce-icon { flex-shrink: 0; display: inline-block; animation: annBounce 1.4s ease-in-out infinite; }
.announce-text { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.25), 0 0 10px rgba(255,255,255,.18); }
.announce-text a, .announce-link {
  color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px;
  display: inline-block; transition: transform .18s var(--ease, ease), color .18s ease;
}
.announce-close {
  position: absolute; right: .55rem; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%; color: #fff; opacity: .9;
  display: flex; align-items: center; justify-content: center; font-size: .95rem;
  background: rgba(255,255,255,.12);
  transition: background .2s ease, transform .25s var(--ease, ease), opacity .2s ease;
}
.announce-close:active { transform: translateY(-50%) scale(.86); }
/* 自动隐藏进度条：由 main.js 在 auto_hide>0 时注入，从右往左缩小；悬停暂停 */
.announce-progress {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.9));
  transform-origin: left;
}
.announce.show .announce-progress { animation: annProgress var(--ann-dur, 5s) linear forwards; }

@media (hover: hover) {
  .announce:hover { filter: brightness(1.07); }
  .announce:hover .announce-progress { animation-play-state: paused; }   /* 悬停暂停倒计时，方便阅读 */
  .announce-link:hover { transform: translateX(3px); color: #ffe7a6; }
  .announce-close:hover { background: rgba(255,255,255,.28); opacity: 1; transform: translateY(-50%) rotate(90deg) scale(1.15); }
}

@keyframes annSlideDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes annBounce { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-3px) rotate(-9deg); } 60% { transform: translateY(-1px) rotate(7deg); } }
@keyframes annProgress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* 样式变体（可选）：main.js 据 cfg.style 添加 .announce--gold / .announce--neon */
.announce--gold { --ann-c: #e8b84b; background: linear-gradient(135deg, #f4c150, #e07a3f); }
.announce--gold .announce-text {
  background: linear-gradient(135deg, #fff7e2, #ffd27a);
  -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none;
}
.announce--neon { background: rgba(15,15,22,.86); }
.announce--neon.show { box-shadow: 0 0 22px rgba(124,108,255,.5), inset 0 0 0 1px rgba(124,108,255,.55); }
.announce--neon .announce-text { color: #fff; text-shadow: 0 0 8px rgba(124,108,255,.85); }
.announce--neon .announce-icon { filter: drop-shadow(0 0 5px rgba(124,108,255,.8)); }

@media (max-width: 640px) {
  .announce-inner { font-size: .8rem; padding: .5rem 2.7rem; }
  .announce.show { max-height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  .announce-icon, .announce.show .announce-inner, .announce.show .announce-progress { animation: none; }
}

/* 背景光晕：大幅收敛，趋近 example.com 的扁平干净（仅极淡的氛围） */
.bg-aurora {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  will-change: transform;   /* 提升为独立合成层：视差位移走 GPU，不触发页面重绘 */
  background:
    radial-gradient(55% 45% at 12% -5%, rgba(110,121,232,.10), transparent 70%),
    radial-gradient(60% 55% at 50% 110%, rgba(91,140,240,.07), transparent 70%);
}
/* 滚动期间暂停全屏装饰动画，减少滚动时的重绘 → 更顺滑 */
.scrolling .bg-aurora::before, .scrolling .bg-aurora::after { animation-play-state: paused; }

/* ── 通用工具 ────────────────────────────────────────────────────────────── */
.hidden   { display: none !important; }
.flex     { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: .5rem; }
.gap-3  { gap: .75rem; }
.gap-4  { gap: 1rem; }
.text-muted { color: var(--muted); }
.text-primary { color: var(--primary); }
.text-sm  { font-size: .8125rem; }
.text-xs  { font-size: .75rem; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── 按钮 ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem 1.125rem; border-radius: var(--radius-sm);
  font-size: .8125rem; font-weight: 600; transition: all .18s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 4px 16px rgba(110,121,232,.28); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(110,121,232,.4); }
.btn-outline { border: 1px solid var(--border); color: var(--muted); background: transparent; }
.btn-outline:hover { border-color: var(--primary); color: var(--text); background: rgba(110,121,232,.08); }
.btn-danger { border: 1px solid rgba(239,68,68,.4); color: #ef4444; }
.btn-danger:hover { background: rgba(239,68,68,.1); }
.btn-sm { padding: .3rem .75rem; font-size: .75rem; border-radius: 8px; }
.btn-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); transition: all .15s;
}
.btn-icon:hover { background: var(--bg3); color: var(--text); }

/* ── 输入框 ──────────────────────────────────────────────────────────────── */
.input {
  width: 100%; padding: .55rem .875rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg3);
  color: var(--text); font-size: .875rem; transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(110,121,232,.18); }
.input::placeholder { color: var(--muted); }
select.input { cursor: pointer; }
.form-label { display: block; font-size: .75rem; font-weight: 500; color: var(--muted); margin-bottom: .375rem; }
.form-group { margin-bottom: 1rem; }

/* ── 导航栏 ──────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: 60px; background: var(--glass-strong);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center;
}
.navbar-inner {
  max-width: 1600px; margin: 0 auto; padding: 0 1.5rem;
  width: 100%; display: flex; align-items: center; gap: 1.25rem;
}
.navbar-brand {
  display: flex; align-items: center; gap: .6rem;
  font-size: 1rem; font-weight: 800; white-space: nowrap; letter-spacing: .01em;
}
.brand-icon {
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--grad); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.navbar-search { flex: 1; max-width: 460px; position: relative; }
.navbar-search input { padding-left: 2.4rem; border-radius: 999px; background: var(--bg2); }
.navbar-search .search-icon {
  position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.navbar-links { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.nav-link {
  position: relative; padding: .4rem .75rem; border-radius: 8px; font-size: .8125rem; font-weight: 500;
  color: var(--muted); transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: ''; position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%);
  width: 18px; height: 2px; border-radius: 2px; background: var(--grad);
}

/* ── 视频详情页容器（video.html 使用） ──────────────────────────────────── */
.page-layout { max-width: 1100px; margin: 0 auto; padding: 1.5rem; min-height: calc(100vh - 60px); }
.page-main { min-width: 0; }

/* ── 首页三栏网格 ────────────────────────────────────────────────────────── */
/* 只为「实际存在的侧栏」分配列，避免空侧栏留下 264px 空白列 */
.home {
  --aside: 264px;
  max-width: 1600px; margin: 0 auto; padding: 1.75rem 1.5rem;   /* 更充足的上下留白 */
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem; align-items: start;
}
.home.has-left  { grid-template-columns: var(--aside) minmax(0, 1fr); }
.home.has-right { grid-template-columns: minmax(0, 1fr) var(--aside); }
.home.has-left.has-right { grid-template-columns: var(--aside) minmax(0, 1fr) var(--aside); }
.home-aside { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 1rem; }
.home-main { min-width: 0; }

/* 玻璃卡片（侧栏容器） */
.side-card {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg); overflow: hidden;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}


/* ── 汉堡菜单 + 侧滑抽屉（移动端导航） ───────────────────────────────────── */
.nav-hamburger {
  display: none; width: 38px; height: 38px; border-radius: 10px;
  align-items: center; justify-content: center; color: var(--text);
  background: transparent; flex-shrink: 0;
}
.nav-hamburger:hover { background: rgba(255,255,255,.06); }
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 200;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; height: 100%; width: min(82vw, 320px);
  transform: translateX(-100%); transition: transform .28s ease;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-right: 1px solid var(--glass-border); z-index: 201;
  display: flex; flex-direction: column; padding: 1rem; overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: .25rem .25rem .9rem; border-bottom: 1px solid var(--border); margin-bottom: .75rem; font-size: 1.05rem; }
.drawer-nav { display: flex; flex-direction: column; gap: .2rem; margin-bottom: 1rem; }
.drawer-link { padding: .7rem .75rem; border-radius: 10px; font-weight: 600; color: var(--text); }
.drawer-link:hover { background: rgba(255,255,255,.06); }
.drawer-section-title { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: .25rem .75rem; }
.drawer-cats { display: flex; flex-wrap: wrap; gap: .4rem; padding: .5rem .25rem; }
.drawer-cat { padding: .4rem .8rem; border-radius: 999px; font-size: .8rem; border: 1px solid var(--border); color: var(--muted); background: transparent; }
.drawer-cat.active, .drawer-cat:hover { border-color: transparent; background: var(--grad); color: #fff; }

/* ── 主布局：内容 + 右分类栏 ─────────────────────────────────────────────── */
.layout {
  max-width: 1600px; margin: 0 auto; padding: 1.5rem;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.75rem; align-items: start;
}
.layout-main { min-width: 0; }
.layout-main .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.layout-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }

/* ── 右侧小部件 ──────────────────────────────────────────────────────────── */
.side-widget { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.side-widget-title { font-size: .9rem; font-weight: 700; margin-bottom: .75rem; padding-left: .6rem; position: relative; }
.side-widget-title::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 1em; border-radius: 3px; background: var(--grad); }
.side-cats { list-style: none; display: flex; flex-direction: column; gap: .25rem; }
.side-cat {
  position: relative; width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; padding: .55rem .7rem .55rem .9rem; border-radius: 10px; font-size: .85rem;
  color: var(--muted); text-align: left; overflow: hidden;
  transition: transform .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease;
}
.side-cat::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 0;
  border-radius: 3px; background: var(--cat-accent, var(--grad)); transition: height .2s ease;
}
.side-cat:hover { background: rgba(255,255,255,.05); color: var(--text); transform: translateX(4px); }
.side-cat:hover::before, .side-cat.active::before { height: 58%; }
.side-cat.active { background: var(--grad-soft); color: var(--text); font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.side-cat-count { font-size: .72rem; color: var(--muted); background: var(--bg3); padding: .05rem .5rem; border-radius: 999px; flex-shrink: 0; transition: background .2s ease, color .2s ease; }
.side-cat.active .side-cat-count { background: var(--cat-accent, var(--grad)); color: #fff; }
/* 分类强调色按顺序循环 6 种，和下载/客服按钮共用同一套配色语言，分类多了也不单调 */
.side-cats li:nth-child(6n+1) .side-cat { --cat-accent: linear-gradient(180deg, #6e79e8, #5b8cf0); }
.side-cats li:nth-child(6n+2) .side-cat { --cat-accent: linear-gradient(180deg, #e6c98a, #c8a24f); }
.side-cats li:nth-child(6n+3) .side-cat { --cat-accent: linear-gradient(180deg, #ff9a76, #f2542d); }
.side-cats li:nth-child(6n+4) .side-cat { --cat-accent: linear-gradient(180deg, #34d399, #059669); }
.side-cats li:nth-child(6n+5) .side-cat { --cat-accent: linear-gradient(180deg, #f472b6, #db2777); }
.side-cats li:nth-child(6n)   .side-cat { --cat-accent: linear-gradient(180deg, #2aabee, #1c8fd1); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag {
  padding: .35rem .85rem; border-radius: 30px; font-size: .78rem; font-weight: 600;
  border: 1px solid var(--border); color: var(--muted); background: rgba(255,255,255,.03);
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.tag:hover { background: var(--tag-accent, var(--grad)); border-color: transparent; color: #fff; transform: scale(1.06) translateY(-1px); box-shadow: 0 6px 16px var(--tag-shadow, rgba(110,121,232,.35)); }
.tag.active { background: var(--tag-accent, var(--grad)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px var(--tag-shadow, rgba(110,121,232,.3)); }
/* 标签配色循环同一套 6 色，和分类列表呼应 */
.tag-cloud .tag:nth-child(6n+1) { --tag-accent: linear-gradient(135deg, #6e79e8, #5b8cf0); --tag-shadow: rgba(110,121,232,.35); }
.tag-cloud .tag:nth-child(6n+2) { --tag-accent: linear-gradient(135deg, #e6c98a, #c8a24f); --tag-shadow: rgba(200,162,79,.4); }
.tag-cloud .tag:nth-child(6n+3) { --tag-accent: linear-gradient(135deg, #ff9a76, #f2542d); --tag-shadow: rgba(242,84,45,.35); }
.tag-cloud .tag:nth-child(6n+4) { --tag-accent: linear-gradient(135deg, #34d399, #059669); --tag-shadow: rgba(5,150,105,.35); }
.tag-cloud .tag:nth-child(6n+5) { --tag-accent: linear-gradient(135deg, #f472b6, #db2777); --tag-shadow: rgba(219,39,119,.35); }
.tag-cloud .tag:nth-child(6n)   { --tag-accent: linear-gradient(135deg, #2aabee, #1c8fd1); --tag-shadow: rgba(28,143,209,.35); }

/* ── 区块标题 ────────────────────────────────────────────────────────────── */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-title { font-size: 1.05rem; font-weight: 700; position: relative; padding-left: .75rem; }
.section-title::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 1.05em; border-radius: 3px; background: var(--grad);
}
.section-count { font-size: .75rem; }

/* ── 分类筛选 ────────────────────────────────────────────────────────────── */
.filter-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.chip {
  padding: .35rem .95rem; border-radius: 999px; font-size: .8125rem; font-weight: 500;
  border: 1px solid var(--border); color: var(--muted);
  background: rgba(255,255,255,.02); transition: all .18s; white-space: nowrap; cursor: pointer;
}
.chip:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }
.chip.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(110,121,232,.35); }
.chip-count { opacity: .65; font-size: .7rem; margin-left: .15rem; }

/* ── 二级菜单（国家 / 类型） ─────────────────────────────────────────────── */
.submenu-row { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: .5rem; }
.submenu-row .filter-row { margin-bottom: .25rem; flex: 1; }
.submenu-label { flex-shrink: 0; font-size: .75rem; font-weight: 600; color: var(--muted); padding: .35rem .5rem .35rem 0; min-width: 3rem; letter-spacing: .03em; }

/* ── 语言切换 ───────────────────────────────────────────────────────────── */
.lang-switch { display: inline-flex; gap: .25rem; align-items: center; }
.lang-btn {
  padding: .25rem .6rem; border-radius: 999px; font-size: .75rem;
  border: 1px solid var(--border); color: var(--muted); background: transparent;
  transition: all .15s; white-space: nowrap;
}
.lang-btn:hover { border-color: var(--primary); color: var(--text); }
.lang-btn.active { background: var(--grad); border-color: transparent; color: #fff; }

/* ── 视频网格 ────────────────────────────────────────────────────────────── */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.5rem; }
/* 所有弹性列统一用 minmax(0,1fr)，把轨道最小值钉死为 0，防止内容撑爆轨道 */
.video-card {
  position: relative;
  background: var(--card); border-radius: 16px;
  overflow: hidden; border: 1px solid var(--border); min-width: 0;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
/* 扫光：一道斜向高光从左上扫到右下（悬停触发，0.6s） */
.video-card::before {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.16) 46%, rgba(216,180,106,.20) 50%, transparent 64%);
  transform: translateX(-130%); opacity: 0;
}
/* 悬停：上浮 5px + 放大 1.02 + 阴影增强 + 紫/金发光边缘（0.3s）*/
.video-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-hov), 0 0 0 1px rgba(110,121,232,.28), 0 0 22px rgba(110,121,232,.22), 0 0 30px rgba(216,180,106,.10);
  border-color: rgba(110,121,232,.4);
}
.card-thumb { aspect-ratio: 16/9; overflow: hidden; position: relative; width: 100%; background: var(--bg3); }
/* img 绝对定位：脱离文档流，不参与 min-content 计算，彻底杜绝
   「aspect-ratio + 图片 height:100% + 单列 1fr 栅格」的循环尺寸爆炸（移动端整页错乱根因） */
.card-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.video-card:hover .card-thumb img { transform: scale(1.05); }
.card-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.45)); opacity: 0; transition: opacity .22s;
}
.video-card:hover .card-play { opacity: 1; }
.card-play-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,.95); display: flex; align-items: center; justify-content: center;
  transform: scale(.85); transition: transform .22s ease; box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.video-card:hover .card-play-btn { transform: scale(1); }
.card-play-btn svg { color: var(--primary); margin-left: 3px; }
.card-cat {
  position: absolute; top: .55rem; left: .55rem;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: .68rem; font-weight: 700; color: #fff;
  background: rgba(110,121,232,.85); backdrop-filter: blur(4px);
}
.card-views {
  position: absolute; bottom: .55rem; right: .55rem; display: flex; align-items: center; gap: .25rem;
  padding: .18rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 600; color: #fff;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px); opacity: 0; transition: opacity .22s;
}
.video-card:hover .card-views { opacity: 1; }
.card-body { padding: .75rem .8rem .85rem; }
.card-title {
  font-size: .85rem; font-weight: 600; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.4; min-height: 2.38em;
}
.card-meta { display: flex; justify-content: flex-end; margin-top: .45rem; font-size: .7rem; color: var(--muted); }

/* ── 分页 ────────────────────────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: .5rem; margin-top: 2.25rem; flex-wrap: wrap; }
.page-btn {
  min-width: 38px; padding: .4rem .8rem; border-radius: 10px; font-size: .8125rem; font-weight: 600;
  border: 1px solid var(--border); color: var(--muted);
  background: var(--card); transition: all .15s; cursor: pointer;
}
.page-btn:hover { border-color: var(--primary); color: var(--text); }
.page-btn.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(110,121,232,.35); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── 视频详情页 ──────────────────────────────────────────────────────────── */
.video-detail { max-width: 920px; margin: 0 auto; }
.player-wrap { border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); width: 100%; max-width: 100%; }
.player-wrap .plyr { width: 100%; max-width: 100%; }                 /* Plyr 容器自适应屏宽 */
.player-wrap iframe, .player-wrap video { width: 100%; max-width: 100%; aspect-ratio: 16/9; display: block; }
.player-wrap video { height: auto; max-height: 80vh; object-fit: contain; }  /* 竖屏/大分辨率视频不超高 */
.video-info {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 1.4rem; margin-top: 1rem; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.video-title { font-size: 1.2rem; font-weight: 800; line-height: 1.35; }
.video-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: .7rem; color: var(--muted); font-size: .8125rem; }
.video-desc { margin-top: .9rem; font-size: .875rem; color: var(--muted); line-height: 1.65; }
.related-title { font-size: 1rem; font-weight: 700; margin: 1.75rem 0 .85rem; }

/* ── 加载 / 空态 ─────────────────────────────────────────────────────────── */
.spinner {
  width: 34px; height: 34px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-wrap { display: flex; justify-content: center; padding: 3rem 0; }
.empty-state { text-align: center; padding: 3.5rem 0; color: var(--muted); }
.empty-state svg { margin: 0 auto 1rem; opacity: .25; }

/* ── 骨架屏 ──────────────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, #232333 37%, var(--bg3) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skeleton-card { pointer-events: none; }
.skeleton.card-thumb { aspect-ratio: 16/9; }
.skeleton-line { height: 11px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast-stack { position: fixed; top: 72px; right: 1rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast {
  padding: .7rem 1.1rem; border-radius: var(--radius-sm);
  font-size: .8125rem; font-weight: 500; color: #fff; box-shadow: var(--shadow);
  pointer-events: all; animation: toastIn .25s ease;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.toast-success { background: rgba(16,185,129,.92); }
.toast-error   { background: rgba(239,68,68,.92); }
.toast-info    { background: rgba(110,121,232,.92); }

/* ── 管理后台 ────────────────────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 224px; flex-shrink: 0; background: var(--glass-strong); border-right: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  transition: width .25s;
}
.admin-sidebar.collapsed { width: 58px; }
.sidebar-header { height: 60px; display: flex; align-items: center; gap: .75rem; padding: 0 1rem; border-bottom: 1px solid var(--glass-border); flex-shrink: 0; }
.sidebar-nav { flex: 1; padding: .5rem; }
.side-link {
  display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; border-radius: var(--radius-sm);
  font-size: .8125rem; font-weight: 500; color: rgba(255,255,255,.55);
  transition: all .15s; white-space: nowrap; overflow: hidden;
}
.side-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.side-link.active { color: #fff; background: rgba(110,121,232,.22); box-shadow: inset 2px 0 0 var(--primary); }
.side-link svg { flex-shrink: 0; }
.admin-sidebar.collapsed .side-link span { display: none; }
.admin-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.admin-topbar { height: 60px; background: var(--glass-strong); border-bottom: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); display: flex; align-items: center; padding: 0 1.25rem; gap: .75rem; flex-shrink: 0; }
.admin-content { flex: 1; overflow-y: auto; padding: 1.5rem; }
.admin-panel { display: none; }
.admin-panel.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── 统计卡片 ────────────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; transition: transform .2s, border-color .2s; }
.stat-card:hover { transform: translateY(-3px); border-color: rgba(110,121,232,.4); }
.stat-value { font-size: 2rem; font-weight: 800; }
.stat-label { font-size: .8125rem; color: var(--muted); margin-top: .25rem; }

/* ── 管理表格 ────────────────────────────────────────────────────────────── */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
table { width: 100%; border-collapse: collapse; }
th { padding: .7rem 1rem; font-size: .75rem; font-weight: 600; color: var(--muted); text-align: left; border-bottom: 1px solid var(--border); }
td { padding: .8rem 1rem; font-size: .8125rem; border-bottom: 1px solid rgba(42,42,55,.6); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── 上传进度条（分片上传） ──────────────────────────────────────────────── */
.progress-track { height: 9px; border-radius: 999px; background: var(--bg3); overflow: hidden; border: 1px solid var(--border); }
.progress-fill { height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width .25s ease; box-shadow: 0 0 8px rgba(110,121,232,.25); }

/* ── 模态框 ──────────────────────────────────────────────────────────────── */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); z-index: 500; align-items: center; justify-content: center; padding: 1rem; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--bg2); border: 1px solid var(--glass-border); border-radius: var(--radius); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; animation: modalIn .2s ease; box-shadow: var(--shadow); }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: .95rem; font-weight: 700; }
.modal-body { padding: 1.25rem; }
.modal-foot { padding: .85rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .5rem; }

/* ── 登录页 ──────────────────────────────────────────────────────────────── */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { width: 100%; max-width: 370px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 2.25rem; box-shadow: var(--shadow); }
.login-logo { text-align: center; margin-bottom: 1.5rem; }
.login-logo .icon { width: 56px; height: 56px; border-radius: var(--radius); background: var(--grad); display: flex; align-items: center; justify-content: center; margin: 0 auto .75rem; box-shadow: 0 6px 16px rgba(0,0,0,.4); }

/* ── 页脚 ────────────────────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--border); padding: 1.5rem; margin-top: 2.5rem; text-align: center; font-size: .75rem; color: var(--muted); }

/* ════════════════════════════════════════════════════════════════════════════
   交互动画（纯新增，可整段删除回滚）
   ════════════════════════════════════════════════════════════════════════════ */

/* 触摸：去掉点击高亮灰块 */
* { -webkit-tap-highlight-color: transparent; }

/* 悬停变形仅在「支持悬停」的设备（桌面）生效，避免触摸端「张贴」式卡住 */
@media (hover: hover) {
  /* 扫光：视频卡悬停时高光从左上扫到右下 */
  .video-card:hover::before { transform: translateX(130%); opacity: 1; }
  /* 后台入口：文字高亮 + Logo 轻旋 */
  #adminLink:hover { color: var(--text); }
  .navbar-brand:hover .brand-icon { transform: rotate(-8deg) scale(1.05); }
}
.brand-icon { transition: transform .35s var(--ease); }

.video-card::before { transition: transform .6s var(--ease), opacity .6s ease; }

/* 页面加载淡入（保留为无 JS 时的兜底动画）*/
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.anim-in { animation: fadeUp .5s var(--ease) both; }

/* 滚动触发显现：默认隐藏下移，进入视口由 JS 加 .sr-in 淡入上浮
   （main.js 含兜底定时器，绝不会让内容长期隐藏；reduce 时强制可见）*/
.sr { opacity: 0; transform: translateY(30px); }
.sr-in { opacity: 1; transform: none; transition: opacity .55s ease, transform .55s var(--ease); }

/* 背景金色粒子：极淡、缓慢飘浮 */
.bg-aurora::after {
  content: ''; position: absolute; inset: -10% -10% 0;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(216,180,106,.35), transparent),
    radial-gradient(2px 2px at 70% 60%, rgba(216,180,106,.28), transparent),
    radial-gradient(1.5px 1.5px at 40% 80%, rgba(216,180,106,.30), transparent),
    radial-gradient(1.5px 1.5px at 85% 25%, rgba(216,180,106,.22), transparent),
    radial-gradient(2px 2px at 55% 15%, rgba(216,180,106,.25), transparent),
    radial-gradient(1.5px 1.5px at 10% 70%, rgba(216,180,106,.22), transparent);
  background-size: 100% 140%;
  opacity: .5; animation: particleDrift 26s linear infinite;
}
@keyframes particleDrift { from { background-position: 0 0; } to { background-position: 0 -140%; } }

/* 闪烁光点（边缘偶现微光，紫/金，极克制）*/
.bg-aurora::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(1.5px 1.5px at 6% 18%, rgba(216,180,106,.9), transparent),
    radial-gradient(1.5px 1.5px at 94% 30%, rgba(150,140,255,.8), transparent),
    radial-gradient(1px 1px at 12% 82%, rgba(216,180,106,.8), transparent),
    radial-gradient(1.5px 1.5px at 90% 78%, rgba(150,140,255,.7), transparent),
    radial-gradient(1px 1px at 50% 6%, rgba(255,255,255,.7), transparent);
  animation: sparkle 5s ease-in-out infinite;
}
@keyframes sparkle { 0%, 100% { opacity: 0; } 45%, 55% { opacity: .8; } }

/* 回到顶部按钮（由 main.js 动态创建注入） */
.to-top {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 150;
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; box-shadow: 0 8px 22px rgba(110,121,232,.35);
  opacity: 0; transform: scale(.4) rotate(-90deg); pointer-events: none;
  transition: opacity .3s ease, transform .3s var(--ease), filter .2s ease;
}
.to-top.show { opacity: 1; transform: scale(1) rotate(0); pointer-events: auto; }
@media (hover: hover) { .to-top:hover { transform: scale(1.12); filter: brightness(1.1); } }
.to-top:active { transform: scale(.95); }

/* 尊重「减少动态效果」：关掉一切装饰动画，并确保滚动显现元素强制可见 */
@media (prefers-reduced-motion: reduce) {
  .anim-in { animation: none; }
  .sr { opacity: 1; transform: none; }
  .bg-aurora::after, .bg-aurora::before { animation: none; opacity: .2; }
  .video-card::before { display: none; }
  .to-top { transition: opacity .2s ease; }
  * { scroll-behavior: auto; }
}

/* ── 响应式 ──────────────────────────────────────────────────────────────── */
/* 新布局（≤1024）：右分类栏移到内容下方，网格 3→2 列 */
@media (max-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .layout-side { position: static; }
  .layout-main .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 平板：缩小侧栏 */
@media (max-width: 1180px) {
  .home { --aside: 210px; gap: 1rem; }
}
/* 中屏：折叠为单列 */
@media (max-width: 980px) {
  .home, .home.has-left, .home.has-right, .home.has-left.has-right { grid-template-columns: minmax(0, 1fr); }
  .home-aside { position: static; flex-direction: column; gap: .85rem; }
  .side-card { flex: 1 1 100%; }
}
@media (max-width: 768px) {
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .layout-main .video-grid { gap: .75rem; }
  /* 移动端导航：显示汉堡、隐藏桌面菜单链接（改用侧滑抽屉） */
  .nav-hamburger { display: inline-flex; }
  .navbar-links { display: none; }
  .layout { padding: 1rem; gap: 1rem; }
  /* 手机版重排：热门分类栏置顶 → 视频。
     display:contents 让右侧栏各部件「升级」为 .layout 的直接网格子项，从而可单独 order 排序。 */
  .layout-side { display: contents; }
  #categories { display: none; }              /* 竖排分类列表隐藏：顶部热门栏 + 汉堡抽屉已覆盖分类入口 */
  #hotTagsWidget { order: 1; }                /* 热门分类栏 → 视频之前 */
  .layout-main   { order: 2; }                /* 双列视频卡片 */
  /* 热门分类栏改横向滚动，不换行 */
  #hotTagsWidget .tag-cloud {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 2px;
  }
  #hotTagsWidget .tag-cloud::-webkit-scrollbar { display: none; }
  #hotTagsWidget .tag { flex-shrink: 0; }     /* pill 不被压缩，超出则横向滚动 */
  .stat-grid { grid-template-columns: 1fr; }
  .admin-sidebar { width: 58px; }
  .admin-sidebar .side-link span { display: none; }
  /* 视频详情页：减小内边距，播放器限高，避免在小屏上过大 */
  .page-layout { padding: 1rem .85rem; }
  .player-wrap iframe, .player-wrap video, .player-wrap .plyr { max-height: 56vh; }
  /* 触摸友好：交互元素加大点击区域（≥40px），字号不小于 13px */
  .chip { padding: .5rem 1rem; }
  .page-btn { min-height: 40px; display: inline-flex; align-items: center; }
  .nav-link { padding: .5rem .7rem; }
  .card-title { font-size: .875rem; }
}
@media (max-width: 640px) {
  .navbar-inner { gap: .6rem; padding: 0 1rem; }
  .navbar-brand span { display: none; }
  .navbar-search { max-width: none; }
  .home { padding: 1rem; }
  .filter-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .filter-row::-webkit-scrollbar { display: none; }
}
@media (max-width: 460px) {
  .video-grid { grid-template-columns: minmax(0, 1fr); }
}
