/* ============================================================
   英语计划 · Web 端公共样式
   - 纯 HTML/CSS/JS，无需构建工具
   - 设计语言：柔和渐变 + 大圆角 + 卡片阴影
   ============================================================ */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #ec4899;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --text-invert: #ffffff;

  --bg-page: #f7f8fc;
  --bg-card: #ffffff;
  --bg-soft: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.85);

  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 24px 60px rgba(99, 102, 241, 0.15);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --transition: 0.2s ease;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
           'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* ---- 初始化 ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font);
  color: var(--text-1);
  background: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; outline: none; }

/* ---- 通用容器 ---- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  border: none;
  cursor: pointer;
  text-align: center;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--bg-soft);
  color: var(--text-1);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #e2e8f0; }

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(239, 68, 68, 0.4); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-soft); border-color: #cbd5e1; color: var(--text-1); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 30px; font-size: 16px; }
.btn-block { width: 100%; }

.btn .icon { font-size: 16px; }

/* ============================================================
   表单
   ============================================================ */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 8px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-1);
  background: var(--bg-card);
  transition: all var(--transition);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.form-control.error { border-color: var(--danger); }
.form-control::placeholder { color: var(--text-3); }

.form-error {
  display: block;
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 5px;
}

.form-select {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-1);
  background: var(--bg-card);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
  transition: all var(--transition);
}
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* ============================================================
   卡片
   ============================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-body { padding: 28px; }
.card-sm .card-body { padding: 20px; }

/* ============================================================
   消息提示
   ============================================================ */
.msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.msg-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.msg-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.msg-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.msg-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.msg-icon { font-size: 18px; flex-shrink: 0; }
.msg-close { margin-left: auto; cursor: pointer; opacity: 0.7; font-size: 16px; }
.msg-close:hover { opacity: 1; }

/* ============================================================
   加载状态
   ============================================================ */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-dark {
  border-color: rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(247, 248, 252, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}
.loading-overlay .spinner { width: 36px; height: 36px; border-width: 3px; }
.loading-overlay .loading-text { margin-top: 12px; color: var(--text-2); font-size: 14px; }

/* ============================================================
   顶部导航
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.brand-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-1);
}
.brand-slogan {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.nav-link {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--radius-full);
  transition: all var(--transition);
}
.nav-link:hover { background: var(--bg-soft); color: var(--text-1); }
.nav-link.active { color: var(--primary); background: rgba(99, 102, 241, 0.08); }

.nav-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-soft);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.nav-user:hover { background: #e2e8f0; }
.nav-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.nav-user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   Hero 横幅
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 50%, var(--secondary) 100%);
  color: #fff;
  padding: 80px 0 100px;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 320px 320px at -80px -80px, rgba(251, 191, 36, 0.5), transparent),
    radial-gradient(ellipse 420px 420px at right -120px bottom -160px, rgba(6, 182, 212, 0.4), transparent),
    radial-gradient(ellipse 260px 260px at 60% 40%, rgba(244, 63, 94, 0.3), transparent);
  animation: heroFloat 16s ease-in-out infinite;
}
@keyframes heroFloat {
  0%, 100% { transform: scale(1) translate(0, 0); }
  33%       { transform: scale(1.05) translate(20px, -20px); }
  66%       { transform: scale(0.97) translate(-20px, 20px); }
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero-tag {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: 20px;
}
.hero-title {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
}
.hero-title-accent {
  background: linear-gradient(135deg, #fde68a 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-desc {
  font-size: 16px;
  line-height: 1.7;
  opacity: 0.92;
  max-width: 520px;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-actions .btn-cta {
  background: linear-gradient(135deg, var(--accent) 0%, var(--danger) 100%);
  color: #fff;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-full);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.hero-actions .btn-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(245, 158, 11, 0.5); }
.hero-actions .btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all var(--transition);
}
.hero-actions .btn-ghost:hover { background: rgba(255, 255, 255, 0.22); }
.hero-highlights { list-style: none; display: flex; gap: 32px; }
.hero-highlights li { display: flex; flex-direction: column; }
.hero-highlights strong { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.hero-highlights span { font-size: 12px; opacity: 0.8; margin-top: 2px; }

/* Hero 右侧卡片 */
.hero-visual { position: relative; height: 420px; }
.hero-card {
  position: absolute;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-1);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
  min-width: 155px;
  animation: cardBob 4s ease-in-out infinite;
}
.hero-card-icon { font-size: 32px; margin-bottom: 6px; }
.hero-card-title { font-weight: 700; font-size: 16px; }
.hero-card-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.hero-card:nth-child(1) { top: 8%; left: 0;   animation-delay: 0s; }
.hero-card:nth-child(2) { top: 38%; right: 0; animation-delay: -1.3s; }
.hero-card:nth-child(3) { bottom: 6%; left: 10%; animation-delay: -2.6s; }
@keyframes cardBob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-14px) rotate(2deg); }
}
.hero-star {
  position: absolute;
  top: 5%;
  right: 18%;
  font-size: 48px;
  animation: spin 10s linear infinite;
}

/* ============================================================
   分类导航
   ============================================================ */
.catnav {
  position: sticky;
  top: 68px;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.catnav-inner {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.catnav-inner::-webkit-scrollbar { display: none; }
.catnav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: var(--bg-soft);
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: all var(--transition);
  border: 1px solid transparent;
  cursor: pointer;
}
.catnav-btn:hover { background: #e2e8f0; color: var(--text-1); }
.catnav-btn.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}
.catnav-icon { font-size: 18px; }

/* ============================================================
   统计条
   ============================================================ */
.statsbar { padding: 28px 0; }
.statsbar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.statsbar-item {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}
.statsbar-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.statsbar-item::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.06;
  border-radius: inherit;
}
.statsbar-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.statsbar-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.5px;
  position: relative;
  z-index: 1;
}
.statsbar-label {
  font-size: 13px;
  color: var(--text-2);
  position: relative;
  z-index: 1;
}

