/* ---------------- 用户端公共 ---------------- */

.user-body { padding-bottom: 30px; }

.user-topbar { gap: 12px; flex-wrap: wrap; }

.user-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.user-nav::-webkit-scrollbar { display: none; }
.user-nav a {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.user-nav a:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.user-nav a.active { color: #fff; background: var(--accent-soft); }

.user-actions { gap: 8px; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 180px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
}
.user-chip.guest { padding: 6px 13px; color: #ffb27a; border-color: rgba(255, 106, 0, .28); background: var(--accent-soft); }
.user-avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7a18, #ff5400);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}
.user-name {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vip-dot {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 5px;
  background: linear-gradient(135deg, #ffd166, #ff9f1c);
  color: #3b2500;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .3px;
}
.free-dot {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 5px;
  background: linear-gradient(135deg, #7ef0c0, #2ec98a);
  color: #053a27;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .3px;
}
.user-logout { color: var(--muted); font-size: 12px; white-space: nowrap; }
.user-logout:hover { color: #ff9b9b; }

.user-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 0;
}

.user-footer { max-width: 1100px; }

.uc-alert {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid;
}
.uc-alert.ok { color: #9df0c2; background: rgba(51, 195, 122, .1); border-color: rgba(51, 195, 122, .3); }
.uc-alert.err { color: #ffb3b3; background: rgba(255, 93, 93, .1); border-color: rgba(255, 93, 93, .3); }

/* ---------------- 登录 / 注册 ---------------- */

.auth-wrap {
  max-width: 420px;
  margin: 8vh auto 20px;
}
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
}
.auth-title { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.auth-sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  color: #c8cfda;
  font-size: 13px;
}
.auth-form input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  outline: none;
}
.auth-form input:focus { border-color: var(--accent); }
.auth-submit {
  width: 100%;
  margin-top: 4px;
  padding: 11px 14px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, #ff7a18, #ff5400);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 106, 0, .26);
}
.auth-submit:hover { filter: brightness(1.06); }
.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}
.auth-links a { color: #ffb27a; }

/* ---------------- 用户中心 ---------------- */

.uc-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 106, 0, .12), var(--panel) 46%);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 16px;
}
.uc-avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7a18, #ff5400);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  flex: 0 0 auto;
}
.uc-identity { min-width: 0; flex: 1 1 220px; }
.uc-identity h1 { margin: 0; font-size: 21px; line-height: 1.3; }
.uc-identity .uc-sub { margin-top: 4px; color: var(--muted); font-size: 12px; }
.uc-vip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255, 176, 32, .3);
  background: rgba(255, 176, 32, .1);
  color: #ffd28a;
}
.uc-vip.none { color: var(--muted); border-color: var(--line); background: var(--panel-2); }
.uc-vip.free {
  color: #86f0c4;
  border-color: rgba(46, 201, 138, .35);
  background: rgba(46, 201, 138, .12);
}

.uc-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}
.uc-stat {
  padding: 12px;
  border-radius: 11px;
  background: rgba(0, 0, 0, .18);
  border: 1px solid rgba(255, 255, 255, .06);
}
.uc-stat span { display: block; color: var(--muted); font-size: 12px; }
.uc-stat b { display: block; margin-top: 3px; font-size: 20px; }

