/* ==========================================================================
   手机版样式：深色、紧凑、单手可操作，所有排版按移动端特性重新设计。
   ========================================================================== */

:root {
  --m-bg: #0e1014;
  --m-surface: #161922;
  --m-surface-2: #1d212c;
  --m-line: #262b38;
  --m-text: #eef1f7;
  --m-muted: #8c94a8;
  --m-faint: #626a7d;
  --m-primary: #4f7cff;
  --m-primary-soft: rgba(79, 124, 255, 0.16);
  --m-good: #43d6a5;
  --m-warn: #ffb454;
  --m-danger: #ff6b6b;
  --m-radius: 14px;
  --m-tabbar-h: 62px;
  --m-top-h: 52px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body.m-body {
  background: var(--m-bg);
  color: var(--m-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

/* -------------------------------------------------------------- 顶部栏 */

.m-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: var(--m-top-h);
  padding: 0 14px;
  background: rgba(14, 16, 20, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--m-line);
}

.m-logo {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}

.m-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--m-line);
  border-radius: 999px;
  background: var(--m-surface);
  color: var(--m-text);
  font-size: 12px;
}

.m-icon-btn:active {
  background: var(--m-surface-2);
}

.m-credits-dot {
  color: var(--m-warn);
  font-size: 12px;
}

.m-icon {
  font-size: 14px;
}

/* -------------------------------------------------------------- 主区域 */

.m-main {
  width: 100%;
  max-width: 100%;
  padding: 14px 14px calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 22px);
  min-height: calc(100vh - var(--m-top-h) - var(--m-tabbar-h));
}

.m-skeleton {
  height: 96px;
  border-radius: var(--m-radius);
  background: linear-gradient(90deg, var(--m-surface), var(--m-surface-2), var(--m-surface));
  background-size: 200% 100%;
  animation: m-shimmer 1.3s infinite;
  margin-bottom: 12px;
}

.m-skeleton.short {
  height: 56px;
  width: 70%;
}

@keyframes m-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* -------------------------------------------------------------- 底部栏 */

.m-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  /* 标签数量会随后台配置变化（创作/爆款/作品/充值/我的），用 auto-fit 避免换行。 */
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  grid-template-columns: none;
  height: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(14, 16, 20, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--m-line);
}

.m-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  color: var(--m-faint);
  transition: color 0.15s;
}

.m-tab-icon {
  font-size: 17px;
  line-height: 1;
}

.m-tab.active {
  color: var(--m-primary);
}

/* -------------------------------------------------------------- 通用块 */

.m-page-head {
  margin: 2px 0 14px;
}

.m-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: 0;
}

.m-sub {
  font-size: 12px;
  color: var(--m-muted);
  margin: 0;
}

.m-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 10px;
  font-size: 14px;
  font-weight: 600;
}

.m-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--m-line);
}

.m-card {
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
  padding: 14px;
}

.m-muted {
  color: var(--m-muted);
}

.m-faint {
  color: var(--m-faint);
}

.m-tiny {
  font-size: 11px;
}

.m-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.m-spacer {
  flex: 1;
}

/* -------------------------------------------------------------- 按钮 */

.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--m-line);
  border-radius: 12px;
  background: var(--m-surface-2);
  color: var(--m-text);
  font-size: 14px;
  font-weight: 600;
}

.m-btn:active {
  transform: scale(0.985);
}

.m-btn-primary {
  background: var(--m-primary);
  border-color: var(--m-primary);
  color: #fff;
}

.m-btn-ghost {
  background: transparent;
}

.m-btn-sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 10px;
}

.m-btn-block {
  width: 100%;
}

.m-btn:disabled {
  opacity: 0.5;
}

/* -------------------------------------------------------------- 首页余额 */

.m-balance {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #202a54 0%, #161922 62%);
  border: 1px solid #2b3456;
  border-radius: var(--m-radius);
  padding: 16px;
}

.m-balance-label {
  font-size: 12px;
  color: #9aa6c8;
}

.m-balance-num {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  margin-top: 2px;
  letter-spacing: 0;
}

.m-balance-member {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: #c8d2ee;
}

.m-balance-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

/* -------------------------------------------------------------- 分类 */

.m-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
}