/* ============================================================
   页面主体
   ============================================================ */
.page-main { padding: 16px 20px 80px; }
.section { margin-bottom: 56px; }
.section-head {
  margin-bottom: 28px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.section-title-text {
  background: linear-gradient(135deg, var(--text-1), var(--text-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--border), transparent);
  border-radius: 1px;
}
.section-sub { font-size: 13px; color: var(--text-3); }

/* 二级分类 */
.subsection { margin-bottom: 36px; }
.subsection-head { margin-bottom: 16px; padding-left: 4px; }
.subsection-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
}
.subsection-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.subsection-desc { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* ============================================================
   资源卡片
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.resource-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.resource-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
}

.rc-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.rc-cover-emoji {
  font-size: 72px;
  transition: transform 0.4s;
}
.resource-card:hover .rc-cover-emoji {
  transform: scale(1.15) rotate(-5deg);
}
/* 动画资源封面上的播放角标：hover 时浮现，点击进入 viewer.html */
.rc-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.0);
  color: #fff;
  text-decoration: none;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 3;
  pointer-events: auto;
}
.rc-play-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(236, 72, 153, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  padding-left: 6px;
  box-shadow: 0 10px 30px rgba(236, 72, 153, 0.5);
  transform: scale(0.7);
  transition: transform 0.2s ease;
}
.resource-card:hover .rc-play-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.35);
}
.resource-card:hover .rc-play-icon {
  transform: scale(1);
}
.rc-play-overlay:hover .rc-play-icon {
  background: rgba(99, 102, 241, 0.95);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.6);
}
/* 移动端没有 hover：直接显示播放角标 */
@media (hover: none) {
  .rc-play-overlay {
    opacity: 0.85;
    background: rgba(0, 0, 0, 0.25);
  }
  .rc-play-icon { transform: scale(0.9); }
}
.rc-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-1);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.rc-episodes {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  backdrop-filter: blur(6px);
}

.rc-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.rc-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rc-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.rc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.rc-meta-item { font-size: 12px; color: var(--text-3); }
.rc-tag {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}
.rc-tag-all   { background: #e0f2fe; color: #0369a1; }
.rc-tag-exp  { background: #fef3c7; color: #92400e; }
.rc-tag-vip  { background: linear-gradient(135deg, #fde68a, var(--accent)); color: #fff; }

.rc-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--bg-soft);
  overflow: hidden;
  margin-bottom: 14px;
}
.rc-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  transition: width 0.6s ease;
}
.rc-actions { display: flex; gap: 8px; margin-top: auto; }
.rc-actions .btn { flex: 1; }
.rc-actions .btn-ghost { flex: 0 0 70px; }

/* ============================================================
   骨架屏
   ============================================================ */
.skeleton { padding: 24px 0; }
.skeleton-section { margin-bottom: 48px; }
.skeleton-title {
  height: 24px;
  width: 160px;
  background: linear-gradient(90deg, #e2e8f0, #f1f5f9, #e2e8f0);
  background-size: 200% 100%;
  border-radius: 6px;
  margin-bottom: 24px;
  animation: shimmer 1.5s infinite;
}
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.skeleton-cover {
  height: 160px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #e2e8f0, #f1f5f9, #e2e8f0);
  background-size: 200% 100%;
  margin-bottom: 14px;
  animation: shimmer 1.5s infinite;
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e2e8f0, #f1f5f9, #e2e8f0);
  background-size: 200% 100%;
  margin-bottom: 8px;
  animation: shimmer 1.5s infinite;
}
.skeleton-line-70 { width: 70%; }
.skeleton-line-50 { width: 50%; }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   空状态
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}
.empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.empty-desc { color: var(--text-2); font-size: 14px; }

/* ============================================================
   底部
   ============================================================ */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 60px 0 24px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 2fr;
  gap: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid #1e293b;
}
.footer-brand .brand-name { color: #fff; }
.footer-brand .brand-slogan { color: #94a3b8; }
.footer-desc {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.7;
  color: #94a3b8;
  max-width: 360px;
}
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-col h4 { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 16px; }
.footer-col a, .footer-col p {
  display: block;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 8px;
  transition: color var(--transition);
}
.footer-col a:hover { color: #c7d2fe; }
.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #64748b;
  flex-wrap: wrap;
  gap: 12px;
}

/* ============================================================
   认证页（登录/注册）
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 50%, var(--secondary) 100%);
}
.auth-panel {
  width: 100%;
  max-width: 460px;
  margin: auto;
  padding: 20px;
}
.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}
.auth-brand {
  text-align: center;
  margin-bottom: 32px;
}
.auth-brand .brand-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  font-size: 26px;
}
.auth-brand h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 4px;
}
.auth-brand p {
  font-size: 14px;
  color: var(--text-3);
}
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: var(--radius-full);
  margin-bottom: 28px;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  border-radius: var(--radius-full);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
}
.auth-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.auth-divider {
  text-align: center;
  margin: 20px 0;
  font-size: 13px;
  color: var(--text-3);
}
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-3);
}
.auth-footer a {
  color: var(--primary);
  font-weight: 600;
}

/* 密码可见切换 */
.password-wrap { position: relative; }
.password-wrap .toggle-pw {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-3);
  font-size: 16px;
  background: none;
  border: none;
  padding: 4px;
}

/* ============================================================
   个人中心
   ============================================================ */
.profile-page { padding: 40px 0 80px; }
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-xl);
  color: #fff;
  margin-bottom: 28px;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  border: 3px solid rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}