.uc-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.uc-tabs a {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
}
.uc-tabs a:hover { color: var(--text); }
.uc-tabs a.active { color: #fff; border-color: rgba(255, 106, 0, .5); background: var(--accent-soft); }

.uc-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.uc-panel h2 { margin: 0 0 4px; font-size: 16px; }
.uc-panel .uc-desc { margin: 0 0 16px; color: var(--muted); font-size: 13px; }

.uc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.uc-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 13px; color: #c8cfda; }
.uc-field input,
.uc-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  outline: none;
}
.uc-field textarea { min-height: 110px; resize: vertical; }
.uc-field input:focus,
.uc-field textarea:focus { border-color: var(--accent); }
.uc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.uc-btn:hover { border-color: #3a4453; }
.uc-btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #ff7a18, #ff5400);
  color: #fff;
  box-shadow: 0 5px 16px rgba(255, 106, 0, .25);
}
.uc-btn.danger { color: #ff9b9b; border-color: rgba(255, 93, 93, .3); }
.uc-btn.mini { min-height: 28px; padding: 4px 10px; font-size: 12px; }

.uc-list { display: flex; flex-direction: column; gap: 10px; }
.uc-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 11px;
  background: var(--panel-2);
  border: 1px solid transparent;
}
.uc-item:hover { border-color: var(--line); }
.uc-poster {
  width: 58px;
  height: 78px;
  flex: 0 0 auto;
  border-radius: 7px;
  overflow: hidden;
  background: #11151c;
}
.uc-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.uc-poster .ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  color: #5f6b7a;
  font-size: 20px;
  font-weight: 700;
}
.uc-info { flex: 1 1 auto; min-width: 0; }
.uc-info h3 { margin: 1px 0 4px; font-size: 14px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-meta { color: var(--muted); font-size: 12px; line-height: 1.7; }
.uc-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; justify-content: center; flex: 0 0 auto; }
.uc-actions form { margin: 0; }

