/* ==========================================================================
   追剧影视 · 前端增强补丁 样式表 (enhance.css)
   作用：①「我的」页面视觉美化 ②新增模块（继续观看 / 观影统计 / 收藏 / 快捷宫格）
        ③影片详情页收藏按钮 ④收藏夹与关于弹层
   说明：本文件通过 index.html 引入，不修改任何构建产物，可随删随用。
   命名约定：新增元素统一使用 enh- 前缀，避免与页面原有样式冲突。
   ========================================================================== */

/* ---------- 1. 全局变量与「我的」页面美化 ---------- */

:root {
  --enh-brand: #00be06;
  --enh-brand-dark: #00a805;
  --enh-radius: 16px;
  --enh-radius-sm: 12px;
  --enh-shadow: 0 2px 12px rgba(0, 0, 0, .06);
  --enh-shadow-hover: 0 6px 20px rgba(0, 0, 0, .1);
  --enh-text-1: #1a1a1a;
  --enh-text-2: #666;
  --enh-text-3: #999;
  --enh-bg: #f4f5f7;
  --enh-card: #fff;
  --enh-line: #f0f1f3;
}

/* 我的页整体底色更柔和 */
.user-page {
  background: var(--enh-bg) !important;
}

/* 顶部安全区兜底：App 未下发 immersive 高度时（如浏览器直开）避免昵称贴住状态栏。
   内联样式（immersed 有值时）优先级更高，会自动覆盖这里 */
.user-page .user-header-section {
  padding-top: 28px;
}

.user-page .user-header-section .header-actions {
  top: 28px;
  /* 关键修复：资料卡在 DOM 中排在按钮之后且同为定位元素，会盖住按钮吃掉点击，
     这里把按钮抬到资料卡之上，右上角「主题切换 / 退出登录」才点得动 */
  z-index: 30;
  /* 两个圆形按钮（站点主题 + 配色按钮）拉开间距，不再挤成一团 */
  gap: 6px;
}

/* 右上角圆形按钮统一收小到 38px，与缩小后的配色圆点视觉齐平 */
.user-page .user-header-section .header-actions .action-btn,
.user-page .user-header-section .header-actions .enh-theme-slot {
  width: 38px;
  height: 38px;
}

.user-page .user-header-section .header-actions .action-btn svg {
  font-size: 19px;
}

.user-page .user-header-section .header-actions .enh-theme-slot i {
  width: 20px;
  height: 20px;
}

/* 未登录态拥挤根因：站点把「立即登录」按钮横向排在资料卡右侧（space-between），
   而右上角图标是 absolute 定位（App 里 top=immersed+16、按钮 top=immersed+40），
   两者在垂直方向重叠 21px、水平方向也压在一起 —— 一眼看去就是挤成一坨。
   这里改成纵向排列：文案在上、按钮在下并左对齐，与右侧图标彻底错开。 */
.user-page .user-header-section .guest-profile {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.user-page .user-header-section .guest-profile .login-btn {
  margin-top: 14px;
  padding: 9px 26px;
  border: none;
  border-radius: 999px;
  /* 坑：站点自带是「绿底白字」，第 1158 行起主题配色又把底色改成 var(--th-solid)，
     而配色脚本 applyThemeColor 同时把 var(--enh-brand) 写成同一个主题色，
     于是「紫底 + 紫字」= 空胶囊，一个字都看不见。
     这里改用固定色：白底 + 深紫字，换任何主题都清晰。 */
  background: #fff !important;
  color: #5B21B6 !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .5px;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(60, 20, 140, .26);
  transition: transform .2s, box-shadow .2s;
}

/* 文字后补一个轻箭头，暗示可点击 */
.user-page .user-header-section .guest-profile .login-btn::after {
  content: "›";
  margin-left: 7px;
  font-size: 15px;
  font-weight: 700;
  vertical-align: -1px;
}

.user-page .user-header-section .guest-profile .login-btn:active {
  transform: scale(.96);
  box-shadow: 0 3px 10px rgba(60, 20, 140, .22);
}

/* ==========================================================================
   用户协议 / 隐私政策弹层（登录弹层里的两个 text-link 按钮，见 enhance.js）
   ========================================================================== */

.enh-agr {
  font-size: 13px;
  line-height: 1.9;
  color: var(--enh-text-2);
}

.enh-agr-meta {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 10px;
  border-radius: 8px;
  background: #f4f5f7;
  color: var(--enh-text-3);
  font-size: 12px;
}

.enh-agr h4 {
  margin: 18px 0 6px;
  padding-left: 9px;
  border-left: 3px solid var(--enh-brand);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--enh-text-1);
}

