/* ZG-137 D 包：黑桃前台付费观看样式（会员角标、选集锁、播放器遮罩、登录注册、个人中心、回跳确认页）。
   只在付费总开关打开时由模板引入；关着时页面不引用本文件。
   颜色沿用两套模板 main.css 的变量，取不到时用同值兜底（播放器页没有引 main.css）。 */

.pw-badge {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--brand, #ffb020), var(--brand-2, #ff7a45));
  color: var(--brand-ink, #1a1205);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: 1px;
  vertical-align: middle;
  white-space: nowrap;
}
.m-item .thumb { position: relative; }
.m-item .thumb .pw-badge-tl {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.pw-title-badge { margin-left: 8px; font-size: 13px; line-height: 22px; position: relative; top: -2px; }

.pw-tip-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 10px 0 0;
  padding: 8px 12px;
  border: 1px solid rgba(255, 176, 32, .35);
  border-radius: var(--radius-sm, 6px);
  background: rgba(255, 176, 32, .08);
  color: var(--txt-2, #a3aabd);
  font-size: 13px;
  line-height: 1.6;
}
.pw-tip-bar strong { color: var(--brand, #ffb020); font-weight: 600; }
.pw-tip-bar a { color: var(--brand, #ffb020); text-decoration: underline; text-underline-offset: 2px; }

/* 选集里的锁：只加一个小锁形图标，不改原来格子的尺寸 */
.pw-lock {
  display: inline-block;
  width: 10px;
  height: 12px;
  margin-left: 4px;
  vertical-align: -1px;
  opacity: .75;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Cpath fill='none' stroke='%23ffb020' stroke-width='1.4' d='M2.5 5V3.5a2.5 2.5 0 0 1 5 0V5'/%3E%3Crect x='.7' y='5' width='8.6' height='6.3' rx='1.3' fill='%23ffb020'/%3E%3C/svg%3E");
}
.pw-free {
  display: inline-block;
  margin-left: 4px;
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(64, 196, 120, .16);
  color: #5fd394;
  font-size: 11px;
  line-height: 16px;
  font-style: normal;
  vertical-align: 1px;
}

/* 头部登录入口 */
.pw-head-user { display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }
.pw-head-user a { color: var(--txt-2, #a3aabd); }
.pw-head-user a:hover, .pw-head-user a:focus-visible { color: var(--brand, #ffb020); }
.pw-head-user .pw-head-vip { color: var(--brand, #ffb020); font-weight: 600; }
.pw-head-user .pw-head-name { max-width: 9em; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
.head-bar .pw-head-user { flex: none; order: 2; }
.ys-header-bar .pw-head-user { flex: none; margin-left: 10px; gap: 6px; font-size: 13px; }
.ys-header-bar .pw-head-user .pw-badge { padding: 0 4px; font-size: 11px; line-height: 18px; letter-spacing: 0; }

/* ===== 页面容器 ===== */
.pw-page { max-width: 960px; margin: 24px auto 40px; padding: 0 16px; color: var(--txt, #e9ecf3); }
.pw-page-narrow { max-width: 420px; }
.pw-card {
  background: var(--bg-2, #141823);
  border: 1px solid var(--line, #262d3f);
  border-radius: var(--radius, 10px);
  padding: 24px;
}
.pw-card + .pw-card { margin-top: 16px; }
.pw-card h1, .pw-card h2 { margin: 0 0 16px; font-size: 20px; line-height: 1.4; color: var(--txt, #e9ecf3); font-weight: 600; }
.pw-card h2 { font-size: 17px; }
.pw-sub { margin: -8px 0 18px; color: var(--txt-3, #6f7789); font-size: 13px; line-height: 1.7; }
.pw-muted { color: var(--txt-3, #6f7789); }

/* 表单 */
.pw-form .pw-field { margin-bottom: 14px; }
.pw-form label { display: block; margin-bottom: 6px; color: var(--txt-2, #a3aabd); font-size: 13px; }
.pw-form input[type="text"], .pw-form input[type="password"] {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  box-sizing: border-box;
  border: 1px solid var(--line, #262d3f);
  border-radius: var(--radius-sm, 6px);
  background: var(--bg, #0d0f14);
  color: var(--txt, #e9ecf3);
  font-size: 16px;
  outline: none;
  transition: border-color .15s;
}
.pw-form input:focus { border-color: var(--brand, #ffb020); }
.pw-form .pw-hint { margin-top: 5px; color: var(--txt-3, #6f7789); font-size: 12px; line-height: 1.5; }
.pw-verify-row { display: flex; gap: 10px; align-items: stretch; }
.pw-verify-row input { flex: 1; min-width: 0; }
.pw-verify-img {
  flex: none;
  width: 112px;
  height: 44px;
  border: 1px solid var(--line, #262d3f);
  border-radius: var(--radius-sm, 6px);
  background: #fff;
  cursor: pointer;
  object-fit: cover;
}
.pw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  box-sizing: border-box;
  border: 0;
  border-radius: var(--radius-sm, 6px);
  background: linear-gradient(135deg, var(--brand, #ffb020), var(--brand-2, #ff7a45));
  color: var(--brand-ink, #1a1205);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s, opacity .15s;
}
.pw-btn:hover, .pw-btn:focus-visible { filter: brightness(1.06); color: var(--brand-ink, #1a1205); }
.pw-btn[disabled], .pw-btn.is-busy { opacity: .55; cursor: default; filter: none; }
.pw-btn-block { display: flex; width: 100%; }
.pw-btn-ghost {
  background: transparent;
  border: 1px solid var(--line, #262d3f);
  color: var(--txt, #e9ecf3);
}
.pw-btn-ghost:hover, .pw-btn-ghost:focus-visible { border-color: var(--brand, #ffb020); color: var(--brand, #ffb020); filter: none; }
.pw-msg { min-height: 20px; margin: 2px 0 12px; font-size: 13px; line-height: 1.6; color: #ff6b6b; }
.pw-msg.is-ok { color: #5fd394; }
.pw-msg:empty { min-height: 0; margin: 0; }
.pw-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 13px; color: var(--txt-3, #6f7789); }
.pw-links a { color: var(--brand, #ffb020); }
.pw-forgot { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line, #262d3f); font-size: 13px; color: var(--txt-3, #6f7789); line-height: 1.7; }
.pw-forgot a { color: var(--brand, #ffb020); }

/* 个人中心 */
.pw-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.pw-status-main { min-width: 0; }
.pw-status-name { font-size: 18px; font-weight: 600; word-break: break-all; }
.pw-status-line { margin-top: 6px; color: var(--txt-2, #a3aabd); font-size: 14px; line-height: 1.6; }
.pw-status-line b { color: var(--brand, #ffb020); font-weight: 600; }
.pw-status-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pw-status-actions .pw-btn { min-height: 36px; padding: 0 14px; font-size: 13px; }
.pw-warn {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm, 6px);
  background: rgba(255, 107, 107, .1);
  border: 1px solid rgba(255, 107, 107, .35);
  color: #ffb4b4;
  font-size: 14px;
  line-height: 1.6;
}

.pw-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; border: 0; }
.pw-plan { position: relative; display: block; margin: 0; cursor: pointer; }
.pw-plan input { position: absolute; opacity: 0; pointer-events: none; }
.pw-plan-box {
  display: block;
  height: 100%;
  box-sizing: border-box;
  padding: 18px 12px 16px;
  border: 1.5px solid var(--line, #262d3f);
  border-radius: var(--radius, 10px);
  background: var(--bg, #0d0f14);
  text-align: center;
  transition: border-color .15s, background .15s;
}
.pw-plan:hover .pw-plan-box { border-color: rgba(255, 176, 32, .5); }
.pw-plan input:checked + .pw-plan-box { border-color: var(--brand, #ffb020); background: rgba(255, 176, 32, .08); }
.pw-plan input:focus-visible + .pw-plan-box { outline: 2px solid var(--brand, #ffb020); outline-offset: 2px; }
.pw-plan-name { display: block; font-size: 15px; color: var(--txt, #e9ecf3); font-weight: 600; }
.pw-plan-price { display: block; margin: 8px 0 4px; color: var(--brand, #ffb020); font-size: 28px; font-weight: 700; line-height: 1.2; }
.pw-plan-price small { font-size: 15px; margin-right: 2px; }
.pw-plan-days { display: block; color: var(--txt-3, #6f7789); font-size: 12px; }
.pw-paytypes { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; padding: 0; border: 0; }
.pw-paytypes[hidden] { display: none; }
.pw-paytype.is-disabled { cursor: not-allowed; }
.pw-paytype.is-disabled span { opacity: .4; }
.pw-paytypes legend { width: 100%; margin-bottom: 8px; padding: 0; color: var(--txt-2, #a3aabd); font-size: 13px; }
.pw-paytype { position: relative; cursor: pointer; }
.pw-paytype input { position: absolute; opacity: 0; pointer-events: none; }
.pw-paytype span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1.5px solid var(--line, #262d3f);
  border-radius: var(--radius-sm, 6px);
  color: var(--txt, #e9ecf3);
  font-size: 14px;
}
.pw-paytype input:checked + span { border-color: var(--brand, #ffb020); color: var(--brand, #ffb020); }
.pw-paytype input:focus-visible + span { outline: 2px solid var(--brand, #ffb020); outline-offset: 2px; }
.pw-buy { margin-top: 18px; }
.pw-buy-note { margin-top: 10px; color: var(--txt-3, #6f7789); font-size: 12px; line-height: 1.7; }

.pw-orders { width: 100%; border-collapse: collapse; font-size: 13px; }
.pw-orders th, .pw-orders td { padding: 10px 8px; border-bottom: 1px solid var(--line, #262d3f); text-align: left; vertical-align: top; }
.pw-orders th { color: var(--txt-3, #6f7789); font-weight: 500; white-space: nowrap; }
.pw-orders td { color: var(--txt-2, #a3aabd); }
.pw-orders .pw-order-no { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.pw-st { display: inline-block; padding: 0 6px; border-radius: 3px; font-size: 12px; line-height: 20px; white-space: nowrap; }
.pw-st-paid { background: rgba(64, 196, 120, .16); color: #5fd394; }
.pw-st-created { background: rgba(255, 176, 32, .14); color: var(--brand, #ffb020); }
.pw-st-closed, .pw-st-refunded { background: rgba(163, 170, 189, .14); color: var(--txt-2, #a3aabd); }
.pw-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--txt-3, #6f7789); }
.pw-pager .pw-btn { min-height: 32px; padding: 0 12px; font-size: 13px; }
.pw-empty { padding: 18px 0 4px; color: var(--txt-3, #6f7789); font-size: 13px; text-align: center; }

/* 回跳确认页 */
.pw-return { text-align: center; padding-top: 32px; padding-bottom: 32px; }
.pw-return-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; line-height: 1; }
.pw-return-icon.is-pending { border: 3px solid rgba(255, 176, 32, .25); border-top-color: var(--brand, #ffb020); animation: pw-spin 1s linear infinite; }
.pw-return-icon.is-ok { background: rgba(64, 196, 120, .16); color: #5fd394; }
.pw-return-icon.is-bad { background: rgba(255, 107, 107, .14); color: #ff6b6b; }
.pw-return h1 { margin-bottom: 8px; }
.pw-return p { margin: 6px 0; color: var(--txt-2, #a3aabd); font-size: 14px; line-height: 1.7; }
.pw-return code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--txt-3, #6f7789); word-break: break-all; }
.pw-return-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
@keyframes pw-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pw-return-icon.is-pending { animation-duration: 3s; } }

/* 播放器遮罩（player.html 里用，覆盖「播放器未就绪」那行字） */
.pw-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: radial-gradient(ellipse at center, rgba(40, 30, 10, .55), rgba(0, 0, 0, .92) 70%), #000;
  color: #e9ecf3;
  font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  text-align: center;
}
.pw-gate-box { max-width: 360px; }
.pw-gate-title { margin: 0 0 6px; font-size: 18px; font-weight: 600; color: #fff; }
.pw-gate-text { margin: 0 0 16px; color: #a3aabd; font-size: 13px; }
.pw-gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pw-gate-actions .pw-btn { min-height: 38px; padding: 0 18px; font-size: 14px; }
.pw-gate-actions .pw-btn-ghost { color: #e9ecf3; border-color: rgba(255, 255, 255, .28); }

/* 试看集：左上角小提示，不挡操作，6 秒后淡出 */
.pw-trial {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 40;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .6);
  color: #ffd27a;
  font: 12px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  pointer-events: none;
  animation: pw-fade 6s ease forwards;
}
@keyframes pw-fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

@media (max-width: 640px) {
  .pw-page { margin: 14px auto 28px; padding: 0 12px; }
  .pw-card { padding: 18px 14px; }
  .pw-plans { gap: 8px; }
  .pw-plan-box { padding: 14px 4px 12px; }
  .pw-plan-price { font-size: 22px; }
  .pw-orders thead { display: none; }
  .pw-orders, .pw-orders tbody, .pw-orders tr, .pw-orders td { display: block; width: 100%; box-sizing: border-box; }
  .pw-orders tr { padding: 10px 0; border-bottom: 1px solid var(--line, #262d3f); }
  .pw-orders td { padding: 2px 0; border: 0; }
  .pw-orders td[data-label]::before { content: attr(data-label) "："; color: var(--txt-3, #6f7789); }
  .pw-gate-title { font-size: 16px; }
}

/* ZG-139 免费专区：绿色「免费」角标、免费提示条、频道页导语与空状态 */
.pw-badge.pw-badge-free { background: linear-gradient(135deg, #47d68a, #1fae66); color: #04210f; }
.pw-tip-bar.pw-tip-free { border-color: rgba(71, 214, 138, .38); background: rgba(71, 214, 138, .08); }
.pw-tip-bar.pw-tip-free strong, .pw-tip-bar.pw-tip-free a { color: #5fd394; }
.pw-free-intro { margin: -4px 0 14px; color: var(--txt-2, #a3aabd); font-size: 14px; line-height: 1.7; }
.mod .pw-free-intro { margin: 0 12px 10px; font-size: 13px; }
.pw-free-empty { padding: 28px 12px; color: var(--txt-3, #6f7789); font-size: 14px; text-align: center; }