.uc-progress {
  height: 4px;
  margin-top: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.uc-progress i { display: block; height: 100%; background: linear-gradient(90deg, #ff7a18, #ff5400); }

.uc-empty { padding: 36px 10px; text-align: center; color: var(--muted); font-size: 13px; }

.uc-feedback {
  padding: 12px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.uc-feedback .uc-fb-head { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.uc-feedback .uc-fb-content { white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.uc-feedback .uc-fb-reply {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(51, 195, 122, .08);
  border: 1px solid rgba(51, 195, 122, .2);
  color: #bfe9d2;
  font-size: 12px;
  white-space: pre-wrap;
}

.uc-code {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px dashed rgba(255, 106, 0, .45);
  color: #ffb27a;
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: 1px;
}

/* ---------------- 公告 ---------------- */

.site-announce {
  max-width: 1280px;
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 106, 0, .08);
  border: 1px solid rgba(255, 106, 0, .22);
  color: #ffd0ae;
  font-size: 13px;
}
.site-announce .sa-label {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 5px;
  background: rgba(255, 106, 0, .2);
  color: #ffb27a;
  font-size: 11px;
  font-weight: 700;
}
.site-announce .sa-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-announce a { color: #ffb27a; white-space: nowrap; }
.site-announce .sa-close {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #c79a7b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.site-announce .sa-close:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.ann-list { display: flex; flex-direction: column; gap: 12px; }
.ann-item {
  padding: 18px;
  border-radius: 13px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.ann-item h2 { margin: 0 0 5px; font-size: 17px; }
.ann-time { color: var(--muted); font-size: 12px; }
.ann-content { margin-top: 10px; color: #c8cfda; font-size: 13px; line-height: 1.85; white-space: pre-wrap; word-break: break-word; }

/* ---------------- 收藏按钮 / 试看限制 ---------------- */

.fav-btn.fav-active {
  color: #ffd28a;
  border-color: rgba(255, 176, 32, .45);
  background: rgba(255, 176, 32, .12);
}

.guest-gate {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 8, 12, .72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.guest-gate.show { opacity: 1; visibility: visible; }
.gg-card {
  width: min(420px, 100%);
  padding: 22px 20px;
  border-radius: 14px;
  background: rgba(24, 29, 38, .97);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
  text-align: center;
}
.gg-card h3 { margin: 0 0 8px; font-size: 19px; }
.gg-card p { margin: 0 0 16px; color: #aab3c2; font-size: 13px; line-height: 1.7; }
.gg-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.gg-actions .btn { padding: 8px 15px; font-size: 13px; }
.gg-actions .btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .15); }

@media (max-width: 720px) {
  .topbar:not(.user-topbar) .user-name,
  .topbar:not(.user-topbar) .user-logout { display: none; }
  .topbar #siteSelect { max-width: 108px; }
  .user-topbar { padding: 9px 12px; gap: 8px; }
  .user-nav { margin-left: 0; order: 3; width: 100%; }
  .user-actions { margin-left: auto; }
  .user-name { max-width: 72px; }
  .user-main { padding: 14px 12px 0; }
  .auth-wrap { margin-top: 5vh; }
  .auth-card { padding: 20px; }
  .uc-hero { padding: 16px; gap: 12px; }
  .uc-avatar { width: 52px; height: 52px; font-size: 21px; }
  .uc-identity h1 { font-size: 18px; }
  .uc-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .uc-stat { padding: 9px; }
  .uc-stat b { font-size: 17px; }
  .uc-panel { padding: 14px; }
  .uc-poster { width: 50px; height: 68px; }
  .uc-actions { gap: 4px; }
  .site-announce { margin: 8px 12px 0; }
  .site-announce .sa-text { white-space: normal; }
}

/* 移动端用户中心：与首页统一的 App 化布局，并为底部导航留出空间 */
@media (max-width: 760px) {
  .user-body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .user-topbar { padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .user-topbar .user-nav { display: none; }
  .user-main { max-width: none; padding: 12px 12px 0; }
  .user-footer { display: none; }

  .uc-hero { padding: 14px; gap: 12px; border-radius: 14px; }
  .uc-avatar { width: 54px; height: 54px; font-size: 22px; }
  .uc-identity h1 { font-size: 18px; }
  .uc-identity .uc-sub { font-size: 11px; }
  .uc-stats { gap: 6px; }
  .uc-stat { padding: 10px; border-radius: 9px; }
  .uc-stat span { font-size: 11px; }
  .uc-stat b { font-size: 17px; }

  .uc-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .uc-tabs::-webkit-scrollbar { display: none; }
  .uc-tabs a { flex: 0 0 auto; padding: 6px 12px; font-size: 12px; }
  .uc-panel { padding: 14px; border-radius: 14px; }
  .uc-item { padding: 10px; gap: 10px; border-radius: 12px; }
  .uc-poster { width: 58px; height: 78px; }
  .uc-actions { flex-direction: row; align-items: center; gap: 4px; }
  .uc-btn { min-height: 32px; padding: 6px 10px; font-size: 12px; }
  .uc-btn.mini { min-height: 26px; }
  /* 避免 iOS 聚焦输入框时自动放大 */
  .uc-field input,
  .uc-field textarea,
  .auth-form input { font-size: 16px; }

  .auth-wrap { margin-top: 3vh; padding: 0 12px 20px; }
  .auth-card { width: 100%; padding: 18px; border-radius: 16px; }
  .auth-form input { height: 46px; }
  .auth-submit { height: 46px; font-size: 15px; }
}

/* ---------------- 观看权限：弹窗与播放页权限墙 ---------------- */

.perm-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}
.perm-mask {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 11, .66);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.perm-dialog {
  position: relative;
  width: min(420px, 100%);
  padding: 24px 22px 20px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .42);
  text-align: center;
  color: var(--text);
}
.perm-dialog h3 { margin: 0 0 8px; font-size: 19px; }
.perm-dialog p { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.perm-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.perm-actions .btn { padding: 8px 15px; font-size: 13px; }
.perm-actions .btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }

.perm-wall {
  display: grid;
  place-items: center;
  min-height: 52vh;
  padding: 30px 0;
}
.perm-card {
  width: min(460px, 100%);
  padding: 32px 26px 26px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: center;
}
.perm-lock {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
}
.perm-card h2 { margin: 0 0 6px; font-size: 20px; color: var(--text); }
.perm-name { margin-bottom: 6px; color: var(--text); font-size: 13px; font-weight: 600; }
.perm-card p { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
