/* ============================================================
   app.css — 无限影视 V3 组件库 (前台 + 后台共用)
   融合: video-clone 卡片/底部Tab/玻璃顶栏 + CMS2 后台sidebar/仪表盘/广告卡
   所有变量来自 tokens.css (需先引入)
   ============================================================ */

/* ---------- 布局 ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.mute { color: var(--text-2); } .mute2 { color: var(--text-3); }

/* ---------- 通用标题 ---------- */
h1 { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.2; }
h2 { font-size: var(--fs-xl); font-weight: 700; line-height: 1.3; }
h3 { font-size: var(--fs-md); font-weight: 600; line-height: 1.4; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: var(--bg-2); color: var(--text-1); font-size: var(--fs-sm); font-weight: 500;
  cursor: pointer; transition: all var(--t); user-select: none; white-space: nowrap;
}
.btn:hover { background: var(--bg-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); box-shadow: var(--shadow-glow); }
.btn-accent { background: var(--accent-grad); color: var(--bg-2); font-weight: 700; }
.btn-accent:hover { filter: brightness(1.1); }
.btn-vip { background: var(--vip-soft); color: var(--vip); border-color: rgba(168,85,247,0.3); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--hover-bg); }
.btn-danger { background: rgba(239,68,68,0.14); color: #fca5a5; border-color: rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.24); }
.btn-success { background: rgba(34,197,94,0.14); color: #86efac; border-color: rgba(34,197,94,0.3); }
.btn-sm { padding: 6px 12px; font-size: var(--fs-xs); }
.btn-lg { padding: 12px 26px; font-size: var(--fs-base); }
.btn-block { display: flex; width: 100%; }

/* ============================================================
   卡片
   ============================================================ */
.card {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); padding: 20px; transition: all var(--t);
}
.card:hover { border-color: var(--border); }
.card-flat { padding: 0; overflow: hidden; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.card-title { font-size: var(--fs-md); font-weight: 600; display: flex; align-items: center; gap: 8px; }

/* ============================================================
   表单
   ============================================================ */
label { display: block; font-size: var(--fs-sm); color: var(--text-2); font-weight: 500; margin-bottom: 6px; }
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-hint { font-size: var(--fs-xs); color: var(--text-3); margin-top: 4px; }
.form-req { color: var(--danger); }

.input, input[type=text], input[type=password], input[type=email], input[type=number],
input[type=search], input[type=url], input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 14px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text-1); font-size: var(--fs-sm); outline: none;
  transition: all var(--t-fast);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); background: var(--bg-1);
}
textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
select { cursor: pointer; }

/* ============================================================
   标签 / 徽章
   ============================================================ */
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  font-size: var(--fs-xs); font-weight: 600; border-radius: var(--r-pill);
  background: var(--bg-2); color: var(--text-2);
}
.tag-brand { background: var(--brand-soft); color: var(--brand); }
.tag-accent { background: var(--accent-soft); color: var(--accent); }
.tag-vip { background: var(--vip-soft); color: var(--vip); }
.tag-success { background: rgba(34,197,94,0.15); color: #86efac; }
.tag-danger { background: rgba(239,68,68,0.15); color: #fca5a5; }
.tag-info { background: rgba(59,130,246,0.15); color: #93c5fd; }
.tag-glow { background: var(--accent-grad); color: var(--bg-2); }

/* ============================================================
   表格
   ============================================================ */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th, .tbl td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-soft); }
.tbl th { background: var(--bg-2); color: var(--text-2); font-weight: 600; font-size: var(--fs-xs); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--t-fast); }
.tbl tbody tr:hover td { background: var(--bg-2); }
.tbl .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.tbl .ctr { color: var(--success); font-weight: 700; }
.tbl-thumb { width: 56px; height: 78px; object-fit: cover; border-radius: 6px; }

/* ============================================================
   顶栏 (前台 · 玻璃拟态)
   ============================================================ */
.topbar {
  background: var(--header-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 100;
}
.topbar-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); gap: 20px;
}
.logo {
  font-size: 22px; font-weight: 800; letter-spacing: -0.5px; cursor: pointer; flex-shrink: 0;
  display: inline-flex; flex-direction: column; line-height: 1.15; text-decoration: none;
}
.logo-main {
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-sub {
  font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--danger, var(--danger));
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
.logo-icon { font-size: 24px; margin-right: 4px; -webkit-text-fill-color: initial; }
.nav-main { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav-main a {
  padding: 8px 14px; border-radius: var(--r-sm); color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 500; transition: all var(--t-fast); white-space: nowrap;
}
.nav-main a:hover { background: var(--hover-bg); color: var(--text-1); }
.nav-main a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
/* #4: 顶栏搜索框 (V3.4.1: 放大镜放进搜索框内部右侧, 点框内任意处弹搜索浮层) */
.topbar-search-wrap { position: relative; display: inline-flex; align-items: center; flex-shrink: 0; }
.topbar-search {
  width: 200px; height: 34px; border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px solid var(--border-soft);
  color: var(--text-1); padding: 0 40px 0 12px; font-size: var(--fs-sm); outline: none;
  transition: border-color var(--t-fast), width var(--t), padding-right var(--t);
}
.topbar-search:focus { border-color: var(--brand); width: 240px; padding: 0 12px 0 40px; }
.topbar-search::placeholder { color: var(--text-3); }
/* 框内放大镜: 默认贴右(透明底), 聚焦时滑出到输入文字前方 — 文字始终不被盖 */
.topbar-search~.search-in {
  position: absolute; right: 3px; top: 3px; width: 28px; height: 28px;
  border: none; background: transparent; border-radius: 8px;
  font-size: 14px; color: var(--text-3); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0;
  transition: left var(--t), background var(--t-fast);
}
.topbar-search:focus ~ .search-in { left: 3px; right: auto; background: var(--bg-3); color: var(--text-1); }
.topbar-search-wrap:hover .search-in { color: var(--brand); }
@media (max-width: 768px) {
  .topbar-search-wrap { flex: 1 1 0; min-width: 48px; }
  .topbar-search { width: 100%; flex: 1; max-width: none; height: 36px; padding: 0 34px 0 12px; border-radius: 18px; font-size: var(--fs-xs); }
  .topbar-search:focus { width: 100%; padding: 0 12px 0 34px; }
  .topbar-search .search-in { right: 4px; top: 4px; width: 28px; height: 28px; font-size: 13px; }
  .topbar-search:focus ~ .search-in { left: 4px; width: 28px; height: 28px; }
  .topbar-mob .topbar-inner { gap: 10px; }
  .topbar-mob .logo-sub { display: none; }
  .topbar-mob .logo-main { font-size: var(--fs-sm); }
}

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm); background: var(--bg-2);
  border: 1px solid var(--border-soft); display: inline-flex; align-items: center;
  justify-content: center; color: var(--text-2); cursor: pointer; font-size: 16px;
  transition: all var(--t-fast); flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-3); color: var(--text-1); }
