/* ============================================
   Profile Tab - 个人中心（对标设计稿 V2）
   ============================================ */

#tab-profile {
  background: var(--bg-primary);
  padding-bottom: calc(var(--tabbar-height, 52px) + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}

/* ---- 顶部导航栏（与 For You 一致）---- */
.profile-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 16px;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.profile-nav-home {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.profile-home-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.profile-nav-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.profile-nav-spacer {
  width: 36px;
}

/* ---- 用户信息区 ---- */
.profile-user-section {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 18px 8px;
}

/* 方形头像 — 蓝色边框 */
.profile-avatar-box {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 11px;
}

.profile-user-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-username {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-svip-badge {
  height: 22px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  vertical-align: middle;
}

.profile-uid {
  font-size: 13px;
  color: #F5F5F5;
  margin: 0;
  line-height: 1.2;
}

/* ---- 订阅卡片（Unlock All Episodes）---- */
.subscribe-card {
  margin: 14px 16px 0;
  background: url('../assets/images/subscribe.png') center/cover no-repeat;
  border-radius: 14px;
  padding: 20px 18px;
  min-height: 100px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}

.subscribe-card:active {
  transform: scale(0.98);
}

.subscribe-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.subscribe-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.subscribe-btn {
  align-self: flex-start;
  padding: 7px 28px;
  background: #fff;
  color: #4C84FB;
  border: none;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.subscribe-btn:active {
  transform: scale(0.95);
  background: #f0f0f0;
}

/* 已订阅状态 */
.subscribe-card.subscribed {
  border: none;
}

.subscribe-card.subscribed .subscribe-title {
  color: #F5A623;
}

.subscribe-card.subscribed .subscribe-btn {
  background: linear-gradient(135deg, #F5A623, #E8940C);
  color: #fff;
}

/* ---- My Wallet 钱包卡片 ---- */
.wallet-card {
  margin: 14px 16px 0;
  background: #2B2D3C;
  border-radius: 14px;
  padding: 16px 18px;
}

.wallet-label {
  font-size: 13px;
  font-weight: 600;
  color: #999;
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}

.wallet-divider {
  height: 1px;
  background: #5A5A5A;
  margin: 0 8px 12px;
}

.wallet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wallet-balance {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wallet-coin-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.wallet-amount {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.wallet-refill-btn {
  padding: 6px 20px;
  background: #fff;
  color: #4C84FB;
  border: none;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wallet-refill-btn:active {
  transform: scale(0.95);
}

/* ---- 功能入口列表 ---- */
.profile-menu-list {
  margin: 18px 16px 0;
  border-radius: 14px;
  overflow: hidden;
}

.pm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease;
}

.pm-item:last-child {
  border-bottom: none;
}

.pm-item:active {
  background: rgba(255,255,255,0.04);
}

.pm-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pm-icon {
  color: #aaa;
  flex-shrink: 0;
}

.pm-label {
  font-size: 16px;
  font-weight: 500;
  color: #E8E8E8;
}

.pm-arrow {
  color: #555;
  flex-shrink: 0;
}


/* ============================================
   Profile 子页面通用样式
   ============================================ */

.sub-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  animation: sub-page-in 0.25s ease;
}

@keyframes sub-page-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.sub-page.hidden {
  display: none !important;
}

.sub-page-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 16px;
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  background: rgba(10,10,10,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.sub-back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

.sub-nav-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.sub-page-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* ---- 空状态 ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
}

.empty-state p {
  font-size: 14px;
  color: #666;
  margin: 0;
}

/* ---- 收藏列表：三列网格卡片（复用 drama-card） ---- */
#favorites-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 10px 32px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  align-content: start;
}

#favorites-list .empty-state,
#playlist-list .empty-state {
  grid-column: 1 / -1;
  min-height: 50vh;
  padding: 0;
}
#favorites-list .drama-card {
  width: 100%;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.15s ease;
  background: transparent;
}

#favorites-list .drama-card:active {
  transform: scale(0.97);
}

#favorites-list .card-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  height: auto;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: #1c1c1e;
}

#favorites-list .card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#favorites-list .card-title {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  padding: 0 2px;
}

#favorites-list .card-ep {
  font-size: 11px;
  font-weight: 400;
  color: #6E6E6E;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  padding: 0 2px;
  margin-top: 2px;
}

#favorites-list .card-badge {
  display: none;
}

/* ---- 播放历史：三列网格卡片（复用 drama-card） ---- */
#playlist-list .drama-card {
  width: 100%;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.15s ease;
  background: transparent;
}

#playlist-list .drama-card:active {
  transform: scale(0.97);
}

#playlist-list .card-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  height: auto;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: #1c1c1e;
}

#playlist-list .card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#playlist-list .card-title {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  padding: 0 2px;
}

#playlist-list .card-ep {
  font-size: 11px;
  font-weight: 400;
  color: #6E6E6E;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  padding: 0 2px;
  margin-top: 2px;
}

#playlist-list .card-badge {
  display: none;
}

/* ---- 语言设置页 ---- */
/* 语言页导航 — 标题居中 */
.lang-nav {
  position: relative;
}

.lang-nav-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* Language 分区标题 */
.lang-section-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  padding: 20px 16px 8px;
}

.lang-list {
  padding: 0;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease;
}

.lang-option:last-child {
  border-bottom: none;
}

.lang-option:active {
  background: rgba(255,255,255,0.04);
}

.lang-name {
  font-size: 15px;
  color: #E8E8E8;
}

.lang-check {
  font-size: 18px;
  color: #3B82F6;
  font-weight: 700;
}

.lang-option:not(.active) .lang-check {
  visibility: hidden;
}

.lang-option.active .lang-name {
  color: #3B82F6;
  font-weight: 600;
}

/* ---- 隐私政策页 ---- */
.privacy-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  padding-bottom: 30px;
  line-height: 1.75;
}

.privacy-content h2 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 24px 0 10px;
}

.privacy-content p {
  font-size: 14px;
  color: #aaa;
  margin: 0 0 12px;
}

.privacy-placeholder {
  text-align: center;
  color: #666;
  font-size: 14px;
  padding: 80px 20px;
}
