/* ===== 网页版追加样式：额度胶囊、滑动对切验证、个人中心与邀请卡 ===== */

.topbar a.ghost,
.topbar button,
.topbar .brandName {
  white-space: nowrap;
  flex-shrink: 0;
}
.topbar a.ghost {
  text-decoration: none;
}

.btnQuota {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(5, 22, 38, 0.16);
  color: #051626;
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.btnQuota:empty {
  display: none;
}
.btnQuota.warn {
  background: rgba(159, 18, 57, 0.18);
  color: #4c0519;
}

/* 素材区标题栏 + 紧凑参考音频按钮 */
.mediaHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.mediaTitle {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--txt);
}
#dropAudio.audioMini {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border-style: solid;
  border-color: rgba(164, 214, 255, 0.24);
  background: rgba(164, 218, 248, 0.08);
  color: #cbe7ff;
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}
#dropAudio.audioMini:hover,
#dropAudio.audioMini.dragging {
  border-color: var(--acc);
  background: rgba(164, 218, 248, 0.16);
  color: #ffffff;
}
#mediaHint:empty {
  display: none;
}
.audioListRow:has(#audioList:empty) {
  display: none;
}

/* 参考图框整体更紧凑 */
#dropRef {
  min-height: 98px;
  padding: 10px 12px;
  gap: 4px;
}
#dropRef .uploadMark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.promoBar {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.promoNote {
  text-align: right;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.2px;
  line-height: 1.4;
}
.vipBtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(251, 211, 141, 0.48);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(56, 189, 248, 0.16));
  color: #fde68a;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(251, 191, 36, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.16s, border-color 0.16s, background 0.16s, box-shadow 0.16s;
}
.vipBtn:hover {
  transform: translateY(-1px);
  border-color: rgba(253, 224, 71, 0.78);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(56, 189, 248, 0.22));
  color: #fffbeb;
  box-shadow: 0 6px 18px rgba(251, 191, 36, 0.24);
}

.vipSteps {
  list-style: none;
  display: grid;
  gap: 9px;
  padding: 12px;
  border-radius: 13px;
  background: rgba(7, 17, 32, 0.72);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: #d6e8fc;
  line-height: 1.5;
}
.vipSteps li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.stepNum {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-top: 1px;
  font-size: 11px;
  font-weight: 700;
  color: #051626;
  background: linear-gradient(135deg, #c7ecff, #64ccf9);
}
.wechatCard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(31, 63, 102, 0.48), rgba(10, 24, 44, 0.88));
  border: 1px solid rgba(164, 218, 248, 0.32);
}
.wechatInfo {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wechatLabel {
  font-size: 11px;
  color: var(--dim);
}
.wechatInfo code {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 1px;
  color: #e0f4ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.quotaPill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(16, 34, 58, 0.72);
  color: #cfe4fa;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.quotaPill:hover {
  background: rgba(164, 218, 248, 0.14);
  border-color: var(--line-strong);
  color: #ffffff;
}
.quotaPill.warn .kpiDot {
  background: var(--warn);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.7);
}
.quotaPill.expired {
  border-color: rgba(251, 113, 133, 0.4);
  color: #fecdd3;
}
.quotaPill.expired .kpiDot {
  background: var(--err);
  box-shadow: 0 0 8px rgba(251, 113, 133, 0.7);
}