.enh-agr h4:first-of-type {
  margin-top: 6px;
}

.enh-agr p {
  margin: 0 0 8px;
}

.enh-agr ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

.enh-agr li {
  margin-bottom: 4px;
}

.enh-agr-foot {
  margin-top: 18px;
  padding: 12px;
  border-radius: 12px;
  background: #f7f8fa;
  color: var(--enh-text-3);
  font-size: 12px;
  line-height: 1.8;
}

body[arco-theme=dark] .enh-agr-meta,
body[arco-theme=dark] .enh-agr-foot {
  background: #26262a;
  color: #8a8a8f;
}

/* 登录态下资料卡没有绑定任何点击行为，去掉手型光标避免误导 */
.user-page .user-header-section .user-profile:not(.guest-profile) {
  cursor: default;
}

/* 顶部背景条：只加高，不再覆盖站点自带的 user-bg-light/dark.png
   —— 那张图是「主题切换」按钮最主要的视觉反馈，之前被 !important 盖掉了 */
.user-page .header-gradient {
  height: 190px !important;
}

/* 底部渐隐过渡交给底色变量，暗色下自动跟随，不会发白 */
.user-page .header-gradient::after {
  height: 110px !important;
  background: linear-gradient(to top, var(--enh-bg) 0%, transparent 100%) !important;
}

/* 头像：加白色描边 + 会员光环 */
.user-page .avatar-wrapper {
  width: 68px !important;
  height: 68px !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 4px 14px rgba(0, 0, 0, .18);
}

.user-page .avatar-wrapper::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255, 255, 255, .0), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0));
  animation: enh-halo 3.6s linear infinite;
  pointer-events: none;
  display: none;
}

.user-page .avatar-wrapper:has(.vip-badge)::before {
  display: block;
}

@keyframes enh-halo {
  to { transform: rotate(360deg); }
}

/* 昵称与副标题：顶部深色背景上要能看清 */
.user-page .user-profile .nickname,
.user-page .user-profile .nickname span {
  color: #fff !important;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .18);
}

.user-page .user-profile .desc {
  color: rgba(255, 255, 255, .88) !important;
}

.user-page .user-profile .vip-tag {
  box-shadow: 0 2px 8px rgba(255, 140, 0, .35);
}

/* 未登录态 */
.user-page .guest-profile .nickname,
.user-page .guest-profile .nickname span {
  color: #fff !important;
}

.user-page .guest-profile .desc {
  color: rgba(255, 255, 255, .85) !important;
}

.user-page .login-btn {
  background: #fff !important;
  color: var(--enh-brand) !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .14) !important;
}

/* 卡片统一圆角与阴影 */
.user-page .history-card,
.user-page .feature-grid,
.user-page .vip-card {
  border-radius: var(--enh-radius) !important;
  box-shadow: var(--enh-shadow) !important;
}

.user-page .vip-card {
  margin-top: 4px !important;
  overflow: hidden;
}

/* 功能宫格：与卡片同宽同圆角 */
.user-page .feature-grid {
  margin: 12px 12px 0 !important;
  padding: 10px 4px !important;
  gap: 4px !important;
}

.user-page .feature-icon {
  border-radius: 14px !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
}

.user-page .feature-item span {
  font-size: 12px;
  color: var(--enh-text-2) !important;
}

/* 历史卡片内部节奏 */
.user-page .history-header {
  border-bottom: 1px solid var(--enh-line) !important;
}