.profile-info h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.profile-info p { font-size: 14px; opacity: 0.85; }
.profile-vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: linear-gradient(135deg, var(--accent), var(--danger));
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
}
.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}
.profile-sidebar .card { position: sticky; top: 90px; }
.sidebar-nav { padding: 8px; }
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-nav-item:hover { background: var(--bg-soft); color: var(--text-1); }
.sidebar-nav-item.active {
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
}
.sidebar-nav-item.danger { color: var(--danger); }
.sidebar-nav-item.danger:hover { background: #fee2e2; }

/* ============================================================
   兑换码面板
   ============================================================ */
.redeem-section {
  padding: 80px 0;
  background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 50%, #831843 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.redeem-section::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
  opacity: 0.4;
  pointer-events: none;
}
.redeem-section::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  opacity: 0.4;
  pointer-events: none;
}
.redeem-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.redeem-tag {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.redeem-title { font-size: 36px; font-weight: 800; margin-bottom: 16px; line-height: 1.2; }
.redeem-desc { font-size: 15px; line-height: 1.7; opacity: 0.85; margin-bottom: 24px; }
.redeem-list { list-style: none; }
.redeem-list li { padding: 6px 0; font-size: 14px; opacity: 0.9; }

.redeem-form {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 32px;
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}
.redeem-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  opacity: 0.9;
}
.redeem-field {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.redeem-input {
  flex: 1;
  padding: 14px 18px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: all var(--transition);
}
.redeem-input::placeholder { color: rgba(255, 255, 255, 0.45); font-weight: 400; letter-spacing: 0; }
.redeem-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}
.redeem-submit {
  background: linear-gradient(135deg, var(--accent) 0%, var(--danger) 100%);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
  transition: all var(--transition);
  flex-shrink: 0;
}
.redeem-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(245, 158, 11, 0.5); }
.redeem-submit:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.redeem-msg {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}
.redeem-msg-success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.redeem-msg-error   { background: rgba(239, 68, 68, 0.2);  color: #fca5a5; }
.redeem-msg-loading { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.8); }
.redeem-hint { font-size: 13px; opacity: 0.65; text-align: center; margin-top: 8px; }
.redeem-hint a { color: #fde68a; font-weight: 600; text-decoration: underline; }

/* ============================================================
   弹窗
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-3);
  cursor: pointer;
  border: none;
  background: var(--bg-soft);
  transition: all var(--transition);
}
.modal-close:hover { background: #e2e8f0; color: var(--text-1); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   分页
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}
.page-btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover:not(:disabled) { background: var(--bg-soft); color: var(--text-1); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-title { font-size: 38px; }
  .hero-visual { height: 300px; max-width: 420px; margin: 0 auto; }
  .statsbar-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-sidebar .card { position: static; }
  .redeem-inner { grid-template-columns: 1fr; gap: 32px; }
  .redeem-title { font-size: 28px; }
  .footer-inner { grid-template-columns: 1fr; gap: 36px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-title { font-size: 30px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn-cta, .hero-actions .btn-ghost { width: 100%; }
  .hero-highlights { gap: 20px; }
  .hero-highlights strong { font-size: 22px; }
  .auth-card { padding: 28px 20px; }
}
@media (max-width: 480px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .redeem-field { flex-direction: column; }
  .redeem-submit { width: 100%; }
  .hero-title { font-size: 26px; }
  .statsbar-num { font-size: 22px; }
  .section-title { font-size: 22px; }
}

/* ============================================================
   资源库页面
   ============================================================ */
.resources-page {
  padding: 32px 0 80px;
  min-height: calc(100vh - 80px);
}

/* 头部 */
.resources-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.resources-header-text { flex: 1 1 320px; min-width: 0; }
.resources-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.resources-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}
.resources-subtitle {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

/* 搜索框 */
.resources-search {
  position: relative;
  flex: 1 1 320px;
  max-width: 460px;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.resources-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
.resources-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-1);
  padding: 8px 4px;
  min-width: 0;
}
.resources-search-input::placeholder { color: var(--text-3); }
.resources-search-clear {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 14px;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 999px;
  transition: all var(--transition);
}
.resources-search-clear:hover { background: var(--bg-soft); color: var(--text-1); }
.resources-search-btn {
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  flex-shrink: 0;
  transition: transform var(--transition), box-shadow var(--transition);
}
.resources-search-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35); }

/* 工具栏 */
.resources-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.resources-tabs { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.resources-tab {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.resources-tab:hover { border-color: var(--primary); color: var(--primary); }
.resources-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.resources-tab-count {
  font-size: 12px;
  opacity: 0.85;
  font-weight: 500;
}
.resources-count {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

/* 主体布局 */
.resources-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: flex-start;
}

/* 侧边栏 */
.resources-sidebar {
  position: sticky;
  top: 96px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.resources-side-section + .resources-side-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}
.resources-side-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.resources-catlist,
.resources-sublist {
  list-style: none;
  padding: 0;
  margin: 0;
}
.resources-catitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-2);
  transition: all var(--transition);
  user-select: none;
}
.resources-catitem:hover { background: var(--bg-soft); color: var(--text-1); }
.resources-catitem.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.10));
  color: var(--primary);
  font-weight: 700;
}
.resources-catitem-ico {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.resources-catitem-label { flex: 1; min-width: 0; }
.resources-catitem-count {
  font-size: 12px;
  color: var(--text-3);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 600;
}
.resources-catitem.active .resources-catitem-count {
  background: rgba(99, 102, 241, 0.18);
  color: var(--primary);
}

.resources-subitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  transition: all var(--transition);
  user-select: none;
}
.resources-subitem:hover { background: var(--bg-soft); color: var(--text-1); }
.resources-subitem.active {
  background: rgba(168, 85, 247, 0.12);
  color: var(--secondary);
  font-weight: 600;
}
.resources-subitem-ico {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}
.resources-subitem-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resources-subitem-count {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
}

