/* =========================================================
 * AI 团购探店视频生成系统 公共样式
 * 主色 #0094e8 / 圆角 12px / 移动端 448px
 * ========================================================= */

:root {
  --primary: #0094e8;
  --primary-dark: #0077c2;
  --primary-light: #e7f4ff;
  --accent: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --text: #1f2937;
  --text-sub: #6b7280;
  --bg: #f6f8fb;
  --card: #ffffff;
  --border: #eef0f4;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 18px rgba(0, 148, 232, 0.08);
  --page-max: 448px;
}

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

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; outline: none; }

/* H5 容器：外层 100vh，固定最大宽度 448px 居中 */
.app-shell {
  max-width: var(--page-max);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
  box-shadow: 0 0 24px rgba(0,0,0,0.04);
}

/* 顶部固定导航 */
.app-header {
  position: sticky; top: 0; z-index: 30;
  height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  font-size: 16px; font-weight: 600;
}
.app-header .back {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  color: var(--text); font-size: 18px;
}
.app-header .right {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--primary);
}

/* 中间独立滚动区域 */
.app-scroll {
  position: absolute; top: 48px; left: 0; right: 0; bottom: 56px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 14px 100px 14px;
}
.app-scroll.no-tab { bottom: 0; }
.app-scroll.no-header { top: 0; }

/* 底部固定 Tab */
.app-tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: var(--page-max);
  height: 56px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex; z-index: 40;
}
.app-tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-sub); text-decoration: none;
}
.app-tabbar a.active { color: var(--primary); }
.app-tabbar a i { font-size: 20px; margin-bottom: 2px; }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.card-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600; margin-bottom: 12px;
}
.card-title .extra { font-size: 12px; color: var(--text-sub); font-weight: 400; }

/* 通用按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px;
  border-radius: 999px; border: 0;
  font-size: 14px; font-weight: 500;
  background: var(--primary); color: #fff;
  transition: transform .12s ease, opacity .12s ease, background .12s ease;
}
.btn:active { transform: scale(0.98); opacity: 0.92; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.gray { background: #f1f5f9; color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.lg { height: 48px; font-size: 16px; border-radius: 999px; }
.btn.sm { height: 28px; font-size: 12px; padding: 0 10px; border-radius: 999px; }

/* 表单 */
.form-item {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px;
}
.form-item label { font-size: 13px; color: var(--text-sub); }
.form-item .required::before {
  content: '*'; color: var(--danger); margin-right: 3px;
}
.input, .textarea, .select {
  width: 100%; height: 40px;
  background: #f7f9fc; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 12px;
  font-size: 14px; color: var(--text);
}
.textarea { height: 80px; padding: 10px 12px; resize: none; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); background: #fff; }
.form-error { color: var(--danger); font-size: 12px; min-height: 16px; }

/* 单选/复选 */
.radio-group, .checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio, .checkbox {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  background: #f1f5f9; color: var(--text);
  font-size: 13px; cursor: pointer; user-select: none;
  transition: all .15s ease;
}
.radio.active, .checkbox.active {
  background: var(--primary-light); color: var(--primary); font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--primary);
}

/* 4 列行业模板 */
.industry-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.industry-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px; border-radius: var(--radius-sm);
  background: #f7f9fc; cursor: pointer;
  transition: all .15s ease;
  font-size: 12px; color: var(--text-sub);
}
.industry-item .icon { font-size: 28px; }
.industry-item.active {
  background: linear-gradient(135deg, #e7f4ff, #cfe9ff);
  color: var(--primary); font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--primary);
}

/* 渐变活动卡 */
.banner-card {
  background: linear-gradient(135deg, #0094e8 0%, #38bdf8 50%, #e0f2fe 100%);
  color: #fff; border-radius: 16px;
  padding: 18px 16px; position: relative; overflow: hidden;
  margin-bottom: 12px;
}
.banner-card::before {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
}
.banner-card::after {
  content: ''; position: absolute; right: 30px; bottom: -30px;
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.banner-card h2 { margin: 0 0 4px 0; font-size: 18px; }
.banner-card p { margin: 0; font-size: 13px; opacity: 0.92; }
.banner-card .tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.25); font-size: 11px; margin-bottom: 8px;
}

/* 进度条 */
.progress {
  height: 6px; background: #eef0f4; border-radius: 999px; overflow: hidden;
}
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #38bdf8, #0094e8); transition: width .3s; }