.user-page .item-cover {
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

.user-page .history-item:active .item-cover {
  transform: scale(.96);
}

/* ---------- 2. 继续观看大卡 ---------- */

.enh-continue {
  margin: 12px;
  border-radius: var(--enh-radius);
  overflow: hidden;
  position: relative;
  background: #111;
  box-shadow: var(--enh-shadow);
  cursor: pointer;
  animation: enh-rise .32s ease both;
}

.enh-continue:active { transform: scale(.985); }

.enh-continue-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(14px) brightness(.55);
  transform: scale(1.15);
}

.enh-continue-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .5) 55%, rgba(0, 0, 0, .35) 100%);
}

.enh-continue-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.enh-continue-cover {
  width: 106px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .1);
  position: relative;
}

.enh-continue-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.enh-continue-cover .enh-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .28);
}

.enh-continue-cover .enh-play i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--enh-brand);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  padding-left: 2px;
}

.enh-continue-info {
  flex: 1;
  min-width: 0;
  color: #fff;
}

.enh-continue-label {
  font-size: 11px;
  color: rgba(255, 255, 255, .7);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.enh-continue-label .enh-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #37e04b;
  box-shadow: 0 0 6px #37e04b;
}

.enh-continue-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.enh-continue-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, .78);
}

.enh-continue-bar {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .25);
  margin-top: 8px;
  overflow: hidden;
}

.enh-continue-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #37e04b, #00be06);
  border-radius: 2px;
}

.enh-continue-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, #37e04b, #00a805);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 168, 5, .35);
  white-space: nowrap;
}

/* ---------- 3. 观影统计卡 ---------- */

.enh-stats {
  margin: 12px;
  padding: 14px 4px;
  border-radius: var(--enh-radius);
  background: var(--enh-card);
  box-shadow: var(--enh-shadow);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  animation: enh-rise .32s ease both;
}

.enh-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

.enh-stat + .enh-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12%;
  height: 76%;
  width: 1px;
  background: var(--enh-line);
}

.enh-stat b {
  font-size: 19px;
  font-weight: 700;
  color: var(--enh-text-1);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.enh-stat b.enh-on {
  color: var(--enh-brand);
}

.enh-stat span {
  font-size: 11px;
  color: var(--enh-text-3);
}

/* ---------- 4. 我的收藏 ---------- */

.enh-fav-card {
  margin: 12px;
  border-radius: var(--enh-radius);
  background: var(--enh-card);
  box-shadow: var(--enh-shadow);
  overflow: hidden;
  animation: enh-rise .32s ease both;
}

.enh-fav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--enh-line);
  cursor: pointer;
}

.enh-fav-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--enh-text-1);
}

.enh-fav-title i {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(135deg, #ff9a3c, #ff5f6d);
  color: #fff;
  font-size: 12px;
  font-style: normal;
  display: flex;
  align-items: center;
  justify-content: center;
}

.enh-fav-more {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--enh-brand);
}

.enh-fav-body {
  padding: 4px 12px 14px;
}

.enh-fav-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  white-space: nowrap;
  padding-right: 12px;
  scrollbar-width: none;
}

.enh-fav-scroll::-webkit-scrollbar { display: none; }

.enh-fav-item {
  width: 96px;
  flex-shrink: 0;
  cursor: pointer;
}

.enh-fav-item .enh-fav-pic {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--enh-line);
  position: relative;
  margin-bottom: 6px;
}