.icon-btn.muted { color: var(--text-3); }

/* 搜索框 */
.search-box { display: flex; flex-shrink: 1; min-width: 0; }
.search-box input {
  border-radius: var(--r-sm) 0 0 var(--r-sm); border-right: none;
  background: var(--bg-2); width: 100%; min-width: 0;
}
.search-box button {
  border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--brand);
  border: 1px solid var(--brand); color: #fff; padding: 0 18px; cursor: pointer; font-weight: 600;
  transition: background var(--t-fast);
}
.search-box button:hover { background: var(--brand-dark); }

/* ============================================================
   底部 Tab (移动端 · 来自 video-clone)
   ============================================================ */
.bottomnav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--header-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-soft); height: var(--bottomnav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottomnav-inner { display: flex; height: 100%; }
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; color: var(--text-3); transition: color var(--t-fast);
}
.bottomnav a .bn-icon { font-size: 20px; line-height: 1; }
.bottomnav a.active { color: var(--brand); }

/* ============================================================
   视频卡片墙
   ============================================================ */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.vcard {
  background: var(--card); border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--border-soft); cursor: pointer; transition: all var(--t); position: relative;
}
.vcard:hover { transform: translateY(-5px); border-color: var(--brand); box-shadow: var(--shadow); }
.vcard-cover { position: relative; aspect-ratio: 16/9; background: var(--bg-3); overflow: hidden; }
.vcard-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.vcard:hover .vcard-cover img { transform: scale(1.06); }
.vcard-rank {
  position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px); padding: 2px 9px; border-radius: 5px; color: var(--accent);
  font-size: var(--fs-xs); font-weight: 700;
}
.vcard-badge {
  position: absolute; top: 8px; right: 8px; z-index: 2; background: var(--brand);
  color: #fff; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 600;
}
.vcard-badge.vip { background: linear-gradient(90deg, #a855f7, #f59e0b); color: var(--bg-2); }
.vcard-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1;
}
.vcard-play::after {
  content: "▶"; font-size: 40px; color: #fff; opacity: 0; transition: opacity 0.3s;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
.vcard:hover .vcard-play::after { opacity: 0.9; }
.vcard-info { padding: 10px 12px; }
.vcard-title {
  font-size: var(--fs-sm); font-weight: 500; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; color: var(--text-1);
}
.vcard-meta { display: flex; gap: 6px; margin-top: 6px; font-size: 11px; color: var(--text-3); align-items: center; }
.vcard-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

/* ============================================================
   区块标题 (section header)
   ============================================================ */
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 32px 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-soft);
}
.sec-head:first-child { margin-top: 8px; }
.sec-title { font-size: var(--fs-lg); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.sec-title .sec-icon { font-size: 22px; }
.sec-hot { background: var(--danger); color: #fff; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.sec-more { font-size: var(--fs-sm); color: var(--text-2); transition: color var(--t-fast); }
.sec-more:hover { color: var(--brand); }

/* ============================================================
   Banner 轮播
   ============================================================ */
.hero-banner {
  position: relative; width: 100%; aspect-ratio: 21/8; max-height: 280px; min-height: 150px;
  margin: 16px auto 0;
  overflow: hidden; border-radius: var(--r-lg);
  perspective: 1700px; perspective-origin: 50% 42%;
  transform-style: preserve-3d;
}
.hero-slide {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 74%; margin-left: -37%;
  opacity: 0;
  transform: translateX(70%) rotateY(-48deg) scale(0.68);
  transform-origin: 50% 50%;
  transition: transform 0.9s var(--ease), opacity 0.9s var(--ease);
  will-change: transform, opacity;
  pointer-events: none;
  border-radius: var(--r-xl); overflow: hidden; background: var(--bg-2);
  box-shadow: var(--shadow-lg);
}
.hero-slide.active {
  opacity: 1; transform: translateX(0) rotateY(0) scale(1);
  z-index: 3; pointer-events: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), var(--shadow-glow);
}
.hero-slide.prev {
  opacity: 0.45; transform: translateX(-62%) rotateY(40deg) scale(0.8);
  z-index: 2;
}
.hero-slide.next {
  opacity: 0.45; transform: translateX(62%) rotateY(-40deg) scale(0.8);
  z-index: 2;
}
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-content {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 32px 40px; z-index: 2;
  background: linear-gradient(transparent, rgba(0,0,0,0.88));
}
.hero-content h2 { font-size: var(--fs-2xl); color: #fff; margin-bottom: 8px; font-weight: 800; text-shadow: 0 2px 12px rgba(0,0,0,0.6); }
.hero-content p { color: rgba(255,255,255,0.85); font-size: var(--fs-base); margin-bottom: 16px; max-width: 640px; }
.hero-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: var(--r-sm);
  background: var(--brand); color: #fff; font-weight: 600; transition: all var(--t-fast);
}
.hero-btn:hover { background: var(--brand-dark); transform: translateY(-2px); }
.hero-btn.ghost { background: rgba(255,255,255,0.18); backdrop-filter: blur(8px); margin-left: 10px; }
.hero-dots { position: absolute; bottom: 22px; right: 32px; display: flex; gap: 8px; z-index: 3; }
.hero-dot {
  width: 8px; height: 8px; border-radius: var(--r-pill); background: rgba(255,255,255,0.4);
  cursor: pointer; transition: all var(--t-fast);
}
.hero-dot.active { background: #fff; width: 26px; }
/* #1: 手动切换箭头 (banner 有 3D perspective, 需 translateZ 推到最前, 否则被旋转的 next 片遮挡) */
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%) translateZ(120px); z-index: 4;
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0,0,0,0.42); color: #fff; font-size: 24px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); transition: all var(--t-fast);
}
.hero-arrow:hover { background: var(--brand); transform: translateY(-50%) translateZ(120px) scale(1.08); }
.hero-arrow-prev { left: 14px; }
.hero-arrow-next { right: 14px; }
.hero-dots { transform: translateZ(120px); }
@media (max-width: 768px) {
  .hero-arrow { width: 32px; height: 32px; font-size: 19px; }
  .hero-arrow-prev { left: 8px; }
  .hero-arrow-next { right: 8px; }
  .hero-dots { bottom: 14px; right: 18px; }
}

/* ============================================================
   筛选栏 (list 页)
   ============================================================ */
.filter-bar {
  background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--r-lg);
  padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 16px 0 8px;
}
.filter-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  padding: 5px 14px; border-radius: var(--r-pill); background: var(--bg-2); color: var(--text-2);
  font-size: var(--fs-sm); cursor: pointer; border: 1px solid transparent; transition: all var(--t-fast);
}
.filter-chip:hover { background: var(--bg-3); color: var(--text-1); }
.filter-chip.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); font-weight: 600; }