.m-chips::-webkit-scrollbar {
  display: none;
}

.m-chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--m-line);
  background: var(--m-surface);
  color: var(--m-muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.m-chip.active {
  background: var(--m-primary-soft);
  border-color: rgba(79, 124, 255, 0.5);
  color: #a9c0ff;
  font-weight: 600;
}

.m-sortbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

/* -------------------------------------------------------------- 功能卡 */

.m-feature-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.m-feature {
  display: flex;
  min-width: 0;
  width: 100%;
  gap: 12px;
  padding: 12px;
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
}

.m-feature:active {
  background: var(--m-surface-2);
}

.m-feature-cover {
  position: relative;
  flex: 0 0 108px;
  width: 108px;
  /* 封面基本是 16:9，用同比例缩略图避免被裁成方块后看不全。 */
  height: auto;
  aspect-ratio: 16 / 9;
  align-self: center;
  border-radius: 11px;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #f7f9ff 0%, #eef1fa 45%, #e6ebf7 100%);
}

.m-feature-cover img,
.m-feature-cover video {
  width: 100%;
  height: 100%;
  /* 封面按原比例完整显示，宽画幅也不会被裁掉两侧。 */
  object-fit: contain;
  display: block;
}

.m-feature-cover .m-cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 20px;
  font-weight: 700;
  color: #4b556e;
  background: linear-gradient(135deg, #232837, #171a22);
}

.m-cover-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.62);
  font-size: 10px;
  color: #ffd479;
  font-weight: 600;
}

.m-cover-reco {
  left: auto;
  right: 6px;
  background: rgba(255, 145, 61, 0.9);
  color: #2b1500;
}

.m-feature-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.m-feature-name {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.m-feature-desc {
  font-size: 11.5px;
  color: var(--m-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.m-feature-note {
  margin-top: 6px;
  font-size: 10.5px;
  color: #8fa6d8;
  background: rgba(79, 124, 255, 0.12);
  border-radius: 6px;
  padding: 3px 7px;
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-price-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 8px;
}

.m-price-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: var(--m-muted);
}

.m-price-item b {
  color: var(--m-text);
  font-size: 12px;
  font-weight: 600;
}

.m-price-item.active {
  color: #a9c0ff;
}

.m-price-item.active b {
  color: #b9cbff;
}

.m-feature-foot {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-vote {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--m-line);
  background: transparent;
  color: var(--m-muted);
  font-size: 11px;
}

.m-vote.on {
  border-color: rgba(79, 124, 255, 0.6);
  color: #a9c0ff;
  background: var(--m-primary-soft);
}

.m-go {
  margin-left: auto;
  font-size: 12px;
  color: var(--m-primary);
  font-weight: 600;
}

/* -------------------------------------------------------------- 生成页 */

.m-studio-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.m-back {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--m-line);
  background: var(--m-surface);
  color: var(--m-text);
  font-size: 16px;
}

.m-field {
  margin-bottom: 16px;
}

.m-field-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
  min-width: 0;
}

.m-field-label {
  font-size: 13px;
  font-weight: 600;
  flex: 0 0 auto;
}

.m-req {
  color: var(--m-danger);
  margin-left: 2px;
}

.m-field-desc {
  font-size: 11px;
  color: var(--m-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.m-input,
.m-select,
.m-textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--m-line);
  border-radius: 11px;
  background: var(--m-surface-2);
  color: var(--m-text);
  font-size: 15px;
  font-family: inherit;
  appearance: none;
}

.m-textarea {
  min-height: 92px;
  line-height: 1.55;
  resize: vertical;
}

.m-input:focus,
.m-select:focus,
.m-textarea:focus {
  outline: none;
  border-color: var(--m-primary);
}

.m-file {
  width: 100%;
  padding: 12px;
  border: 1px dashed var(--m-line);
  border-radius: 11px;
  background: var(--m-surface-2);
  color: var(--m-muted);
  font-size: 13px;
}

.m-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
}

.m-check input {
  width: 19px;
  height: 19px;
  accent-color: var(--m-primary);
}

.m-upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.m-upload-preview img,
.m-upload-preview video {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid var(--m-line);
}

.m-upload-preview audio {
  width: 100%;
}

/* 费用面板 */

