/* 用户端手机 H5 全部样式 */
:root {
  --p: #6366f1;
  --p2: #8b5cf6;
  --bg: #f4f5fa;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #9ca3af;
  --danger: #ef4444;
  --ok: #10b981;
  --warn: #f59e0b;
  --radius: 16px;
  --tabbar-h: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
/* 桌面端壳层背景：手机画布居中时两侧显示深色 */
html { background: #17171f; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  box-shadow: 0 0 48px rgba(0, 0, 0, .55);
}

/* ---------- 页面骨架 ---------- */
.page { padding: 20px 16px; }
.page-head { margin-bottom: 16px; }
.hi { font-size: 22px; font-weight: 700; }
.hi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- 首页 ---------- */
.hero-card {
  background: linear-gradient(135deg, var(--p), var(--p2));
  border-radius: var(--radius);
  color: #fff;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .3);
}
.hero-label { font-size: 13px; opacity: .85; }
.hero-num { font-size: 56px; font-weight: 800; line-height: 1.2; }
.hero-num .unlimited { font-size: 40px; font-weight: 700; }
.hero-sub { font-size: 12px; opacity: .8; }

.pool-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
}
.pool-row { display: flex; justify-content: space-between; font-size: 14px; }
.pool-row b { color: var(--p); }
.pool-tip { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

.apply-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--p), var(--p2));
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(99, 102, 241, .35);
  transition: transform .1s, opacity .2s;
}
.apply-btn:active { transform: scale(.97); }
.apply-btn:disabled { opacity: .45; box-shadow: none; }
.apply-btn svg { width: 22px; height: 22px; }

/* ---------- 我的视频 ---------- */
.vlist { display: flex; flex-direction: column; gap: 12px; }
.vcard {
  display: flex; gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
}
.vcover {
  width: 84px; height: 84px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: #eef0f6;
}
.vcover-empty {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef0ff, #f5f0ff);
  color: var(--p);
}
.vcover-empty svg { width: 32px; height: 32px; }
.vinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vtitle {
  font-size: 15px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vmeta { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.vtime { font-size: 11px; color: var(--muted); }
.vactions { display: flex; gap: 8px; margin-top: auto; }

.badge {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge-available { color: var(--p); background: #eef0ff; }
.badge-assigned { color: var(--ok); background: #e7f9f1; }
.badge-invalid { color: var(--danger); background: #feecec; }
.badge-user-pending { color: var(--warn); background: #fef4e2; }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty svg { width: 56px; height: 56px; opacity: .4; }
.empty p { margin: 12px 0 16px; font-size: 14px; }

/* ---------- 我的 ---------- */
.me-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 16px;
}
.avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--p), var(--p2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
}
.me-name { font-size: 17px; font-weight: 700; }
.me-quota { font-size: 12px; color: var(--muted); margin-top: 2px; }

.stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 20px;
}
.stat-cell {
  background: var(--card);
  border-radius: var(--radius);
  text-align: center;
  padding: 16px 8px;
}
.stat-num { font-size: 22px; font-weight: 800; color: var(--p); }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- 登录/注册 ---------- */
.auth-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.auth-card {
  width: 100%;
  background: var(--card);
  border-radius: 20px;
  padding: 32px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .06);
}
.auth-logo {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--p), var(--p2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.auth-logo svg { width: 32px; height: 32px; }
.pending-icon { background: linear-gradient(135deg, var(--warn), #fbbf24); }
.auth-card h1 { font-size: 20px; text-align: center; }
.auth-sub { font-size: 13px; color: var(--muted); text-align: center; margin: 8px 0 20px; line-height: 1.6; }
.auth-card input {
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
  background: #fafafc;
}
.auth-card input:focus { border-color: var(--p); background: #fff; }
.auth-foot { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.auth-foot a { color: var(--p); text-decoration: none; font-weight: 600; }

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .2s, transform .1s;
  font-family: inherit;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: linear-gradient(135deg, var(--p), var(--p2)); color: #fff; }
.btn-secondary { background: #eef0f6; color: var(--text); }
.btn-danger { background: #feecec; color: var(--danger); }
.btn-warn { background: #fef4e2; color: var(--warn); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-block { width: 100%; padding: 13px; font-size: 15px; border-radius: 12px; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(100%, 480px);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  border-top: 1px solid #eceef3;
  display: flex;
  z-index: 10;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--p); font-weight: 600; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 20%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(31, 41, 55, .92);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  max-width: min(80vw, 440px);
  text-align: center;
  z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 下载状态标记 ---------- */
.dl-status { margin-top: 4px; }
.dl-ok { color: #16a34a; font-weight: 600; font-size: 12px; margin-right: 8px; }
.dl-bad { color: #dc2626; font-weight: 600; font-size: 12px; margin-right: 8px; }