/* ============================================================
   广告卡片 (融合 CMS2 6 格式渲染 + 伪装视频卡)
   ============================================================ */
.ad-wrap { position: relative; }
.ad-card {
  display: block; background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); overflow: hidden; transition: all var(--t);
  text-decoration: none; color: inherit; position: relative;
}
.ad-card:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow); }
.ad-card img, .ad-card video { width: 100%; display: block; object-fit: cover; }
.ad-tag {
  position: absolute; top: 8px; left: 8px; z-index: 2; padding: 2px 9px; border-radius: 5px;
  background: rgba(245,158,11,0.95); color: var(--bg-2); font-size: 11px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
/* 伪装视频卡广告 (混在视频墙里) */
.vcard-ad .vcard-cover img { width: 100%; height: 100%; object-fit: cover; }

/* 广告位容器 (前台插入) */
.ad-slot { margin: 20px 0; }
.ad-slot-center { text-align: center; }

/* ============================================================
   VIP 横幅 (CMS2 基因)
   ============================================================ */
.vip-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #581c87 50%, #7c2d12 100%);
  border-radius: var(--r-xl); padding: 24px 28px; display: flex; align-items: center;
  justify-content: space-between; gap: 20px; margin: 20px 0; position: relative; overflow: hidden;
}
.vip-hero::before {
  content: ""; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px;
  border-radius: 50%; background: radial-gradient(circle, rgba(245,158,11,0.4), transparent 60%);
}
.vip-hero-content { position: relative; z-index: 1; }
.vip-hero-title { font-size: var(--fs-lg); font-weight: 700; color: #fff; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.vip-hero-text { color: rgba(255,255,255,0.8); font-size: var(--fs-sm); margin-bottom: 14px; }
.vip-hero-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 20px; border-radius: var(--r-sm);
  background: linear-gradient(90deg, #f59e0b, #ef4444); color: var(--bg-2); font-weight: 700;
  transition: filter var(--t-fast);
}
.vip-hero-btn:hover { filter: brightness(1.12); }

/* ============================================================
   VIP 横幅 (后台可重复添加多条; 首条全宽, 后续递减窄, 整条可点击)
   ============================================================ */
.vip-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(120deg, #1e1b4b 0%, #581c87 46%, #7c2d12 100%);
  border-radius: var(--r-lg); padding: 20px 26px; text-decoration: none;
  position: relative; overflow: hidden; transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.vip-banner:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(88,28,135,.28); }
.vip-banner::before {
  content: ""; position: absolute; right: -30px; top: -30px; width: 150px; height: 150px;
  border-radius: 50%; background: radial-gradient(circle, rgba(245,158,11,.42), transparent 62%);
  pointer-events: none;
}
.vb-narrow-1 { margin: 10px 70px; }
.vb-narrow-2 { margin: 10px 140px; }
.vb-narrow-3 { margin: 10px 210px; }
@media (max-width: 900px) {
  .vb-narrow-1 { margin: 10px 26px; }
  .vb-narrow-2 { margin: 10px 40px; }
  .vb-narrow-3 { margin: 10px 54px; }
}
@media (max-width: 600px) {
  .vip-banner { padding: 14px 16px; gap: 10px; flex-wrap: wrap; }
  .vb-content { flex: 1 1 60%; }
  .vb-narrow-1, .vb-narrow-2, .vb-narrow-3 { margin: 8px 24px; }
}
.vb-content { position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.vb-title { font-size: var(--fs-lg); font-weight: 800; color: #fff; }
.vb-text { color: rgba(255,255,255,.82); font-size: var(--fs-sm); }
.vb-btn {
  position: relative; z-index: 1; flex: none;
  display: inline-flex; align-items: center; padding: 9px 20px; border-radius: var(--r-sm);
  background: linear-gradient(90deg, #fbbf24, #ef4444); color: #2a1a00; font-weight: 800; font-size: 14px;
  transition: filter var(--t-fast);
}
.vip-banner:hover .vb-btn { filter: brightness(1.12); }

/* ============================================================
   分页
   ============================================================ */
.pager { display: flex; gap: 6px; justify-content: center; margin: 28px 0; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 8px 14px; border-radius: var(--r-sm); background: var(--bg-2); color: var(--text-2);
  font-size: var(--fs-sm); min-width: 38px; text-align: center; transition: all var(--t-fast);
}
.pager a:hover { background: var(--bg-3); color: var(--text-1); }
.pager .active { background: var(--brand); color: #fff; font-weight: 600; }
.pager .disabled { opacity: 0.4; pointer-events: none; }

/* ============================================================
   详情页
   ============================================================ */
.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 32px; margin-top: 24px; }
.detail-cover { aspect-ratio: 16/9; max-height: 480px; border-radius: var(--r-xl); overflow: hidden; background: var(--bg-2); }
.detail-cover img, .detail-cover video { width: 100%; height: 100%; object-fit: cover; }
.detail-info h1 { font-size: var(--fs-2xl); font-weight: 700; margin-bottom: 12px; line-height: 1.25; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; color: var(--text-2); font-size: var(--fs-sm); align-items: center; }
.detail-meta .sep { color: var(--text-3); }
.detail-actions { display: flex; gap: 10px; margin: 20px 0; flex-wrap: wrap; }
.episode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; margin-top: 20px; }
.episode {
  padding: 10px; background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  text-align: center; font-size: var(--fs-sm); cursor: pointer; transition: all var(--t-fast); color: var(--text-2);
}
.episode:hover { border-color: var(--brand); color: var(--brand); }
.episode.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }

/* ============================================================
   空状态 / 加载
   ============================================================ */
.empty-state { padding: 60px 20px; text-align: center; color: var(--text-3); }
.empty-state .empty-icon { font-size: 48px; opacity: 0.5; margin-bottom: 12px; }
.skeleton {
  background: linear-gradient(90deg, var(--bg-1), var(--bg-2), var(--bg-1));
  background-size: 200% 100%; animation: skeleton 1.5s linear infinite; border-radius: var(--r-sm);
}
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   Toast 通知
   ============================================================ */
#toast-root { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  padding: 12px 22px; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 500;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px;
  animation: toastIn 0.3s var(--ease); backdrop-filter: blur(8px);
}
.toast-success { background: rgba(34,197,94,0.95); color: #fff; }
.toast-error { background: rgba(239,68,68,0.95); color: #fff; }
.toast-info { background: rgba(59,130,246,0.95); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   Modal 弹窗
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.72); backdrop-filter: blur(4px);
  z-index: 1000; display: none; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow-y: auto;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 24px; width: 100%; max-width: 640px; box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s var(--ease);
}
.modal-box.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: var(--fs-lg); font-weight: 700; }
.modal-close {
  width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--bg-2);
  border: 0; color: var(--text-2); font-size: 24px; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: all var(--t-fast);
}
.modal-close:hover { background: var(--bg-3); color: var(--text-1); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   后台 · sidebar 布局 (CMS2 基因 + 升级)
   ============================================================ */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: var(--sidebar-w); background: var(--bg-1); border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column; flex-shrink: 0; position: fixed; left: 0; top: 0;
  height: 100vh; overflow-y: auto; z-index: 100;
}
.admin-sidebar .logo { padding: 20px; border-bottom: 1px solid var(--border-soft); font-size: 19px; display: flex; align-items: center; gap: 8px; }
.admin-nav { padding: 12px 0; flex: 1; }
.admin-nav-section { padding: 12px 20px 4px; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.admin-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 20px; color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 500; border-left: 3px solid transparent; transition: all var(--t-fast);
}
.admin-nav a:hover { background: var(--bg-2); color: var(--text-1); }
.admin-nav a.active { background: var(--brand-soft); color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
.admin-nav a .nav-icon { font-size: 17px; width: 22px; text-align: center; }
.admin-nav a .nav-badge { margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: var(--r-pill); font-weight: 700; }
.admin-nav a.logout { color: var(--danger); margin-top: auto; }
.admin-main { flex: 1; padding: 28px 32px; margin-left: var(--sidebar-w); background: var(--bg); min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: var(--fs-xl); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.page-title small { font-size: var(--fs-sm); color: var(--text-3); font-weight: 400; margin-left: 8px; }

/* 后台顶部条 (主区) */
.admin-topbar {
  background: var(--header-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft); height: 56px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 90; margin: -28px -32px 24px; padding: 0 32px;
}
.admin-topbar .crumb { color: var(--text-3); font-size: var(--fs-sm); }
.admin-topbar .crumb b { color: var(--text-1); font-weight: 600; }

/* ============================================================
   仪表盘统计卡
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--r-lg);
  padding: 20px; transition: all var(--t); position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; right: -20px; bottom: -20px; width: 90px; height: 90px;
  border-radius: 50%; background: var(--brand-soft); opacity: 0.6; transition: transform 0.4s var(--ease);
}
.stat-card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card:hover::after { transform: scale(1.4); }
.stat-label { font-size: var(--fs-sm); color: var(--text-3); margin-bottom: 8px; }
.stat-value { font-size: 34px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.stat-sub { font-size: var(--fs-xs); color: var(--text-3); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.stat-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 2px 8px; border-radius: var(--r-pill); }
.stat-trend.up { background: rgba(34,197,94,0.15); color: #86efac; }
.stat-trend.down { background: rgba(239,68,68,0.15); color: #fca5a5; }
.stat-icon {
  position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; background: var(--brand-soft);
  color: var(--brand); font-size: 20px; z-index: 1;
}
.stat-card.accent .stat-icon { background: var(--accent-soft); color: var(--accent); }
.stat-card.accent::after { background: var(--accent-soft); }
.stat-card.vip .stat-icon { background: var(--vip-soft); color: var(--vip); }
.stat-card.vip::after { background: var(--vip-soft); }

/* 后台图表 (纯 CSS 柱状/条形) */
.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-row .bar-label { width: 90px; flex-shrink: 0; font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-track { flex: 1; height: 10px; background: var(--bg-2); border-radius: var(--r-pill); overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: var(--r-pill); background: var(--brand-grad); transition: width 0.6s var(--ease); }
.bar-row .bar-val { width: 60px; flex-shrink: 0; text-align: right; font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================================================
   登录页 (双主题径向背景)
   ============================================================ */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(circle at 18% 20%, rgba(102,126,234,0.14), transparent 45%),
    radial-gradient(circle at 82% 82%, rgba(168,85,247,0.12), transparent 45%),
    var(--bg);
}
.auth-box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 40px 34px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; font-size: 40px; margin-bottom: 8px; }
.auth-title {
  font-size: var(--fs-2xl); font-weight: 800; text-align: center; margin-bottom: 4px;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-sub { text-align: center; color: var(--text-2); font-size: var(--fs-sm); margin-bottom: 28px; }
.auth-foot { text-align: center; margin-top: 20px; font-size: var(--fs-sm); color: var(--text-3); }
.auth-foot a { color: var(--brand); }

/* ============================================================
   工具条 (后台列表页顶)
   ============================================================ */
.toolbar {
  background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--r-lg);
  padding: 16px 20px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px;
}
.toolbar .spacer { flex: 1; }

/* ============================================================
   实时预览区 (广告)
   ============================================================ */
.live-preview { margin-top: 10px; padding: 16px; background: var(--bg-1); border: 1px dashed var(--border); border-radius: var(--r-md); min-height: 70px; }
.live-preview .lp-label { font-size: 11px; color: var(--text-3); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.detect-tag { display: inline-block; padding: 2px 9px; border-radius: 5px; font-size: 11px; font-weight: 600; background: var(--bg-3); color: var(--text-2); }
.detect-tag.image, .detect-tag.image_base64 { background: rgba(14,165,233,0.2); color: #38bdf8; }
.detect-tag.video, .detect-tag.video_m3u8 { background: rgba(236,72,153,0.2); color: #ec4899; }
.detect-tag.html { background: rgba(245,158,11,0.2); color: var(--accent); }
.detect-tag.text { background: rgba(100,116,139,0.2); color: #94a3b8; }
.detect-tag.json { background: rgba(168,85,247,0.2); color: var(--vip); }
.detect-tag.link { background: rgba(59,130,246,0.2); color: #60a5fa; }

/* ============================================================
   响应式
   ============================================================ */
/* ============ 播放页布局 ============ */
.player-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--gap-lg); align-items: start;
}
.player-main { min-width: 0; }
.player-side { position: sticky; top: calc(var(--topbar-h) + var(--gap-md)); }
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .player-layout { grid-template-columns: 1fr; }
  .player-side { display: none; }
}
@media (max-width: 768px) {
  html { font-size: 14px; }
  .container { padding: 0 12px; }
  /* V5: 手机端顶栏单行并列 — LOGO | 搜索(弹性) | 功能图标, 不再折两行 */
  .topbar-inner { height: auto; min-height: 54px; max-height: 54px; gap: 8px; padding: 8px 12px; flex-wrap: nowrap; align-items: center; }
  .topbar-inner .logo { gap: 8px; flex-shrink: 0; max-width: 132px; overflow: hidden; }
  .topbar .logo img { max-width: 110px; }
  .logo-sub { display: none; }
  /* 左上文字栏目: 手机端隐藏 (底部 Tab 已覆盖 首页/短剧/短视频/小说/我的) */
  .topbar-mob .nav-main { display: none !important; }
  /* V3.4.1: 搜索框(含框内放大镜)布局统一在文件前部 .topbar-search-wrap 段维护, 此处不再重复覆盖 */
  .nav-actions { gap: 6px; flex-shrink: 1; min-width: 0; }
  .bottomnav { display: block; }
  main, .page-body { padding-bottom: calc(var(--bottomnav-h) + 24px); }
  .icon-btn { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
  .member-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
  .device-badge { display: none; }
  .member-label { display: none; }
  .vgrid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
  .vcard-info { padding: 8px 10px; }
  .sec-title { font-size: var(--fs-md); }
  .hero-banner { aspect-ratio: 16/5; min-height: 100px; border-radius: var(--r-lg); }
  .hero-content { padding: 14px 16px; }
  .hero-content h2 { font-size: var(--fs-base); }
  .hero-content p { display: none; }
  .hero-btn { padding: 8px 16px; font-size: var(--fs-xs); }
  .filter-bar { padding: 12px; gap: 10px; }
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s var(--ease); width: 260px; box-shadow: var(--shadow-lg); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { padding: 20px 16px; margin-left: 0; }
  .admin-topbar { margin: -20px -16px 20px; padding: 0 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 24px; }
  .page-title { font-size: var(--fs-lg); }
  .form-row { grid-template-columns: 1fr; }
  .modal-overlay { padding: 16px 10px; }
  .modal-box { padding: 18px; }
}
@media (max-width: 480px) {
  .vgrid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   4 类广告 (对齐参考站 CMS2): 左右对联 / 弹窗 / 应用推荐
   (横幅复用现有 .ad-slot 通栏样式)
   ============================================================ */

/* 左右对联: 屏幕左/右固定竖版 */
.couplet {
  position: fixed; top: 120px; z-index: 90; width: 84px;
  border-radius: var(--r-md); overflow: visible;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.couplet-left { left: 8px; }
.couplet-right { right: 8px; }
.couplet-inner {
  display: block; border-radius: var(--r-md); overflow: hidden;
  background: var(--bg-3); border: 1px solid var(--border-soft);
  transition: transform 0.2s var(--ease);
}
.couplet:hover .couplet-inner { transform: scale(1.05); }
.couplet-close {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: #fff; color: var(--bg-2); font-size: 14px; line-height: 1;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.4); z-index: 2;
}
.couplet-close:hover { background: var(--accent); }
@media (max-width: 900px) { .couplet { display: none; } }

/* 弹窗广告: 全屏遮罩 + 居中卡片 + 右上角关闭 */
.popup-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.25s var(--ease);
}
.popup-mask.show { opacity: 1; }
.popup-box {
  position: relative; max-width: 90vw; max-height: 90vh;
  border-radius: var(--r-lg);
  background: var(--card); border: 1px solid var(--border-soft);
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  transform: scale(0.92); transition: transform 0.25s var(--ease);
}
.popup-mask.show .popup-box { transform: scale(1); }
.popup-inner {
  max-width: 420px; max-height: 420px; display: block;
  border-radius: calc(var(--r-lg) - 1px); overflow: hidden;
}
.popup-inner img, .popup-inner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.popup-close {
  position: absolute; top: -14px; right: -14px;
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: #fff; color: var(--bg-2); font-size: 18px; font-weight: 700;
  line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.5); z-index: 3;
}
.popup-close:hover { background: var(--accent); transform: rotate(90deg); transition: transform 0.2s; }

/* 应用推荐卡片墙 — 规格与"分类专区"完全一致 (cat-grid / cat-card 同款) */
.app-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
}
.app-card {
  position: relative; aspect-ratio: 4/3; border-radius: var(--r-lg); overflow: hidden;
  cursor: pointer; border: 1px solid var(--border-soft); transition: all var(--t);
}
.app-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.app-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.app-card:hover img { transform: scale(1.08); }
/* 标题压在图片底部 (与 .cat-name 同款) */
.app-info {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 22px 14px 10px; z-index: 2;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.app-title {
  color: #fff; font-weight: 600; font-size: var(--fs-base);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-tag {
  flex: none; padding: 1px 7px; border-radius: 5px; font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,0.18); color: #fff;
}

/* ================= VIP 剧集系统 ================= */
.vcard-vip {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  font-size: 11px; font-weight: 800; letter-spacing: .5px; color: var(--bg-2);
  background: linear-gradient(135deg, #fbbf24, #f59e0b); padding: 2px 9px; border-radius: 6px;
  box-shadow: 0 1px 4px rgba(245, 158, 11, .5);
}
.episode.locked { opacity: .55; border-style: dashed; }
.episode.locked.active { opacity: .85; }
.ep-vip-tag {
  display: inline-block; margin-left: 8px; vertical-align: middle;
  font-size: 11px; font-weight: 800; color: var(--bg-2);
  background: linear-gradient(135deg, #fbbf24, #f59e0b); padding: 2px 8px; border-radius: 5px;
}
.ep-free-hint { font-size: 12px; color: var(--text-3); }
.ep-free-hint b { color: var(--vip); }

/* VIP 开通弹窗 */
.vip-modal-mask {
  position: fixed; inset: 0; z-index: 900; background: rgba(0,0,0,.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .25s;
}
.vip-modal-mask.show { opacity: 1; }
.vip-modal-box {
  width: min(92vw, 400px); background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-xl, 20px); padding: 28px 26px 24px; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.5); transform: translateY(12px) scale(.97); transition: transform .25s;
}
.vip-modal-mask.show .vip-modal-box { transform: none; }
.vip-modal-head { text-align: center; margin-bottom: 18px; }
.vip-modal-icon {
  width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b); display: flex; align-items: center; justify-content: center;
  font-size: 30px; box-shadow: 0 6px 20px rgba(245,158,11,.45);
}
.vip-modal-head h3 { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.vip-modal-sub { font-size: 13px; color: var(--text-3); }
.vip-modal-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.vip-modal-list li { font-size: 13px; color: var(--text-1); padding: 10px 14px; background: var(--bg-2); border-radius: 10px; }
.vip-modal-price { text-align: center; font-size: 32px; font-weight: 800; color: var(--vip); margin-bottom: 18px; }
.vip-modal-price span { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 4px; }
.vip-modal-actions { display: flex; gap: 12px; }
.vip-modal-actions .btn { flex: 1; justify-content: center; padding: 11px 0; }
.btn-vip {
  background: linear-gradient(135deg, #c084fc, #f59e0b); border: none; color: var(--bg-2); font-weight: 700;
}
.btn-vip:hover { filter: brightness(1.08); }

/* ---------- 友情链接 (底部文字广告) ---------- */
.friend-link {
  color: var(--text-2); text-decoration: none; padding: 3px 9px; border-radius: 6px;
  background: var(--bg-2); transition: color .15s, background .15s, border-color .15s;
  border: 1px solid transparent; line-height: 1.6;
}
.friend-link:hover { color: var(--brand); border-color: var(--brand); background: transparent; }

/* ============================================================
   t3/t8: 广告轮播 (多图自动轮播)
   ============================================================ */
.ad-carousel {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--border-soft); background: var(--bg-3);
  aspect-ratio: 1280 / 420; max-height: 260px;
}
.ad-carousel-slides { position: relative; width: 100%; height: 100%; }
.ad-carousel-slide {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  transition: opacity .5s var(--ease); cursor: pointer;
}
.ad-carousel-slide.active { opacity: 1; pointer-events: auto; }
.ad-carousel-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-carousel-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; background: linear-gradient(transparent, rgba(0,0,0,.78));
}
.ad-carousel-cap b { color: #fff; font-size: 15px; text-shadow: 0 1px 6px rgba(0,0,0,.6); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-carousel-btn {
  color: #fff; font-size: 13px; background: rgba(255,255,255,.22); backdrop-filter: blur(6px);
  padding: 6px 14px; border-radius: 999px; text-decoration: none;
}
.ad-carousel-dots {
  position: absolute; bottom: 12px; right: 16px; z-index: 3; display: flex; gap: 6px;
}
.ad-carousel-dot {
  width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.45);
  cursor: pointer; transition: all .2s;
}
.ad-carousel-dot.active { width: 20px; background: #fff; }

/* ============================================================
   t8: 豆腐块广告 (小方格 2x2 宫格)
   ============================================================ */
.tofu-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
@media (max-width: 640px) { .tofu-grid { grid-template-columns: repeat(2, 1fr); } }
.tofu-cell {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--r-md);
  overflow: hidden; cursor: pointer; border: 1px solid var(--border-soft);
  background: var(--bg-3); transition: all var(--t);
}
.tofu-cell:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: var(--shadow); }
.tofu-cell img { width: 100%; height: 100%; object-fit: cover; }
.tofu-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 10px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,.8));
  color: #fff; font-size: 12px; font-weight: 600; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============================================================
   t4: 返回顶部按钮
   ============================================================ */