/* 主区卡片网格 */
.resources-main { min-width: 0; }
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

/* 卡片扩展 */
.rc-subcat {
  display: inline-block;
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-soft);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
  font-weight: 500;
}
.rc-fav {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  padding: 0;
  line-height: 1;
}
.rc-fav:hover {
  transform: scale(1.1);
  color: #f59e0b;
}
.rc-fav.is-fav {
  color: #f59e0b;
  background: rgba(254, 243, 199, 0.95);
}
.rc-fav.is-fav:hover {
  background: rgba(254, 215, 170, 0.95);
}
.rc-fav:disabled { opacity: 0.6; cursor: wait; }

/* 分页 */
.resources-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.rp-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.rp-btn:hover:not(:disabled):not(.disabled) {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.rp-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.rp-btn:disabled,
.rp-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.rp-ellipsis {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 13px;
  user-select: none;
}

/* 响应式 */
@media (max-width: 960px) {
  .resources-layout { grid-template-columns: 1fr; }
  .resources-sidebar { position: static; }
  .resources-header { flex-direction: column; align-items: stretch; }
  .resources-search { max-width: 100%; }
}
@media (max-width: 480px) {
  .resources-title { font-size: 26px; }
  .resources-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .rc-cover-emoji { font-size: 56px; }
  .rc-title { font-size: 14px; }
  .resources-tab { padding: 6px 12px; font-size: 12px; }
}

/* ============================================================
   资源卡片 - 封面图 / 会员锁
   ============================================================ */
.rc-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
  transition: transform 0.5s ease;
}
.resource-card:hover .rc-cover-img { transform: scale(1.06); }
.rc-cover > .rc-chip,
.rc-cover > .rc-episodes,
.rc-cover > .rc-fav,
.rc-cover > .rc-lock {
  z-index: 2;
}
.rc-lock {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.65);
  border-radius: 999px;
  color: #fde68a;
  backdrop-filter: blur(6px);
}

/* ============================================================
   兑换结果弹窗
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 16px;
}
.modal-overlay.show { opacity: 1; }

.modal-card {
  background: var(--bg-card, #fff);
  border-radius: 18px;
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.show .modal-card { transform: translateY(0) scale(1); }

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-soft);
  color: var(--text-2);
  border-radius: 999px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  z-index: 3;
  transition: all 0.2s;
}
.modal-close:hover { background: #fee2e2; color: #991b1b; }

.redeem-modal { padding-bottom: 0; }
.redeem-modal-head {
  text-align: center;
  padding: 28px 24px 16px;
  background: linear-gradient(135deg, rgba(99,102,241,0.10), rgba(168,85,247,0.10));
  border-bottom: 1px solid var(--border);
}
.redeem-modal-icon {
  font-size: 48px;
  width: 76px;
  height: 76px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  box-shadow: 0 8px 22px rgba(99,102,241,0.35);
}
.redeem-modal-icon.is-re {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  box-shadow: 0 8px 22px rgba(245,158,11,0.35);
}
.redeem-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 4px;
}
.redeem-modal-sub {
  font-size: 13px;
  color: var(--text-2);
}
.redeem-modal-meta {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 12px 24px;
  font-size: 13px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.redeem-modal-ep {
  padding: 16px 20px 4px;
  overflow-y: auto;
  flex: 1;
  min-height: 200px;
  max-height: 50vh;
}
.redeem-modal-ep-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.redeem-ep-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.redeem-ep-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-1);
  transition: background 0.2s;
}
.redeem-ep-item:hover { background: rgba(99,102,241,0.10); }
.redeem-ep-idx {
  flex: 0 0 28px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(99,102,241,0.12);
  color: var(--primary);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.redeem-ep-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.redeem-ep-link {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99,102,241,0.12);
  transition: all 0.2s;
}
.redeem-ep-link:hover { background: var(--primary); color: #fff; }
.redeem-ep-link.disabled { color: var(--text-3); background: transparent; cursor: not-allowed; }
.redeem-ep-more, .redeem-ep-empty {
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  padding: 14px 0 6px;
}
.redeem-modal-actions {
  padding: 16px 20px 20px;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--border);
  margin-top: auto;
  background: var(--bg-card, #fff);
}
.redeem-modal-actions .btn { min-width: 140px; }

@media (max-width: 480px) {
  .redeem-modal-head { padding: 20px 16px 12px; }
  .redeem-modal-icon { width: 60px; height: 60px; font-size: 36px; }
  .redeem-modal-title { font-size: 17px; }
  .redeem-ep-item { font-size: 12px; padding: 7px 10px; }
}

/* ============================================================
   会员升级面板（profile.html 会员卡片内嵌）
   ============================================================ */