.m-cost {
  position: sticky;
  bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 6px);
  z-index: 40;
  margin-top: 18px;
  background: rgba(22, 25, 34, 0.97);
  backdrop-filter: blur(14px);
  border: 1px solid #2b3456;
  border-radius: var(--m-radius);
  padding: 13px;
  box-shadow: 0 -6px 26px rgba(0, 0, 0, 0.4);
}

.m-cost-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.m-cost-total {
  font-size: 25px;
  font-weight: 800;
  color: var(--m-warn);
  line-height: 1.1;
}

.m-cost-total span {
  font-size: 12px;
  font-weight: 500;
  color: var(--m-muted);
  margin-left: 3px;
}

.m-cost-meta {
  font-size: 11px;
  color: var(--m-muted);
  text-align: right;
  line-height: 1.5;
}

.m-cost-members {
  display: grid;
  gap: 6px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--m-line);
}

.m-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--m-muted);
}

.m-cost-row b {
  color: var(--m-text);
  font-weight: 600;
}

.m-cost-row.active {
  color: #a9c0ff;
}

.m-cost-row.active b {
  color: #b9cbff;
}

.m-hint {
  margin-top: 9px;
  font-size: 11px;
  color: #8fa6d8;
  line-height: 1.5;
}

/* -------------------------------------------------------------- 作品 */

.m-job {
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
  padding: 12px;
  margin-bottom: 12px;
}

.m-job-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.m-job-name {
  font-size: 13.5px;
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 进行中任务的进度条：按预计时长匀速填充。 */
.m-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--m-surface-2);
  overflow: hidden;
  margin-top: 10px;
}

.m-progress-bar {
  height: 100%;
  width: 4%;
  border-radius: 999px;
  background: var(--m-primary);
  transition: width 1s linear;
}

/* 没有历史样本时用不定态动画，避免停在 4% 看起来像卡住。 */
.m-progress-indeterminate {
  width: 35%;
  animation: mSlide 1.4s ease-in-out infinite;
}

@keyframes mSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.m-status {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--m-surface-2);
  color: var(--m-muted);
}

.m-status.running { background: rgba(79, 124, 255, 0.18); color: #9db6ff; }
.m-status.success { background: rgba(67, 214, 165, 0.16); color: var(--m-good); }
.m-status.failed { background: rgba(255, 107, 107, 0.16); color: var(--m-danger); }

.m-job-media {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 9px;
}

.m-job-media::-webkit-scrollbar {
  display: none;
}

.m-job-media img,
.m-job-media video {
  flex: 0 0 auto;
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--m-line);
  background: radial-gradient(120% 90% at 50% 0%, #f7f9ff 0%, #eef1fa 45%, #e6ebf7 100%);
}

.m-job-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--m-muted);
}

.m-job-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* -------------------------------------------------------------- 爆款 */

.m-showcase {
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
  overflow: hidden;
  margin-bottom: 14px;
}

.m-showcase-media {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  background: #07080b;
  display: block;
}

.m-showcase-body {
  padding: 12px;
}

.m-showcase-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.m-showcase-title {
  font-size: 14px;
  font-weight: 700;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-showcase-meta {
  font-size: 11px;
  color: var(--m-faint);
  margin-bottom: 9px;
}

/* 分类与时间一行，消耗积分单独一行。 */
.m-showcase-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-showcase-meta span + span {
  margin-top: 2px;
}

.m-reactbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-react {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--m-line);
  background: transparent;
  color: var(--m-muted);
  font-size: 12px;
}

.m-react.on {
  border-color: rgba(79, 124, 255, 0.6);
  color: #a9c0ff;
  background: var(--m-primary-soft);
}

/* -------------------------------------------------------------- 我的 */

.m-me {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
}

.m-avatar {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f7cff, #7a5cff);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
}

.m-menu {
  margin-top: 14px;
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
  overflow: hidden;
}

.m-menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border-bottom: 1px solid var(--m-line);
  font-size: 14px;
}

.m-menu-item:last-child {
  border-bottom: none;
}

.m-menu-item:active {
  background: var(--m-surface-2);
}

.m-menu-icon {
  width: 22px;
  text-align: center;
  color: var(--m-muted);
}