.back-top {
  position: fixed; right: 20px; bottom: calc(var(--bottomnav-h, 0px) + 20px);
  z-index: 90; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--border-soft); background: var(--header-bg);
  backdrop-filter: blur(14px); color: var(--brand); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: all .25s var(--ease);
}
@media (max-width: 768px) {
  .back-top { bottom: calc(var(--bottomnav-h, 56px) + 20px); right: 16px; width: 42px; height: 42px; }
}
.back-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-top:hover { border-color: var(--brand); transform: translateY(-3px); }

/* ============================================================
   t5: 底部永久链接 + 下载提示
   ============================================================ */
.footer-promo {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(90deg, rgba(99,102,241,.96), rgba(168,85,247,.96));
  color: #fff; font-size: 13px; backdrop-filter: blur(10px);
  box-shadow: 0 -4px 20px rgba(0,0,0,.25);
  transition: all .3s var(--ease);
}
.footer-promo.hide { transform: translateY(110%); opacity: 0; }
.footer-promo .fp-ico { font-size: 16px; }
.footer-promo .fp-text b { color: #fde68a; }
.footer-promo .fp-sep { opacity: .5; }
.footer-promo .fp-close {
  margin-left: auto; width: 26px; height: 26px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.2); color: #fff; cursor: pointer;
  font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.footer-promo .fp-close:hover { background: rgba(255,255,255,.35); }
@media (max-width: 768px) {
  .footer-promo { bottom: calc(var(--bottomnav-h, 56px)); }
}
@media (max-width: 560px) {
  .footer-promo { font-size: 12px; }
  .footer-promo .fp-sep { display: none; }
}

/* ============================================================
   t7: 顶部滚动公告
   ============================================================ */
.notice-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: linear-gradient(90deg, rgba(251,191,36,.16), rgba(168,85,247,.14));
  border-bottom: 1px solid var(--border-soft); font-size: 13px;
  transition: all .3s var(--ease);
}
.notice-bar.hide { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; overflow: hidden; border-bottom: none; }
.notice-bar .nb-ico { flex-shrink: 0; font-size: 15px; }
.notice-bar .nb-viewport { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.notice-bar .nb-track { display: inline-block; white-space: nowrap; color: var(--text-2); }
.notice-bar .nb-close {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--border-soft); background: var(--panel-2);
  color: var(--text-2); cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.notice-bar .nb-close:hover { color: var(--brand); border-color: var(--brand); }
@keyframes nb-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   设备识别 + 版本切换 (手机 / PC)
   ============================================================ */
.device-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600;
  background: var(--brand-soft); color: var(--brand); white-space: nowrap; flex-shrink: 0;
}
.dev-switch { width: 38px; height: 38px; font-size: 17px; }

