/* ============================================================
   common.css  —  11 个 HTML 页面共享的基础样式
   来源：对 bifen / channel-detail / contact / index / new /
   pindao / shipin / video-detail / zhibo / 免责 / 隐私 的
   内联 <style> 做规则级比对后抽取。
   - 标注 [11/11] 的规则在所有页面中完全一致
   - 标注 [10/11] 的规则在 10 个页面一致（contact/隐私 等缺页脚组件）
   - 存在差异的规则已取「最常见变体」并注明分歧
   ============================================================ */

/* ---------- 1. 设计令牌 (Design Tokens) [11/11] ---------- */
/* 注：:root 原有 3 个变体，差异为是否包含 --accent-red。
   此处取最完整版本（8/11 文件使用）。 */
:root {
  --bg-body: #f4f3f0;
  --bg-card: #ffffff;
  --bg-elevated: #faf9f7;
  --bg-header: rgba(15, 23, 42, 0.95);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-inverse: #f8fafc;
  --accent-blue: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-orange: #f97316;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --border-light: #e2e8f0;
  --border-subtle: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,0.05), 0 2px 4px -2px rgba(15,23,42,0.03);
  --shadow-lg: 0 10px 15px -3px rgba(15,23,42,0.06), 0 4px 6px -4px rgba(15,23,42,0.02);
  --shadow-xl: 0 20px 25px -5px rgba(15,23,42,0.08), 0 8px 10px -6px rgba(15,23,42,0.02);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-body: #0b0f19;
    --bg-card: #151b2b;
    --bg-elevated: #1e2538;
    --bg-header: rgba(11, 15, 25, 0.92);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    --border-light: #1e293b;
    --border-subtle: #1e2538;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.6), 0 8px 10px -6px rgba(0,0,0,0.4);
  }
}

/* ---------- 2. 重置与基类 [11/11] ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
button, input { font: inherit; }

/* 注：body 有 2 个变体，8/11 文件带 background-image 渐变，3/11 不带 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(37,99,235,0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(16,185,129,0.03) 0%, transparent 40%);
}
@media (prefers-color-scheme: dark) {
  body {
    background-image:
      radial-gradient(circle at 10% 20%, rgba(37,99,235,0.06) 0%, transparent 40%),
      radial-gradient(circle at 90% 80%, rgba(16,185,129,0.06) 0%, transparent 40%);
  }
}

/* ---------- 3. 无障碍跳转链接 [11/11] ---------- */
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--accent-blue); color: #fff;
  padding: 8px 16px; z-index: 1000;
  text-decoration: none; font-size: 13px; font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* ---------- 4. 布局容器 [11/11 选择器一致；padding 有分歧] ---------- */
/* 注：.sw-container padding 有 16px/20px 两个变体，此处取 20px (8/11) */
.sw-container {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 340px;
  gap: 20px; padding: 20px 20px 40px;
}
.sw-left { min-width: 0; }                                 /* [8/11] */
.sw-right { min-width: 0; display: flex; flex-direction: column; gap: 16px; } /* [8/11] */

/* ---------- 5. 顶部 Header [11/11] ---------- */
.sw-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-header);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow-sm);
}
.sw-header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
}
.sw-logo {
  font-size: 18px; font-weight: 800;
  display: flex; align-items: center; gap: 10px;
  color: var(--text-inverse);
  white-space: nowrap; flex-shrink: 0;
  text-decoration: none; letter-spacing: -0.02em;
}
.sw-logo-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
  box-shadow: 0 0 12px rgba(16,185,129,0.5);
  animation: pulse-glow 2.5s ease-in-out infinite;
  position: relative;
}
.sw-logo-dot::after {
  content: ''; position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(16,185,129,0.3);
  animation: ripple 2.5s ease-out infinite;
}

/* ---------- 6. 导航 [11/11] ---------- */
.sw-nav {
  display: flex; gap: 4px;
  overflow-x: auto; flex-wrap: nowrap;
  scrollbar-width: none; flex: 1; min-width: 0;
  padding: 2px;
}
.sw-nav::-webkit-scrollbar { display: none; }
.sw-nav-item {
  padding: 7px 14px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  cursor: pointer;
  transition: all 0.25s var(--transition-smooth);
  color: rgba(248,250,252,0.65);
  background: transparent; border: none;
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0; position: relative; overflow: hidden;
  text-decoration: none;
}
a.sw-nav-item:link, a.sw-nav-item:visited,
a.sw-nav-item:hover, a.sw-nav-item:active {
  color: rgba(248,250,252,0.65);
  text-decoration: none;
}
a.sw-nav-item.active:link, a.sw-nav-item.active:visited,
a.sw-nav-item.active:hover, a.sw-nav-item.active:active {
  color: var(--text-inverse);
}
.sw-nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.9; }
.sw-nav-item.active {
  background: rgba(255,255,255,0.1);
  color: var(--text-inverse);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), inset 0 1px 0 rgba(255,255,255,0.06);
}
.sw-nav-item::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0.06);
  border-radius: inherit; opacity: 0;
  transition: opacity 0.2s ease;
}
.sw-nav-item:hover, .sw-nav-item:focus { color: var(--text-inverse); outline: none; }
.sw-nav-item:hover::before, .sw-nav-item:focus::before { opacity: 1; }