/* ---------- 弹窗通用 ---------- */
.webDialog {
  margin: auto;
  width: min(410px, 92vw);
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(180deg, #10213c, #0a162a);
  color: var(--txt);
  box-shadow:
    inset 0 1px 0 rgba(212, 237, 255, 0.16),
    0 24px 64px rgba(1, 6, 16, 0.72);
}
.webDialog::backdrop {
  background: rgba(3, 9, 20, 0.74);
  backdrop-filter: blur(8px);
}
.dlgHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.dlgHead h2 {
  font-size: 16.5px;
  font-weight: 660;
  color: var(--txt);
}
.dlgSub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.dlgClose {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(16, 32, 56, 0.7);
  color: var(--dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.dlgClose:hover {
  color: #fff;
  border-color: var(--line-strong);
}

.loginForm,
.accountBox {
  display: grid;
  gap: 13px;
}
.dlgField {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--dim);
}
.dlgField small {
  color: var(--muted);
  font-weight: 400;
}
.dlgField input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
}
.codeRow {
  display: flex;
  gap: 8px;
}
.codeRow input {
  flex: 1;
  letter-spacing: 3px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.codeRow button {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  white-space: nowrap;
}
.dlgMsg {
  min-height: 18px;
  font-size: 12px;
  color: #fda4af;
  line-height: 1.5;
}
.dlgMsg.ok {
  color: #6ee7b7;
}
.dlgMsg:empty {
  display: none;
}
.loginFootnote {
  margin-top: 2px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.2px;
  line-height: 1.5;
}

/* ---------- 滑动对切验证 ---------- */
.sliderWrap {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(7, 17, 32, 0.78);
  border: 1px solid var(--line);
}
.sliderStage {
  position: relative;
  width: 300px;
  height: 116px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(164, 214, 255, 0.22);
  background: #071426;
  user-select: none;
}
.sliderStage canvas {
  position: absolute;
  inset: 0;
  display: block;
}
.capRefresh {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid rgba(164, 214, 255, 0.28);
  background: rgba(7, 18, 34, 0.72);
  color: #cbe7ff;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.capRefresh:hover {
  background: rgba(20, 46, 78, 0.9);
  color: #fff;
}

.sliderTrack {
  position: relative;
  width: 300px;
  height: 38px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(12, 27, 48, 0.92);
  border: 1px solid rgba(164, 214, 255, 0.22);
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
.sliderFill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.24), rgba(164, 218, 248, 0.36));
  pointer-events: none;
}
.sliderTip {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  color: var(--dim);
  padding-left: 26px;
  pointer-events: none;
}
.sliderThumb {
  position: absolute;
  left: 2px;
  top: 2px;
  z-index: 2;
  width: 40px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #c7ecff, #64ccf9);
  color: #051626;
  font-size: 15px;
  font-weight: 700;
  cursor: grab;
  box-shadow: 0 3px 12px rgba(56, 189, 248, 0.35);
}
.sliderThumb:active {
  cursor: grabbing;
}
.sliderTrack.ok {
  border-color: rgba(52, 211, 153, 0.55);
}
.sliderTrack.ok .sliderFill {
  background: rgba(52, 211, 153, 0.22);
}
.sliderTrack.ok .sliderTip {
  color: #6ee7b7;
  padding-left: 0;
}
.sliderTrack.ok .sliderThumb {
  background: linear-gradient(135deg, #6ee7b7, #10b981);
}
.sliderTrack.err {
  border-color: rgba(251, 113, 133, 0.6);
  animation: shake 0.32s ease;
}
.sliderTrack.err .sliderFill {
  background: rgba(251, 113, 133, 0.22);
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ---------- 个人中心 & 邀请卡 ---------- */
.accUserRow {
  display: flex;
  align-items: center;
  gap: 12px;
}
.accAvatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #c7ecff 0%, #67cdf8 52%, #2563eb 100%);
  color: #051626;
  font-size: 18px;
  font-weight: 750;
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.35);
}
.accStats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.accStatCard {
  padding: 10px;
  border-radius: 12px;
  background: rgba(8, 19, 36, 0.85);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.accStatCard span {
  font-size: 11px;
  color: var(--muted);
}
.accStatCard b {
  font-size: 13.5px;
  color: var(--txt);
  font-variant-numeric: tabular-nums;
}

.inviteCard {
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(31, 63, 102, 0.45), rgba(10, 24, 44, 0.85));
  border: 1px solid rgba(164, 218, 248, 0.26);
  display: grid;
  gap: 10px;
}
.inviteCardHead {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.inviteCardHead span {
  font-size: 12.5px;
  font-weight: 600;
  color: #dff3ff;
}
.inviteCardHead small {
  font-size: 11px;
  color: var(--dim);
}
.inviteCodeRow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.inviteCodeRow code {
  padding: 6px 12px;
  border-radius: 9px;
  background: rgba(6, 16, 30, 0.9);
  border: 1px solid rgba(164, 218, 248, 0.32);
  color: #bae6fd;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.primary.sm {
  height: 30px;
  padding: 0 12px;
  font-size: 11.5px;
}
.dangerBtn {
  color: #fda4af !important;
  border-color: rgba(251, 113, 133, 0.32) !important;
}
.dangerBtn:hover {
  background: rgba(251, 113, 133, 0.14) !important;
}

/* ---------- 作品区：横向卡片轮播（左右滑动 + 翻页箭头） ---------- */
.taskCarousel {
  position: relative;
  display: flex;
  align-items: center;
}
.poolMain .taskList {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  padding: 16px 20px 18px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  min-height: 170px;
}
.poolMain .taskList::-webkit-scrollbar {
  display: none;
}
.poolMain .taskList .empty {
  flex: 1 0 100%;
  width: 100%;
}
.poolMain .taskList .card {
  flex: 0 0 282px;
  width: 282px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cardHeadRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cardTitle {
  font-size: 13px;
  font-weight: 650;
  color: var(--txt);
  font-variant-numeric: tabular-nums;
}
.cardMedia {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(6, 15, 29, 0.92);
  border: 1px solid var(--line);
  margin: 2px 0;
}
.cardMedia video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.cardPlaceholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
  color: var(--dim);
  font-size: 12px;
  background: linear-gradient(135deg, rgba(16, 36, 66, 0.65), rgba(8, 20, 38, 0.9));
}
.card[data-status="generating"] .cardPlaceholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(164, 218, 248, 0.12) 50%, transparent 75%);
  background-size: 200% 100%;
  animation: barShimmer 1.8s linear infinite;
  pointer-events: none;
}
.cardPct {
  font-size: 20px;
  font-weight: 700;
  color: #bae6fd;
  font-variant-numeric: tabular-nums;
}
.cardPlaceholder.err {
  color: #fda4af;
  background: linear-gradient(135deg, rgba(58, 18, 30, 0.45), rgba(14, 18, 32, 0.92));
}
.card .cardActions {
  margin-top: auto;
  padding-top: 4px;
}