/* 手机访问 PC 版时的顶部提示条 */
.mobile-hint {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9998;
  display: flex; align-items: center; gap: 10px; justify-content: center;
  padding: 10px 12px; background: linear-gradient(90deg, var(--brand), var(--vip));
  color: #fff; font-size: 13px; box-shadow: var(--shadow);
}
.mobile-hint b { font-weight: 800; }
.mobile-hint .mh-btn {
  background: #fff; color: var(--brand); font-weight: 700; font-size: 12px;
  padding: 6px 14px; border-radius: var(--r-pill); white-space: nowrap;
}
.mobile-hint .mh-close {
  background: rgba(255,255,255,0.22); border: 0; color: #fff; width: 26px; height: 26px;
  border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; flex-shrink: 0;
}
/* 有提示条时给顶栏让位 */
body:has(.mobile-hint) { padding-top: 40px; }
body:has(.mobile-hint) .topbar { top: 40px; }

/* ============================================================
   手机版 (m 页) — 单列 / 大卡片 / 触摸优先
   ============================================================ */
.m-page { -webkit-tap-highlight-color: transparent; }
.m-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.m-header-inner {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; height: 54px;
}
.m-logo { flex-shrink: 0; display: inline-flex; flex-direction: column; line-height: 1.15; text-decoration: none; }
.m-logo-main {
  font-size: 19px; font-weight: 800; letter-spacing: 1px;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.m-logo-sub {
  font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--danger, var(--danger));
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
.m-search { flex: 1; display: flex; min-width: 0; }
.m-search input {
  flex: 1; min-width: 0; height: 38px; padding: 0 14px; border-radius: 19px;
  background: var(--bg-2); border: 1px solid var(--border-soft); color: var(--text-1);
  font-size: 14px; outline: none;
}
.m-iconbtn {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1px solid var(--border-soft); color: var(--text-2); font-size: 16px;
}
.m-iconbtn.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }

.m-banner {
  margin: 12px 14px; border-radius: var(--r-lg); overflow: hidden; position: relative;
  aspect-ratio: 16/9; background: var(--bg-2);
}
.m-banner img { width: 100%; height: 100%; object-fit: cover; }
.m-banner-cap {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 26px 14px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}
.m-banner-cap h3 { color: #fff; font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.m-banner-dots { position: absolute; bottom: 10px; right: 14px; display: flex; gap: 5px; z-index: 3; }
.m-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.4); }
.m-dot.active { background: #fff; width: 16px; border-radius: 4px; }

.m-sec { margin: 18px 14px 0; }
.m-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.m-sec-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.m-sec-more { font-size: 13px; color: var(--text-2); }
.m-sec-more:hover { color: var(--brand); }

/* 分类横滑条 */
.m-cats { display: flex; gap: 10px; overflow-x: auto; padding: 4px 14px 8px; margin: 14px 0 0; -webkit-overflow-scrolling: touch; }
.m-cats::-webkit-scrollbar { display: none; }
.m-cat {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 16px; background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); font-size: 13px; color: var(--text-1);
}
.m-cat .m-cat-ico { font-size: 24px; }

/* 手机视频列表 (一行二部: 横图 16:9 在上, 片名在下) */
.m-vlist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 4px 14px; }
.m-vitem {
  display: block; background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
}
.m-vitem-cover { position: relative; width: 100%; aspect-ratio: 16/9; background: var(--bg-3); }
.m-vitem-cover img { width: 100%; height: 100%; object-fit: cover; }
.m-vitem-rank {
  position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,0.65); color: var(--accent);
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
}
.m-vitem-vip {
  position: absolute; top: 6px; right: 6px; background: linear-gradient(90deg,#a855f7,#f59e0b);
  color: var(--bg-2); font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
}
/* #7: 手机端插播广告卡 — 广告角标 */
.m-vitem-adtag {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  background: rgba(245,158,11,0.95); color: var(--bg-2); font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.m-vitem-badge {
  position: absolute; bottom: 6px; left: 6px; background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 4px;
}
.m-vitem-info { padding: 8px 10px 10px; }
.m-vitem-title {
  font-size: 14px; font-weight: 600; color: var(--text-1); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.m-vitem-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.m-vitem-meta .m-dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.m-vitem-tag { padding: 2px 8px; border-radius: var(--r-pill); background: var(--bg-2); color: var(--text-2); font-size: 11px; font-weight: 600; }
.m-vitem-tag.vip { background: var(--vip-soft); color: var(--vip); }
.m-vitem-play { margin-top: 10px; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--brand); font-weight: 600; }

/* 手机版底部导航 */
.m-bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; background: var(--header-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-soft); height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.m-bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--text-3);
}
.m-bottomnav a .m-bn-ico { font-size: 21px; line-height: 1; }
.m-bottomnav a.active { color: var(--brand); font-weight: 600; }
.m-bottomnav a.active .m-bn-ico { transform: translateY(-1px); }