/* 状态标签 */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; line-height: 1.4;
}
.tag.gray { background: #f1f5f9; color: var(--text-sub); }
.tag.primary { background: var(--primary-light); color: var(--primary); }
.tag.success { background: #dcfce7; color: #16a34a; }
.tag.danger { background: #fee2e2; color: var(--danger); }
.tag.warn { background: #fef3c7; color: #b45309; }

/* 列表行 */
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: 0; }
.list-row .meta { flex: 1; min-width: 0; }
.list-row .meta h4 { margin: 0 0 4px 0; font-size: 14px; font-weight: 500; }
.list-row .meta p { margin: 0; font-size: 12px; color: var(--text-sub); }
.list-row .arrow { color: #cbd5e1; font-size: 14px; }

/* 上传缩略图 */
.thumb-list { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb {
  position: relative; width: 76px; height: 76px;
  border-radius: 10px; overflow: hidden; background: #f1f5f9;
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .audio { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--primary); font-size: 24px; background: linear-gradient(135deg,#e0f2fe,#fff); }
.thumb .del {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; cursor: pointer;
}
.thumb.uploader {
  border: 1px dashed #cbd5e1; background: #fafbfd;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-sub); font-size: 22px; cursor: pointer;
}

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; animation: fadeIn .18s ease;
}
.modal {
  background: #fff; border-radius: 14px; width: 80%; max-width: 360px;
  padding: 20px 18px; animation: popIn .22s cubic-bezier(.2,.9,.3,1.2);
}
.modal h3 { margin: 0 0 8px 0; font-size: 16px; }
.modal p { margin: 0 0 14px 0; color: var(--text-sub); font-size: 13px; }
.modal .actions { display: flex; gap: 8px; }
.modal .actions .btn { flex: 1; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

/* Loading */
.loading-mask {
  position: fixed; inset: 0; background: rgba(255,255,255,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 300;
}
.loading-mask .spin {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--primary-light); border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.78); color: #fff;
  padding: 8px 14px; border-radius: 8px; font-size: 13px;
  z-index: 400; animation: fadeIn .2s ease;
  max-width: 80%; text-align: center;
}

/* 用户卡 */
.user-card {
  background: linear-gradient(135deg, #0094e8, #38bdf8);
  color: #fff; border-radius: 14px; padding: 18px;
  display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
}
.user-card .avatar {
  width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; overflow: hidden;
}
.user-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-card .name { font-size: 16px; font-weight: 500; }
.user-card .level { display: inline-block; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,0.3); font-size: 11px; margin-top: 4px; }

/* 套餐卡 */
.vip-card {
  border-radius: 14px; padding: 18px; color: #fff;
  position: relative; overflow: hidden;
  margin-bottom: 12px;
}
.vip-card.l1 { background: linear-gradient(135deg, #06b6d4, #38bdf8); }
.vip-card.l2 { background: linear-gradient(135deg, #0094e8, #2563eb); }
.vip-card.l3 { background: linear-gradient(135deg, #7c3aed, #c026d3); }
.vip-card.l0 { background: linear-gradient(135deg, #10b981, #22c55e); }
.vip-card .tag {
  position: absolute; top: 12px; right: -28px;
  transform: rotate(35deg);
  background: #facc15; color: #7c2d12; font-size: 11px;
  padding: 2px 30px; font-weight: 600;
}
.vip-card h3 { margin: 0 0 4px 0; font-size: 18px; }
.vip-card .price { font-size: 26px; font-weight: 700; }
.vip-card .price small { font-size: 12px; font-weight: 400; opacity: 0.85; margin-left: 2px; }
.vip-card .original { text-decoration: line-through; opacity: 0.7; font-size: 13px; margin-left: 6px; }
.vip-card ul { margin: 12px 0 14px 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.8; }
.vip-card ul li::before { content: '✓'; margin-right: 6px; opacity: 0.9; }

/* 订单行 */
.order-row { padding: 14px 0; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: center; }
.order-row:last-child { border-bottom: 0; }
.order-row .info { flex: 1; min-width: 0; }
.order-row .info h4 { margin: 0 0 4px 0; font-size: 14px; }
.order-row .info p { margin: 0; font-size: 12px; color: var(--text-sub); }
.order-row .price { color: var(--primary); font-weight: 600; }
.order-row .status { margin-top: 4px; }

/* 状态筛选 Tab */
.filter-tabs {
  display: flex; background: #fff; border-radius: 12px; padding: 4px;
  margin-bottom: 12px; position: sticky; top: 0; z-index: 10;
}
.filter-tabs a {
  flex: 1; text-align: center; padding: 8px 0; font-size: 13px;
  border-radius: 8px; color: var(--text-sub); text-decoration: none;
}
.filter-tabs a.active { background: var(--primary); color: #fff; font-weight: 500; }

/* 空状态 */
.empty {
  text-align: center; padding: 60px 20px; color: var(--text-sub); font-size: 13px;
}
.empty i { font-size: 36px; color: #cbd5e1; margin-bottom: 8px; display: block; }

/* 视频卡片 */
.video-card { background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow); }
.video-card .top { display: flex; align-items: center; gap: 10px; }
.video-card .cover {
  width: 72px; height: 72px; border-radius: 8px; background: linear-gradient(135deg, #0094e8, #38bdf8);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px;
  flex-shrink: 0; overflow: hidden;
}
.video-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.video-card .info { flex: 1; min-width: 0; }
.video-card h4 { margin: 0 0 4px 0; font-size: 14px; }
.video-card .meta { font-size: 12px; color: var(--text-sub); }
.video-card .actions { display: flex; gap: 8px; margin-top: 10px; }
.video-card .actions .btn { flex: 1; height: 32px; font-size: 12px; padding: 0 8px; }

/* 帮助行 */
.menu-list { background: #fff; border-radius: 12px; overflow: hidden; }
.menu-list a {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--text); font-size: 14px;
}
.menu-list a:last-child { border-bottom: 0; }
.menu-list a i:first-child { color: var(--primary); width: 20px; text-align: center; }
.menu-list a .arrow { color: #cbd5e1; margin-left: auto; }