.m-menu-value {
  margin-left: auto;
  color: var(--m-muted);
  font-size: 13px;
}

/* -------------------------------------------------------------- 充值 */

.m-package {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
}

.m-package.hot {
  border-color: rgba(79, 124, 255, 0.5);
}

.m-package-name {
  font-size: 14.5px;
  font-weight: 700;
}

.m-package-credits {
  font-size: 12px;
  color: var(--m-muted);
  margin-top: 2px;
}

.m-package-price {
  margin-left: auto;
  text-align: right;
}

.m-package-price b {
  font-size: 19px;
  color: var(--m-warn);
}

/* -------------------------------------------------------- 会员权益 */

.m-level-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.m-level-card {
  padding: 13px 14px;
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
}

.m-level-card.active {
  border-color: rgba(79, 124, 255, 0.55);
  background: rgba(79, 124, 255, 0.06);
}

.m-level-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.m-level-name {
  font-size: 14px;
  font-weight: 700;
}

.m-level-tag {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 176, 71, 0.16);
  color: #ffb047;
  font-size: 10px;
}

.m-level-active {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 5px;
  background: rgba(79, 124, 255, 0.16);
  color: #a9c0ff;
  font-size: 10px;
}

.m-level-row {
  font-size: 12px;
  color: var(--m-muted);
  line-height: 1.75;
}

.m-level-row b {
  color: var(--m-text);
  font-weight: 600;
}

.m-level-meta {
  margin-top: 5px;
  font-size: 11px;
  color: var(--m-faint);
}

/* -------------------------------------------------------------- 明细 */

.m-list {
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
  overflow: hidden;
}

.m-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border-bottom: 1px solid var(--m-line);
}

.m-list-row:last-child {
  border-bottom: none;
}

.m-list-main {
  min-width: 0;
  flex: 1;
}

.m-list-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-list-sub {
  font-size: 11px;
  color: var(--m-faint);
  margin-top: 3px;
}

.m-delta {
  font-size: 14px;
  font-weight: 700;
  flex: 0 0 auto;
}

.m-delta.in { color: var(--m-good); }
.m-delta.out { color: #ff9187; }

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

.m-ann {
  padding: 13px;
  background: var(--m-surface);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
  margin-bottom: 10px;
}

.m-ann-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.m-ann-body {
  font-size: 12.5px;
  color: #c2c9d8;
  line-height: 1.65;
  white-space: pre-wrap;
}

.m-ann-meta {
  margin-top: 8px;
  font-size: 11px;
  color: var(--m-faint);
}

/* -------------------------------------------------------------- 提示 */

.m-empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--m-faint);
  font-size: 13px;
}

.m-toast-host {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--m-tabbar-h) + env(safe-area-inset-bottom) + 18px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: 88vw;
}

.m-toast {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(30, 34, 46, 0.97);
  border: 1px solid var(--m-line);
  color: var(--m-text);
  font-size: 13px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  animation: m-toast-in 0.18s ease-out;
}

.m-toast.error {
  border-color: rgba(255, 107, 107, 0.5);
  color: #ffb3b3;
}

.m-toast.success {
  border-color: rgba(67, 214, 165, 0.5);
  color: #9ff0d4;
}

@keyframes m-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------- 弹层 */

.m-sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.m-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  overflow-y: auto;
  background: var(--m-surface);
  border-radius: 18px 18px 0 0;
  border-top: 1px solid var(--m-line);
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  animation: m-sheet-up 0.2s ease-out;
}