.enh-fav-item .enh-fav-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.enh-fav-item .enh-fav-tag {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 10px;
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enh-fav-item .enh-fav-name {
  font-size: 12px;
  color: var(--enh-text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.enh-fav-empty {
  padding: 18px 0 22px;
  text-align: center;
  color: var(--enh-text-3);
  font-size: 13px;
  line-height: 1.9;
}

.enh-fav-empty b {
  color: var(--enh-brand);
  font-weight: 600;
}

/* ---------- 5. 详情页收藏按钮 ---------- */

.enh-detail-fav {
  position: fixed;
  right: 14px;
  bottom: 96px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .68);
  color: #fff;
  font-size: 10px;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  cursor: pointer;
  transition: transform .2s, background .2s;
  user-select: none;
}

.enh-detail-fav:active { transform: scale(.92); }

.enh-detail-fav.on {
  background: linear-gradient(135deg, #ff9a3c, #ff5f6d);
  box-shadow: 0 6px 18px rgba(255, 95, 109, .4);
}

.enh-detail-fav i {
  font-style: normal;
  font-size: 17px;
  line-height: 1;
}

/* 详情页底部提示条 */
.enh-toast {
  position: fixed;
  left: 50%;
  bottom: 30%;
  transform: translateX(-50%);
  z-index: 99999;
  max-width: 76%;
  padding: 10px 18px;
  border-radius: 22px;
  background: rgba(0, 0, 0, .82);
  color: #fff;
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
  animation: enh-toast-in .22s ease both;
  pointer-events: none;
}

@keyframes enh-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- 6. 通用弹层（收藏夹 / 关于） ---------- */

.enh-sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0, 0, 0, .5);
  display: flex;
  align-items: flex-end;
  animation: enh-fade .2s ease both;
}

@keyframes enh-fade { from { opacity: 0; } to { opacity: 1; } }

.enh-sheet {
  width: 100%;
  max-height: 76vh;
  background: var(--enh-card);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: enh-up .26s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes enh-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.enh-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--enh-line);
  flex-shrink: 0;
}

.enh-sheet-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--enh-text-1);
}

.enh-sheet-head span {
  font-size: 16px;
  color: var(--enh-text-3);
  cursor: pointer;
  padding: 2px 6px;
}

.enh-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  -webkit-overflow-scrolling: touch;
}

/* 收藏夹网格 */
.enh-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.enh-grid-item {
  position: relative;
}

.enh-grid-item .enh-grid-pic {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--enh-line);
  position: relative;
}

.enh-grid-item .enh-grid-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.enh-grid-item .enh-grid-del {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
  z-index: 2;
  cursor: pointer;
}