/* ---------- 7. 搜索框 [11/11] ---------- */
.sw-search { position: relative; width: 220px; flex-shrink: 0; }
.sw-search input {
  width: 100%; padding: 8px 12px 8px 36px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.06);
  color: var(--text-inverse); font-size: 13px;
  outline: none;
  transition: all 0.3s var(--transition-smooth);
}
.sw-search input::placeholder { color: rgba(248,250,252,0.4); }
.sw-search input:focus {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15), 0 0 20px rgba(37,99,235,0.1);
}
.sw-search-icon {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: rgba(248,250,252,0.4); pointer-events: none;
}

/* ---------- 8. 卡片面板与标题 [11/11] ---------- */
/* 注：.sw-panel 有 5 个 padding/overflow 变体，此处取 6/11 的常见变体 */
.sw-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 18px; margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.3s ease;
  position: relative; overflow: hidden;
  animation: fade-up 0.6s var(--transition-smooth) both;
}
.sw-panel:hover { box-shadow: var(--shadow-lg); }
@media (prefers-color-scheme: dark) {
  .sw-panel { border-color: var(--border-light); }
}
.sw-panel:nth-child(1) { animation-delay: 0.05s; }   /* [6/11] */
.sw-panel:nth-child(2) { animation-delay: 0.1s; }    /* [6/11] */
.sw-panel:nth-child(3) { animation-delay: 0.15s; }   /* [5/11] */

h2.sw-section-title {
  font-size: 15px; font-weight: 800;
  padding: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-primary); letter-spacing: -0.01em;
}
h2.sw-section-title svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent-blue); }

/* ---------- 9. 页脚 [10/11]（contact/隐私 等无页脚） ---------- */
.sw-footer {
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
  max-width: 1280px; margin: 0 auto;
  box-shadow: 0 -4px 20px rgba(15,23,42,0.03);
}
.sw-footer-inner { padding: 32px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.sw-footer-brand { display: flex; align-items: center; gap: 10px; }
.sw-footer-brand span { font-size: 13px; color: var(--text-secondary); font-weight: 700; }
.sw-footer-brand svg { color: var(--text-muted); }
.sw-footer-nav { display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }
.sw-footer-nav a {
  font-size: 12px; color: var(--text-muted);
  text-decoration: none; font-weight: 600;
  transition: all 0.2s ease; position: relative;
}
.sw-footer-nav a::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1.5px; background: var(--accent-blue);
  transition: width 0.25s ease;
}
.sw-footer-nav a:hover { color: var(--text-primary); }
.sw-footer-nav a:hover::after { width: 100%; }
.sw-footer-copyright { font-size: 11px; color: var(--text-muted); font-weight: 500; }

/* ---------- 10. 返回顶部按钮 [10/11] ---------- */
.back-to-top {
  position: fixed; bottom: 28px; right: 28px;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1.5px solid var(--border-light);
  background: var(--bg-card); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0; visibility: hidden;
  transform: translateY(12px) scale(0.9);
  transition: all 0.35s var(--transition-bounce);
  box-shadow: var(--shadow-lg); z-index: 99;
}
.back-to-top svg { width: 20px; height: 20px; }
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.back-to-top:hover {
  background: var(--accent-blue); color: #fff;
  border-color: var(--accent-blue);
  box-shadow: 0 8px 24px rgba(37,99,235,0.3);
  transform: translateY(-2px) scale(1.05);
}

/* ---------- 11. 滚动条 [10/11] ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }   /* [7/11] */

/* ---------- 12. 动画关键帧 ---------- */
@keyframes pulse-glow { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.85); opacity: 0.7; } }  /* [11/11] */
@keyframes ripple { 0% { transform: scale(0.8); opacity: 0.6; } 100% { transform: scale(2); opacity: 0; } }            /* [11/11] */
@keyframes fade-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }  /* [10/11] */
@keyframes live-dot { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.85); opacity: 0.7; } }     /* [4/11] */
@keyframes live-ring { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(2.5); opacity: 0; } }         /* [2/11] */

/* ---------- 13. 响应式 [11/11] ---------- */
@media (max-width: 1024px) {
  .sw-container { grid-template-columns: 1fr; padding: 16px 16px 32px; gap: 16px; }
}
@media (max-width: 900px) {
  .sw-header-inner { flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
  .sw-nav { order: 2; flex: 0 0 100%; flex-wrap: wrap; gap: 2px; overflow: visible; }
  .sw-nav-item { padding: 6px 10px; font-size: 12px; }
  .sw-search { flex: 0 0 100%; order: 3; }
}
@media (max-width: 640px) {
  .back-to-top { bottom: 20px; right: 20px; width: 44px; height: 44px; }
  .back-to-top svg { width: 18px; height: 18px; }
}
@media (max-width: 420px) {
  .sw-nav-item { padding: 6px 8px; font-size: 11px; gap: 4px; }
  .sw-nav-item svg { width: 14px; height: 14px; }
}
@media (max-width: 320px) {
  .sw-header-inner { padding: 8px 10px; gap: 8px; }
  .sw-nav-item { padding: 5px 7px; font-size: 10px; gap: 3px; }
  .sw-nav-item svg { width: 12px; height: 12px; }
  .sw-logo { font-size: 16px; }
  .sw-logo-dot { width: 8px; height: 8px; }
}