@keyframes m-sheet-up {
  from { transform: translateY(28px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

.m-sheet-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px;
}

.m-sheet-close {
  position: absolute;
  right: 14px;
  top: 12px;
}

.m-qr {
  width: 100%;
  max-width: 220px;
  border-radius: 12px;
  display: block;
  margin: 10px auto 0;
  background: #fff;
}

.m-inline-input {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.m-inline-input .m-input {
  flex: 1;
}

/* 二维码登录 */

.m-login-box {
  text-align: center;
  padding: 8px 0 4px;
}

.m-login-qr {
  width: 190px;
  height: 190px;
  margin: 8px auto 0;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.m-login-qr img,
.m-login-qr canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 小屏微调 */

@media (max-width: 350px) {
  .m-feature-cover {
    flex-basis: 92px;
    width: 92px;
    height: auto;
  }
  .m-price-grid {
    grid-template-columns: 1fr;
  }
}

.zoom-backdrop {
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.zoom-image {
  max-width: 96vw;
  max-height: 90vh;
  border-radius: 10px;
}
.showcase-zoom {
  cursor: zoom-in;
}

/* 列表自动预览：点击后切换为完整成品。 */
.m-showcase-media[data-showcase-preview] {
  cursor: pointer;
}

/* ===== LIGHT THEME START ===== */
/* ==================================================================
   手机版浅色主题 · 视觉重做
   ------------------------------------------------------------------
   由 work/_apply-theme.mjs 自动写入 mobile.css 末尾。
   只覆盖配色与圆角，不改布局与尺寸。
   ================================================================== */

:root {
  --m-bg: #f4f5fa;
  --m-surface: #ffffff;
  --m-surface-2: #f1f2f9;
  --m-line: #e7e9f3;
  --m-text: #1b1e2c;
  --m-muted: #676e82;
  --m-faint: #949bb0;
  --m-primary: #6b5bfa;
  --m-primary-soft: rgba(107, 91, 250, 0.12);
  --m-good: #12b981;
  --m-warn: #f59e0b;
  --m-danger: #ef4444;
  --m-shadow: 0 1px 2px rgba(27, 30, 44, 0.04), 0 6px 18px rgba(27, 30, 44, 0.06);
}

body,
.m-body {
  background: var(--m-bg);
  color: var(--m-text);
}

.m-topbar {
  background: rgba(255, 255, 255, 0.92);
  color: var(--m-text);
}

.m-tabbar {
  background: rgba(255, 255, 255, 0.96);
}

.m-tab {
  color: var(--m-muted);
}

.m-tab.active {
  color: var(--m-primary);
}

.m-icon-btn {
  background: var(--m-surface-2);
  color: var(--m-text);
}

.m-card,
.m-job,
.m-ann {
  background: var(--m-surface);
  box-shadow: var(--m-shadow);
}

.m-feature {
  background: var(--m-surface);
}

.m-title {
  color: var(--m-text);
}

.m-muted {
  color: var(--m-muted);
}

.m-faint,
.m-tiny {
  color: var(--m-faint);
}

.m-sub,
.m-section-title {
  color: var(--m-muted);
}

.m-balance {
  background: linear-gradient(135deg, #6b5bfa 0%, #8f7dff 55%, #a78bfa 100%);
  border-color: transparent;
  box-shadow: 0 10px 26px rgba(107, 91, 250, 0.28);
}

.m-balance-label {
  color: rgba(255, 255, 255, 0.85);
}

.m-balance-num {
  color: #fff;
}

.m-balance-member {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.m-btn {
  background: var(--m-surface-2);
  color: var(--m-text);
}

.m-btn-primary {
  background: linear-gradient(135deg, #6b5bfa 0%, #8f7dff 100%);
  border-color: transparent;
  color: #fff;
}

.m-btn-ghost {
  background: transparent;
}

.m-chip {
  background: var(--m-surface);
  color: var(--m-muted);
}

.m-chip.active {
  background: var(--m-primary-soft);
  border-color: rgba(107, 91, 250, 0.3);
  color: var(--m-primary);
}

.m-field-label {
  color: var(--m-text);
}

.m-field-desc,
.m-hint {
  color: #5a48e8;
}

.m-input,
.m-textarea,
.m-select {
  background: var(--m-surface-2);
  color: var(--m-text);
}

.m-input::placeholder,
.m-textarea::placeholder {
  color: #a7adc0;
}

.m-input:focus,
.m-textarea:focus {
  border-color: var(--m-primary);
}

.m-feature-cover {
  background: #eef0f7;
}

.m-feature-cover .m-cover-fallback {
  color: #a5a0d0;
  background: linear-gradient(135deg, #eef0fb, #e6e9f7);
}

.m-feature-note {
  color: #5a48e8;
  background: rgba(107, 91, 250, 0.07);
}

.m-price-item.active,
.m-price-item.active b,
.m-cost-row.active,
.m-cost-row.active b {
  color: var(--m-primary);
}

.m-vote,
.m-react {
  background: var(--m-surface);
  color: var(--m-muted);
}

.m-vote.on,
.m-react.on {
  border-color: rgba(107, 91, 250, 0.4);
  color: var(--m-primary);
  background: var(--m-primary-soft);
}

.m-cost {
  background: rgba(255, 255, 255, 0.97);
  border-color: var(--m-line);
  box-shadow: 0 -6px 26px rgba(27, 30, 44, 0.1);
}

.m-cost-total,
.m-cost-top,
.m-cost-meta,
.m-cost-members {
  color: var(--m-muted);
}

.m-status.running {
  background: rgba(107, 91, 250, 0.12);
  color: var(--m-primary);
}

.m-status.success {
  background: rgba(18, 185, 129, 0.13);
  color: #0d9668;
}

.m-status.failed {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.m-job-media img {
  background: #eef0f7;
}

.m-job-media video {
  background: #0f1116;
}

.m-showcase-media {
  background: #0f1116;
}

.m-avatar {
  background: linear-gradient(135deg, #6b5bfa, #a78bfa);
  color: #fff;
}

.m-package {
  background: var(--m-surface);
}

.m-package.hot {
  border-color: rgba(107, 91, 250, 0.4);
}

.m-delta.out {
  color: #dc2626;
}

.m-ann-title {
  color: var(--m-text);
  font-weight: 600;
}

.m-ann-body {
  color: var(--m-muted);
}

.m-ann-meta {
  color: var(--m-faint);
}

.m-toast {
  background: rgba(255, 255, 255, 0.98);
  color: var(--m-text);
}

.m-toast.error {
  border-color: rgba(239, 68, 68, 0.4);
  color: #dc2626;
}

.m-toast.success {
  border-color: rgba(18, 185, 129, 0.4);
  color: #0d9668;
}

.m-sheet {
  background: var(--m-surface);
  color: var(--m-text);
}

.m-sheet-mask {
  background: rgba(20, 22, 34, 0.42);
}

.m-menu-item {
  color: var(--m-text);
}

.m-progress {
  background: #e9ebf5;
}

.m-progress-bar {
  background: linear-gradient(90deg, #6b5bfa 0%, #8f7dff 100%);
}

.m-empty {
  color: var(--m-faint);
}
/* ===== LIGHT THEME END ===== */

/* ===== 播放器：画面按原比例完整显示，右上角带全屏按钮 ===== */
.m-media-box {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  /* r38：原来 #0b0d11 纯深色，封面/预览一失败就是黑块。换柔和占位。 */
  background: radial-gradient(120% 90% at 50% 0%, #f7f9ff 0%, #eef1fa 45%, #e6ebf7 100%);
  border-radius: 10px;
  border: 1px solid var(--m-line);
  overflow: hidden;
}

.m-media-box video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 68vh;
  object-fit: contain;
  background: radial-gradient(120% 90% at 50% 0%, #f7f9ff 0%, #eef1fa 45%, #e6ebf7 100%);
}

/* 作品列表里的视频宽度固定，高度随原片比例自适应。 */
.m-media-box img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.m-job-media .m-media-box {
  width: 148px;
}

.m-fs {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: rgba(10, 12, 18, 0.62);
  color: #fff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 2;
}

.m-fs:active {
  background: rgba(10, 12, 18, 0.85);
}

/* 爆款灵感里的视频铺满卡片，比例按原片。 */
.m-showcase .m-media-box {
  width: 100%;
  border: 0;
  border-radius: 0;
}


/* ---------------------------------------------------------- 品牌 LOGO */
.m-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.m-brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex: 0 0 auto;
}


/* ------------------------------------------------- 我要赚钱（手机版） */
.m-rule-list {
  margin: 0;
  padding-left: 18px;
  color: #b8c2de;
  font-size: 12.5px;
  line-height: 1.8;
}

.m-rule-list b {
  color: #6fe0bf;
}

.m-tier-note {
  font-size: 12px;
  color: #9aa6c8;
  margin-bottom: 10px;
}

.m-slot-box {
  border: 1px solid rgba(111, 224, 191, 0.45);
  background: rgba(111, 224, 191, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.m-slot-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #6fe0bf;
  margin-bottom: 8px;
}

.m-tier-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  color: #b8c2de;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.m-tier-chip:last-child {
  border-bottom: none;
}

.m-tier-chip b {
  color: #6fe0bf;
  font-weight: 600;
}

.m-tier-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.m-tier-row {
  border: 1px solid #2b3456;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 10px 12px;
}

.m-tier-row.m-tier-done {
  border-color: rgba(111, 224, 191, 0.45);
  background: rgba(111, 224, 191, 0.06);
}

.m-tier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: #c8d2ee;
}

.m-tier-head b {
  color: #6fe0bf;
  font-size: 14px;
}

.m-tier-sub {
  margin-top: 6px;
  font-size: 11.5px;
  color: #9aa6c8;
  line-height: 1.7;
  word-break: break-all;
}

/* 原片已过期：手机端同样只播预览片段并标注。 */
.m-expired { position: relative; width: 100%; min-height: 108px; background: linear-gradient(160deg, #f2f4fa 0%, #e6eaf5 55%, #dfe4f1 100%); border-radius: 12px; overflow: hidden; }
.m-expired video { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.m-expired-box { color: #98a1b8; font-size: 13px; height: 108px; display: flex; align-items: center; justify-content: center; }
.m-expired-badge { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.6); color: #d6dbe8; font-size: 11px; line-height: 18px; }

/* ---- 我的作品：批量选择 ---- */
.m-select-bar {
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--m-surface-2);
}

.m-select-bar .m-btn-danger {
  background: #d94a45;
  color: #fff;
}

.m-job-selected {
  outline: 1px solid var(--m-primary);
  outline-offset: -1px;
}

.m-btn-danger {
  background: #d94a45;
  color: #fff;
  border-color: transparent;
}

/* ---- 我的作品：状态筛选 + 批量下载 ---- */
.m-status-chips {
  margin-top: -6px;
}

.m-select-bar .m-btn {
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.m-select-bar .m-tiny {
  white-space: nowrap;
}


/* -------------------------------------------------------- 教程动态 */

.m-tut-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: var(--m-radius);
  background: linear-gradient(120deg, rgba(79, 124, 255, 0.22), rgba(79, 124, 255, 0.06));
  border: 1px solid var(--m-line);
}

.m-tut-icon {
  font-size: 24px;
  line-height: 1;
  flex: 0 0 auto;
}

.m-tut-body {
  flex: 1 1 auto;
  min-width: 0;
}

.m-tut-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.m-tut-note {
  color: var(--m-muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.m-tut-video {
  display: flex;
  gap: 12px;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: var(--m-radius);
  background: var(--m-surface);
  border: 1px solid var(--m-line);
}

.m-tut-thumb {
  width: 96px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.m-tut-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.m-tut-play {
  color: #fff;
  font-size: 20px;
  opacity: 0.85;
}

.m-tut-vbody {
  flex: 1 1 auto;
  min-width: 0;
}

.m-tut-vtitle {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
}

.m-tut-vdesc {
  color: var(--m-muted);
  font-size: 11px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.m-tut-qr {
  width: 100%;
  max-width: 260px;
  margin: 6px auto 0;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  display: block;
}

.m-tut-player {
  width: 100%;
  border-radius: 12px;
  background: #000;
  display: block;
  margin-top: 6px;
}

/* r38：手机端封面/预览失败兜底，绝不留黑块。 */
.m-poster-failed,
.m-showcase-preview-failed {
  background: radial-gradient(120% 90% at 50% 0%, #f7f9ff 0%, #eef1fa 45%, #e6ebf7 100%) !important;
}

/* ==================================================================
   r38 · 手机端横滑提示
   ------------------------------------------------------------------
   .m-chips 是 overflow-x:auto 且隐藏了滚动条，用户根本看不出右边还有选项。
   右侧加一层渐隐遮罩，暗示「还能往右划」。
   ================================================================== */
.m-chips {
  position: relative;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.m-chips > * {
  scroll-snap-align: start;
}
.m-chips::after {
  content: '';
  position: sticky;
  right: 0;
  flex: 0 0 18px;
  margin-left: -18px;
  background: linear-gradient(to right, rgba(244, 245, 250, 0), var(--m-bg, #f4f5fa) 78%);
  pointer-events: none;
}