.m-footer { text-align: center; padding: 24px 14px 20px; font-size: 12px; color: var(--text-3); }
.m-footer a { color: var(--brand); }
.m-ad { margin: 16px 14px; border-radius: var(--r-lg); overflow: hidden; position: relative; }
.m-ad img { width: 100%; display: block; }
.m-ad .ad-tag { position: absolute; top: 8px; left: 8px; z-index: 2; padding: 2px 9px; border-radius: 5px;
  background: rgba(245,158,11,0.95); color: var(--bg-2); font-size: 11px; font-weight: 700; }

/* 底部提示条: 后台广告位 footer_promo 内容区 */
.footer-promo .fp-content {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  justify-content: center; flex-wrap: wrap; line-height: 1.5;
}
.footer-promo .fp-content img.fp-img { max-height: 26px; width: auto; display: block; }
.footer-promo.fp-clickable { cursor: pointer; }

/* ============================================================
   顶栏: 导航图标 + 右上操作 + 搜索浮层 + 更多菜单 + 公告弹层
   ============================================================ */
.nav-main .nv-ico { margin-right: 4px; font-size: 14px; }

/* ⑤ 分类文字条 (列表页): 页面首块, 滚动时固定在顶栏正下方 */
.filter-bar.sticky-cats {
  position: sticky; top: var(--header-h); z-index: 90;
  margin-top: 12px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.16);
}
@media (max-width: 768px) {
  .filter-bar.sticky-cats { top: var(--topbar-h, 96px); padding: 10px 12px; }
}

/* 搜索浮层 */
.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 0;
}
.search-overlay.open { display: flex; }
.search-overlay-inner {
  width: 100%; max-width: 560px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 6px;
  display: flex; align-items: center; gap: 6px;
  animation: so-in .18s var(--ease);
}
@keyframes so-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.search-overlay-inner input {
  flex: 1; min-width: 0; height: 42px; border: none; background: transparent;
  color: var(--text-1); font-size: 15px; outline: none; padding: 0 10px;
}
.search-overlay-inner #top-search-btn {
  height: 42px; padding: 0 20px; border-radius: var(--r-sm); border: none;
  background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; flex-shrink: 0;
}
.search-overlay-inner #top-search-btn:hover { background: var(--brand-dark); }
.search-overlay-inner .so-close {
  width: 38px; height: 42px; border: none; background: transparent; color: var(--text-3);
  font-size: 16px; cursor: pointer; flex-shrink: 0;
}
.search-overlay-inner .so-close:hover { color: var(--text-1); }
.search-overlay .so-history {
  display: none; width: 100%; max-width: 560px; margin-top: 10px;
  background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--r-lg);
  padding: 12px 14px; flex-wrap: wrap; gap: 8px; align-items: center;
}
.search-overlay .so-history:has(.filter-chip) { display: flex; }
.search-overlay .so-history .sh-lb { font-size: 12px; color: var(--text-3); margin-right: 2px; }

/* 更多菜单 */
.more-menu {
  position: fixed; z-index: 210; min-width: 190px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
.more-menu.open { display: block; animation: so-in .15s var(--ease); }
.more-menu .mm-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: none; background: transparent; color: var(--text-1);
  font-size: 14px; cursor: pointer; border-radius: var(--r-sm); text-align: left;
}
.more-menu .mm-item:hover { background: var(--hover-bg); }
.more-menu .mm-item span { font-size: 16px; width: 22px; text-align: center; }
.more-menu .mm-item em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--text-3); }