.carouselNav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(9, 22, 40, 0.86);
  color: #e2f2ff;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(1, 6, 16, 0.5);
  transition: background 0.16s, border-color 0.16s, opacity 0.16s;
}
.carouselNav.prev { left: 8px; }
.carouselNav.next { right: 8px; }
.carouselNav:hover:not(:disabled) {
  background: rgba(24, 54, 92, 0.95);
  border-color: var(--acc);
}
.carouselNav:disabled {
  opacity: 0.3;
  cursor: default;
}
.carouselNav[hidden],
.taskPager[hidden] {
  display: none;
}
.taskPager {
  text-align: center;
  padding: 0 0 14px;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ========== 手机端与窄屏无缝响应式适配 ========== */

/* 窄屏 / 分屏（≤ 760px）：管理后台收成精致圆形图标按钮，避免挤出屏幕 */
@media (max-width: 760px) {
  body .topbar {
    height: auto;
    min-height: 54px;
    padding: 8px 14px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .topbar a.ghost#btnAdmin {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
  }
  .topbar a.ghost#btnAdmin span {
    display: none;
  }
  .topbar .brand {
    gap: 8px;
    font-size: 14px;
  }
  .topbar .topright {
    gap: 6px;
    margin-left: auto;
  }

  body .poolMain {
    padding: 16px 14px max(32px, env(safe-area-inset-bottom));
    gap: 14px;
  }
  .pageHead {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .poolMain h1 {
    font-size: 22px;
  }
  .promoBar {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }
  .promoNote {
    text-align: left;
    font-size: 11.5px;
    flex: 1;
  }

  .composer {
    padding: 16px;
    gap: 14px;
  }
  .editor {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .field.grow {
    min-height: 0;
  }
  .editor textarea {
    min-height: 118px;
    font-size: 13.5px;
  }
  #dropRef {
    min-height: 76px;
    padding: 8px 10px;
  }

  /* 底部操作栏：4 个参数紧凑单排 + 下方全宽主按钮 */
  .composerBar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    gap: 8px;
  }
  .composerControls {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    width: 100%;
  }
  .composerBar .row {
    display: contents;
  }
  .composerBar .field {
    flex: 1 1 0;
    min-width: 0;
    gap: 0;
  }
  .composerBar .row:first-child .field:first-child {
    flex: 1.65 1 0;
  }
  .composerBar .row:last-child .field:last-child {
    flex: 0.72 1 0;
  }
  .composerBar .field > label {
    display: none;
  }
  .composerBar select {
    width: 100%;
    height: 34px;
    padding: 0 6px;
    font-size: 11.5px;
    text-overflow: ellipsis;
  }
  .composerBar .primary {
    width: 100%;
    height: 42px;
    margin-left: 0;
    font-size: 14px;
  }

  /* 任务区 */
  .tasksHead {
    padding: 13px 16px;
    gap: 8px;
  }
  .stats {
    gap: 6px;
    font-size: 11px;
  }
  .stats .st {
    padding: 3px 8px;
  }
  .poolMain .taskList {
    padding: 12px 14px 16px;
    gap: 12px;
  }
  .poolMain .taskList .card {
    flex: 0 0 min(82vw, 304px);
    width: min(82vw, 304px);
  }
  .carouselNav {
    width: 28px;
    height: 28px;
    font-size: 17px;
  }

  /* 悬浮提示条在手机上居中贴底 */
  .statusToast {
    left: 16px;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    text-align: center;
    max-width: none;
  }
}

/* 手机竖屏（≤ 480px）：顶栏信息超紧凑，零横向溢出 */
@media (max-width: 480px) {
  body .topbar {
    padding: 8px 12px;
  }
  .brandLogo {
    width: 24px;
    height: 24px;
  }
  .verBadge {
    font-size: 9.5px;
    padding: 2px 6px;
  }
  .quotaPill {
    height: 30px;
    padding: 0 9px;
    font-size: 11px;
    gap: 5px;
  }
  .userBtn {
    height: 30px;
    padding: 0 11px;
    font-size: 11.5px;
  }
  .userBtn.logged {
    width: 30px;
    height: 30px;
    font-size: 12.5px;
  }
  .snowBtn,
  .topbar a.ghost#btnAdmin {
    width: 30px;
    height: 30px;
  }

  .webDialog {
    width: calc(100vw - 20px);
    padding: 16px 14px;
    border-radius: 16px;
  }
  .sliderWrap {
    padding: 8px 6px;
  }
  .accStats {
    grid-template-columns: 1fr;
  }
}