.vip-redeem-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.06));
  border: 1px dashed rgba(99, 102, 241, 0.35);
  animation: vipPanelIn 0.25s ease-out;
}
@keyframes vipPanelIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.vip-redeem-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
  margin-bottom: 14px;
}
.vip-redeem-hint .iconfont {
  margin-top: 2px;
  flex-shrink: 0;
}
.vip-redeem-field {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.vip-redeem-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  font-size: 15px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.5px;
  border: 1.5px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1, #fff);
  outline: none;
  transition: all 0.15s;
}
.vip-redeem-input::placeholder {
  color: var(--text-3);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  font-size: 13px;
}
.vip-redeem-input:focus {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.06);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.vip-redeem-field .btn {
  flex-shrink: 0;
  height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.vip-redeem-field .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.vip-redeem-tips {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.06);
  border-radius: 8px;
  border-left: 3px solid #f59e0b;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-2);
  display: flex;
  gap: 8px;
}
.vip-redeem-tips > .iconfont {
  color: #f59e0b;
  margin-top: 2px;
  flex-shrink: 0;
}
.vip-redeem-tips ul {
  margin: 0;
  padding-left: 16px;
  list-style: disc;
}
.vip-redeem-tips li {
  margin: 1px 0;
}
.vip-redeem-tips b {
  color: var(--text-1, #fff);
}
#vipRedeemMsg {
  margin-top: 10px;
}
#vipRedeemMsg .msg {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}
#vipRedeemMsg .msg-success {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
#vipRedeemMsg .msg-error {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
#vipRedeemMsg .iconfont { font-size: 16px; }
@media (max-width: 480px) {
  .vip-redeem-field { flex-direction: column; }
  .vip-redeem-field .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   我的兑换区（首页 + profile）
   ============================================================ */
.myredeem-section { padding: 40px 0 8px; }
.section-sub-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.section-sub-link:hover { text-decoration: underline; }

.myredeem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 1024px) { .myredeem-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .myredeem-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 420px)  { .myredeem-grid { grid-template-columns: 1fr; } }

.myredeem-section .empty-state { padding: 60px 20px; }

/* profile 我的兑换 tab */
.redeem-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.redeem-tab {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  border-radius: 8px 8px 0 0;
}
.redeem-tab:hover { color: var(--primary); }
.redeem-tab.active {
  color: var(--primary);
  background: rgba(99,102,241,0.08);
}
.redeem-tab-count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 8px;
  font-size: 11px;
  background: var(--bg-soft);
  color: var(--text-2);
  border-radius: 999px;
  font-weight: 700;
}
.redeem-tab.active .redeem-tab-count {
  background: var(--primary);
  color: #fff;
}
.redeem-tab-pane { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.myredeem-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 20px 0 4px;
}
.redeem-page-btn {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-1);
  transition: all 0.2s;
}
.redeem-page-btn:hover:not([disabled]) {
  border-color: var(--primary);
  color: var(--primary);
}
.redeem-page-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.redeem-page-info {
  font-size: 13px;
  color: var(--text-2);
}

/* 已兑换标记 */
.rc-chip-mine {
  background: rgba(16,185,129,0.85) !important;
  color: #fff !important;
  left: auto !important;
  right: 10px !important;
  top: 10px !important;
  font-weight: 700;
}

/* ============================================================
   个人中心 - 概览页"最近兑换"
   ============================================================ */