/* 公告弹层 */
.notice-modal {
  position: fixed; inset: 0; z-index: 220;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; transition: opacity .25s var(--ease);
}
.notice-modal.show { opacity: 1; }
.notice-modal.hide { opacity: 0; }
.notice-modal .nm-card {
  width: 100%; max-width: 460px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; transform: translateY(10px) scale(.98); transition: transform .25s var(--ease);
}
.notice-modal.show .nm-card { transform: none; }
.notice-modal .nm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; font-weight: 700; font-size: 15px;
  border-bottom: 1px solid var(--border-soft); background: linear-gradient(90deg, rgba(251,191,36,.1), rgba(168,85,247,.08));
}
.notice-modal .nm-head .nm-close {
  width: 30px; height: 30px; border-radius: var(--r-sm); border: none;
  background: var(--bg-2); color: var(--text-2); cursor: pointer; font-size: 14px;
}
.notice-modal .nm-head .nm-close:hover { color: var(--text-1); }
.notice-modal .nm-body {
  padding: 18px 20px; font-size: 14px; line-height: 1.85; color: var(--text-1);
  white-space: pre-wrap; word-break: break-word; max-height: 55vh; overflow-y: auto;
}

/* ============================================================
   V4.0 通用后台组件 (从 12 个 admin 页面抽出, 避免重复)
   ============================================================ */

/* ---------- 卡片容器 ---------- */
.panel { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 18px; }
.panel h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.panel h3 small { color: var(--text-3); font-weight: 400; font-size: 12px; margin-left: auto; }

/* ---------- 双列/三列网格 ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .three-col { grid-template-columns: 1fr; } }

/* ---------- 工具条 (搜索+筛选) ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .search-input { flex: 1; min-width: 200px; max-width: 380px; }
.toolbar select.input { max-width: 160px; }

/* ---------- 通用表格 ---------- */
.tbl-wrap { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--r-lg); overflow: hidden; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 560px; }
table.tbl th { text-align: left; font-size: 12px; color: var(--text-3); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; user-select: none; }
table.tbl th.sortable { cursor: pointer; transition: color 0.15s; }
table.tbl th.sortable:hover { color: var(--text-1); }
table.tbl th.sortable::after { content: ' ⇅'; opacity: 0.4; font-size: 10px; }
table.tbl th.sortable.sort-asc::after { content: ' ▲'; opacity: 1; color: var(--brand); }
table.tbl th.sortable.sort-desc::after { content: ' ▼'; opacity: 1; color: var(--brand); }
table.tbl td { padding: 11px 14px; font-size: 13px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: var(--bg-2); }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--text-3); padding: 40px 0; font-size: 14px; }
.empty-hint { color: var(--text-3); font-size: 13px; text-align: center; padding: 28px 0; }

/* ---------- 分页 ---------- */
.pg { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 16px; }
.pg .btn { padding: 6px 12px; font-size: 13px; }

/* ---------- 键值对列表 ---------- */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; word-break: break-all; font-family: ui-monospace, monospace; font-size: 12.5px; }

/* ---------- 表单行 ---------- */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }

/* ---------- 标签 ---------- */
.tag { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; line-height: 1.6; }
.tag-success { background: rgba(34,197,94,0.15); color: var(--success); }
.tag-warn { background: rgba(245,158,11,0.15); color: var(--warning); }
.tag-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.tag-mute { background: var(--bg-3); color: var(--text-2); }
.tag-brand { background: var(--brand-soft); color: var(--brand); }
.tag-vip { background: var(--vip-soft); color: var(--vip); }
.tag-accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- checkbox 列 ---------- */
.selcol { width: 36px; text-align: center; }
.selcol input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; vertical-align: middle; }

/* ---------- 批量操作条 ---------- */
.batch-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px; background: var(--bg-3); border: 1px solid var(--border-soft); border-radius: var(--r-lg); }
.batch-bar .sel-hint { font-size: 13px; color: var(--text-2); }
.batch-bar .btn { padding: 6px 12px; font-size: 13px; }
.batch-bar .sp { flex: 1; }
.batch-bar .btn-danger-soft { color: var(--danger); }

/* ---------- 状态行 ---------- */
.status-line { margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.status-line .tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; margin-right: 6px; }
.tag-ok { background: rgba(52,211,153,.15); color: #34d399; }
.tag-warn { background: rgba(251,191,36,.15); color: #fbbf24; }
.tag-err { background: rgba(248,113,113,.15); color: #f87171; }

/* ============================================================
   V4.0 骨架屏 (A2)
   ============================================================ */
.skeleton { background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s infinite; border-radius: 6px; display: block; }
.skeleton.sk-line { height: 12px; margin-bottom: 8px; }
.skeleton.sk-line.lg { height: 16px; width: 80%; }
.skeleton.sk-line.sm { height: 10px; width: 50%; }
.skeleton.sk-card { height: 120px; border-radius: 14px; margin-bottom: 12px; }
.skeleton.sk-circle { border-radius: 50%; width: 40px; height: 40px; }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   V4.0 页面切换顶部进度条 (B2)
   ============================================================ */
.page-progress {
  position: fixed; top: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  z-index: 99999; width: 0%;
  transition: width 0.3s var(--ease), opacity 0.3s;
  box-shadow: 0 0 8px rgba(102,126,234,0.5);
  pointer-events: none;
}
.page-progress.show { opacity: 1; }
.page-progress.done { opacity: 0; }

/* ============================================================
   V4.0 面包屑增强 (B1)
   ============================================================ */
.crumb-link { color: var(--text-3); cursor: pointer; transition: color 0.15s; }
.crumb-link:hover { color: var(--brand); }
.crumb-sep { margin: 0 6px; color: var(--text-3); font-size: 12px; }

/* ============================================================
   V4.0 返回顶部按钮 (B5)
   ============================================================ */
.back-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 9990;
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--border-soft);
  color: var(--text-2); display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: all 0.2s var(--ease);
  box-shadow: var(--shadow);
}
.back-top.show { opacity: 1; pointer-events: auto; }
.back-top:hover { color: var(--brand); border-color: var(--brand-ring); transform: translateY(-2px); }
.back-top svg { width: 18px; height: 18px; }

/* ============================================================
   V4.0 可撤回 toast (B4)
   ============================================================ */
.toast-undo { display: inline-flex; align-items: center; gap: 12px; }
.toast-undo .undo-btn { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3); color: #fff; padding: 4px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; }
.toast-undo .undo-btn:hover { background: rgba(255,255,255,0.3); }

/* ============================================================
   V4.2 智能图标渲染 (.ic-img / .ic-tx)
   ============================================================ */
.ic-img { display: inline-block; vertical-align: middle; object-fit: contain; }
.ic-img.ic-nv { width: 18px; height: 18px; }
.ic-img.ic-card { width: 32px; height: 32px; }
.ic-tx { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.ic-tx.ic-nv { font-size: 16px; }
.ic-tx.ic-card { font-size: 28px; }
.ic-tx.ic-err { color: var(--danger); font-size: 14px; }

/* nav 容器 */
.nv-lbl { margin-left: 4px; }
/* admin 后台 sidebar 已有 .nav-icon 样式, 不动 */