.enh-grid-item .enh-grid-name {
  margin-top: 6px;
  font-size: 12px;
  color: var(--enh-text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.enh-grid-item .enh-grid-sub {
  font-size: 11px;
  color: var(--enh-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.enh-sheet-empty {
  padding: 46px 0;
  text-align: center;
  color: var(--enh-text-3);
  font-size: 13px;
  line-height: 2;
}

/* 关于弹层列表 */
.enh-about-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 2px;
  border-bottom: 1px solid var(--enh-line);
  font-size: 14px;
  color: var(--enh-text-1);
}

.enh-about-row:last-child { border-bottom: none; }

.enh-about-row em {
  font-style: normal;
  color: var(--enh-text-3);
  font-size: 13px;
}

.enh-about-tip {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f7f8fa;
  color: var(--enh-text-2);
  font-size: 12px;
  line-height: 1.8;
}

/* ---------- 7. 通用动效与暗色适配 ---------- */

@keyframes enh-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.enh-hidden { display: none !important; }

/* ==========================================================================
   暗色模式
   站点的主题切换是通过 document.body.setAttribute('arco-theme','dark') 实现的
   （Arco Design 机制），所以这里必须以 body[arco-theme=dark] 为前缀，
   之前误写成 .dark 导致暗色适配从未生效。
   ========================================================================== */

/* 先重定义调色板变量，所有用到 var(--enh-*) 的规则自动跟随 */
body[arco-theme=dark] {
  --enh-bg: #16161A;
  --enh-card: #1C1C1E;
  --enh-line: #2A2A2E;
  --enh-text-1: #E8E8E8;
  --enh-text-2: #B0B0B5;
  --enh-text-3: #8A8A8F;
  --enh-shadow: 0 2px 12px rgba(0, 0, 0, .45);
  --enh-shadow-hover: 0 6px 20px rgba(0, 0, 0, .55);
}

/* 顶部渐变：暗色下压暗，避免一整块亮绿刺眼 */
body[arco-theme=dark] .user-page .header-gradient {
  background: linear-gradient(160deg, #106B22 0%, #0B4C18 55%, #073812 100%) !important;
}

body[arco-theme=dark] .user-page .header-gradient::after {
  background: linear-gradient(to top, #16161A 0%, rgba(22, 22, 26, .6) 45%, transparent 100%) !important;
}

/* 新增模块的暗色底色 */
body[arco-theme=dark] .enh-stats,
body[arco-theme=dark] .enh-fav-card,
body[arco-theme=dark] .enh-sheet,
body[arco-theme=dark] .enh-fav-scroll {
  background: #1C1C1E;
}

body[arco-theme=dark] .enh-stat b,
body[arco-theme=dark] .enh-fav-title,
body[arco-theme=dark] .enh-fav-item .enh-fav-name,
body[arco-theme=dark] .enh-sheet-head h3,
body[arco-theme=dark] .enh-grid-item .enh-grid-name,
body[arco-theme=dark] .enh-about-row {
  color: #E8E8E8;
}

body[arco-theme=dark] .enh-stat + .enh-stat::before,
body[arco-theme=dark] .enh-fav-head,
body[arco-theme=dark] .enh-sheet-head,
body[arco-theme=dark] .enh-about-row {
  border-color: #2A2A2E;
}

body[arco-theme=dark] .enh-stat span,
body[arco-theme=dark] .enh-grid-item .enh-grid-sub,
body[arco-theme=dark] .enh-about-row em {
  color: #8A8A8F;
}

body[arco-theme=dark] .enh-sheet-empty,
body[arco-theme=dark] .enh-fav-empty,
body[arco-theme=dark] .enh-fav-more {
  color: #8A8A8F;
}

body[arco-theme=dark] .enh-about-tip {
  background: #26262A;
  color: #B0B0B5;
}

body[arco-theme=dark] .enh-grid-item .enh-grid-pic,
body[arco-theme=dark] .enh-fav-item .enh-fav-pic {
  background: #26262A;
}

/* 签到卡：暗色下改用深绿底 */
body[arco-theme=dark] .enh-sign-card {
  background: linear-gradient(135deg, #1A2E20, #16301F) !important;
}

body[arco-theme=dark] .enh-sign-card.done {
  background: linear-gradient(135deg, #172A26, #142A25) !important;
}

body[arco-theme=dark] .enh-sign-title {
  color: #CBEBD6 !important;
}

body[arco-theme=dark] .enh-sign-sub {
  color: #7FA490 !important;
}

body[arco-theme=dark] .enh-sign-card.done .enh-sign-go {
  background: rgba(255, 255, 255, .08);
  color: #7FA490;
}

/* 继续观看卡在暗色下本来就深色，这里只把描边提亮一点 */
body[arco-theme=dark] .enh-continue {
  box-shadow: 0 2px 14px rgba(0, 0, 0, .5);
}

/* ---------- 8. 每日签到卡 / 邀请横幅 / 更新红点 ---------- */

.enh-sign-card {
  margin: 12px;
  padding: 14px 16px;
  border-radius: var(--enh-radius);
  background: linear-gradient(135deg, #eefaf0, #dcf5e4);
  box-shadow: var(--enh-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  animation: enh-rise .32s ease both;
}

.enh-sign-card:active { transform: scale(.985); }

.enh-sign-card.done {
  background: linear-gradient(135deg, #edf9f4, #e2f4ee);
}

.enh-sign-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.enh-sign-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #43D67F, #159E52);
  color: #fff;
  font-style: normal;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(21, 158, 82, .28);
}

.enh-sign-card.done .enh-sign-ico {
  background: linear-gradient(135deg, #34D399, #0E9B6E);
  box-shadow: 0 4px 12px rgba(14, 155, 110, .26);
}

.enh-sign-txt { min-width: 0; }

.enh-sign-title {
  font-size: 15px;
  font-weight: 600;
  color: #14532d;
  margin-bottom: 3px;
}

.enh-sign-sub {
  font-size: 12px;
  color: #4f7a5f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.enh-sign-go {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, #34D399, #00a805);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 168, 5, .3);
}

.enh-sign-card.done .enh-sign-go {
  background: rgba(0, 0, 0, .05);
  color: #7d8f84;
  box-shadow: none;
}

/* 邀请横幅 */
.enh-invite-bar {
  margin: 12px;
  padding: 14px 16px;
  border-radius: var(--enh-radius);
  background: linear-gradient(135deg, #6a5acd, #8a6fe8 55%, #b06ab3);
  box-shadow: 0 6px 18px rgba(106, 90, 205, .28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  animation: enh-rise .32s ease both;
}

.enh-invite-bar:active { transform: scale(.985); }

.enh-invite-bar-txt { min-width: 0; }

.enh-invite-bar-txt b {
  display: block;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 3px;
}

.enh-invite-bar-txt span {
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
}

.enh-invite-bar-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  background: #fff;
  color: #6a5acd;
  font-size: 13px;
  font-weight: 600;
}

/* 更新红点 */
.enh-badge {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 9px;
  background: #ff4d4f;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
  vertical-align: middle;
}

/* ---------- 9. 签到弹层 ---------- */

.enh-sign-top {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px 0 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--enh-line);
}

.enh-sign-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.enh-sign-item b {
  font-size: 20px;
  font-weight: 700;
  color: #00a805;
}

.enh-sign-item span {
  font-size: 11px;
  color: var(--enh-text-3);
}

.enh-cal-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--enh-text-1);
  margin: 14px 0 10px;
}

.enh-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.enh-cal-cell {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: #f4f5f7;
  color: #9aa0a6;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.enh-cal-cell.on {
  background: linear-gradient(135deg, #43D67F, #159E52);
  color: #fff;
  font-weight: 600;
}

.enh-cal-cell.today {
  box-shadow: 0 0 0 2px rgba(21, 158, 82, .45);
}

.enh-sign-btn {
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #34D399, #00a805);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 168, 5, .3);
}

.enh-sign-btn:active { transform: scale(.98); }

.enh-sign-btn[disabled] {
  background: #eceff1;
  color: #9aa0a6;
  box-shadow: none;
}

.enh-ex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.enh-ex-tip {
  font-size: 12px;
  color: var(--enh-text-3);
}

.enh-ex-btns {
  display: flex;
  gap: 8px;
}

.enh-ex-btns button {
  padding: 7px 14px;
  border-radius: 18px;
  border: 1px solid #c9ecd6;
  background: #f2fbf5;
  color: #0f8f4f;
  font-size: 13px;
  cursor: pointer;
}

.enh-ex-btns button:active { background: #e4f6ea; }

/* ---------- 10. 邀请弹层 ---------- */

.enh-invite-hero {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6a5acd, #b06ab3);
  color: #fff;
  font-size: 14px;
  text-align: center;
  margin-bottom: 16px;
}

.enh-invite-hero b { font-size: 18px; }

.enh-invite-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px dashed #c9b8f5;
  background: #faf8ff;
  margin-bottom: 12px;
}

.enh-invite-code span {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #6a5acd;
}

.enh-invite-code button {
  padding: 8px 14px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, #6a5acd, #b06ab3);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

.enh-invite-link {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f8fa;
  color: var(--enh-text-2);
  font-size: 12px;
  word-break: break-all;
  margin-bottom: 12px;
  cursor: pointer;
}

.enh-invite-stat {
  text-align: center;
  font-size: 13px;
  color: var(--enh-text-2);
  margin-bottom: 14px;
}

.enh-invite-stat b {
  color: #ff7a45;
  font-size: 16px;
}

@media only screen and (max-width: 340px) {
  .enh-continue-cover { width: 88px; height: 54px; }
  .enh-stat b { font-size: 17px; }
  .enh-sign-go { padding: 7px 12px; font-size: 12px; }
}

/* ==========================================================================
   主题配色（可切换渐变皮肤）
   --------------------------------------------------------------------------
   默认「森林绿」不干预站点原有样式（保留站点自带的 user-bg 背景图）；
   选择其它配色时 enhance.js 会给 body 加 .enh-theme-custom 并注入 --th-* 变量，
   下面这些规则才会生效。
   ========================================================================== */

/* ---------- 顶部渐变 ---------- */
body.enh-theme-custom .user-page .header-gradient {
  background-image: var(--th-grad) !important;
}

/* ---------- 「我的」页绿色点缀 ---------- */
body.enh-theme-custom .user-page .header-left .header-icon,
body.enh-theme-custom .user-page .view-all,
body.enh-theme-custom .user-page .header-left .header-icon svg,
body.enh-theme-custom .user-page .view-all svg {
  color: var(--th-solid) !important;
}

body.enh-theme-custom .user-page .progress-bar .progress-inner {
  background: var(--th-solid) !important;
}

body.enh-theme-custom .user-page .login-btn {
  background: var(--th-solid) !important;
  box-shadow: 0 2px 6px var(--th-shadow) !important;
}

/* ---------- 底部导航选中态 ---------- */
body.enh-theme-custom .nav-item.active,
body.enh-theme-custom .nav-item.active svg,
body.enh-theme-custom .nav-item.active .icon {
  color: var(--th-solid) !important;
}

/* ---------- 播放页选中态（源 / 选集 / 线路 / 倍速 / 比例） ---------- */
body.enh-theme-custom .source-tab.active,
body.enh-theme-custom .mobile-episode-item.playing,
body.enh-theme-custom .pc-episode-item.playing,
body.enh-theme-custom .modal-episode-item.playing,
body.enh-theme-custom .episode-item.active,
body.enh-theme-custom .speed-item.active,
body.enh-theme-custom .ratio-item.active,
body.enh-theme-custom .route-item.active,
body.enh-theme-custom .apply-btn {
  border-color: var(--th-solid) !important;
}

body.enh-theme-custom .source-tab.active,
body.enh-theme-custom .mobile-episode-item.playing,
body.enh-theme-custom .pc-episode-item.playing,
body.enh-theme-custom .modal-episode-item.playing,
body.enh-theme-custom .episode-item.active,
body.enh-theme-custom .apply-btn,
body.enh-theme-custom .route-icon.active,
body.enh-theme-custom .route-badge {
  background-color: var(--th-solid) !important;
  background-image: none !important;
}

body.enh-theme-custom .speed-item.active,
body.enh-theme-custom .ratio-item.active,
body.enh-theme-custom .route-status.active {
  color: var(--th-solid) !important;
}

/* ---------- 首页 / 分类选中态 ---------- */
body.enh-theme-custom .category-tab.active,
body.enh-theme-custom .tab-item.active,
body.enh-theme-custom .search-button,
body.enh-theme-custom .more-btn:hover,
body.enh-theme-custom .refresh-btn:hover:not(:disabled) {
  background: var(--th-solid) !important;
  border-color: var(--th-solid) !important;
}

body.enh-theme-custom .category-tab.active,
body.enh-theme-custom .search-button {
  color: #fff !important;
}

/* ---------- 登录 / 会员 ---------- */
body.enh-theme-custom .primary-btn,
body.enh-theme-custom .confirm-btn {
  background: linear-gradient(135deg, var(--th1), var(--th2)) !important;
}

body.enh-theme-custom .auth-tab.active,
body.enh-theme-custom .text-link,
body.enh-theme-custom .login-header h2,
body.enh-theme-custom .progress-text {
  color: var(--th-solid) !important;
}

body.enh-theme-custom .auth-tab.active::after {
  background: var(--th-solid) !important;
}

body.enh-theme-custom .form-field input:focus {
  border-color: var(--th-solid) !important;
}

/* ---------- 我的增强模块跟随主题 ---------- */
body.enh-theme-custom .enh-sign-card {
  background: linear-gradient(135deg, var(--th-soft), #FFFFFF) !important;
}

body.enh-theme-custom .enh-sign-ico,
body.enh-theme-custom .enh-sign-go,
body.enh-theme-custom .enh-sign-btn {
  background: linear-gradient(135deg, var(--th1), var(--th2)) !important;
}

body.enh-theme-custom .enh-sign-title {
  color: var(--th2) !important;
}

body.enh-theme-custom .enh-sign-item b,
body.enh-theme-custom .enh-stat b.enh-on {
  color: var(--th-solid) !important;
}

body.enh-theme-custom .enh-continue-btn {
  background: linear-gradient(135deg, var(--th1), var(--th2)) !important;
  box-shadow: 0 4px 12px var(--th-shadow) !important;
}

body.enh-theme-custom .enh-continue-bar i {
  background: linear-gradient(90deg, var(--th1), var(--th2)) !important;
}

/* ---------- 主题按钮 ---------- */
.enh-theme-slot {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .2s;
}

.enh-theme-slot:active {
  transform: scale(.92);
}

.enh-theme-slot i {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .9);
  background: var(--th-grad-current, conic-gradient(#17C93A, #3B9DFF, #14B8B8, #3EE8B4, #F7B733, #FF9A3C, #F2394E, #FF6FA5, #7C5CFC, #6366F1, #2C4478, #B4763F, #17C93A));
  font-style: normal;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08) inset;
}

/* ---------- 主题选择面板 ---------- */
.enh-themes {
  display: flex;
  flex-wrap: wrap;
}

.enh-theme-item {
  width: 33.333%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
  cursor: pointer;
}

.enh-theme-swatch {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  position: relative;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .16);
  transition: transform .2s;
}

.enh-theme-item:active .enh-theme-swatch {
  transform: scale(.94);
}

.enh-theme-item.on .enh-theme-swatch {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--th-solid), 0 8px 18px rgba(0, 0, 0, .18);
}

.enh-theme-check {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  background: #fff;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.enh-theme-name {
  margin-top: 10px;
  font-size: 12px;
  color: var(--enh-text-2);
}

.enh-theme-item.on .enh-theme-name {
  color: var(--th-solid);
  font-weight: 600;
}

.enh-theme-tip {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border-radius: 12px;
  background: #f7f8fa;
  color: var(--enh-text-3);
  font-size: 12px;
  line-height: 1.8;
}

body[arco-theme=dark] .enh-theme-tip {
  background: #26262a;
  color: #8a8a8f;
}

/* ==========================================================================
   首页「白天模式 / 历史观看」双卡：统一规格
   --------------------------------------------------------------------------
   站点原样式的两处不协调（都出在垂直方向）：
   ① .domain-box 是 flex 容器，.left 被默认的 align-items:stretch 拉高到
      「右卡高度 + 右卡自带的 12px margin-bottom」，左卡底边比右卡低 12px；
   ② 左卡不是 flex，内容从顶部 15px 内边距起排；右卡 align-items:center 垂直居中
      —— 两卡文字一高一低，整块看上去上重下轻。
   另外左卡标题 20px / 右卡 16px、内边距 15px / 18px 也不一致。
   这里统一：同高、同内边距、同字号节奏，内容都垂直居中。
   ========================================================================== */

.domain-box[data-v-928a85c8] {
  align-items: stretch;
}

/* 两张卡：同高 / 同内边距 / 同圆角 */
.domain-box[data-v-928a85c8] > .left,
.domain-box[data-v-928a85c8] > .right > .history {
  box-sizing: border-box;
  min-height: 84px;
  padding: 15px 16px;
  border-radius: var(--enh-radius-sm);
}

/* 左卡：内容垂直居中（背景图绝对定位铺满，不受 flex 影响） */
.domain-box[data-v-928a85c8] > .left {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 右卡：清掉自带的下外边距，右列高度 = 卡片高度，两卡底边才真正齐平 */
.domain-box[data-v-928a85c8] > .right > .history {
  margin-bottom: 0;
}

/* 标题 / 副标题：两卡字号、行高、间距统一 */
.domain-box[data-v-928a85c8] > .left p,
.domain-box[data-v-928a85c8] > .right > .history p {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 4px;
}

.domain-box[data-v-928a85c8] > .left span,
.domain-box[data-v-928a85c8] > .right > .history span {
  font-size: 11px;
  line-height: 1.2;
}