.dash-recent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.dash-recent-item:hover {
  background: rgba(99,102,241,0.08);
  transform: translateX(2px);
}
.dash-recent-cover {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-color: rgba(99,102,241,0.12);
}
.dash-recent-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dash-recent-info {
  flex: 1;
  min-width: 0;
}
.dash-recent-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-recent-time {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.dash-recent-ep {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(99,102,241,0.12);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ============================================================
   绘本阅读器 (viewer.html)
   ============================================================ */
.viewer-page {
  padding-top: 56px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  color: #e2e8f0;
}

/* 顶部信息条 */
.viewer-topbar {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.viewer-topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}
.viewer-back {
  flex: 0 0 auto;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  transition: all 0.2s;
}
.viewer-back:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.viewer-topbar-info {
  flex: 1;
  min-width: 0;
}
.viewer-topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewer-topbar-meta {
  font-size: 13px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
}
.meta-chip {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
}
.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #64748b;
  display: inline-block;
}
.viewer-topbar-counter {
  flex: 0 0 auto;
  font-size: 14px;
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
}

/* ============================================================
   阅读器工具栏（字号 / 背景 / 模式）
   ============================================================ */
.viewer-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.viewer-tool-btn {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.viewer-tool-btn:hover { background: rgba(99, 102, 241, 0.3); color: #fff; }
.viewer-tool-btn.active {
  background: rgba(99, 102, 241, 0.45);
  color: #a5b4fc;
}
.viewer-bg-picker {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}
.viewer-bg-btn {
  width: 26px;
  height: 26px;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s;
}
.viewer-bg-btn:hover { transform: scale(1.1); }
.viewer-bg-btn.is-active { border-color: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.3); }

/* 主区 */
.viewer-main {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  padding: 24px 20px 40px;
}
@media (max-width: 900px) {
  .viewer-main {
    grid-template-columns: 1fr;
  }
}

/* 加载/错误 */
.viewer-loading {
  grid-column: 1 / -1;
  padding: 80px 0;
  text-align: center;
}
.viewer-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.viewer-loading-text { font-size: 14px; color: #94a3b8; }

.viewer-error {
  grid-column: 1 / -1;
  padding: 80px 0;
  text-align: center;
}
.viewer-error-icon { font-size: 64px; margin-bottom: 16px; }
.viewer-error-title { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.viewer-error-desc { font-size: 14px; color: #94a3b8; }

/* 电子书区 */
.viewer-stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ebook-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.ebook-pages {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  position: relative;
}
.ebook-page-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  animation: pageFadeIn 0.5s ease;
}
@keyframes pageFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
.ebook-page-error {
  color: #991b1b;
  background: #fee2e2;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  font-size: 14px;
  max-width: 80%;
}
.ebook-empty {
  text-align: center;
  color: #92400e;
  font-size: 16px;
  font-weight: 600;
}
.ebook-empty-icon { font-size: 64px; margin-bottom: 12px; }

.ebook-floats {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  pointer-events: none;
}
.ebook-page-tag {
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.ebook-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(15, 23, 42, 0.5);
  color: #fff;
  border-radius: 999px;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: all 0.2s;
  backdrop-filter: blur(6px);
}
.ebook-nav-btn:hover {
  background: rgba(99, 102, 241, 0.8);
  transform: translateY(-50%) scale(1.1);
}
.ebook-nav-prev { left: 14px; }
.ebook-nav-next { right: 14px; }
.ebook-nav-icon { line-height: 1; margin-top: -3px; display: block; }

/* 文本区 */
.ebook-text {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.6;
  color: #e2e8f0;
  min-height: 60px;
  border-left: 4px solid #6366f1;
}
.ebook-text-content:empty::before {
  content: '（当前页没有字幕）';
  color: #64748b;
  font-style: italic;
}

/* 音频播放器 */
.audio-player {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}
.audio-play-btn {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  border-radius: 999px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  transition: transform 0.15s;
}
.audio-play-btn:hover { transform: scale(1.06); }
.audio-play-btn.playing {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.audio-info {
  flex: 1;
  min-width: 0;
}
.audio-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audio-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.audio-progress {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: height 0.15s;
}
.audio-progress:hover { height: 8px; }
.audio-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  border-radius: 999px;
  pointer-events: none;
}
.audio-progress-handle {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.15s;
}
.audio-progress:hover .audio-progress-handle { opacity: 1; }

.audio-controls {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.audio-ctrl-btn {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
  min-width: 38px;
}
.audio-ctrl-btn:hover { background: rgba(99, 102, 241, 0.3); color: #fff; }
.audio-ctrl-btn.active {
  background: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
}

/* 侧边栏 */
.viewer-sidebar {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 56px - 48px);
  position: sticky;
  top: calc(56px + 24px);
  overflow: hidden;
}
@media (max-width: 900px) {
  .viewer-sidebar {
    position: static;
    max-height: 480px;
  }
}
.viewer-sidebar-head {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.viewer-sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.viewer-sidebar-count {
  font-size: 12px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.viewer-ep-list {
  list-style: none;
  padding: 8px;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}
.ep-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.ep-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
.ep-item.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.6);
}
.ep-cover {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
}
.ep-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ep-cover-emoji { font-size: 28px; }
.ep-idx {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, 0.7);
  padding: 1px 6px;
  border-radius: 4px;
}
.ep-info {
  flex: 1;
  min-width: 0;
}
.ep-title {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep-item.active .ep-title { color: #fff; }
.ep-meta {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  gap: 8px;
}
.ep-status {
  flex: 0 0 auto;
  width: 24px;
  text-align: center;
  font-size: 14px;
  color: #a5b4fc;
}

/* ============================================================
   主题：白天/夜间切换
   ============================================================ */
.viewer-page.theme-day {
  background: linear-gradient(180deg, #fefce8 0%, #f5f5f4 50%, #fefce8 100%);
  color: #1e293b;
}
.viewer-page.theme-day .viewer-topbar {
  background: rgba(255, 255, 252, 0.85);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
.viewer-page.theme-day .viewer-back {
  background: rgba(0, 0, 0, 0.05);
  color: #475569;
}
.viewer-page.theme-day .viewer-back:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #1e293b;
}
.viewer-page.theme-day .viewer-topbar-title { color: #1e293b; }
.viewer-page.theme-day .viewer-topbar-meta { color: #64748b; }
.viewer-page.theme-day .meta-chip {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}
.viewer-page.theme-day .viewer-topbar-counter {
  color: #475569;
  background: rgba(0, 0, 0, 0.05);
}
.viewer-page.theme-day .viewer-tool-btn {
  background: rgba(0, 0, 0, 0.05);
  color: #475569;
}
.viewer-page.theme-day .viewer-tool-btn:hover {
  background: rgba(99, 102, 241, 0.18);
  color: #1e293b;
}
.viewer-page.theme-day .viewer-tool-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: #4f46e5;
}
.viewer-page.theme-day .viewer-bg-picker {
  background: rgba(0, 0, 0, 0.05);
}
.viewer-page.theme-day .viewer-bg-btn.is-active { border-color: #1e293b; box-shadow: 0 0 0 1px rgba(0,0,0,0.15); }

.viewer-page.theme-day .viewer-sidebar {
  background: rgba(255, 255, 252, 0.85);
  border-color: rgba(0, 0, 0, 0.08);
}
.viewer-page.theme-day .viewer-sidebar-title { color: #1e293b; }
.viewer-page.theme-day .viewer-sidebar-count {
  background: rgba(0, 0, 0, 0.06);
  color: #64748b;
}
.viewer-page.theme-day .ep-item:hover { background: rgba(0, 0, 0, 0.04); }
.viewer-page.theme-day .ep-item.active {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.5);
}
.viewer-page.theme-day .ep-title { color: #1e293b; }
.viewer-page.theme-day .ep-item.active .ep-title { color: #1e293b; font-weight: 700; }
.viewer-page.theme-day .ep-meta { color: #64748b; }
.viewer-page.theme-day .ep-status { color: #4f46e5; }
.viewer-page.theme-day .ep-idx {
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
}

.viewer-page.theme-day .ebook-frame {
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 0, 0, 0.08);
}
.viewer-page.theme-day .ebook-page-tag {
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
}
.viewer-page.theme-day .ebook-nav-btn {
  background: rgba(15, 23, 42, 0.5);
  color: #fff;
}

.viewer-page.theme-day .ebook-text {
  background: #fff;
  color: #1e293b;
  border-left-color: #6366f1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.viewer-page.theme-day .ebook-text-content:empty::before { color: #94a3b8; }

.viewer-page.theme-day .audio-player {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.viewer-page.theme-day .audio-title { color: #1e293b; }
.viewer-page.theme-day .audio-time { color: #64748b; }
.viewer-page.theme-day .audio-progress { background: rgba(0, 0, 0, 0.08); }
.viewer-page.theme-day .audio-progress-handle {
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.viewer-page.theme-day .audio-ctrl-btn {
  background: rgba(0, 0, 0, 0.05);
  color: #475569;
}
.viewer-page.theme-day .audio-ctrl-btn:hover {
  background: rgba(99, 102, 241, 0.18);
  color: #1e293b;
}
.viewer-page.theme-day .audio-ctrl-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: #4f46e5;
}

.viewer-page.theme-day .viewer-error-title { color: #1e293b; }
.viewer-page.theme-day .viewer-error-desc { color: #64748b; }
.viewer-page.theme-day .viewer-loading-text { color: #64748b; }

/* ============================================================
   双页模式
   ============================================================ */
.viewer-page.dual-page .ebook-frame {
  aspect-ratio: 16 / 9;
}
.viewer-page.dual-page .ebook-pages {
  position: relative;
  background: var(--ebook-bg, linear-gradient(135deg, #fef3c7, #fde68a));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
}
.viewer-page.dual-page .ebook-page-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
/* 双页中缝 */
.viewer-page.dual-page .ebook-pages::after {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 50%;
  width: 4px;
  margin-left: -2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.15) 30%,
    rgba(0, 0, 0, 0.25) 50%,
    rgba(0, 0, 0, 0.15) 70%,
    transparent 100%);
  pointer-events: none;
  z-index: 5;
}
.viewer-page.dual-page .ebook-empty,
.viewer-page.dual-page .ebook-page-error {
  grid-column: 1 / -1;
}
@media (max-width: 720px) {
  .viewer-page.dual-page .ebook-frame { aspect-ratio: 16 / 10; }
  .viewer-page.dual-page .ebook-pages {
    grid-template-columns: 1fr;
  }
  .viewer-page.dual-page .ebook-pages::after { display: none; }
}

/* ============================================================
   4 套背景色（应用在 .ebook-pages 区域）
   ============================================================ */
.viewer-page[data-bg="paper"] .ebook-pages { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.viewer-page[data-bg="sky"]   .ebook-pages { background: linear-gradient(135deg, #dbeafe, #93c5fd); }
.viewer-page[data-bg="mint"]  .ebook-pages { background: linear-gradient(135deg, #d1fae5, #6ee7b7); }
.viewer-page[data-bg="dark"]  .ebook-pages { background: linear-gradient(135deg, #1e293b, #475569); }
.viewer-page[data-bg="dark"] .ebook-page-tag { background: rgba(0, 0, 0, 0.7); }
.viewer-page[data-bg="dark"] .ebook-nav-btn { background: rgba(0, 0, 0, 0.6); }

/* ============================================================
   阅读模式（隐藏音频栏）
   ============================================================ */
.viewer-page.read-mode .audio-player { display: none; }
.viewer-page.read-mode .ebook-frame { aspect-ratio: 4 / 3; }

/* ============================================================
   字号变量（3 档）
   ============================================================ */
.viewer-page[data-font="sm"] .ebook-text { font-size: 13px; padding: 10px 14px; }
.viewer-page[data-font="md"] .ebook-text { font-size: 15px; padding: 14px 18px; }
.viewer-page[data-font="lg"] .ebook-text { font-size: 18px; padding: 16px 22px; }
.viewer-page[data-font="xl"] .ebook-text { font-size: 21px; padding: 18px 26px; }

/* ============================================================
   顶栏图标日间模式对比度
   ============================================================ */
.viewer-page.theme-day .viewer-bg-btn.is-active { border-color: #1e293b; }

/* ============================================================
   网页全屏模式（不离开网页，只把页面撑满 viewport）
   - 完全隐藏：navbar、viewer-topbar、viewer-sidebar、ebook-text
   - 只显示：ebook-frame（绘本画布） + audio-player（音频栏）
   - 画布自适应宽高（object-fit: contain），不被裁切
   - 提供最小化的浮动工具条（返回、退出全屏、暂停/播放）
   ============================================================ */
body.webscreen-active {
  overflow: hidden;
  background: #000;
}
body.webscreen-active #navbar { display: none !important; }
body.webscreen-active .viewer-topbar { display: none !important; }
/* 注：webscreen 模式下右侧侧栏保持可见（用户希望列表与播放器等高） */
body.webscreen-active .ebook-text { display: none !important; }

.viewer-page.webscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* 移动端动态视口 */
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: #000;
  margin: 0;
  padding: 0;
}
.viewer-page.webscreen .viewer-main {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  max-width: none;
  width: 100%;
  padding: 16px;
  margin: 0;
  background: #000;
  align-items: stretch;
}
.viewer-page.webscreen .viewer-stage {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  min-height: 0;
}
/* 全屏下侧栏与播放器等高 */
.viewer-page.webscreen .viewer-sidebar {
  height: 100%;
  max-height: 100%;
  position: static;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
}
.viewer-page.webscreen .viewer-ep-list {
  flex: 1 1 auto;
  overflow-y: auto;
  max-height: none;
}
@media (max-width: 900px) {
  .viewer-page.webscreen .viewer-main {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .viewer-page.webscreen .viewer-sidebar {
    height: 200px;
  }
}
.viewer-page.webscreen .ebook-frame {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
  border: none;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viewer-page.webscreen .ebook-pages {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  position: relative;
  padding: 0;
  margin: 0;
}
.viewer-page.webscreen .ebook-page-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.viewer-page.webscreen .ebook-nav-btn {
  /* 网页全屏下导航按钮大一点，方便触屏 */
  width: 56px;
  height: 56px;
  font-size: 24px;
}
.viewer-page.webscreen .ebook-page-tag {
  /* 网页全屏下页码放大 */
  font-size: 14px;
  padding: 6px 12px;
}
.viewer-page.webscreen .audio-player {
  flex: 0 0 auto;
  border-radius: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.95);
}

/* 网页全屏下双页也保持自适应 */
.viewer-page.webscreen.dual-page .ebook-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
}
.viewer-page.webscreen.dual-page .ebook-page-img {
  max-width: calc(50% - 4px);
  max-height: 100%;
}

/* 浮动工具条：返回 + 退出全屏 + 播放/暂停 */
.webscreen-fab-bar {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 80;
  display: flex;
  gap: 8px;
  pointer-events: none;
}
.webscreen-fab-bar > * {
  pointer-events: auto;
}
.webscreen-fab-bar button {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: none;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s;
}
.webscreen-fab-bar button:hover { background: rgba(99, 102, 241, 0.9); transform: scale(1.05); }
.webscreen-fab-bar button.is-playing { background: rgba(34, 197, 94, 0.85); }

/* 顶部右侧：退出全屏 + 侧栏按钮 */
.webscreen-fab-bar.is-right {
  left: auto;
  right: 12px;
}

/* 动画模式：去除 ebook-frame / audio-player / ebook-text 的高度贡献 */
.viewer-page.mode-video .audio-player,
.viewer-page.mode-video .ebook-text { display: none !important; }
.viewer-page.mode-video .video-frame { display: flex !important; }

/* ============================================================
   动画视频播放器（mode-video）
   - 默认：黑底居中，16:9 max-width，保留原生 controls
   - 全屏（webscreen）：撑满整个 viewport
   ============================================================ */
.video-frame {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 280px);
}
.video-el {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  outline: none;
}
.video-el::-webkit-media-controls-panel { background: rgba(0, 0, 0, 0.55); }

.video-upnext {
  position: absolute;
  right: 16px;
  bottom: 72px;
  z-index: 5;
  animation: video-upnext-in 0.25s ease-out;
}
@keyframes video-upnext-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.video-upnext-inner {
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 220px;
}
.video-upnext-title {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}
.video-upnext-sub {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

/* 网页全屏下 video 撑满 */
.viewer-page.webscreen .video-frame {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  border: none;
}
.viewer-page.webscreen .video-el { width: 100%; height: 100%; object-fit: contain; }
.viewer-page.webscreen .video-upnext { bottom: 80px; right: 24px; }

/* 视频框内的网页全屏按钮（hover 显示；动画模式专用，因为 audioFsBtn 在视频模式下被隐藏） */
.video-fs-btn {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  border: none;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease, transform 0.18s ease;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.video-fs-btn:hover {
  background: rgba(99, 102, 241, 0.9);
  transform: scale(1.08);
}
.video-frame:hover .video-fs-btn { opacity: 1; }
.video-fs-btn.is-active { background: rgba(99, 102, 241, 0.9); opacity: 1; }
/* 移动端直接显示 */
@media (hover: none) {
  .video-fs-btn { opacity: 0.85; }
}
/* 全屏模式下隐藏（避免和 FAB 重叠） */
.viewer-page.webscreen .video-fs-btn { display: none !important; }

/* 浮动工具条：返回 + 退出全屏 + 播放/暂停 */
.webscreen-fab-bar {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 80;
  display: flex;
  gap: 8px;
  pointer-events: none;
}
/* （修复）ebook-pages 的基础背景，由 JS 注入 --edge-bg 变量 */
.ebook-pages {
  background-color: transparent;
}
.ebook-pages.has-edge-bg {
  background-image: var(--edge-bg) !important;
  background-color: #000;
  transition: background-image 0.4s ease;
}

/* iconfont 通用兜底：让所有未接入 iconfont 的图标位置仍留出空间 */
.iconfont {
  font-style: normal;
  display: inline-block;
  text-align: center;
  vertical-align: middle;
}
.ebook-page-error .iconfont {
  margin-right: 6px;
  font-size: 18px;
  vertical-align: -2px;
}
.ebook-empty-icon .iconfont {
  font-size: inherit;
}
.viewer-loading-spinner .iconfont {
  font-size: 32px;
  animation: spin 1s linear infinite;
  display: inline-block;
}
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* iconfont 在彩色按钮里：自动跟随文字色 */
.viewer-tool-btn.active .iconfont,
.audio-ctrl-btn.active .iconfont {
  color: inherit;
}
